diff mbox

[08/12] drm/i915: Allow calling intel_adjust_tile_offset() multiple times

Message ID 1462290001-9246-9-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä May 3, 2016, 3:39 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Minimize the resulting X coordinate after intel_adjust_tile_offset() is
done with it's offset adjustment. This allows calling
intel_adjust_tile_offset() multiple times in case we need to adjust
the offset several times.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Ville Syrjälä May 27, 2016, 8:23 a.m. UTC | #1
On Tue, May 03, 2016 at 06:39:57PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Minimize the resulting X coordinate after intel_adjust_tile_offset() is
> done with it's offset adjustment. This allows calling
> intel_adjust_tile_offset() multiple times in case we need to adjust
> the offset several times.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

I was hoping to push most of this, but this patch still needs to be
reviewed before I do that. I don't want to push without the SKL
X-tile hack (which needs this).

Sivakumar, are you still looking at this or should I turn elsewhere?

> ---
>  drivers/gpu/drm/i915/intel_display.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 438f3bd86e48..17f9f014e808 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2361,6 +2361,7 @@ static u32 intel_adjust_tile_offset(int *x, int *y,
>  				    u32 old_offset,
>  				    u32 new_offset)
>  {
> +	unsigned int pitch_pixels = pitch_tiles * tile_width;
>  	unsigned int tiles;
>  
>  	WARN_ON(old_offset & (tile_size - 1));
> @@ -2372,6 +2373,10 @@ static u32 intel_adjust_tile_offset(int *x, int *y,
>  	*y += tiles / pitch_tiles * tile_height;
>  	*x += tiles % pitch_tiles * tile_width;
>  
> +	/* minimize x in case it got needlessly big */
> +	*y += *x / pitch_pixels * tile_height;
> +	*x %= pitch_pixels;
> +
>  	return new_offset;
>  }
>  
> -- 
> 2.7.4
Sivakumar Thulasimani May 30, 2016, 10:14 a.m. UTC | #2
On 5/27/2016 1:53 PM, Ville Syrjälä wrote:
> On Tue, May 03, 2016 at 06:39:57PM +0300, ville.syrjala@linux.intel.com wrote:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> Minimize the resulting X coordinate after intel_adjust_tile_offset() is
>> done with it's offset adjustment. This allows calling
>> intel_adjust_tile_offset() multiple times in case we need to adjust
>> the offset several times.
>>
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> I was hoping to push most of this, but this patch still needs to be
> reviewed before I do that. I don't want to push without the SKL
> X-tile hack (which needs this).
>
> Sivakumar, are you still looking at this or should I turn elsewhere?
sorry for the delay in reply, can you check if someone else can review 
this patch alone ?

regards,
Sivakumar
>
>> ---
>>   drivers/gpu/drm/i915/intel_display.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index 438f3bd86e48..17f9f014e808 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -2361,6 +2361,7 @@ static u32 intel_adjust_tile_offset(int *x, int *y,
>>   				    u32 old_offset,
>>   				    u32 new_offset)
>>   {
>> +	unsigned int pitch_pixels = pitch_tiles * tile_width;
>>   	unsigned int tiles;
>>   
>>   	WARN_ON(old_offset & (tile_size - 1));
>> @@ -2372,6 +2373,10 @@ static u32 intel_adjust_tile_offset(int *x, int *y,
>>   	*y += tiles / pitch_tiles * tile_height;
>>   	*x += tiles % pitch_tiles * tile_width;
>>   
>> +	/* minimize x in case it got needlessly big */
>> +	*y += *x / pitch_pixels * tile_height;
>> +	*x %= pitch_pixels;
>> +
>>   	return new_offset;
>>   }
>>   
>> -- 
>> 2.7.4
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 438f3bd86e48..17f9f014e808 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2361,6 +2361,7 @@  static u32 intel_adjust_tile_offset(int *x, int *y,
 				    u32 old_offset,
 				    u32 new_offset)
 {
+	unsigned int pitch_pixels = pitch_tiles * tile_width;
 	unsigned int tiles;
 
 	WARN_ON(old_offset & (tile_size - 1));
@@ -2372,6 +2373,10 @@  static u32 intel_adjust_tile_offset(int *x, int *y,
 	*y += tiles / pitch_tiles * tile_height;
 	*x += tiles % pitch_tiles * tile_width;
 
+	/* minimize x in case it got needlessly big */
+	*y += *x / pitch_pixels * tile_height;
+	*x %= pitch_pixels;
+
 	return new_offset;
 }