Hi,
On 23.06.26 18:48, Harry Wentland wrote:
Add three new limited-range YUV-to-RGB conversion presets to the
Fixed Matrix colorop enum:
- DRM_COLOROP_FM_YCBCR601_LIMITED_RGB
- DRM_COLOROP_FM_YCBCR709_LIMITED_RGB
- DRM_COLOROP_FM_YCBCR2020_NC_LIMITED_RGB
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Harry Wentland <[email protected]>
Reviewed-by: Alex Hung <[email protected]>
---
drivers/gpu/drm/drm_colorop.c | 3 +++
include/drm/drm_colorop.h | 30 ++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
index c11c3012fcc5..9cf89153b365 100644
--- a/drivers/gpu/drm/drm_colorop.c
+++ b/drivers/gpu/drm/drm_colorop.c
@@ -93,8 +93,11 @@ static const struct drm_prop_enum_list
drm_colorop_lut3d_interpolation_list[] =
static const char * const colorop_fixed_matrix_type_names[] = {
[DRM_COLOROP_FM_YCBCR601_FULL_RGB] = "YCbCr 601 Full to RGB",
+ [DRM_COLOROP_FM_YCBCR601_LIMITED_RGB] = "YCbCr 601 Limited to RGB",
[DRM_COLOROP_FM_YCBCR709_FULL_RGB] = "YCbCr 709 Full to RGB",
+ [DRM_COLOROP_FM_YCBCR709_LIMITED_RGB] = "YCbCr 709 Limited to RGB",
[DRM_COLOROP_FM_YCBCR2020_NC_FULL_RGB] = "YCbCr 2020 NC Full to RGB",
+ [DRM_COLOROP_FM_YCBCR2020_NC_LIMITED_RGB] = "YCbCr 2020 NC Limited to
RGB",
[DRM_COLOROP_FM_YCBCR_LIMITED_FULL] = "YCbCr limited to full",
[DRM_COLOROP_FM_RGB709_RGB2020] = "RGB709 to RGB2020",
};
diff --git a/include/drm/drm_colorop.h b/include/drm/drm_colorop.h
index 88933d5b4d8b..5c542c264a36 100644
--- a/include/drm/drm_colorop.h
+++ b/include/drm/drm_colorop.h
@@ -150,6 +150,16 @@ enum drm_colorop_fixed_matrix_type {
*/
DRM_COLOROP_FM_YCBCR601_FULL_RGB,
+ /**
+ * @DRM_COLOROP_FM_YCBCR601_LIMITED_RGB:
+ *
+ * enum string "YCbCr 601 Limited to RGB"
+ *
+ * This selects the matrix that converts limited range YCbCr into RGB
+ * according to the BT.601 coefficients.
+ */
+ DRM_COLOROP_FM_YCBCR601_LIMITED_RGB,
+
/**
* @DRM_COLOROP_FM_YCBCR709_FULL_RGB:
*
@@ -160,6 +170,16 @@ enum drm_colorop_fixed_matrix_type {
*/
DRM_COLOROP_FM_YCBCR709_FULL_RGB,
+ /**
+ * @DRM_COLOROP_FM_YCBCR709_LIMITED_RGB:
+ *
+ * enum string "YCbCr 709 Limited to RGB"
+ *
+ * This selects the matrix that converts limited range YCbCr into RGB
+ * according to the BT.709 coefficients.
+ */
+ DRM_COLOROP_FM_YCBCR709_LIMITED_RGB,
+
/**
* @DRM_COLOROP_FM_YCBCR2020_NC_FULL_RGB:
*
@@ -170,6 +190,16 @@ enum drm_colorop_fixed_matrix_type {
*/
DRM_COLOROP_FM_YCBCR2020_NC_FULL_RGB,
+ /**
+ * @DRM_COLOROP_FM_YCBCR2020_NC_LIMITED_RGB:
+ *
+ * enum string "YCbCr 2020 NC Limited to RGB"
+ *
+ * This selects the matrix that converts limited range YCbCr into RGB
+ * according to the BT.2020 non-constant luminance coefficients.
+ */
+ DRM_COLOROP_FM_YCBCR2020_NC_LIMITED_RGB,
+
/**
* @DRM_COLOROP_FM_YCBCR_LIMITED_FULL:
*
I'd prefer the commit to get squashed into the previous one - but either
way:
Reviewed-by: Robert Mader <[email protected]>
--
Robert Mader
Consultant Software Developer
Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
Registered in England & Wales, no. 5513718