diff mbox series

[16/16] drm/i915: pass dev_priv explicitly to PIPEGCMAX

Message ID 5fdc8562fe7b8d26e1ec1bb8f9a221348246bbe1.1716469091.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: dev_priv fixes for i9xx_plane_regs.h/intel_color_regs.h | expand

Commit Message

Jani Nikula May 23, 2024, 12:59 p.m. UTC
Avoid the implicit dev_priv local variable use, and pass dev_priv
explicitly to the PIPEGCMAX register macro.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_color.c      | 13 +++++++------
 drivers/gpu/drm/i915/display/intel_color_regs.h |  6 +++---
 2 files changed, 10 insertions(+), 9 deletions(-)

Comments

Ville Syrjala May 23, 2024, 1:14 p.m. UTC | #1
On Thu, May 23, 2024 at 03:59:44PM +0300, Jani Nikula wrote:
> Avoid the implicit dev_priv local variable use, and pass dev_priv
> explicitly to the PIPEGCMAX register macro.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_color.c      | 13 +++++++------
>  drivers/gpu/drm/i915/display/intel_color_regs.h |  6 +++---
>  2 files changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
> index a83f41ee6834..da56d24eb933 100644
> --- a/drivers/gpu/drm/i915/display/intel_color.c
> +++ b/drivers/gpu/drm/i915/display/intel_color.c
> @@ -1284,9 +1284,10 @@ static void i965_load_lut_10p6(struct intel_crtc *crtc,
>  				  i965_lut_10p6_udw(&lut[i]));
>  	}
>  
> -	intel_de_write_fw(dev_priv, PIPEGCMAX(pipe, 0), lut[i].red);
> -	intel_de_write_fw(dev_priv, PIPEGCMAX(pipe, 1), lut[i].green);
> -	intel_de_write_fw(dev_priv, PIPEGCMAX(pipe, 2), lut[i].blue);
> +	intel_de_write_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 0), lut[i].red);
> +	intel_de_write_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 1),
> +			  lut[i].green);

nit: the newline breaks the pattern in a somewhat ugly way

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

> +	intel_de_write_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 2), lut[i].blue);
>  }
>  
>  static void i965_load_luts(const struct intel_crtc_state *crtc_state)
> @@ -3239,9 +3240,9 @@ static struct drm_property_blob *i965_read_lut_10p6(struct intel_crtc *crtc)
>  		i965_lut_10p6_pack(&lut[i], ldw, udw);
>  	}
>  
> -	lut[i].red = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(pipe, 0)));
> -	lut[i].green = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(pipe, 1)));
> -	lut[i].blue = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(pipe, 2)));
> +	lut[i].red = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 0)));
> +	lut[i].green = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 1)));
> +	lut[i].blue = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 2)));
>  
>  	return blob;
>  }
> diff --git a/drivers/gpu/drm/i915/display/intel_color_regs.h b/drivers/gpu/drm/i915/display/intel_color_regs.h
> index 61c18b4a7fa5..8eb643cfead7 100644
> --- a/drivers/gpu/drm/i915/display/intel_color_regs.h
> +++ b/drivers/gpu/drm/i915/display/intel_color_regs.h
> @@ -37,9 +37,9 @@
>  						  (i) * 4)
>  
>  /* i965/g4x/vlv/chv */
> -#define  _PIPEAGCMAX           0x70010
> -#define  _PIPEBGCMAX           0x71010
> -#define PIPEGCMAX(pipe, i)     _MMIO_PIPE2(dev_priv, pipe, _PIPEAGCMAX + (i) * 4) /* u1.16 */
> +#define  _PIPEAGCMAX			0x70010
> +#define  _PIPEBGCMAX			0x71010
> +#define PIPEGCMAX(dev_priv, pipe, i)	_MMIO_PIPE2(dev_priv, pipe, _PIPEAGCMAX + (i) * 4) /* u1.16 */
>  
>  /* ilk+ palette */
>  #define _LGC_PALETTE_A           0x4a000
> -- 
> 2.39.2
Jani Nikula May 23, 2024, 1:18 p.m. UTC | #2
On Thu, 23 May 2024, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Thu, May 23, 2024 at 03:59:44PM +0300, Jani Nikula wrote:
>> Avoid the implicit dev_priv local variable use, and pass dev_priv
>> explicitly to the PIPEGCMAX register macro.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_color.c      | 13 +++++++------
>>  drivers/gpu/drm/i915/display/intel_color_regs.h |  6 +++---
>>  2 files changed, 10 insertions(+), 9 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
>> index a83f41ee6834..da56d24eb933 100644
>> --- a/drivers/gpu/drm/i915/display/intel_color.c
>> +++ b/drivers/gpu/drm/i915/display/intel_color.c
>> @@ -1284,9 +1284,10 @@ static void i965_load_lut_10p6(struct intel_crtc *crtc,
>>  				  i965_lut_10p6_udw(&lut[i]));
>>  	}
>>  
>> -	intel_de_write_fw(dev_priv, PIPEGCMAX(pipe, 0), lut[i].red);
>> -	intel_de_write_fw(dev_priv, PIPEGCMAX(pipe, 1), lut[i].green);
>> -	intel_de_write_fw(dev_priv, PIPEGCMAX(pipe, 2), lut[i].blue);
>> +	intel_de_write_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 0), lut[i].red);
>> +	intel_de_write_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 1),
>> +			  lut[i].green);
>
> nit: the newline breaks the pattern in a somewhat ugly way

