drm/i915/dp: Return min bpc supported by source instead of 0
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Fri, 31 Jan 2025 04:13:42 +0000 (09:43 +0530)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Fri, 31 Jan 2025 15:18:38 +0000 (10:18 -0500)
Currently, intel_dp_dsc_max_src_input_bpc can return 0 for platforms not
supporting DSC, which could theoretically cause issues in clamp()
due to a low limit being greater than the high limit.

Instead, return the minimum bpc supported by the source to prevent
such issues.

Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/all/CA+G9fYtNfM399_=_ff81zeRJv=0+z7oFJfPGmJgTp6yrJmU+1w@mail.gmail.com/
Fixes: 160672b86b0d ("drm/i915/dp: Use clamp for pipe_bpp limits with DSC")
Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Tested-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250131041342.3086716-1-ankit.k.nautiyal@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/display/intel_dp.c

index 4fe274105c1dd0b3e47233ecb3633addf38be6b5..00aba97631a9bc0326ea7fc4399897cededbe016 100644 (file)
@@ -1791,7 +1791,7 @@ int intel_dp_dsc_max_src_input_bpc(struct intel_display *display)
        if (DISPLAY_VER(display) == 11)
                return 10;
 
-       return 0;
+       return intel_dp_dsc_min_src_input_bpc();
 }
 
 int intel_dp_dsc_compute_max_bpp(const struct intel_connector *connector,