Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/dp: Fail state computation for invalid DSC source input BPP values

There is no reason to accept an invalid minimum/maximum DSC source input
BPP value (i.e a minimum DSC input BPP value above the maximum pipe BPP
or a maximum DSC input BPP value below the minimum pipe BPP value), fail
the state computation in these cases.

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20251215192357.172201-17-imre.deak@intel.com

Imre Deak 33846549 a63bbb8d

+21 -7
+21 -7
drivers/gpu/drm/i915/display/intel_dp.c
··· 2661 2661 return true; 2662 2662 } 2663 2663 2664 - static void 2665 - intel_dp_dsc_compute_pipe_bpp_limits(struct intel_dp *intel_dp, 2664 + static bool 2665 + intel_dp_dsc_compute_pipe_bpp_limits(struct intel_connector *connector, 2666 2666 struct link_config_limits *limits) 2667 2667 { 2668 - struct intel_display *display = to_intel_display(intel_dp); 2668 + struct intel_display *display = to_intel_display(connector); 2669 + const struct link_config_limits orig_limits = *limits; 2669 2670 int dsc_min_bpc = intel_dp_dsc_min_src_input_bpc(); 2670 2671 int dsc_max_bpc = intel_dp_dsc_max_src_input_bpc(display); 2671 2672 2672 - limits->pipe.max_bpp = clamp(limits->pipe.max_bpp, dsc_min_bpc * 3, dsc_max_bpc * 3); 2673 - limits->pipe.min_bpp = clamp(limits->pipe.min_bpp, dsc_min_bpc * 3, dsc_max_bpc * 3); 2673 + limits->pipe.min_bpp = max(limits->pipe.min_bpp, dsc_min_bpc * 3); 2674 + limits->pipe.max_bpp = min(limits->pipe.max_bpp, dsc_max_bpc * 3); 2675 + 2676 + if (limits->pipe.min_bpp <= 0 || 2677 + limits->pipe.min_bpp > limits->pipe.max_bpp) { 2678 + drm_dbg_kms(display->drm, 2679 + "[CONNECTOR:%d:%s] Invalid DSC src/sink input BPP (src:%d-%d pipe:%d-%d)\n", 2680 + connector->base.base.id, connector->base.name, 2681 + dsc_min_bpc * 3, dsc_max_bpc * 3, 2682 + orig_limits.pipe.min_bpp, orig_limits.pipe.max_bpp); 2683 + 2684 + return false; 2685 + } 2686 + 2687 + return true; 2674 2688 } 2675 2689 2676 2690 bool ··· 2724 2710 respect_downstream_limits); 2725 2711 } 2726 2712 2727 - if (dsc) 2728 - intel_dp_dsc_compute_pipe_bpp_limits(intel_dp, limits); 2713 + if (dsc && !intel_dp_dsc_compute_pipe_bpp_limits(connector, limits)) 2714 + return false; 2729 2715 2730 2716 if (is_mst || intel_dp->use_max_params) { 2731 2717 /*