compositor-drm: Don't test render-only atomic configuration

Submitted by Daniel Stone on July 20, 2018, 6:55 p.m.

Details

Message ID 20180720185537.23588-1-daniels@collabora.com
State Accepted
Commit 117892259014d02e3ed41d241c6068d026f4c440
Headers show
Series "compositor-drm: Don't test render-only atomic configuration" ( rev: 1 ) in Wayland

Not browsing as part of any series.

Commit Message

Daniel Stone July 20, 2018, 6:55 p.m.
In the RENDERER_ONLY state proposal mode, we don't actually have a
viable configuration to test, because we won't get a renderer buffer
until after assign_planes - where we're called from - has completed.

This can result in us trying to test a configuration with the CRTC and
connectors active, but no planes active, which the kernel can
legitimately fail.

If we're working in renderer-only mode, just return the state we have
without trying to test it first, and let the kernel fill it in later.

Signed-off-by: Daniel Stone <daniels@collabora.com>
---
 libweston/compositor-drm.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 98e6ff839..704ac32c7 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -3488,6 +3488,11 @@  drm_output_propose_state(struct weston_output *output_base,
 	pixman_region32_fini(&renderer_region);
 	pixman_region32_fini(&occluded_region);
 
+	/* In renderer-only mode, we can't test the state as we don't have a
+	 * renderer buffer yet. */
+	if (mode == DRM_OUTPUT_PROPOSE_STATE_RENDERER_ONLY)
+		return state;
+
 	/* Check to see if this state will actually work. */
 	ret = drm_pending_state_test(state->pending_state);
 	if (ret != 0)

Comments

On 2018-07-20 01:55 PM, Daniel Stone wrote:
> In the RENDERER_ONLY state proposal mode, we don't actually have a
> viable configuration to test, because we won't get a renderer buffer
> until after assign_planes - where we're called from - has completed.
> 
> This can result in us trying to test a configuration with the CRTC and
> connectors active, but no planes active, which the kernel can
> legitimately fail.
> 
> If we're working in renderer-only mode, just return the state we have
> without trying to test it first, and let the kernel fill it in later.
> 
> Signed-off-by: Daniel Stone <daniels@collabora.com>

This looks right to me, and is apparently quite important as it fixes VT
switching.

I'm not really well versed enough in this code to give a solid RB, but
I'm going to land it shortly with
Acked-by: Derek Foreman <derek.foreman.samsung@gmail.com>


> ---
>  libweston/compositor-drm.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index 98e6ff839..704ac32c7 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -3488,6 +3488,11 @@ drm_output_propose_state(struct weston_output *output_base,
>  	pixman_region32_fini(&renderer_region);
>  	pixman_region32_fini(&occluded_region);
>  
> +	/* In renderer-only mode, we can't test the state as we don't have a
> +	 * renderer buffer yet. */
> +	if (mode == DRM_OUTPUT_PROPOSE_STATE_RENDERER_ONLY)
> +		return state;
> +
>  	/* Check to see if this state will actually work. */
>  	ret = drm_pending_state_test(state->pending_state);
>  	if (ret != 0)
>