It's all cocci's doing... sometimes it's smart, sometimes less so.

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

Thanks!


>
>> +	intel_de_write_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 2), lut[i].blue);
>>  }
>>  
>>  static void i965_load_luts(const struct intel_crtc_state *crtc_state)
>> @@ -3239,9 +3240,9 @@ static struct drm_property_blob *i965_read_lut_10p6(struct intel_crtc *crtc)
>>  		i965_lut_10p6_pack(&lut[i], ldw, udw);
>>  	}
>>  
>> -	lut[i].red = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(pipe, 0)));
>> -	lut[i].green = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(pipe, 1)));
>> -	lut[i].blue = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(pipe, 2)));
>> +	lut[i].red = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 0)));
>> +	lut[i].green = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 1)));
>> +	lut[i].blue = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 2)));
>>  
>>  	return blob;
>>  }
>> diff --git a/drivers/gpu/drm/i915/display/intel_color_regs.h b/drivers/gpu/drm/i915/display/intel_color_regs.h
>> index 61c18b4a7fa5..8eb643cfead7 100644
>> --- a/drivers/gpu/drm/i915/display/intel_color_regs.h
>> +++ b/drivers/gpu/drm/i915/display/intel_color_regs.h
>> @@ -37,9 +37,9 @@
>>  						  (i) * 4)
>>  
>>  /* i965/g4x/vlv/chv */
>> -#define  _PIPEAGCMAX           0x70010
>> -#define  _PIPEBGCMAX           0x71010
>> -#define PIPEGCMAX(pipe, i)     _MMIO_PIPE2(dev_priv, pipe, _PIPEAGCMAX + (i) * 4) /* u1.16 */
>> +#define  _PIPEAGCMAX			0x70010
>> +#define  _PIPEBGCMAX			0x71010
>> +#define PIPEGCMAX(dev_priv, pipe, i)	_MMIO_PIPE2(dev_priv, pipe, _PIPEAGCMAX + (i) * 4) /* u1.16 */
>>  
>>  /* ilk+ palette */
>>  #define _LGC_PALETTE_A           0x4a000
>> -- 
>> 2.39.2
Jani Nikula May 24, 2024, 9:12 a.m. UTC | #3
On Thu, 23 May 2024, Jani Nikula <jani.nikula@intel.com> wrote:
> On Thu, 23 May 2024, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
>> On Thu, May 23, 2024 at 03:59:44PM +0300, Jani Nikula wrote:
>>> Avoid the implicit dev_priv local variable use, and pass dev_priv
>>> explicitly to the PIPEGCMAX register macro.
>>> 
>>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>> ---
>>>  drivers/gpu/drm/i915/display/intel_color.c      | 13 +++++++------
>>>  drivers/gpu/drm/i915/display/intel_color_regs.h |  6 +++---
>>>  2 files changed, 10 insertions(+), 9 deletions(-)
>>> 
>>> diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
>>> index a83f41ee6834..da56d24eb933 100644
>>> --- a/drivers/gpu/drm/i915/display/intel_color.c
>>> +++ b/drivers/gpu/drm/i915/display/intel_color.c
>>> @@ -1284,9 +1284,10 @@ static void i965_load_lut_10p6(struct intel_crtc *crtc,
>>>  				  i965_lut_10p6_udw(&lut[i]));
>>>  	}
>>>  
>>> -	intel_de_write_fw(dev_priv, PIPEGCMAX(pipe, 0), lut[i].red);
>>> -	intel_de_write_fw(dev_priv, PIPEGCMAX(pipe, 1), lut[i].green);
>>> -	intel_de_write_fw(dev_priv, PIPEGCMAX(pipe, 2), lut[i].blue);
>>> +	intel_de_write_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 0), lut[i].red);
>>> +	intel_de_write_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 1),
>>> +			  lut[i].green);
>>
>> nit: the newline breaks the pattern in a somewhat ugly way
>
> It's all cocci's doing... sometimes it's smart, sometimes less so.

Pushed to din, with this small wart fixed while applying.

