compositor-drm: Make alpha-to-opaque handling common

Rather than a hardcoded ARGB8888 -> XRGB8888 translation inside a
GBM-specific helper, just determine whether or not the view is opaque,
and use the generic helpers to implement the format translation.

As a consequence of reordering the calls in
drm_output_prepare_overlay_view(), we move the GBM BO dereference into a
different failure path, before it gets captured by the plane state.

Signed-off-by: Daniel Stone <>
Reviewed-by: Pekka Paalanen <>
Tested-by: Emre Ucan <>
1 file changed