Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2078842yba; Wed, 3 Apr 2019 00:24:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIGQrNJ0or2G/DeANw6NgWEakuNYf2uADUtLj8IsOX/+jG7F1wzCzLn1N8FIENyaqzPNSZ X-Received: by 2002:a63:360e:: with SMTP id d14mr57908375pga.188.1554276293336; Wed, 03 Apr 2019 00:24:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554276293; cv=none; d=google.com; s=arc-20160816; b=VM9d7nwrYdaYDFwx4yQC/kOESsrh1QZlHvUWTIIx6FD/tsZ6A9ohiIlp8Uk818+UKV BvBxe+z79QzRFGha3Fe3cSH9JV0iZGzW8Z/nUlkYSy31ML0Ubb1DePI4BWgeWa5x6u4B qIfWzoqGbYlHKNpmluinnFr/kJR1sy+KZALo+atCIekJqFQZs8wIbSP13/QJj00aGtIV A1LkNW3Io6g1rDc+X8u15fRrAB1F/l/0N8fb+p2JVnnbAEwy8+y0JmxQvNag2lKvs1qn ek2apkI9000Ms53IsfoKposwucol6ohiIVEewtK1FRKgb9k6Vspn/YukdP1pqzZSJI8d lSLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=RxHiuw22pYjKLpwSRcLeYJfWUChcVfRcpPzOgdgkfrQ=; b=zzNzRv0RvYZDmo4MV+U8Y+FQDLf8N1kBeSg3NaPTrgOZGKlaWvjrNoM5BkgBi72gRm BwkkC69V09+nHPxgxeyvq51b/s+wpvv5k60xlLtbi4ks9ukaoXruCgi6/5ok+EJIGs16 +KqX7rEhJqpQzcTkmQrYjUaMXRK6hhuQfp3uNFf/Objilag0gID7t39KrXQFIhKb8WA/ YelsWiQvi5NYba64TiwkXNJ0p7MdwGdkmU5s2E14/P55AdTht6br7cW1vbr4mQV+UOn8 86yIKF7PQBchSbdVtC3RMpQq4H7nFUXo8pfk0l8tqXmUINBMXD9OkRqPhupxr0qboc4o 8Mdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w25si13470740pgl.346.2019.04.03.00.24.34; Wed, 03 Apr 2019 00:24:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728718AbfDCHXY (ORCPT + 99 others); Wed, 3 Apr 2019 03:23:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60942 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbfDCHXX (ORCPT ); Wed, 3 Apr 2019 03:23:23 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C317A30833A4; Wed, 3 Apr 2019 07:23:22 +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 B59A562674; Wed, 3 Apr 2019 07:23:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0BD211750B; Wed, 3 Apr 2019 09:23:18 +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] drm/cirrus: rewrite and modernize driver. Date: Wed, 3 Apr 2019 09:23:17 +0200 Message-Id: <20190403072318.31507-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 03 Apr 2019 07:23:22 +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. - Only DRM_FORMAT_RGB565 (depth 16) is supported. The old driver does that too by default. There was a module parameter which enables 24/32 bpp support and disables higher resolutions (due to cirrus hardware constrains). That parameter wasn't reimplemented. - The simple display pipeline is used. - The generic fbdev emulation is used. - It's a atomic driver now. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/cirrus/cirrus_drv.h | 251 ----------- drivers/gpu/drm/cirrus/cirrus.c | 602 +++++++++++++++++++++++++ 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, 603 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