>
>> Series is
>> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Thanks!
>
>
>>
>>> +	intel_de_write_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 2), lut[i].blue);
>>>  }
>>>  
>>>  static void i965_load_luts(const struct intel_crtc_state *crtc_state)
>>> @@ -3239,9 +3240,9 @@ static struct drm_property_blob *i965_read_lut_10p6(struct intel_crtc *crtc)
>>>  		i965_lut_10p6_pack(&lut[i], ldw, udw);
>>>  	}
>>>  
>>> -	lut[i].red = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(pipe, 0)));
>>> -	lut[i].green = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(pipe, 1)));
>>> -	lut[i].blue = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(pipe, 2)));
>>> +	lut[i].red = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 0)));
>>> +	lut[i].green = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 1)));
>>> +	lut[i].blue = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 2)));
>>>  
>>>  	return blob;
>>>  }
>>> diff --git a/drivers/gpu/drm/i915/display/intel_color_regs.h b/drivers/gpu/drm/i915/display/intel_color_regs.h
>>> index 61c18b4a7fa5..8eb643cfead7 100644
>>> --- a/drivers/gpu/drm/i915/display/intel_color_regs.h
>>> +++ b/drivers/gpu/drm/i915/display/intel_color_regs.h
>>> @@ -37,9 +37,9 @@
>>>  						  (i) * 4)
>>>  
>>>  /* i965/g4x/vlv/chv */
>>> -#define  _PIPEAGCMAX           0x70010
>>> -#define  _PIPEBGCMAX           0x71010
>>> -#define PIPEGCMAX(pipe, i)     _MMIO_PIPE2(dev_priv, pipe, _PIPEAGCMAX + (i) * 4) /* u1.16 */
>>> +#define  _PIPEAGCMAX			0x70010
>>> +#define  _PIPEBGCMAX			0x71010
>>> +#define PIPEGCMAX(dev_priv, pipe, i)	_MMIO_PIPE2(dev_priv, pipe, _PIPEAGCMAX + (i) * 4) /* u1.16 */
>>>  
>>>  /* ilk+ palette */
>>>  #define _LGC_PALETTE_A           0x4a000
>>> -- 
>>> 2.39.2
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
index a83f41ee6834..da56d24eb933 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -1284,9 +1284,10 @@  static void i965_load_lut_10p6(struct intel_crtc *crtc,
 				  i965_lut_10p6_udw(&lut[i]));
 	}
 
-	intel_de_write_fw(dev_priv, PIPEGCMAX(pipe, 0), lut[i].red);
-	intel_de_write_fw(dev_priv, PIPEGCMAX(pipe, 1), lut[i].green);
-	intel_de_write_fw(dev_priv, PIPEGCMAX(pipe, 2), lut[i].blue);
+	intel_de_write_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 0), lut[i].red);
+	intel_de_write_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 1),
+			  lut[i].green);
+	intel_de_write_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 2), lut[i].blue);
 }
 
 static void i965_load_luts(const struct intel_crtc_state *crtc_state)
@@ -3239,9 +3240,9 @@  static struct drm_property_blob *i965_read_lut_10p6(struct intel_crtc *crtc)
 		i965_lut_10p6_pack(&lut[i], ldw, udw);
 	}
 
-	lut[i].red = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(pipe, 0)));
-	lut[i].green = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(pipe, 1)));
-	lut[i].blue = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(pipe, 2)));
+	lut[i].red = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 0)));
+	lut[i].green = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 1)));
+	lut[i].blue = i965_lut_11p6_max_pack(intel_de_read_fw(dev_priv, PIPEGCMAX(dev_priv, pipe, 2)));
 
 	return blob;
 }
diff --git a/drivers/gpu/drm/i915/display/intel_color_regs.h b/drivers/gpu/drm/i915/display/intel_color_regs.h
index 61c18b4a7fa5..8eb643cfead7 100644
--- a/drivers/gpu/drm/i915/display/intel_color_regs.h
+++ b/drivers/gpu/drm/i915/display/intel_color_regs.h
@@ -37,9 +37,9 @@ 
 						  (i) * 4)
 
 /* i965/g4x/vlv/chv */
-#define  _PIPEAGCMAX           0x70010
-#define  _PIPEBGCMAX           0x71010
-#define PIPEGCMAX(pipe, i)     _MMIO_PIPE2(dev_priv, pipe, _PIPEAGCMAX + (i) * 4) /* u1.16 */
+#define  _PIPEAGCMAX			0x70010
+#define  _PIPEBGCMAX			0x71010
+#define PIPEGCMAX(dev_priv, pipe, i)	_MMIO_PIPE2(dev_priv, pipe, _PIPEAGCMAX + (i) * 4) /* u1.16 */
 
 /* ilk+ palette */
 #define _LGC_PALETTE_A           0x4a000