Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Jessica Zhang <quic_jesszhan@quicinc.com>
Cc: Simon Ser <contact@emersion.fr>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Daniel Vetter <daniel@ffwll.ch>,
	<freedreno@lists.freedesktop.org>,
	<linux-arm-msm@vger.kernel.org>,
	<dri-devel@lists.freedesktop.org>, <robdclark@gmail.com>,
	<seanpaul@chromium.org>, <swboyd@chromium.org>,
	<quic_abhinavk@quicinc.com>, <daniel.vetter@ffwll.ch>,
	<laurent.pinchart@ideasonboard.com>, <sebastian.wick@redhat.com>,
	<wayland-devel@lists.freedesktop.org>,
	<ville.syrjala@linux.intel.com>
Subject: Re: [RFC PATCH v3 0/3] Support for Solid Fill Planes
Date: Thu, 2 Feb 2023 10:55:37 +0200	[thread overview]
Message-ID: <20230202105537.1ae1f459@eldfell> (raw)
In-Reply-To: <5376994b-99f6-0f48-139f-6e622a8b0778@quicinc.com>

[-- Attachment #1: Type: text/plain, Size: 5499 bytes --]

On Wed, 1 Feb 2023 18:06:41 -0800
Jessica Zhang <quic_jesszhan@quicinc.com> wrote:

> On 1/31/2023 4:49 AM, Pekka Paalanen wrote:
> > On Tue, 31 Jan 2023 11:21:18 +0000
> > Simon Ser <contact@emersion.fr> wrote:
> >   
> >> On Tuesday, January 31st, 2023 at 12:13, Pekka Paalanen <ppaalanen@gmail.com> wrote:
> >>  
> >>> On Tue, 31 Jan 2023 10:06:39 +0000
> >>> Simon Ser <contact@emersion.fr> wrote:
> >>>      
> >>>> On Tuesday, January 31st, 2023 at 10:25, Pekka Paalanen <ppaalanen@gmail.com> wrote:
> >>>>      
> >>>>> indeed, what about simply using a 1x1 framebuffer for real? Why was that
> >>>>> approach rejected?  
> >>>>
> >>>> Ideally we don't want to allocate any GPU memory for the solid-fill
> >>>> stuff. And if we special-case 1x1 FB creation to not be backed by real
> >>>> GPU memory then we hit several situations where user-space expects a
> >>>> real FB but there isn't: for instance, GETFB2 converts from FB object
> >>>> ID to GEM handles. Even if we make GETFB2 fail and accept that this
> >>>> breaks user-space, then there is no way for user-space to recover the
> >>>> FB color for flicker-free transitions and such.
> >>>>
> >>>> This is all purely from a uAPI PoV, completely ignoring the potential
> >>>> issues with the internal kernel abstractions which might not be suitable
> >>>> for this either.  
> >>>
> >>> I mean a real 1x1 buffer: a dumb buffer.
> >>>
> >>> It would be absolutely compatible with anything existing, because it is
> >>> a real FB. As a dumb buffer it would be trivial to write into and read
> >>> out. As 1x1 it would be tiny (one page?). Even if something needs to
> >>> raw-access uncached memory over 33 MHz PCI bus or whatever the worst
> >>> case is, it's just one pixel, so it's fast enough, right? And it only
> >>> needs to be read once when set, like USB display drivers do. The driver
> >>> does not need to manually apply any color operations, because none are
> >>> supported in this special case.
> >>>
> >>> One can put all these limitations and even pixel format in the plane
> >>> property that tells userspace that a 1x1 FB works here.
> >>>
> >>> To recap, the other alternatives under discussion I see right now are:
> >>>
> >>> - this proposal of dedicated fill color property
> >>> - stuffing something new into FB_ID property
> >>>
> >>> There is also the question of other kinds of plane content sources like
> >>> live camera feeds where userspace won't be shovelling each frame
> >>> individually like we do now.
> >>>
> >>> 1x1 dumb buffer is not as small and lean as a dedicated fill color
> >>> property, but the UAPI design questions seem to be much less. What's
> >>> the best trade-off and for whom?  
> >>
> >> By "real memory" yes I mean the 1 page.
> >>
> >> Using a real buffer also brings back other discussions, e.g. the one about
> >> which pixel formats to accept.  
> > 
> > Yeah, which is why I wrote: "One can put all these limitations and even
> > pixel format in the plane property". It doesn't even need to be a
> > variable in the UAPI, it can be hardcoded in the UAPI doc.
> > 
> > Please, do not understand this as me strongly advocating for the real FB
> > approach! I just don't want that option to be misunderstood.
> > 
> > I don't really care which design is chosen, but I do care about
> > documenting why other designs were rejected. If the rejection reasons
> > were false, they should be revised, even if the decision does not
> > change.  
> 
> Hi Pekka/Daniel,
> 
> Looks like the general sentiment is to keep solid fill as a separate 
> property, so I will stick with that implementation for v4.
> 
> I can document the reason why we chose this approach over 1x1 FB in the 
> cover letter, but to summarize here:
> 
> Allocating an FB for solid_fill brings in unnecessary overhead (ex. 
> having to allocate memory for the FB). In addition, since memory fetch 
> is disabled when solid fill is enabled, having a separate property that 
> doesn't do any memory allocation for solid fill better reflects the 
> behavior of this feature within driver.
> 
> We also wanted to avoid having FB_ID accept a property blob as it would 
> involve loosening some drm_property checks, which could cause issues 
> with other property ioctls.
> 

That's fine by me, thanks!

> Also, re: other plane sources -- FWIW, I have tried implementing a 
> source enum as Ville suggested, but ultimately dropped the change as it 
> would require userspace to set properties in a specific order (i.e. to 
> enable solid_fill, userspace would have to first set FB_ID to NULL then 
> set SOLID_FILL).
> 
> I'm not sure how much of a can of worms that would be for userspace, but 
> if you're fine with having that as a requirement the I can re-add the code.

There is no ordering between properties set in a single atomic commit,
they all apply at the same time. Therefore the kernel code needs to
consider the whole new state set as a single entity.

If userspace splits changing those two properties into different atomic
commits, that's a userspace bug. It would not work with atomic
properties already today, where you need to set half a dozen properties
to update one KMS plane.

The only complication I can see is the legacy KMS UAPI, non-atomic.
They will change FB_ID, but they cannot touch the solid fill property.
I guess that needs to be special-cased somehow.


Thanks,
pq

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-02-02  8:56 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 23:40 [RFC PATCH v3 0/3] Support for Solid Fill Planes Jessica Zhang
2023-01-04 23:40 ` [RFC PATCH v3 1/3] drm: Introduce solid fill property for drm plane Jessica Zhang
2023-01-05  1:50   ` Dmitry Baryshkov
2023-01-05  2:12   ` Dmitry Baryshkov
2023-01-18 18:57   ` Harry Wentland
2023-01-18 22:53     ` Jessica Zhang
2023-01-19 15:57       ` Harry Wentland
2023-01-19 16:24         ` Jessica Zhang
2023-01-19 16:27           ` Harry Wentland
2023-01-04 23:40 ` [RFC PATCH v3 2/3] drm: Adjust atomic checks for solid fill color Jessica Zhang
2023-01-05  1:57   ` Dmitry Baryshkov
2023-01-06 20:51     ` Jessica Zhang
2023-01-04 23:40 ` [RFC PATCH v3 3/3] drm/msm/dpu: Use color_fill property for DPU planes Jessica Zhang
2023-01-05  2:16   ` Dmitry Baryshkov
2023-01-06 20:57     ` [Freedreno] " Jessica Zhang
2023-01-06 21:56       ` Dmitry Baryshkov
2023-01-05 11:33 ` [RFC PATCH v3 0/3] Support for Solid Fill Planes Daniel Vetter
2023-01-06  0:37   ` Jessica Zhang
2023-01-06  3:43     ` Dmitry Baryshkov
2023-01-06 18:41       ` Daniel Vetter
2023-01-06 21:49         ` Dmitry Baryshkov
2023-01-07  0:33           ` Abhinav Kumar
2023-01-11 22:29             ` Daniel Vetter
2023-01-24 10:42               ` Simon Ser
2023-01-31  9:25           ` Pekka Paalanen
2023-01-31 10:06             ` Simon Ser
2023-01-31 11:13               ` Pekka Paalanen
2023-01-31 11:21                 ` Simon Ser
2023-01-31 12:49                   ` Pekka Paalanen
2023-02-02  2:06                     ` Jessica Zhang
2023-02-02  8:55                       ` Pekka Paalanen [this message]
2023-01-06 19:44       ` Jessica Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230202105537.1ae1f459@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=contact@emersion.fr \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel@ffwll.ch \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_jesszhan@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=seanpaul@chromium.org \
    --cc=sebastian.wick@redhat.com \
    --cc=swboyd@chromium.org \
    --cc=ville.syrjala@linux.intel.com \
    --cc=wayland-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox