[PATCH 03/10] INTEL_DII: drm/i915/mtl: Add degamma lut range for 24 bit degamma LUT
Borah, Chaitanya Kumar
chaitanya.kumar.borah at intel.com
Wed Sep 14 12:47:56 UTC 2022
Add a lut range to support high precision degamma LUT.
Signed-off-by: Borah, Chaitanya Kumar <chaitanya.kumar.borah at intel.com>
---
drivers/gpu/drm/i915/display/intel_color.c | 30 ++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
index 4dd5c5c8fd5727..6921827b548762 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -120,6 +120,8 @@ struct intel_color_funcs {
#define GAMMA_MODE_SPLIT_12BIT BIT(4)
#define GAMMA_MODE_LOGARITHMIC_12BIT BIT(5) /* XELPD+ */
+#define DEGAMMA_MODE_24BIT BIT(0) /* MTL/D14+ */
+
#define INTEL_GAMMA_MODE_MASK (\
GAMMA_MODE_LEGACY_PALETTE_8BIT | \
GAMMA_MODE_PRECISION_PALETTE_10BIT | \
@@ -3136,6 +3138,21 @@ static const struct drm_color_lut_range xelpd_gamma_hdr[] = {
},
};
+static const struct drm_color_lut_range mtl_24bit_degamma[] = {
+ /* segment 0 */
+ {
+ .flags = (DRM_MODE_LUT_DEGAMMA |
+ DRM_MODE_LUT_REFLECT_NEGATIVE |
+ DRM_MODE_LUT_INTERPOLATE |
+ DRM_MODE_LUT_REUSE_LAST |
+ DRM_MODE_LUT_NON_DECREASING),
+ .count = 131,
+ .input_bpc = 24, .output_bpc = 24,
+ .start = 0, .end = (1 << 24) - 1,
+ .min = 0, .max = (1 << 24) - 1,
+ }
+};
+
int intel_color_plane_init(struct drm_plane *plane)
{
struct drm_i915_private *dev_priv = to_i915(plane->dev);
@@ -3224,6 +3241,19 @@ void intel_color_init(struct intel_crtc *crtc)
sizeof(xelpd_logarithmic_gamma),
LUT_TYPE_GAMMA);
drm_crtc_attach_gamma_mode_property(&crtc->base);
+
+ if (DISPLAY_VER(dev_priv) >= 14) {
+ drm_color_create_degamma_mode_property(&crtc->base, 2);
+ drm_color_add_gamma_degamma_mode_range(&crtc->base,
+ "no degamma", NULL, 0,
+ LUT_TYPE_DEGAMMA);
+ drm_color_add_gamma_degamma_mode_range(&crtc->base,
+ "extended degamma",
+ mtl_24bit_degamma,
+ sizeof(mtl_24bit_degamma),
+ LUT_TYPE_DEGAMMA);
+ }
+
} else if (DISPLAY_VER(dev_priv) >= 11) {
dev_priv->color_funcs = &icl_color_funcs;
} else if (DISPLAY_VER(dev_priv) == 10) {
--
2.25.1
More information about the Intel-gfx-trybot
mailing list