From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>,
airlied@linux.ie, dri-devel@lists.freedesktop.org,
laurent.pinchart@ideasonboard.com, jsarha@ti.com
Subject: Re: [PATCH 1/2] drm/blend: Account also the primary plane of the crtc for normalized_zpos
Date: Thu, 21 Dec 2017 17:12:04 +0200 [thread overview]
Message-ID: <20171221151204.GN10981@intel.com> (raw)
In-Reply-To: <30283ec6-ff0d-c953-a321-7bc3cb326a0d@ti.com>
On Thu, Dec 21, 2017 at 04:31:47PM +0200, Tomi Valkeinen wrote:
> On 21/12/17 16:20, Ville Syrjälä wrote:
> > On Thu, Dec 21, 2017 at 03:44:56PM +0200, Tomi Valkeinen wrote:
> >> On 21/12/17 14:55, Ville Syrjälä wrote:
> >>> On Thu, Dec 21, 2017 at 02:11:00PM +0200, Peter Ujfalusi wrote:
> >>>> Make sure that the primary plane will get normalized_zpos=0 if it's zpos is
> >>>> set to 0, avoiding other planes to be placed in the background.
> >>>
> >>> Can you describe the actual "bad" configuration?
> >>>
> >>> Without knowing the details this looks like it's making things
> >>> more complicated for no particularly good reason. If you're worried
> >>> about clients that don't set zpos, then I think you should just
> >>> assign the default zpos values better and/or allocate the planes
> >>> in a better order. But it's definitely possible I'm missing the
> >>> reason why you're doing this.
> >>
> >> Let's say we have two displays and two planes. First display will use
> >> crtc0 and plane0 as primary plane, the second display crtc1, plane1. The
> >> zpos of primary planes will be set to 0 by default.
> >>
> >> The userspace wants to use the second display, with an overlay plane. So
> >> it takes the plane0 and moves it to crtc1. Now the second display has
> >> two planes with zpos 0, and normalize_zpos will fix it according to the
> >> plane id, i.e. the primary plane of the second display will be on top of
> >> the "overlay" plane.
> >>
> >> I don't think other default zpos values and/or allocating planes in
> >> better order can solve this.
> >
> > Hmm. True. OTOH this messes up the simple "plane id is used to resolve
> > zpos conflicts" logic.
> >
> > Also since you have multiple primary planes on the same crtc, which
> > primary plane is the "real primary" for the crtc? How would userspace
> > even determine that? I guess the rule could be that the primary planes
> > have to be registered in the same order as the crtcs?
>
> Hmm, true.
>
> >> If the userspace is required to understand and set zpos, then this patch
> >> is not needed. But at least in my test scripts I've hit this a few times =).
> >
> > I think it would be nice if we can just make it a rule that any
> > userspace that moves planes between crtcs has to know about zpos.
> > Otherwise it's pretty much pure luck what stacking order you would
> > get.
>
> Yes, but how does the userspace know when it is moving planes between crtcs?
>
> If the userspace knows this, then it knows which primary plane is for
> which crtc, right?
>
> And if it doesn't know this, then the userspace cannot associate any
> plane to any crtc (except what it configures itself).
>
> So... If using legacy modesetting (and non-universal planes), there's no
> problem, primary planes are fixed and at low zpos. If using atomic
> modesetting and universal planes, there's really no (default)
> association between planes and crtcs, and "primary plane" doesn't have
> much meaning. Is that correct?
>
> If so... Then I guess the atomic modesetting client essentially randomly
> picks which plane it uses as a "root plane" (if it even needs such), and
> which planes as overlay planes? If that's the case, then this patch
> doesn't quite fix the issue...
I'm not sure anyone has really thought how userspace would/should assign
planes to crtcs. My only idea so far has been the crtc and their
preferred primary planes should be registered in the same order. But
someone should then also implement that same policy in userspace when
it's trying to figure out which plane to use. There are other
heuristics it should probably use, like preferring to pick a primary
plane for any fullscreen surface.
I guess from functional point of view it shouldn't matter which plane
you pick as long as the plane's user visible capabilities are
sufficient. But there might be user invisible power saving features and
whatnot that only work with specific planes. So from that point of view
maybe the order in which the planes get registered is important. Or we
could maybe come up with some kind of plane usage hints in the uapi
which could help userspace decide?
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-12-21 15:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-21 12:10 [PATCH 0/2] drm blend/omap: normalized zpos handling Peter Ujfalusi
2017-12-21 12:11 ` [PATCH 1/2] drm/blend: Account also the primary plane of the crtc for normalized_zpos Peter Ujfalusi
2017-12-21 12:55 ` Ville Syrjälä
2017-12-21 13:44 ` Tomi Valkeinen
2017-12-21 14:20 ` Ville Syrjälä
2017-12-21 14:31 ` Tomi Valkeinen
2017-12-21 15:12 ` Ville Syrjälä [this message]
2017-12-22 9:16 ` Tomi Valkeinen
2017-12-22 10:12 ` Ville Syrjälä
2017-12-22 15:15 ` Peter Ujfalusi
2018-01-09 12:42 ` Daniel Vetter
2018-01-09 13:40 ` Laurent Pinchart
2018-01-09 14:29 ` Daniel Vetter
2017-12-21 12:11 ` [PATCH 2/2] drm/omap: Normalize the zpos and use the normalized_zpos in runtime Peter Ujfalusi
2017-12-21 13:17 ` Daniel Vetter
2017-12-22 6:38 ` Peter Ujfalusi
2018-01-09 8:51 ` Daniel Vetter
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=20171221151204.GN10981@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=jsarha@ti.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=peter.ujfalusi@ti.com \
--cc=tomi.valkeinen@ti.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.