renderer-native: Always post device wide updates during mode set

Don't mode set each CRTC in separate KMS updates, as reconfiguring one
CRTC might cause other CRTCs to be implicitly reset thus as well,
causing KMS return EBUSY if using atomic modesetting.

Prepare for this by compositing each CRTC first including adding steps
to the KMS update, but wait until all views has rendered at least once
before posting the initial update. After this each CRTC is posted
separately.

Using EGLStreams instead of normal page flipping seems to fail when
doing this though, so handle that the old way for the EGLStream case,
i.e. eglSwapBuffers() -> mode set with dumb buffer -> eglStream
"acquire" (resulting in page flip under the hood).

For this we also introduce a new error code so that we don't use client
buffers when doing mode sets, which could accidentally configure the
CRTC in a way that is incompatible with the primary plane buffers.

Do the same also when we're in power save mode, to only have one special
case path for this scenario in the regular swap-buffer path.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1488>
This commit is contained in:
Jonas Ådahl
2020-10-09 23:17:06 +02:00
committed by Marge Bot
parent 92d4cb5184
commit 447c51e68e
5 changed files with 259 additions and 39 deletions

View File

@ -264,6 +264,12 @@ clutter_round_to_256ths (float *f)
*f = roundf ((*f) * 256) / 256;
}
static inline uint64_t
ns (uint64_t ns)
{
return ns;
}
static inline int64_t
us (int64_t us)
{
@ -282,6 +288,12 @@ ms2us (int64_t ms)
return us (ms * 1000);
}
static inline int64_t
us2ns (int64_t us)
{
return ns (us * 1000);
}
static inline int64_t
us2ms (int64_t us)
{

View File

@ -722,7 +722,10 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
&error))
return;
g_warning ("Failed to scan out client buffer: %s", error->message);
if (!g_error_matches (error,
COGL_SCANOUT_ERROR,
COGL_SCANOUT_ERROR_INHIBITED))
g_warning ("Failed to scan out client buffer: %s", error->message);
}
clutter_stage_cogl_redraw_view_primary (stage_cogl, view, frame);