From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB949C4360F for ; Thu, 4 Apr 2019 15:24:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 73C0C20855 for ; Thu, 4 Apr 2019 15:24:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729456AbfDDPYy (ORCPT ); Thu, 4 Apr 2019 11:24:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44182 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729151AbfDDPYh (ORCPT ); Thu, 4 Apr 2019 11:24:37 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CDEA23089FE9; Thu, 4 Apr 2019 15:24:35 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-22.ams2.redhat.com [10.36.116.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DA768635E; Thu, 4 Apr 2019 15:24:33 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 68F66A1E3; Thu, 4 Apr 2019 17:24:31 +0200 (CEST) From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org Cc: Gerd Hoffmann , Dave Airlie , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org (open list), virtualization@lists.linux-foundation.org (open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE) Subject: [PATCH v2 6/6] drm/cirrus: rewrite and modernize driver. Date: Thu, 4 Apr 2019 17:24:30 +0200 Message-Id: <20190404152430.8263-7-kraxel@redhat.com> In-Reply-To: <20190404152430.8263-1-kraxel@redhat.com> References: <20190404152430.8263-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 04 Apr 2019 15:24:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Time to kill some bad sample code people are copying from ;) This is a complete rewrite of the cirrus driver. The cirrus_mode_set() function is pretty much the only function which is carried over largely unmodified. Everything else is upside down. It is a single monster patch. But given that it does some pretty fundamental changes to the drivers workflow and also reduces the code size by roughly 70% I think it'll still be alot easier to review than a longish baby-step patch series. Changes summary: - Given the small amout of video memory (4 MB) the cirrus device has the rewritten driver doesn't try to manage buffers there. Instead it will blit (memcpy) the active framebuffer to video memory. - All gem objects are stored in main memory and are manged using the new shmem helpers. ttm is out. - It supports RG16, RG24 and XR24 formats. XR24 gets converted to RG24 or RG16 at blit time if needed, to avoid the pitch becoming larger than what the cirrus hardware can handle. - The simple display pipeline is used. - The generic fbdev emulation is used. - It's a atomic driver now. - It runs wayland. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/cirrus/cirrus_drv.h | 251 ----------- drivers/gpu/drm/cirrus/cirrus.c | 621 ++++++++++++++++++++++++++ drivers/gpu/drm/cirrus/cirrus_drv.c | 161 ------- drivers/gpu/drm/cirrus/cirrus_fbdev.c | 309 ------------- drivers/gpu/drm/cirrus/cirrus_main.c | 328 -------------- drivers/gpu/drm/cirrus/cirrus_mode.c | 617 ------------------------- drivers/gpu/drm/cirrus/cirrus_ttm.c | 343 -------------- drivers/gpu/drm/cirrus/Kconfig | 2 +- drivers/gpu/drm/cirrus/Makefile | 3 - 9 files changed, 622 insertions(+), 2013 deletions(-) delete mode 100644 drivers/gpu/drm/cirrus/cirrus_drv.h create mode 100644 drivers/gpu/drm/cirrus/cirrus.c delete mode 100644 drivers/gpu/drm/cirrus/cirrus_drv.c delete mode 100644 drivers/gpu/drm/cirrus/cirrus_fbdev.c delete mode 100644 drivers/gpu/drm/cirrus/cirrus_main.c delete mode 100644 drivers/gpu/drm/cirrus/cirrus_mode.c delete mode 100644 drivers/gpu/drm/cirrus/cirrus_ttm.c diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h deleted file mode 100644 index 828b150cdb20..000000000000 --- a/drivers/gpu/drm/cirrus/cirrus_drv.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright 2012 Red Hat - * - * This file is subject to the terms and conditions of the GNU General - * Public License version 2. See the file COPYING in the main - * directory of this archive for more details. - * - * Authors: Matthew Garrett - * Dave Airlie - */ -#ifndef __CIRRUS_DRV_H__ -#define __CIRRUS_DRV_H__ - -#include