diff mbox series

[02/14] drm/i915/dp: Return early if DSC not supported

Message ID 20241217093244.3938132-3-ankit.k.nautiyal@intel.com (mailing list archive)
State New
Headers show
Series DP DSC min/max src bpc fixes | expand

Commit Message

Nautiyal, Ankit K Dec. 17, 2024, 9:32 a.m. UTC
Check for DSC support before computing link config with DSC.
For DP MST we are already doing the same.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jani Nikula Dec. 17, 2024, 10:55 a.m. UTC | #1
On Tue, 17 Dec 2024, Ankit Nautiyal <ankit.k.nautiyal@intel.com> wrote:
> Check for DSC support before computing link config with DSC.
> For DP MST we are already doing the same.
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 908b9887f89b..dd2da9facaad 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -2375,9 +2375,6 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
>  		 intel_dp_supports_fec(intel_dp, connector, pipe_config) &&
>  		 !intel_dp_is_uhbr(pipe_config));
>  
> -	if (!intel_dp_supports_dsc(intel_dp, connector, pipe_config))
> -		return -EINVAL;
> -
>  	if (!intel_dp_dsc_supports_format(connector, pipe_config->output_format))
>  		return -EINVAL;
>  
> @@ -2652,6 +2649,9 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
>  			    str_yes_no(ret), str_yes_no(joiner_needs_dsc),
>  			    str_yes_no(intel_dp->force_dsc_en));
>  
> +		if (!intel_dp_supports_dsc(intel_dp, connector, pipe_config))
> +			return -EINVAL;
> +

The (pre-existing) problem with this is that we debug log we fall back
to DSC, while we don't.

Maybe we should do something like this instead, both in SST and MST code:

--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -2644,6 +2644,11 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
 			dsc_needed = true;
 	}
 
+	if (dsc_needed && !intel_dp_supports_dsc(connector, pipe_config)) {
+		drm_dbg_kms(display->drm, "DSC required but not available.\n");
+		return -EINVAL;
+	}
+
 	if (dsc_needed) {
 		drm_dbg_kms(display->drm,
 			    "Try DSC (fallback=%s, joiner=%s, force=%s)\n",

BR,
Jani.

>  		if (!intel_dp_compute_config_limits(intel_dp, pipe_config,
>  						    respect_downstream_limits,
>  						    true,
Jani Nikula Dec. 17, 2024, 11:02 a.m. UTC | #2
On Tue, 17 Dec 2024, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> On Tue, 17 Dec 2024, Ankit Nautiyal <ankit.k.nautiyal@intel.com> wrote:
>> Check for DSC support before computing link config with DSC.
>> For DP MST we are already doing the same.
>>
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_dp.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
>> index 908b9887f89b..dd2da9facaad 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
>> @@ -2375,9 +2375,6 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
>>  		 intel_dp_supports_fec(intel_dp, connector, pipe_config) &&
>>  		 !intel_dp_is_uhbr(pipe_config));
>>  
>> -	if (!intel_dp_supports_dsc(intel_dp, connector, pipe_config))
>> -		return -EINVAL;
>> -
>>  	if (!intel_dp_dsc_supports_format(connector, pipe_config->output_format))
>>  		return -EINVAL;
>>  
>> @@ -2652,6 +2649,9 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
>>  			    str_yes_no(ret), str_yes_no(joiner_needs_dsc),
>>  			    str_yes_no(intel_dp->force_dsc_en));
>>  
>> +		if (!intel_dp_supports_dsc(intel_dp, connector, pipe_config))
>> +			return -EINVAL;
>> +
>
> The (pre-existing) problem with this is that we debug log we fall back
> to DSC, while we don't.
>
> Maybe we should do something like this instead, both in SST and MST code:

On second thought, this can also come as a follow-up later. I don't want
to block the series with this.

BR,
Jani.


>
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -2644,6 +2644,11 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
>  			dsc_needed = true;
>  	}
>  
> +	if (dsc_needed && !intel_dp_supports_dsc(connector, pipe_config)) {
> +		drm_dbg_kms(display->drm, "DSC required but not available.\n");
> +		return -EINVAL;
> +	}
> +
>  	if (dsc_needed) {
>  		drm_dbg_kms(display->drm,
>  			    "Try DSC (fallback=%s, joiner=%s, force=%s)\n",
>
> BR,
> Jani.
>
>>  		if (!intel_dp_compute_config_limits(intel_dp, pipe_config,
>>  						    respect_downstream_limits,
>>  						    true,
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 908b9887f89b..dd2da9facaad 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -2375,9 +2375,6 @@  int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
 		 intel_dp_supports_fec(intel_dp, connector, pipe_config) &&
 		 !intel_dp_is_uhbr(pipe_config));
 
-	if (!intel_dp_supports_dsc(intel_dp, connector, pipe_config))
-		return -EINVAL;
-
 	if (!intel_dp_dsc_supports_format(connector, pipe_config->output_format))
 		return -EINVAL;
 
@@ -2652,6 +2649,9 @@  intel_dp_compute_link_config(struct intel_encoder *encoder,
 			    str_yes_no(ret), str_yes_no(joiner_needs_dsc),
 			    str_yes_no(intel_dp->force_dsc_en));
 
+		if (!intel_dp_supports_dsc(intel_dp, connector, pipe_config))
+			return -EINVAL;
+
 		if (!intel_dp_compute_config_limits(intel_dp, pipe_config,
 						    respect_downstream_limits,
 						    true,