Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp898853yba; Wed, 3 Apr 2019 23:32:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/xJafLXq4JQCASyzEIk+ACRp6lDtBlnzVEwYrtK6I7ylofdS7OLdbMITEUn8TH7tCHAZH X-Received: by 2002:a17:902:8345:: with SMTP id z5mr4562103pln.197.1554359565726; Wed, 03 Apr 2019 23:32:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554359565; cv=none; d=google.com; s=arc-20160816; b=WOq+Iv3cXvPwOUXsUL+FlzGKpchxFDYGyDk/SoOP/I7gGDUQswAsmydpPhUctcE9oS 50Yi2cWvWuAKLS5C6tjAb3uFlpyDoCGtS/+i6d9uCNezL4/amWbbVDVNlGVXu/sr1N2K MyFpIJ0QIHCcgbiYnWcZFiq6HQj7nJQ9moEHNkog3MIDWHO4cCT6AFZYszBSDGXrFcPF K5SgsFFdgleYKwGxwpHivyAEqd/6WoTm8ywnMFbe16nVkoDqyKfCqww37tyZYv+Cm1JW nq3JelU6foNI7HIz6HhScS+VDnFiDkg/PyeIerJhK03ITaufx392Dhrbb17H0iPdW2a2 NIuA== 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=P1rT7cfdGTAKxZ0s5KNwvJVhwQTjQls7apnGG8IwBys=; b=XxNZaZizAPTiGc4kgDLLuCPqgKFe0OEVUKJ6ZDgN9GSWqUoZUNHy74YUIrezGPXn51 QIEKCNP2Vqv2lkT5r+JbDrREf1ctvZEqzRMu6ePvggY8uYWVBNI9WcmY86i2dr5kPOsP 8PzGpcNOKTZQeBKsuopk9zQnx7zWtJ8PQocEXof6vgBRxZJQdawGZVDUiXXGuUm+zxWT NBst/WoNM8BfmsGc7eHaAU2qycoe1pMsUEJAkjDnZeLBC/7o/FsyWEjT7lON97OvNRde 4QIrFnWL2YIrneYP80zS0xSrxU68zF3fUlYtqAU3SVWeOOuJPE/FGv4D7TE+713fJWdq qXNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=YrfFHhxo; 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 m23si16012991pgc.550.2019.04.03.23.32.30; Wed, 03 Apr 2019 23:32:45 -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=YrfFHhxo; 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 S1726815AbfDDGbw (ORCPT + 99 others); Thu, 4 Apr 2019 02:31:52 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:54048 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726031AbfDDGbv (ORCPT ); Thu, 4 Apr 2019 02:31:51 -0400 Received: by mail-it1-f193.google.com with SMTP id y204so1966200itf.3 for ; Wed, 03 Apr 2019 23:31:51 -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=P1rT7cfdGTAKxZ0s5KNwvJVhwQTjQls7apnGG8IwBys=; b=YrfFHhxoV9TDfAxq8cxsgkK+2azGanIYQipRF8aZgDHCoK0LQmo/UyhKlaIoz7RElL JONo+QzYlAN4lgx+7DI5sjas74qGs4Oo0oCnjZYdqEeMWsmQuw6yP1pNAyydi1aWBkL/ kF9ooyhS+gdlpB+6A6i6PTkdbAE1+VG210nhQ= 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=P1rT7cfdGTAKxZ0s5KNwvJVhwQTjQls7apnGG8IwBys=; b=mmhSPdnWVPstWyDejXKWnpv6gwcw/Ap3CPlEjIHFJh+tRtLlbtdmph4sYcHU3i9602 zy7DHZXLNlKl9OQg0gEMYg9Rv15qYzpQW5JUWbOyBIAcd4HO02In+8piSj5yoYUBuWqe zu/1pJ4W5Rhwc2KuyKF7NV6q0XViZMQYrbU8TuduqBn9vTRq3SFjlDZGi5uWYtPj6Bqi 22BhZjXE0tiXwBhXT1ywMliWsW2n7/EQ4+Ns6FnpNEYCsJ1scyD0VhpJqHUkWpTx8T/v i5jhooNYbuKTllu2nosXiZP4h214gJVVw1RHIht8XptRqZfr7s/2mv72aVbHiL8rjoCK j4zQ== X-Gm-Message-State: APjAAAVo2l1HJnJ9Sv/RWQ4+UCoaqS6/Ziz+qr/7MHKUDIn3uJD7Gbk4 Xb7AMh/QPlnmIVyzap+L5By0AojsMawrkWkl/JgeJg== X-Received: by 2002:a24:480e:: with SMTP id p14mr3799657ita.61.1554359511061; Wed, 03 Apr 2019 23:31:51 -0700 (PDT) MIME-Version: 1.0 References: <20190403072318.31507-1-kraxel@redhat.com> <20190404055056.ddc2bdgjbgjj7tby@sirius.home.kraxel.org> In-Reply-To: <20190404055056.ddc2bdgjbgjj7tby@sirius.home.kraxel.org> From: Daniel Vetter Date: Thu, 4 Apr 2019 08:31:39 +0200 Message-ID: Subject: Re: [PATCH] drm/cirrus: rewrite and modernize driver. To: Gerd Hoffmann Cc: David Airlie , dri-devel , 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 Thu, Apr 4, 2019 at 7:51 AM Gerd Hoffmann wrote: > > On Thu, Apr 04, 2019 at 12:58:09PM +1000, David Airlie wrote: > > On Wed, Apr 3, 2019 at 5:23 PM 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. > > > > Does it get any slower, with TTM I just wrote it to migrate just the > > frontbuffer in/out of VRAM on modeset, won't we end up with more > > copies now? > > I didn't benchmark it, but if you care about performance you should not > be using cirrus anyway ... > > For fbcon it probably doesn't make much of a difference, fbcon used a > shadow framebuffer before (for fbdev mmap and dirty tracking). > > xorg probably ends up with more copying. > > Anything doing display updates with page flips (i.e wayland) should end > up with less copying, because you have one copy (blit) instead of two > copies (migrate old frontbuffer out of vram, migrate new frontbuffer > into vram) on pageflip. > > Speaking of wayland: Seems at least gnome-shell insists on using XR24. Yeah XR24 is pretty much mandatory. Noralf added a few helpers to convert XR24 to other formats, for display not supporting anything else. Because userspace. > > > - 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. > > > This might be the big sticking point, this is a userspace regression > > for a feature that was explicitly added a few years ago, can we really > > get away without it? > > Well, I can reintroduce the module option. I don't see any other > reasonable way to support 32bpp. If the driver reports XR24 as > supported and also adds the higher resolutions (which work with RG16 > only) to the mode list userspace will of course try the higher > resolutions with XR24 and struggle ... Maybe atomic userspace is better (it should be, it can do TEST_ONLY), but I'm not so sure that exposing all modes for atomic clients would work. Also, currently not possible with our probe helpers (we don't refilter the list per client). -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch