How to handle DRM crtc_id, connector_id greater than 31

Miguel Angel Vico mvicomoya at nvidia.com
Wed Dec 7 00:21:30 UTC 2016


Hi Eric,

The problem here is we are using crtc_id and connector_id as indexes,
while they aren't.

Nothing keeps DRM drivers from advertising CRTC and connectors with ids
that aren't sequential and starting at 0 or 1.

The right fix is to use indexes instead of ids to update bitmasks.

drm_output::pipe stores the CRTC index and can be used to update CRTC
bitmasks.

For connectors, we need to add something similar.

Thanks.

On Mon, 5 Dec 2016 21:49:40 +0000
"Ruei, Eric" <e-ruei1 at ti.com> wrote:

> To whom it may concern:
> 
> We have encountered a Weston hotplug issue with DRM backend where the
> hotplug of HDMI connector caused unexpected Weston exit recently. The
> root cause of the problem is that the DRM connector id of the HDMI
> display exceeds 31, but the corresponding active bitmap variable
> connector_allocator is only 32-bit. The same issue is also applicable
> to the DRM instance variable crtc_allocator and all the local
> variables of CRTC or connector bitmap.  A tentative quick fix is to
> increase the size of bitmap variable from uint32_t to uint64_t, but
> it will break again when the DRM id exceeds 63. 
> 
> Attached please find our tentative patch against Weston 1.9 as your
> reference.
> 
> Best regards,
> 
> Eric
> 
> 


-- 
Miguel




More information about the wayland-devel mailing list