Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2092956yba; Wed, 3 Apr 2019 00:49:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIGk7jJTl7M/WzXIjSAvXhuSEdjhY+C0gdJrNBaaFSUd6/A+fEhlupfQMLfIZutSkPQkKX X-Received: by 2002:a63:2c4a:: with SMTP id s71mr31531548pgs.373.1554277751025; Wed, 03 Apr 2019 00:49:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554277751; cv=none; d=google.com; s=arc-20160816; b=zmI36k2dr2Gfm6A9kCRLzLM92t3HheTgMnqRkDpeZ0zvzw+WRm6YX3AWuUKU4rIObG ll9ceKXl0SD5zxo2Wrdeo4pAtkU9QM2TWE8E+wmSR4bIOOXSXJLGBP++K36iWkiLuw1b 282AMijII9e6Mgl8zF669CfweqJeFMFUxQHLhoVM0MH8+/tsvx9Reqy27jdvGpJ2eT+S WgVnteuVLt5Ry/SJhUCuNV/RD6ZqCjHF0QqYuGHd6bqwWJ9qA5OfgD42P6od8ou6GEbW vxQSw1y0XC1LV6TEWzcc1YTUbcaX0iYsjiS/kQF+WVjaabLXupiShZyR8b4RwyIagl6Q C3Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zdhJTWOjHQ4i57yGLbd6+dwOYKx/SUyvhaO/r6WGEcc=; b=HvwyiiwDE627to3VswrzeVkyiCXaqo7nZP/6qwMRqBz0nSokibHcQqKdZemGGV7r+2 X42ETi2cgO8lXtcdt0CD01LKm1rv+a/88pzlolANcPRmxpMZcFk3Y/RP6LnadPKz12C6 pZjIiIelY+746SZsLalA8088wz+rHhwo51qQhqd4n5t2oXmI/pdyI0YYNpxboFUjqwcD e2gYlmgaIZOcmiNpXmXBZnLQJ2+8lGQvagYzhuawh3pGw9r2hMZHPX8rCAoliAx1DiFt JAhp7kxKeCzpXsNmrGLniVpxUfxVKkB1/Ntj9evd4YIOXH2o+CVTmsTmdiK7EiAd1GRt RiQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=AavKy0RE; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32si8861662pgv.387.2019.04.03.00.48.55; Wed, 03 Apr 2019 00:49:11 -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; dkim=pass header.i=@ffwll.ch header.s=google header.b=AavKy0RE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728645AbfDCHsM (ORCPT + 99 others); Wed, 3 Apr 2019 03:48:12 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:35832 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbfDCHsM (ORCPT ); Wed, 3 Apr 2019 03:48:12 -0400 Received: by mail-it1-f194.google.com with SMTP id w15so9798341itc.0 for ; Wed, 03 Apr 2019 00:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zdhJTWOjHQ4i57yGLbd6+dwOYKx/SUyvhaO/r6WGEcc=; b=AavKy0REnM99FXDVSC1/qqGf6yum7rWiDZBfAJ6GpxqwTAbsCmzothf0CuoZYS0l6P PO2LDmp7Uli4T9VkoIFnyrMrn5iytVzhF3u1HZ9U4938riccSZz5wBQEtKPt2jL9ODef TRMaQCplWO57MMH8GLVwOd/ZfwafMaoDjqGeM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zdhJTWOjHQ4i57yGLbd6+dwOYKx/SUyvhaO/r6WGEcc=; b=RShNWuexArZP/HT7TDe3jfEdWt0833NSSUHK8avKb4xTR+f1n0jU/99ehVIFToFUcO xBrLpINi7Tr7FEO9ybYk64oJXfJzMgMvSmDTc4w3qDUNG8gep4bNkeLM7V9gUE4v88ZL YhAwUKf2JsNxUAyWZycY5+OxOqhpv72xGVLdwdsGkysvgREW483K2Qaw5P3UAetHIBRr 5WI5tZEfQKfClT82CDQqgAB9x+ePXlT/tQZD6qkp5CoV6l1oHbY40iHRkHlQPgir0lPF 5lYZojzXYx/cw6BmpC8BuwoRzt8oZ53aigofwCypTl6km0INLscbNqZzSRhMn8a6NGsb 8qgQ== X-Gm-Message-State: APjAAAWZZcoTBgg2Y98G9UuPi/RO58p2NGNNT3MDZwq+Vl89z5eqIxpH Wri50Hz+ZsuUxLQM5PSa8HvfjtHc4nwMxXS57XcanNux X-Received: by 2002:a02:ac9a:: with SMTP id x26mr15946510jan.129.1554277689386; Wed, 03 Apr 2019 00:48:09 -0700 (PDT) MIME-Version: 1.0 References: <20190403072318.31507-1-kraxel@redhat.com> In-Reply-To: <20190403072318.31507-1-kraxel@redhat.com> From: Daniel Vetter Date: Wed, 3 Apr 2019 09:47:56 +0200 Message-ID: Subject: Re: [PATCH] drm/cirrus: rewrite and modernize driver. To: Gerd Hoffmann Cc: dri-devel , Dave Airlie , David Airlie , open list , "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 3, 2019 at 9:23 AM Gerd Hoffmann wrote: > > 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. Sounds all awesome. Some tiny comments below, with those addressed looks all good and gets my Acked-by: Daniel Vetter -Daniel > 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