[Mesa-dev] [PATCH mesa 2/6] vulkan/wsi/display: also select a plane when selecting a crtc

Keith Packard keithp at keithp.com
Wed Sep 26 23:32:08 UTC 2018

Eric Engestrom <eric.engestrom at intel.com> writes:

> +   /* if there's a plane is active on the connector's crtc, pick it */
> +   for (size_t i = 0; i < plane_res->count_planes; i++) {
> +      drmModePlane *plane = drmModeGetPlane(wsi->fd, plane_res->planes[i]);
> +      if (!plane)
> +         continue;

I think you can do these three operations in a single walk of the
planes; it's obviously not performance critical, but I think squashing
them together would reduce the amount of duplicate code and make it
at least shorter to read.

Just find three plane ids -- one in use on the crtc, one compatible with
the crtc and one idle one, then select the one to use after the loop is over.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180926/a21363a0/attachment.sig>

More information about the mesa-dev mailing list