Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp260839yba; Wed, 3 Apr 2019 08:16:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhtQJHCTb3muG8cH3mxwwqXWTCh3uuqsZRE1G4eJo8MS6mnC+LP2XVti1Ok4yiIJ1LPrw0 X-Received: by 2002:a62:4ec8:: with SMTP id c191mr37874321pfb.138.1554304601849; Wed, 03 Apr 2019 08:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554304601; cv=none; d=google.com; s=arc-20160816; b=vJsNsnZSSenvUrSQBNSAmc4CYM0XFyiCyvYl0vvEVouspa9/SGMTq/HCpaGHhgWFCN iq0rPXtcwyoYSQW347RTqfAG4JhHKa0wXPtlc7MUmF8M3zjUX+cJ96gpD5IdqTIa0EXC Ob35kYVxIShzH8LfXvXRJ0i6If6FW0wBpT0V1lv2SLK5rrNKbjQj11DjsxprwJj5y5tx Ae9i0H+xKzUdyGrEy9UEOEfWTsGFDXhDYt2dIUoodHDfT1x6hBo9sc7P38fOhRwxyWb6 9a2qI0tLlAW2RP3TgrZMLjjrM05FuL8s818oHXuNQxQyUwHMrE5K3yCBNsLoBaRCJby6 KtHA== 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=iHotHzEjU1qzj9BJulC5Ed51CFuyFnl3nK+gD0M9X6A=; b=ZSLFv4DTProHYtLIHI9szJck/75I9hXmC4NRLcI2jtoLj6gZ5UBNcV2XPA7T/ezIql 1M5yg4wqi9rRgXE7oirskB68P3kayYdgNImlr4wBZw72X7RE3R+WJ3xJjrUaA1EOKywK 3vxiArw6jF4f/otM/a85UjGgYALdANevzOw1nu33WF7jtv1MuyPiV6IBdqDiihSF2vgs Jfzcj4jlNBvmJE/to6n92lCIuEU+tsSgHyufi6hf7j0xnDz1ECF/e8WUMdIWPeKCXcpt QeMXrkZhFQJb8y/H2j5ipSnbQKpiUjj+ng0bwis7dopGBAC01jMKwancPsPd5oIygG// qtOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fooishbar-org.20150623.gappssmtp.com header.s=20150623 header.b=jUcez77v; 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 z7si13593447pgu.546.2019.04.03.08.16.26; Wed, 03 Apr 2019 08:16:41 -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=@fooishbar-org.20150623.gappssmtp.com header.s=20150623 header.b=jUcez77v; 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 S1726442AbfDCPPW (ORCPT + 99 others); Wed, 3 Apr 2019 11:15:22 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:36644 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726084AbfDCPPV (ORCPT ); Wed, 3 Apr 2019 11:15:21 -0400 Received: by mail-lj1-f193.google.com with SMTP id r24so15252341ljg.3 for ; Wed, 03 Apr 2019 08:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fooishbar-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iHotHzEjU1qzj9BJulC5Ed51CFuyFnl3nK+gD0M9X6A=; b=jUcez77vGOxll91oMTJgrsgL/43L+fXpHbXMt2nXXRcnNdZX6or4swAlYGmDujYbr6 63p9yhQ+oNHQSDcteYTxEhqEeaHn7Xo9Wl/wnQCz+VhdjxRhjpXRvS0QSG8sj0GfAorX y+mqAchoAukp5rHxB23LfZaBqPKEm78T8bLukqKaptfUKSA49MVDNf5y1kX6ssj/nNYT kHPD5sHJTKR9qQLL3yE31JwyZAGdivoe20u6YwCyvKTimoh/yiUDm11ikcC3466QRoJc aY9c4Z/KHKfCm4Xa/z1jrGo16WIAxZxx3Ippi3iRGOuDtGe9+GF+FNtFnsOdiwRiFrF7 n9JA== 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=iHotHzEjU1qzj9BJulC5Ed51CFuyFnl3nK+gD0M9X6A=; b=tLK2bfmnASL88QbJtNaYhkhYnzV7pIvhqoy98LnFQQviQAZidpXA9qMsAugpKJiJkU ddbkV1pztQiDe6gG5zA79fwipCMQq+hBpeEoCCkx8JcRTR+Pj3qSFdA+oeG+xHWGi7yn zxKFSLSCY+crG8fb3wcJb4LDc8OT5W1KczfL/nyD46fq/EhtPGoYBkRYKpcYSnkUpp8H 2+lZp44fEOSn+eJfKEz5M8xl4M5XZLal5Qhi07N05GKFitANeBdJbBNP4xCa3r2/giBD LIxRmuvMeSS09s/RmT2oa3pO84Ao6oB4S2MVEQF4h0amzTHXKssDTWew9H037X6C+wQc xapQ== X-Gm-Message-State: APjAAAVpdghQDtEtN2ZgHY77Zqotmbk/LpZeMLK2AAWF+IMtGjYFXgH+ m2WLZlJ7O8oG3KSeaSQMJdN3m1pLGrsYqaFaQQGdJA== X-Received: by 2002:a2e:9703:: with SMTP id r3mr191509lji.88.1554304519634; Wed, 03 Apr 2019 08:15:19 -0700 (PDT) MIME-Version: 1.0 References: <20190403072318.31507-1-kraxel@redhat.com> <85ba308177f4e9ddee336d5110cb6df7a447cebf.camel@redhat.com> In-Reply-To: <85ba308177f4e9ddee336d5110cb6df7a447cebf.camel@redhat.com> From: Daniel Stone Date: Wed, 3 Apr 2019 16:15:08 +0100 Message-ID: Subject: Re: [PATCH] drm/cirrus: rewrite and modernize driver. To: Adam Jackson Cc: Gerd Hoffmann , dri-devel , David Airlie , Dave 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, 3 Apr 2019 at 16:12, Adam Jackson wrote: > On Wed, 2019-04-03 at 09:23 +0200, Gerd Hoffmann wrote: > > - 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. > > One slightly annoying aspect of this (well, initially of the patch to > clamp the default to 16bpp, but this too) is that we only have a way to > ask the driver which format it prefers, not which ones it supports at > all. For X's modesetting driver (and yes some of this is because X is > awful) this creates the following failure mode: > > 1: user sets up xorg.conf for depth 24 > 2: user upgrades kernel, reboots > 3: X driver detects that depth 16 is preferred, but > 4: X core respects user's xorg.conf and tries depth 24, which > 5: throws -EINVAL and X won't start. > > Possibly X should work around this by transparently setting up a shadow > framebuffer at the user's requested depth. The problem there is, if 565 > is preferred but 8888 works, you're adding a format-conversion blit in > the middle for no reason. If I could ask the kernel for the entire list > of supported formats, I could only set up the shadow if it was > necessary. There's already a list of supported formats for each DRM plane, which you can get via drmModeGetPlane (being careful to enable universal planes so you can discover the primary plane). The same information is present in the 'IN_FORMATS' property, which is more difficult to parse but also tells you about modifiers. modesetting already pulls all this out (at least in the atomic path) so we can reason about acceptable modifiers. Cheers, Daniel