diff mbox series

drm/i915/dp: Fix the computation for compressed_bpp for DISPLAY < 13

Message ID 20240305054443.2489895-1-ankit.k.nautiyal@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/dp: Fix the computation for compressed_bpp for DISPLAY < 13 | expand

Commit Message

Ankit Nautiyal March 5, 2024, 5:44 a.m. UTC
For DISPLAY < 13, compressed bpp is chosen from a list of
supported compressed bpps. Fix the condition to choose the
appropriate compressed bpp from the list.

Fixes: 1c56e9a39833 ("drm/i915/dp: Get optimal link config to have best compressed bpp")
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: <stable@vger.kernel.org> # v6.7+
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10162
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Suraj Kandpal March 27, 2024, 4:05 a.m. UTC | #1
> Subject: [PATCH] drm/i915/dp: Fix the computation for compressed_bpp for
> DISPLAY < 13
> 
> For DISPLAY < 13, compressed bpp is chosen from a list of supported
> compressed bpps. Fix the condition to choose the appropriate compressed
> bpp from the list.
> 

LGTM,
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>

> Fixes: 1c56e9a39833 ("drm/i915/dp: Get optimal link config to have best
> compressed bpp")
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: <stable@vger.kernel.org> # v6.7+
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10162
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index e13121dc3a03..d579195f84ee 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1918,8 +1918,9 @@ icl_dsc_compute_link_config(struct intel_dp
> *intel_dp,
>  	dsc_max_bpp = min(dsc_max_bpp, pipe_bpp - 1);
> 
>  	for (i = 0; i < ARRAY_SIZE(valid_dsc_bpp); i++) {
> -		if (valid_dsc_bpp[i] < dsc_min_bpp ||
> -		    valid_dsc_bpp[i] > dsc_max_bpp)
> +		if (valid_dsc_bpp[i] < dsc_min_bpp)
> +			continue;
> +		if (valid_dsc_bpp[i] > dsc_max_bpp)
>  			break;
> 
>  		ret = dsc_compute_link_config(intel_dp,
> --
> 2.40.1
Ankit Nautiyal April 2, 2024, 5:57 a.m. UTC | #2
On 3/27/2024 9:35 AM, Kandpal, Suraj wrote:
>> Subject: [PATCH] drm/i915/dp: Fix the computation for compressed_bpp for
>> DISPLAY < 13
>>
>> For DISPLAY < 13, compressed bpp is chosen from a list of supported
>> compressed bpps. Fix the condition to choose the appropriate compressed
>> bpp from the list.
>>
> LGTM,
> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>

Thanks for the review. Patch was pushed to drm-intel-next.

Regards,

Ankit

>
>> Fixes: 1c56e9a39833 ("drm/i915/dp: Get optimal link config to have best
>> compressed bpp")
>> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: <stable@vger.kernel.org> # v6.7+
>> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10162
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>>   drivers/gpu/drm/i915/display/intel_dp.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
>> b/drivers/gpu/drm/i915/display/intel_dp.c
>> index e13121dc3a03..d579195f84ee 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
>> @@ -1918,8 +1918,9 @@ icl_dsc_compute_link_config(struct intel_dp
>> *intel_dp,
>>   	dsc_max_bpp = min(dsc_max_bpp, pipe_bpp - 1);
>>
>>   	for (i = 0; i < ARRAY_SIZE(valid_dsc_bpp); i++) {
>> -		if (valid_dsc_bpp[i] < dsc_min_bpp ||
>> -		    valid_dsc_bpp[i] > dsc_max_bpp)
>> +		if (valid_dsc_bpp[i] < dsc_min_bpp)
>> +			continue;
>> +		if (valid_dsc_bpp[i] > dsc_max_bpp)
>>   			break;
>>
>>   		ret = dsc_compute_link_config(intel_dp,
>> --
>> 2.40.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index e13121dc3a03..d579195f84ee 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1918,8 +1918,9 @@  icl_dsc_compute_link_config(struct intel_dp *intel_dp,
 	dsc_max_bpp = min(dsc_max_bpp, pipe_bpp - 1);
 
 	for (i = 0; i < ARRAY_SIZE(valid_dsc_bpp); i++) {
-		if (valid_dsc_bpp[i] < dsc_min_bpp ||
-		    valid_dsc_bpp[i] > dsc_max_bpp)
+		if (valid_dsc_bpp[i] < dsc_min_bpp)
+			continue;
+		if (valid_dsc_bpp[i] > dsc_max_bpp)
 			break;
 
 		ret = dsc_compute_link_config(intel_dp,