diff mbox series

[02/15] drm/i915/display: convert HAS_D12_PLANE_MINIMIZATION() to struct intel_display

Message ID 3f7b119ce893194eb50b652c6e6a9050d0d3c2a9.1730740629.git.jani.nikula@intel.com (mailing list archive)
State New
Headers show
Series drm/i915/display: convert display feature helpers to struct intel_display | expand

Commit Message

Jani Nikula Nov. 4, 2024, 5:19 p.m. UTC
Convert HAS_D12_PLANE_MINIMIZATION() to struct intel_display. Do minimal
drive-by conversions to struct intel_display in the callers while at it.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_device.c |  2 +-
 drivers/gpu/drm/i915/display/intel_display_device.h |  2 +-
 drivers/gpu/drm/i915/display/intel_display_irq.c    | 12 +++++++-----
 drivers/gpu/drm/i915/display/skl_universal_plane.c  |  4 +++-
 4 files changed, 12 insertions(+), 8 deletions(-)

Comments

Vinod Govindapillai Nov. 6, 2024, 8:58 a.m. UTC | #1
On Mon, 2024-11-04 at 19:19 +0200, Jani Nikula wrote:
> Convert HAS_D12_PLANE_MINIMIZATION() to struct intel_display. Do minimal
> drive-by conversions to struct intel_display in the callers while at it.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display_device.c |  2 +-
>  drivers/gpu/drm/i915/display/intel_display_device.h |  2 +-
>  drivers/gpu/drm/i915/display/intel_display_irq.c    | 12 +++++++-----
>  drivers/gpu/drm/i915/display/skl_universal_plane.c  |  4 +++-
>  4 files changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c
> b/drivers/gpu/drm/i915/display/intel_display_device.c
> index 47957384d56d..1e561df02751 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.c
> @@ -1687,7 +1687,7 @@ static void __intel_display_device_info_runtime_init(struct drm_i915_private
> *i9
>                 display_runtime->num_scalers[PIPE_C] = 1;
>         }
>  
> -       if (DISPLAY_VER(i915) >= 13 || HAS_D12_PLANE_MINIMIZATION(i915))
> +       if (DISPLAY_VER(i915) >= 13 || HAS_D12_PLANE_MINIMIZATION(display))
Just want to note that, I guess you intentionally leftout rest of the "i915" in this
__intel_display_device_info_runtime_init(). Though all instances of i915 in
gen8_de_pipe_fault_mask() are changed to intel_display.

Anyway, doesnt impact any functionalities..

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>

