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 EEB6CC4360F for ; Wed, 3 Apr 2019 07:23:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7533320830 for ; Wed, 3 Apr 2019 07:23:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728743AbfDCHXY (ORCPT ); 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