mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
drm: Add CRTC background color property
Some display controllers can be hardware programmed to show non-black colors for pixels that are either not covered by any plane or are exposed through transparent regions of higher planes. This feature can help reduce memory bandwidth usage, e.g. in compositors managing a UI with a solid background color while using smaller planes to render the remaining content. To support this capability, introduce the BACKGROUND_COLOR standard DRM mode property, which can be attached to a CRTC through the drm_crtc_attach_background_color_property() helper function. Additionally, define a 64-bit ARGB format value to be built with the help of a couple of dedicated DRM_ARGB64_PREP*() helpers. Individual color components can be extracted with desired precision using the corresponding DRM_ARGB64_GET*() macros. Co-developed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Tested-by: Diederik de Haas <diederik@cknow-tech.com> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Link: https://patch.msgid.link/20260303-rk3588-bgcolor-v8-2-fee377037ad1@collabora.com Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
committed by
Daniel Stone
parent
de9e2b3d88
commit
4c684596cd
@@ -380,6 +380,12 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)
|
||||
return -ENOMEM;
|
||||
dev->mode_config.gamma_lut_size_property = prop;
|
||||
|
||||
prop = drm_property_create_range(dev, 0,
|
||||
"BACKGROUND_COLOR", 0, U64_MAX);
|
||||
if (!prop)
|
||||
return -ENOMEM;
|
||||
dev->mode_config.background_color_property = prop;
|
||||
|
||||
prop = drm_property_create(dev,
|
||||
DRM_MODE_PROP_IMMUTABLE | DRM_MODE_PROP_BLOB,
|
||||
"IN_FORMATS", 0);
|
||||
|
||||
Reference in New Issue
Block a user