[PATCH v14 10/41] compositor-drm: Disable unused CRTCs/connectors

Daniel Stone daniel at fooishbar.org
Wed Jan 31 17:33:42 UTC 2018


Hi Pekka,

On 17 January 2018 at 10:43, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> I have a recollection of having a rationale that the state_invalid flag
> should stay per-output, but it seems those ideas were just optimization
> that's probably moot anyway. I suppose with atomic, the per-output flag
> would not make any difference to a global flag, since the atomic commit
> would be modeset-or-not as a whole?

Yep, correct.

> I wonder, could the following happen:
> - have outputs A and B at different timing phase such that they usually
>   don't coalesce to the same atomic update
> - output A needs a modeset
> - output B repaints first, does modeset, and clears the flag
> - output A does not get a modeset
>
> Would we actually need per-output flags and a flag for the unused CRTCs?

For DPMS-on conditions, 'needs a modeset' is determined by:
> +     if (backend->state_invalid || !scanout_plane->state_cur->fb ||
>           scanout_plane->state_cur->fb->stride != scanout_state->fb->stride) {

As we discard the scanout_plane fb when we go to DPMS off, this
condition covers off-to-on transitions. Stride is a proxy for
dimension changes, though technically I suppose we should be testing
height, in the event we somehow manage to change mode without changing
stride. We don't have any other cases where we would need to flip the
modeset flag.

> Clone mode will bring new causes for "needs a modeset": attaching or
> detaching a head from a running output.
>
> If we were good with just a global flag, then this patch would be good.

Yeah. The set of connectors (a single connector) is static right now,
but having that dynamic would be another modeset condition. We'd need
to account for that when that happens.

Cheers,
Daniel


More information about the wayland-devel mailing list