Skip to content
Commit 663d5e9b authored by Pekka Paalanen's avatar Pekka Paalanen
Browse files

compositor-drm: allocate CRTC on enable()



A drm_output needs a CRTC only when it is in use. Allocating a CRTC on
creation of drm_output will reserve the CRTC regardless of whether the
output is actually used or not. This may cause creating other
drm_outputs to fail if there are not enough CRTCs.

Instead, allocate the CRTC on drm_output enable() time. A drm_output
will have a valid CRTC only while it is enabled.

This allows us to create drm_output objects arbitrarily and without a
head assignment, which is required by the head-based output API for the
backends. The assigned heads will be known only at enable() time.

Now drm_output_enable() has to call drmModeGetResources() to be able to
find a suitable CRTC. We might want to cache the resources somewhere,
but that is it topic for another patch.

v4: Force resetting unused CRTCs on fini.

Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: default avatarDaniel Stone <daniels@collabora.com>
Acked-by: default avatarDerek Foreman <derekf@osg.samsung.com>
parent c1e89ba2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment