[PATCH v19 03/10] compositor-drm: Add modes to drm_output_propose_state
Pekka Paalanen
ppaalanen at gmail.com
Wed Jul 11 09:23:44 UTC 2018
On Wed, 11 Jul 2018 12:21:07 +0300
Pekka Paalanen <ppaalanen at gmail.com> wrote:
> On Tue, 10 Jul 2018 18:58:42 +0100
> Daniel Stone <daniels at collabora.com> wrote:
>
> > Add support for multiple modes to drm_output_propose_state. Currently we
> > intend to operate in three modes: planes-only (no renderer buffer,
> > client buffers in planes only), mixed-mode (promote client buffers to
> > planes where possible, falling back to the renderer where not), and
> > renderer-only (no plane usage at all).
> >
> > We want to use the first (planes-only) mode where possible: it can avoid
> > us having to allocate buffers for the renderer, and it also gives us the
> > best chance of the optimal configuration, with no composition. In this
> > mode, we walk the scene looking at all views, trying to put them in
> > planes, and failing as soon as we find a view we cannot place in a
> > plane.
>
> Hi,
>
> please add a note that planes-only mode gets added by a later patch.
>
> >
> > In the second mode, rather than failing, we assign those views which
> > cannot be on a plane to the renderer, and allow the renderer to
> > composite them.
> >
> > In the third mode, planes are not usable, so everything but the cursor
> > goes to the renderer. We will use this when we cannot use the planes-only
> > mode (because some views cannot be placed in planes), but also cannot
> > use the 'mixed' mode because we have no renderer buffer yet. Since we
> > walk the scene graph from top to bottom, using atomic modesetting we
> > will determine if planes can be promoted in mixed mode by placing a
> > renderer buffer at the bottom of the scene, placing a cursor buffer if
> > applicable, then testing if we can add overlay planes to this mode.
> >
> > Without a buffer from the renderer, we cannot do these tests, so we push
> > everything through the renderer and then switch to mixed mode on the
> > next repaint.
> >
> > Signed-off-by: Daniel Stone <daniels at collabora.com>
> > Tested-by: Emre Ucan <eucan at de.adit-jv.com>
> > ---
> > libweston/compositor-drm.c | 69 +++++++++++++++++++++++++-------------
> > 1 file changed, 45 insertions(+), 24 deletions(-)
> > @@ -3390,8 +3404,15 @@ drm_assign_planes(struct weston_output *output_base, void *repaint_data)
> > struct drm_plane_state *plane_state;
> > struct weston_view *ev;
> > struct weston_plane *primary = &output_base->compositor->primary_plane;
> > + enum drm_output_propose_state_mode mode;
Oh, 'mode' also unused here.
> > +
> > + if (!b->sprites_are_broken)
> > + state = drm_output_propose_state(output_base, pending_state,
> > + DRM_OUTPUT_PROPOSE_STATE_MIXED);
> >
> > - state = drm_output_propose_state(output_base, pending_state);
> > + if (!state)
>
> 'state' may be used uninitialized, needs initialization to NULL.
>
> > + state = drm_output_propose_state(output_base, pending_state,
> > + DRM_OUTPUT_PROPOSE_STATE_RENDERER_ONLY);
> >
> > wl_list_for_each(ev, &output_base->compositor->view_list, link) {
> > struct drm_plane *target_plane = NULL;
>
> With those three issues fixed:
Make that four.
> Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
>
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180711/c46c0e07/attachment-0001.sig>
More information about the wayland-devel
mailing list