>                 for_each_pipe(i915, pipe)
>                         display_runtime->num_sprites[pipe] = 4;
>         else if (DISPLAY_VER(i915) >= 11)
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h
> b/drivers/gpu/drm/i915/display/intel_display_device.h
> index 392fbe29e974..e45ba21166d3 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h
> @@ -144,7 +144,7 @@ struct intel_display_platforms {
>  #define HAS_CDCLK_CRAWL(i915)          (DISPLAY_INFO(i915)->has_cdclk_crawl)
>  #define HAS_CDCLK_SQUASH(i915)         (DISPLAY_INFO(i915)->has_cdclk_squash)
>  #define HAS_CUR_FBC(i915)              (!HAS_GMCH(i915) && IS_DISPLAY_VER(i915, 7, 13))
> -#define HAS_D12_PLANE_MINIMIZATION(i915) (IS_ROCKETLAKE(i915) || IS_ALDERLAKE_S(i915))
> +#define HAS_D12_PLANE_MINIMIZATION(__display)  ((__display)->platform.rocketlake || (__display)-
> >platform.alderlake_s)
>  #define HAS_DBUF_OVERLAP_DETECTION(__i915) (DISPLAY_RUNTIME_INFO(__i915)-
> >has_dbuf_overlap_detection)
>  #define HAS_DDI(i915)                  (DISPLAY_INFO(i915)->has_ddi)
>  #define HAS_DISPLAY(i915)              (DISPLAY_RUNTIME_INFO(i915)->pipe_mask != 0)
> diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c
> b/drivers/gpu/drm/i915/display/intel_display_irq.c
> index e1547ebce60e..f0d3bdb5fc60 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_irq.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
> @@ -843,7 +843,9 @@ static u32 gen8_de_port_aux_mask(struct drm_i915_private *dev_priv)
>  
>  static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>  {
> -       if (DISPLAY_VER(dev_priv) >= 14)
> +       struct intel_display *display = &dev_priv->display;
> +
> +       if (DISPLAY_VER(display) >= 14)
>                 return MTL_PIPEDMC_ATS_FAULT |
>                         MTL_PLANE_ATS_FAULT |
>                         GEN12_PIPEDMC_FAULT |
> @@ -853,7 +855,7 @@ static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>                         GEN9_PIPE_PLANE3_FAULT |
>                         GEN9_PIPE_PLANE2_FAULT |
>                         GEN9_PIPE_PLANE1_FAULT;
> -       if (DISPLAY_VER(dev_priv) >= 13 || HAS_D12_PLANE_MINIMIZATION(dev_priv))
> +       if (DISPLAY_VER(display) >= 13 || HAS_D12_PLANE_MINIMIZATION(display))
>                 return GEN12_PIPEDMC_FAULT |
>                         GEN9_PIPE_CURSOR_FAULT |
>                         GEN11_PIPE_PLANE5_FAULT |
> @@ -861,7 +863,7 @@ static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>                         GEN9_PIPE_PLANE3_FAULT |
>                         GEN9_PIPE_PLANE2_FAULT |
>                         GEN9_PIPE_PLANE1_FAULT;
> -       else if (DISPLAY_VER(dev_priv) == 12)
> +       else if (DISPLAY_VER(display) == 12)
>                 return GEN12_PIPEDMC_FAULT |
>                         GEN9_PIPE_CURSOR_FAULT |
>                         GEN11_PIPE_PLANE7_FAULT |
> @@ -871,7 +873,7 @@ static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>                         GEN9_PIPE_PLANE3_FAULT |
>                         GEN9_PIPE_PLANE2_FAULT |
>                         GEN9_PIPE_PLANE1_FAULT;
> -       else if (DISPLAY_VER(dev_priv) == 11)
> +       else if (DISPLAY_VER(display) == 11)
>                 return GEN9_PIPE_CURSOR_FAULT |
>                         GEN11_PIPE_PLANE7_FAULT |
>                         GEN11_PIPE_PLANE6_FAULT |
> @@ -880,7 +882,7 @@ static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>                         GEN9_PIPE_PLANE3_FAULT |
>                         GEN9_PIPE_PLANE2_FAULT |
>                         GEN9_PIPE_PLANE1_FAULT;
> -       else if (DISPLAY_VER(dev_priv) >= 9)
> +       else if (DISPLAY_VER(display) >= 9)
>                 return GEN9_PIPE_CURSOR_FAULT |
>                         GEN9_PIPE_PLANE4_FAULT |
>                         GEN9_PIPE_PLANE3_FAULT |
> diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> index 038ca2ec5d7a..c6e464d70cc7 100644
> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> @@ -239,7 +239,9 @@ int skl_format_to_fourcc(int format, bool rgb_order, bool alpha)
>  
>  static u8 icl_nv12_y_plane_mask(struct drm_i915_private *i915)
>  {
> -       if (DISPLAY_VER(i915) >= 13 || HAS_D12_PLANE_MINIMIZATION(i915))
> +       struct intel_display *display = &i915->display;
> +
> +       if (DISPLAY_VER(display) >= 13 || HAS_D12_PLANE_MINIMIZATION(display))
>                 return BIT(PLANE_4) | BIT(PLANE_5);
>         else
>                 return BIT(PLANE_6) | BIT(PLANE_7);
Jani Nikula Nov. 6, 2024, 9:07 a.m. UTC | #2
On Wed, 06 Nov 2024, "Govindapillai, Vinod" <vinod.govindapillai@intel.com> wrote:
> On Mon, 2024-11-04 at 19:19 +0200, Jani Nikula wrote:
>> Convert HAS_D12_PLANE_MINIMIZATION() to struct intel_display. Do minimal
>> drive-by conversions to struct intel_display in the callers while at it.
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_display_device.c |  2 +-
>>  drivers/gpu/drm/i915/display/intel_display_device.h |  2 +-
>>  drivers/gpu/drm/i915/display/intel_display_irq.c    | 12 +++++++-----
>>  drivers/gpu/drm/i915/display/skl_universal_plane.c  |  4 +++-
>>  4 files changed, 12 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c
>> b/drivers/gpu/drm/i915/display/intel_display_device.c
>> index 47957384d56d..1e561df02751 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_device.c
>> +++ b/drivers/gpu/drm/i915/display/intel_display_device.c
>> @@ -1687,7 +1687,7 @@ static void __intel_display_device_info_runtime_init(struct drm_i915_private
>> *i9
>>                 display_runtime->num_scalers[PIPE_C] = 1;
>>         }
>>
>> -       if (DISPLAY_VER(i915) >= 13 || HAS_D12_PLANE_MINIMIZATION(i915))
>> +       if (DISPLAY_VER(i915) >= 13 || HAS_D12_PLANE_MINIMIZATION(display))
> Just want to note that, I guess you intentionally leftout rest of the "i915" in this
> __intel_display_device_info_runtime_init(). Though all instances of i915 in
> gen8_de_pipe_fault_mask() are changed to intel_display.

Judgement call. Changing __intel_display_device_info_runtime_init()
would be a bigger change than everything else in the patch. It's done
separately in a later patch, and that depends on this
patch. gen8_de_pipe_fault_mask() has a few references only, so makes
sense to convert that.

> Anyway, doesnt impact any functionalities..
>
> Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>

Thanks.

>
>>                 for_each_pipe(i915, pipe)
>>                         display_runtime->num_sprites[pipe] = 4;
>>         else if (DISPLAY_VER(i915) >= 11)
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h
>> b/drivers/gpu/drm/i915/display/intel_display_device.h
>> index 392fbe29e974..e45ba21166d3 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_device.h
>> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h
>> @@ -144,7 +144,7 @@ struct intel_display_platforms {
>>  #define HAS_CDCLK_CRAWL(i915)          (DISPLAY_INFO(i915)->has_cdclk_crawl)
>>  #define HAS_CDCLK_SQUASH(i915)         (DISPLAY_INFO(i915)->has_cdclk_squash)
>>  #define HAS_CUR_FBC(i915)              (!HAS_GMCH(i915) && IS_DISPLAY_VER(i915, 7, 13))
>> -#define HAS_D12_PLANE_MINIMIZATION(i915) (IS_ROCKETLAKE(i915) || IS_ALDERLAKE_S(i915))
>> +#define HAS_D12_PLANE_MINIMIZATION(__display)  ((__display)->platform.rocketlake || (__display)-
>> >platform.alderlake_s)
>>  #define HAS_DBUF_OVERLAP_DETECTION(__i915) (DISPLAY_RUNTIME_INFO(__i915)-
>> >has_dbuf_overlap_detection)
>>  #define HAS_DDI(i915)                  (DISPLAY_INFO(i915)->has_ddi)
>>  #define HAS_DISPLAY(i915)              (DISPLAY_RUNTIME_INFO(i915)->pipe_mask != 0)
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c
>> b/drivers/gpu/drm/i915/display/intel_display_irq.c
>> index e1547ebce60e..f0d3bdb5fc60 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_irq.c
>> +++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
>> @@ -843,7 +843,9 @@ static u32 gen8_de_port_aux_mask(struct drm_i915_private *dev_priv)
>>
>>  static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>>  {
>> -       if (DISPLAY_VER(dev_priv) >= 14)
>> +       struct intel_display *display = &dev_priv->display;
>> +
>> +       if (DISPLAY_VER(display) >= 14)
>>                 return MTL_PIPEDMC_ATS_FAULT |
>>                         MTL_PLANE_ATS_FAULT |
>>                         GEN12_PIPEDMC_FAULT |
>> @@ -853,7 +855,7 @@ static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>>                         GEN9_PIPE_PLANE3_FAULT |
>>                         GEN9_PIPE_PLANE2_FAULT |
>>                         GEN9_PIPE_PLANE1_FAULT;
>> -       if (DISPLAY_VER(dev_priv) >= 13 || HAS_D12_PLANE_MINIMIZATION(dev_priv))
>> +       if (DISPLAY_VER(display) >= 13 || HAS_D12_PLANE_MINIMIZATION(display))
>>                 return GEN12_PIPEDMC_FAULT |
>>                         GEN9_PIPE_CURSOR_FAULT |
>>                         GEN11_PIPE_PLANE5_FAULT |
>> @@ -861,7 +863,7 @@ static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>>                         GEN9_PIPE_PLANE3_FAULT |
>>                         GEN9_PIPE_PLANE2_FAULT |
>>                         GEN9_PIPE_PLANE1_FAULT;
>> -       else if (DISPLAY_VER(dev_priv) == 12)
>> +       else if (DISPLAY_VER(display) == 12)
>>                 return GEN12_PIPEDMC_FAULT |
>>                         GEN9_PIPE_CURSOR_FAULT |
>>                         GEN11_PIPE_PLANE7_FAULT |
>> @@ -871,7 +873,7 @@ static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>>                         GEN9_PIPE_PLANE3_FAULT |
>>                         GEN9_PIPE_PLANE2_FAULT |
>>                         GEN9_PIPE_PLANE1_FAULT;
>> -       else if (DISPLAY_VER(dev_priv) == 11)
>> +       else if (DISPLAY_VER(display) == 11)
>>                 return GEN9_PIPE_CURSOR_FAULT |
>>                         GEN11_PIPE_PLANE7_FAULT |
>>                         GEN11_PIPE_PLANE6_FAULT |
>> @@ -880,7 +882,7 @@ static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>>                         GEN9_PIPE_PLANE3_FAULT |
>>                         GEN9_PIPE_PLANE2_FAULT |
>>                         GEN9_PIPE_PLANE1_FAULT;
>> -       else if (DISPLAY_VER(dev_priv) >= 9)
>> +       else if (DISPLAY_VER(display) >= 9)
>>                 return GEN9_PIPE_CURSOR_FAULT |
>>                         GEN9_PIPE_PLANE4_FAULT |
>>                         GEN9_PIPE_PLANE3_FAULT |
>> diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c
>> b/drivers/gpu/drm/i915/display/skl_universal_plane.c
>> index 038ca2ec5d7a..c6e464d70cc7 100644
>> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
>> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
>> @@ -239,7 +239,9 @@ int skl_format_to_fourcc(int format, bool rgb_order, bool alpha)
>>
>>  static u8 icl_nv12_y_plane_mask(struct drm_i915_private *i915)
>>  {
>> -       if (DISPLAY_VER(i915) >= 13 || HAS_D12_PLANE_MINIMIZATION(i915))
>> +       struct intel_display *display = &i915->display;
>> +
>> +       if (DISPLAY_VER(display) >= 13 || HAS_D12_PLANE_MINIMIZATION(display))
>>                 return BIT(PLANE_4) | BIT(PLANE_5);
>>         else
>>                 return BIT(PLANE_6) | BIT(PLANE_7);
>
Rodrigo Vivi Nov. 6, 2024, 4:44 p.m. UTC | #3
On Mon, Nov 04, 2024 at 07:19:16PM +0200, Jani Nikula wrote:
> Convert HAS_D12_PLANE_MINIMIZATION() to struct intel_display. Do minimal
> drive-by conversions to struct intel_display in the callers while at it.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display_device.c |  2 +-
>  drivers/gpu/drm/i915/display/intel_display_device.h |  2 +-
>  drivers/gpu/drm/i915/display/intel_display_irq.c    | 12 +++++++-----
>  drivers/gpu/drm/i915/display/skl_universal_plane.c  |  4 +++-
>  4 files changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c
> index 47957384d56d..1e561df02751 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.c
> @@ -1687,7 +1687,7 @@ static void __intel_display_device_info_runtime_init(struct drm_i915_private *i9
>  		display_runtime->num_scalers[PIPE_C] = 1;
>  	}
>  
> -	if (DISPLAY_VER(i915) >= 13 || HAS_D12_PLANE_MINIMIZATION(i915))
> +	if (DISPLAY_VER(i915) >= 13 || HAS_D12_PLANE_MINIMIZATION(display))
>  		for_each_pipe(i915, pipe)
>  			display_runtime->num_sprites[pipe] = 4;
>  	else if (DISPLAY_VER(i915) >= 11)
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h
> index 392fbe29e974..e45ba21166d3 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h
> @@ -144,7 +144,7 @@ struct intel_display_platforms {
>  #define HAS_CDCLK_CRAWL(i915)		(DISPLAY_INFO(i915)->has_cdclk_crawl)
>  #define HAS_CDCLK_SQUASH(i915)		(DISPLAY_INFO(i915)->has_cdclk_squash)
>  #define HAS_CUR_FBC(i915)		(!HAS_GMCH(i915) && IS_DISPLAY_VER(i915, 7, 13))
> -#define HAS_D12_PLANE_MINIMIZATION(i915) (IS_ROCKETLAKE(i915) || IS_ALDERLAKE_S(i915))
> +#define HAS_D12_PLANE_MINIMIZATION(__display)	((__display)->platform.rocketlake || (__display)->platform.alderlake_s)
>  #define HAS_DBUF_OVERLAP_DETECTION(__i915) (DISPLAY_RUNTIME_INFO(__i915)->has_dbuf_overlap_detection)
>  #define HAS_DDI(i915)			(DISPLAY_INFO(i915)->has_ddi)
>  #define HAS_DISPLAY(i915)		(DISPLAY_RUNTIME_INFO(i915)->pipe_mask != 0)
> diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c
> index e1547ebce60e..f0d3bdb5fc60 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_irq.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
> @@ -843,7 +843,9 @@ static u32 gen8_de_port_aux_mask(struct drm_i915_private *dev_priv)
>  
>  static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>  {
> -	if (DISPLAY_VER(dev_priv) >= 14)
> +	struct intel_display *display = &dev_priv->display;
> +
> +	if (DISPLAY_VER(display) >= 14)
>  		return MTL_PIPEDMC_ATS_FAULT |
>  			MTL_PLANE_ATS_FAULT |
>  			GEN12_PIPEDMC_FAULT |
> @@ -853,7 +855,7 @@ static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>  			GEN9_PIPE_PLANE3_FAULT |
>  			GEN9_PIPE_PLANE2_FAULT |
>  			GEN9_PIPE_PLANE1_FAULT;
> -	if (DISPLAY_VER(dev_priv) >= 13 || HAS_D12_PLANE_MINIMIZATION(dev_priv))
> +	if (DISPLAY_VER(display) >= 13 || HAS_D12_PLANE_MINIMIZATION(display))
>  		return GEN12_PIPEDMC_FAULT |
>  			GEN9_PIPE_CURSOR_FAULT |
>  			GEN11_PIPE_PLANE5_FAULT |
> @@ -861,7 +863,7 @@ static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>  			GEN9_PIPE_PLANE3_FAULT |
>  			GEN9_PIPE_PLANE2_FAULT |
>  			GEN9_PIPE_PLANE1_FAULT;
> -	else if (DISPLAY_VER(dev_priv) == 12)
> +	else if (DISPLAY_VER(display) == 12)
>  		return GEN12_PIPEDMC_FAULT |
>  			GEN9_PIPE_CURSOR_FAULT |
>  			GEN11_PIPE_PLANE7_FAULT |
> @@ -871,7 +873,7 @@ static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>  			GEN9_PIPE_PLANE3_FAULT |
>  			GEN9_PIPE_PLANE2_FAULT |
>  			GEN9_PIPE_PLANE1_FAULT;
> -	else if (DISPLAY_VER(dev_priv) == 11)
> +	else if (DISPLAY_VER(display) == 11)
>  		return GEN9_PIPE_CURSOR_FAULT |
>  			GEN11_PIPE_PLANE7_FAULT |
>  			GEN11_PIPE_PLANE6_FAULT |
> @@ -880,7 +882,7 @@ static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
>  			GEN9_PIPE_PLANE3_FAULT |
>  			GEN9_PIPE_PLANE2_FAULT |
>  			GEN9_PIPE_PLANE1_FAULT;
> -	else if (DISPLAY_VER(dev_priv) >= 9)
> +	else if (DISPLAY_VER(display) >= 9)
>  		return GEN9_PIPE_CURSOR_FAULT |
>  			GEN9_PIPE_PLANE4_FAULT |
>  			GEN9_PIPE_PLANE3_FAULT |
> diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> index 038ca2ec5d7a..c6e464d70cc7 100644
> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> @@ -239,7 +239,9 @@ int skl_format_to_fourcc(int format, bool rgb_order, bool alpha)
>  
>  static u8 icl_nv12_y_plane_mask(struct drm_i915_private *i915)
>  {
> -	if (DISPLAY_VER(i915) >= 13 || HAS_D12_PLANE_MINIMIZATION(i915))
> +	struct intel_display *display = &i915->display;
> +
> +	if (DISPLAY_VER(display) >= 13 || HAS_D12_PLANE_MINIMIZATION(display))
>  		return BIT(PLANE_4) | BIT(PLANE_5);
>  	else
>  		return BIT(PLANE_6) | BIT(PLANE_7);
> -- 
> 2.39.5
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c
index 47957384d56d..1e561df02751 100644
--- a/drivers/gpu/drm/i915/display/intel_display_device.c
+++ b/drivers/gpu/drm/i915/display/intel_display_device.c
@@ -1687,7 +1687,7 @@  static void __intel_display_device_info_runtime_init(struct drm_i915_private *i9
 		display_runtime->num_scalers[PIPE_C] = 1;
 	}
 
-	if (DISPLAY_VER(i915) >= 13 || HAS_D12_PLANE_MINIMIZATION(i915))
+	if (DISPLAY_VER(i915) >= 13 || HAS_D12_PLANE_MINIMIZATION(display))
 		for_each_pipe(i915, pipe)
 			display_runtime->num_sprites[pipe] = 4;
 	else if (DISPLAY_VER(i915) >= 11)
diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h
index 392fbe29e974..e45ba21166d3 100644
--- a/drivers/gpu/drm/i915/display/intel_display_device.h
+++ b/drivers/gpu/drm/i915/display/intel_display_device.h
@@ -144,7 +144,7 @@  struct intel_display_platforms {
 #define HAS_CDCLK_CRAWL(i915)		(DISPLAY_INFO(i915)->has_cdclk_crawl)
 #define HAS_CDCLK_SQUASH(i915)		(DISPLAY_INFO(i915)->has_cdclk_squash)
 #define HAS_CUR_FBC(i915)		(!HAS_GMCH(i915) && IS_DISPLAY_VER(i915, 7, 13))
-#define HAS_D12_PLANE_MINIMIZATION(i915) (IS_ROCKETLAKE(i915) || IS_ALDERLAKE_S(i915))
+#define HAS_D12_PLANE_MINIMIZATION(__display)	((__display)->platform.rocketlake || (__display)->platform.alderlake_s)
 #define HAS_DBUF_OVERLAP_DETECTION(__i915) (DISPLAY_RUNTIME_INFO(__i915)->has_dbuf_overlap_detection)
 #define HAS_DDI(i915)			(DISPLAY_INFO(i915)->has_ddi)
 #define HAS_DISPLAY(i915)		(DISPLAY_RUNTIME_INFO(i915)->pipe_mask != 0)
diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c
index e1547ebce60e..f0d3bdb5fc60 100644
--- a/drivers/gpu/drm/i915/display/intel_display_irq.c
+++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
@@ -843,7 +843,9 @@  static u32 gen8_de_port_aux_mask(struct drm_i915_private *dev_priv)
 
 static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
 {
-	if (DISPLAY_VER(dev_priv) >= 14)
+	struct intel_display *display = &dev_priv->display;
+
+	if (DISPLAY_VER(display) >= 14)
 		return MTL_PIPEDMC_ATS_FAULT |
 			MTL_PLANE_ATS_FAULT |
 			GEN12_PIPEDMC_FAULT |
@@ -853,7 +855,7 @@  static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
 			GEN9_PIPE_PLANE3_FAULT |
 			GEN9_PIPE_PLANE2_FAULT |
 			GEN9_PIPE_PLANE1_FAULT;
-	if (DISPLAY_VER(dev_priv) >= 13 || HAS_D12_PLANE_MINIMIZATION(dev_priv))
+	if (DISPLAY_VER(display) >= 13 || HAS_D12_PLANE_MINIMIZATION(display))
 		return GEN12_PIPEDMC_FAULT |
 			GEN9_PIPE_CURSOR_FAULT |
 			GEN11_PIPE_PLANE5_FAULT |
@@ -861,7 +863,7 @@  static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
 			GEN9_PIPE_PLANE3_FAULT |
 			GEN9_PIPE_PLANE2_FAULT |
 			GEN9_PIPE_PLANE1_FAULT;
-	else if (DISPLAY_VER(dev_priv) == 12)
+	else if (DISPLAY_VER(display) == 12)
 		return GEN12_PIPEDMC_FAULT |
 			GEN9_PIPE_CURSOR_FAULT |
 			GEN11_PIPE_PLANE7_FAULT |
@@ -871,7 +873,7 @@  static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
 			GEN9_PIPE_PLANE3_FAULT |
 			GEN9_PIPE_PLANE2_FAULT |
 			GEN9_PIPE_PLANE1_FAULT;
-	else if (DISPLAY_VER(dev_priv) == 11)
+	else if (DISPLAY_VER(display) == 11)
 		return GEN9_PIPE_CURSOR_FAULT |
 			GEN11_PIPE_PLANE7_FAULT |
 			GEN11_PIPE_PLANE6_FAULT |
@@ -880,7 +882,7 @@  static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
 			GEN9_PIPE_PLANE3_FAULT |
 			GEN9_PIPE_PLANE2_FAULT |
 			GEN9_PIPE_PLANE1_FAULT;
-	else if (DISPLAY_VER(dev_priv) >= 9)
+	else if (DISPLAY_VER(display) >= 9)
 		return GEN9_PIPE_CURSOR_FAULT |
 			GEN9_PIPE_PLANE4_FAULT |
 			GEN9_PIPE_PLANE3_FAULT |
diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index 038ca2ec5d7a..c6e464d70cc7 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -239,7 +239,9 @@  int skl_format_to_fourcc(int format, bool rgb_order, bool alpha)
 
 static u8 icl_nv12_y_plane_mask(struct drm_i915_private *i915)
 {
-	if (DISPLAY_VER(i915) >= 13 || HAS_D12_PLANE_MINIMIZATION(i915))
+	struct intel_display *display = &i915->display;
+
+	if (DISPLAY_VER(display) >= 13 || HAS_D12_PLANE_MINIMIZATION(display))
 		return BIT(PLANE_4) | BIT(PLANE_5);
 	else
 		return BIT(PLANE_6) | BIT(PLANE_7);