]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/dp: Fix VSC dynamic range signaling for RGB formats
authorChaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Tue, 5 May 2026 09:09:20 +0000 (14:39 +0530)
committerTvrtko Ursulin <tursulin@ursulin.net>
Tue, 12 May 2026 07:05:24 +0000 (08:05 +0100)
For RGB, set dynamic_range to CTA or VESA based on
crtc_state->limited_color_range so sinks apply correct
quantization. YCbCr remains limited (CTA) range.
(DP v1.4, Table 5-1)

v2:
- Added Reported-by and Tested-by tags

v3:
- Add back YCbCr comment(Suraj)

Cc: stable@vger.kernel.org #v5.8+
Reported-by: DeepChirp <DeepChirp@outlook.com>
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/15874
Tested-by: DeepChirp <DeepChirp@outlook.com>
Fixes: 9799c4c3b76e ("drm/i915/dp: Add compute routine for DP VSC SDP")
Assisted-by: GitHub-Copilot:GPT-5.4
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/20260505090920.2479112-1-chaitanya.kumar.borah@intel.com
(cherry picked from commit 38e10ddae6f8d42a2e8437fcd25a1cac51106c64)
Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
drivers/gpu/drm/i915/display/intel_dp.c

index 4955bd8b11d7ad04d918c9e43b59c3a06bddeebc..50d34b4fdf82a9624881c0cdcc3fb16774289bb4 100644 (file)
@@ -3119,8 +3119,13 @@ static void intel_dp_compute_vsc_colorimetry(const struct intel_crtc_state *crtc
        drm_WARN_ON(display->drm,
                    vsc->bpc == 6 && vsc->pixelformat != DP_PIXELFORMAT_RGB);
 
-       /* all YCbCr are always limited range */
-       vsc->dynamic_range = DP_DYNAMIC_RANGE_CTA;
+       /* All YCbCr formats are always limited range. */
+       if (vsc->pixelformat == DP_PIXELFORMAT_RGB)
+               vsc->dynamic_range = crtc_state->limited_color_range ?
+                       DP_DYNAMIC_RANGE_CTA : DP_DYNAMIC_RANGE_VESA;
+       else
+               vsc->dynamic_range = DP_DYNAMIC_RANGE_CTA;
+
        vsc->content_type = DP_CONTENT_TYPE_NOT_DEFINED;
 }