diff mbox series

[v7,15/22] drm/edid: move EDID BPC quirk application to update_display_info()

Message ID 8997e0fa3b0fd03c920e72d1dff24c0d96ff4dd0.1672826282.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/edid: info & modes parsing and drm_edid refactors | expand

Commit Message

Jani Nikula Jan. 4, 2023, 10:05 a.m. UTC
The BPC quirks are closer to home in update_display_info().

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

Comments

Ville Syrjälä Jan. 18, 2023, 4:15 p.m. UTC | #1
On Wed, Jan 04, 2023 at 12:05:30PM +0200, Jani Nikula wrote:
> The BPC quirks are closer to home in update_display_info().
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 810a5fca398a..5881df5bddb9 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -6555,6 +6555,18 @@ static void update_display_info(struct drm_connector *connector,
>  	if (info->quirks & EDID_QUIRK_CAP_DSC_15BPP)
>  		info->max_dsc_bpp = 15;
>  
> +	if (info->quirks & EDID_QUIRK_FORCE_6BPC)
> +		info->bpc = 6;
> +
> +	if (info->quirks & EDID_QUIRK_FORCE_8BPC)
> +		info->bpc = 8;
> +
> +	if (info->quirks & EDID_QUIRK_FORCE_10BPC)
> +		info->bpc = 10;
> +
> +	if (info->quirks & EDID_QUIRK_FORCE_12BPC)
> +		info->bpc = 12;
> +
>  	/* Depends on info->cea_rev set by drm_parse_cea_ext() above */
>  	drm_edid_to_eld(connector, drm_edid);
>  }
> @@ -6654,7 +6666,7 @@ static int add_displayid_detailed_modes(struct drm_connector *connector,
>  static int _drm_edid_connector_update(struct drm_connector *connector,
>  				      const struct drm_edid *drm_edid)
>  {
> -	struct drm_display_info *info = &connector->display_info;
> +	const struct drm_display_info *info = &connector->display_info;
>  	int num_modes = 0;
>  
>  	/*
> @@ -6694,18 +6706,6 @@ static int _drm_edid_connector_update(struct drm_connector *connector,
>  	if (info->quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75))
>  		edid_fixup_preferred(connector);
>  
> -	if (info->quirks & EDID_QUIRK_FORCE_6BPC)
> -		info->bpc = 6;
> -
> -	if (info->quirks & EDID_QUIRK_FORCE_8BPC)
> -		info->bpc = 8;
> -
> -	if (info->quirks & EDID_QUIRK_FORCE_10BPC)
> -		info->bpc = 10;
> -
> -	if (info->quirks & EDID_QUIRK_FORCE_12BPC)
> -		info->bpc = 12;
> -
>  	return num_modes;
>  }
>  
> -- 
> 2.34.1
Jani Nikula Jan. 19, 2023, 12:16 p.m. UTC | #2
On Wed, 18 Jan 2023, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Wed, Jan 04, 2023 at 12:05:30PM +0200, Jani Nikula wrote:
>> The BPC quirks are closer to home in update_display_info().
>> 
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Thanks, also pushed patches 12-15 because they don't depend on patch 11.

BR,
Jani.

>
>> ---
>>  drivers/gpu/drm/drm_edid.c | 26 +++++++++++++-------------
>>  1 file changed, 13 insertions(+), 13 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 810a5fca398a..5881df5bddb9 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -6555,6 +6555,18 @@ static void update_display_info(struct drm_connector *connector,
>>  	if (info->quirks & EDID_QUIRK_CAP_DSC_15BPP)
>>  		info->max_dsc_bpp = 15;
>>  
>> +	if (info->quirks & EDID_QUIRK_FORCE_6BPC)
>> +		info->bpc = 6;
>> +
>> +	if (info->quirks & EDID_QUIRK_FORCE_8BPC)
>> +		info->bpc = 8;
>> +
>> +	if (info->quirks & EDID_QUIRK_FORCE_10BPC)
>> +		info->bpc = 10;
>> +
>> +	if (info->quirks & EDID_QUIRK_FORCE_12BPC)
>> +		info->bpc = 12;
>> +
>>  	/* Depends on info->cea_rev set by drm_parse_cea_ext() above */
>>  	drm_edid_to_eld(connector, drm_edid);
>>  }
>> @@ -6654,7 +6666,7 @@ static int add_displayid_detailed_modes(struct drm_connector *connector,
>>  static int _drm_edid_connector_update(struct drm_connector *connector,
>>  				      const struct drm_edid *drm_edid)
>>  {
>> -	struct drm_display_info *info = &connector->display_info;
>> +	const struct drm_display_info *info = &connector->display_info;
>>  	int num_modes = 0;
>>  
>>  	/*
>> @@ -6694,18 +6706,6 @@ static int _drm_edid_connector_update(struct drm_connector *connector,
>>  	if (info->quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75))
>>  		edid_fixup_preferred(connector);
>>  
>> -	if (info->quirks & EDID_QUIRK_FORCE_6BPC)
>> -		info->bpc = 6;
>> -
>> -	if (info->quirks & EDID_QUIRK_FORCE_8BPC)
>> -		info->bpc = 8;
>> -
>> -	if (info->quirks & EDID_QUIRK_FORCE_10BPC)
>> -		info->bpc = 10;
>> -
>> -	if (info->quirks & EDID_QUIRK_FORCE_12BPC)
>> -		info->bpc = 12;
>> -
>>  	return num_modes;
>>  }
>>  
>> -- 
>> 2.34.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 810a5fca398a..5881df5bddb9 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -6555,6 +6555,18 @@  static void update_display_info(struct drm_connector *connector,
 	if (info->quirks & EDID_QUIRK_CAP_DSC_15BPP)
 		info->max_dsc_bpp = 15;
 
+	if (info->quirks & EDID_QUIRK_FORCE_6BPC)
+		info->bpc = 6;
+
+	if (info->quirks & EDID_QUIRK_FORCE_8BPC)
+		info->bpc = 8;
+
+	if (info->quirks & EDID_QUIRK_FORCE_10BPC)
+		info->bpc = 10;
+
+	if (info->quirks & EDID_QUIRK_FORCE_12BPC)
+		info->bpc = 12;
+
 	/* Depends on info->cea_rev set by drm_parse_cea_ext() above */
 	drm_edid_to_eld(connector, drm_edid);
 }
@@ -6654,7 +6666,7 @@  static int add_displayid_detailed_modes(struct drm_connector *connector,
 static int _drm_edid_connector_update(struct drm_connector *connector,
 				      const struct drm_edid *drm_edid)
 {
-	struct drm_display_info *info = &connector->display_info;
+	const struct drm_display_info *info = &connector->display_info;
 	int num_modes = 0;
 
 	/*
@@ -6694,18 +6706,6 @@  static int _drm_edid_connector_update(struct drm_connector *connector,
 	if (info->quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75))
 		edid_fixup_preferred(connector);
 
-	if (info->quirks & EDID_QUIRK_FORCE_6BPC)
-		info->bpc = 6;
-
-	if (info->quirks & EDID_QUIRK_FORCE_8BPC)
-		info->bpc = 8;
-
-	if (info->quirks & EDID_QUIRK_FORCE_10BPC)
-		info->bpc = 10;
-
-	if (info->quirks & EDID_QUIRK_FORCE_12BPC)
-		info->bpc = 12;
-
 	return num_modes;
 }