Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/vkms: Support setting custom background color

Make use of the BACKGROUND_COLOR CRTC property when filling the
background during blending. It already defaults to solid black.

Since the internal representation of the pixel color in VKMS relies on
16 bits of precision, use the newly introduced DRM_ARGB64_GET{R|G|B}()
helpers to access the individual components of the background color
property, which is compliant with DRM_FORMAT_ARGB16161616.

It's worth noting the alpha component is ignored, hence non-opaque
background colors are not supported.

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: Diederik de Haas <diederik@cknow-tech.com>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://patch.msgid.link/20260303-rk3588-bgcolor-v8-3-fee377037ad1@collabora.com
Signed-off-by: Daniel Stone <daniels@collabora.com>

authored by

Cristian Ciocaltea and committed by
Daniel Stone
0b9eff72 4c684596

+10 -1
+7 -1
drivers/gpu/drm/vkms/vkms_composer.c
··· 475 475 { 476 476 struct vkms_plane_state **plane = crtc_state->active_planes; 477 477 u32 n_active_planes = crtc_state->num_active_planes; 478 + u64 bgcolor = crtc_state->base.background_color; 478 479 479 - const struct pixel_argb_u16 background_color = { .a = 0xffff }; 480 + const struct pixel_argb_u16 background_color = { 481 + .a = 0xffff, 482 + .r = DRM_ARGB64_GETR(bgcolor), 483 + .g = DRM_ARGB64_GETG(bgcolor), 484 + .b = DRM_ARGB64_GETB(bgcolor), 485 + }; 480 486 481 487 int crtc_y_limit = crtc_state->base.mode.vdisplay; 482 488 int crtc_x_limit = crtc_state->base.mode.hdisplay;
+3
drivers/gpu/drm/vkms/vkms_crtc.c
··· 4 4 5 5 #include <drm/drm_atomic.h> 6 6 #include <drm/drm_atomic_helper.h> 7 + #include <drm/drm_blend.h> 7 8 #include <drm/drm_managed.h> 8 9 #include <drm/drm_print.h> 9 10 #include <drm/drm_probe_helper.h> ··· 227 226 } 228 227 229 228 drm_crtc_enable_color_mgmt(crtc, 0, false, VKMS_LUT_SIZE); 229 + 230 + drm_crtc_attach_background_color_property(crtc); 230 231 231 232 spin_lock_init(&vkms_out->lock); 232 233 spin_lock_init(&vkms_out->composer_lock);