All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Correcting proper src & dst height - width comparision for 90/270 rotation.
@ 2015-11-18 11:49 Nabendu Maiti
  2015-11-18 12:14 ` Ville Syrjälä
  0 siblings, 1 reply; 4+ messages in thread
From: Nabendu Maiti @ 2015-11-18 11:49 UTC (permalink / raw)
  To: intel-gfx

On 90/270 rotation case source width and height was not compared
properly with destination height and width check plane.Which added
erroneous check while doing scaling or normal 90/270 rotation.

Signed-off-by: Nabendu Maiti <nabendu.bikash.maiti@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 688d484..cd5bb28 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13723,6 +13723,9 @@ intel_check_primary_plane(struct drm_plane *plane,
 	int min_scale = DRM_PLANE_HELPER_NO_SCALING;
 	int max_scale = DRM_PLANE_HELPER_NO_SCALING;
 	bool can_position = false;
+	struct drm_rect *src = &state->src;
+	struct drm_rect *dest = &state->dst;
+	int ret = -1;
 
 	/* use scaler when colorkey is not required */
 	if (INTEL_INFO(plane->dev)->gen >= 9 &&
@@ -13732,11 +13735,26 @@ intel_check_primary_plane(struct drm_plane *plane,
 		can_position = true;
 	}
 
-	return drm_plane_helper_check_update(plane, crtc, fb, &state->src,
-					     &state->dst, &state->clip,
+	/*
+	 * FIXME the following code does a bunch of fuzzy adjustments to the
+	 * coordinates and sizes for rotations. We probably need some way to
+	 * decide whether more strict checking should be done instead.
+	 */
+	if (fb)
+		drm_rect_rotate(src, fb->width << 16, fb->height << 16,
+				state->base.rotation);
+
+	ret = drm_plane_helper_check_update(plane, crtc, fb, src,
+					     dest, &state->clip,
 					     min_scale, max_scale,
 					     can_position, true,
 					     &state->visible);
+
+	/* Restore the originl unrotated co-ordinates */
+	if (fb)
+		drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16,
+				    state->base.rotation);
+	return ret;
 }
 
 static void
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Correcting proper src & dst height - width comparision for 90/270 rotation.
  2015-11-18 11:49 [PATCH] drm/i915: Correcting proper src & dst height - width comparision for 90/270 rotation Nabendu Maiti
@ 2015-11-18 12:14 ` Ville Syrjälä
  2015-11-26 18:40   ` Nabendu Maiti
  0 siblings, 1 reply; 4+ messages in thread
From: Ville Syrjälä @ 2015-11-18 12:14 UTC (permalink / raw)
  To: Nabendu Maiti; +Cc: intel-gfx

On Wed, Nov 18, 2015 at 05:19:26PM +0530, Nabendu Maiti wrote:
> On 90/270 rotation case source width and height was not compared
> properly with destination height and width check plane.Which added
> erroneous check while doing scaling or normal 90/270 rotation.
> 
> Signed-off-by: Nabendu Maiti <nabendu.bikash.maiti@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 22 ++++++++++++++++++++--
>  1 file changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 688d484..cd5bb28 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13723,6 +13723,9 @@ intel_check_primary_plane(struct drm_plane *plane,
>  	int min_scale = DRM_PLANE_HELPER_NO_SCALING;
>  	int max_scale = DRM_PLANE_HELPER_NO_SCALING;
>  	bool can_position = false;
> +	struct drm_rect *src = &state->src;
> +	struct drm_rect *dest = &state->dst;
> +	int ret = -1;
>  
>  	/* use scaler when colorkey is not required */
>  	if (INTEL_INFO(plane->dev)->gen >= 9 &&
> @@ -13732,11 +13735,26 @@ intel_check_primary_plane(struct drm_plane *plane,
>  		can_position = true;
>  	}
>  
> -	return drm_plane_helper_check_update(plane, crtc, fb, &state->src,
> -					     &state->dst, &state->clip,
> +	/*
> +	 * FIXME the following code does a bunch of fuzzy adjustments to the
> +	 * coordinates and sizes for rotations. We probably need some way to
> +	 * decide whether more strict checking should be done instead.
> +	 */
> +	if (fb)
> +		drm_rect_rotate(src, fb->width << 16, fb->height << 16,
> +				state->base.rotation);
> +
> +	ret = drm_plane_helper_check_update(plane, crtc, fb, src,
> +					     dest, &state->clip,
>  					     min_scale, max_scale,
>  					     can_position, true,
>  					     &state->visible);
> +
> +	/* Restore the originl unrotated co-ordinates */
> +	if (fb)
> +		drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16,
> +				    state->base.rotation);


We should put the rotation handling into helper. And someone should
really just move all the good code from intel_sprite into the helper
instead of having two totally different ways of doing things.

> +	return ret;
>  }
>  
>  static void
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Correcting proper src & dst height - width comparision for 90/270 rotation.
  2015-11-18 12:14 ` Ville Syrjälä
@ 2015-11-26 18:40   ` Nabendu Maiti
  2015-12-07 18:23     ` Nabendu Maiti
  0 siblings, 1 reply; 4+ messages in thread
From: Nabendu Maiti @ 2015-11-26 18:40 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx



On 11/18/2015 05:44 PM, Ville Syrjälä wrote:
> On Wed, Nov 18, 2015 at 05:19:26PM +0530, Nabendu Maiti wrote:
>> On 90/270 rotation case source width and height was not compared
>> properly with destination height and width check plane.Which added
>> erroneous check while doing scaling or normal 90/270 rotation.
>>
>> Signed-off-by: Nabendu Maiti <nabendu.bikash.maiti@intel.com>
>> ---
>>   drivers/gpu/drm/i915/intel_display.c | 22 ++++++++++++++++++++--
>>   1 file changed, 20 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index 688d484..cd5bb28 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -13723,6 +13723,9 @@ intel_check_primary_plane(struct drm_plane *plane,
>>   	int min_scale = DRM_PLANE_HELPER_NO_SCALING;
>>   	int max_scale = DRM_PLANE_HELPER_NO_SCALING;
>>   	bool can_position = false;
>> +	struct drm_rect *src = &state->src;
>> +	struct drm_rect *dest = &state->dst;
>> +	int ret = -1;
>>   
>>   	/* use scaler when colorkey is not required */
>>   	if (INTEL_INFO(plane->dev)->gen >= 9 &&
>> @@ -13732,11 +13735,26 @@ intel_check_primary_plane(struct drm_plane *plane,
>>   		can_position = true;
>>   	}
>>   
>> -	return drm_plane_helper_check_update(plane, crtc, fb, &state->src,
>> -					     &state->dst, &state->clip,
>> +	/*
>> +	 * FIXME the following code does a bunch of fuzzy adjustments to the
>> +	 * coordinates and sizes for rotations. We probably need some way to
>> +	 * decide whether more strict checking should be done instead.
>> +	 */
>> +	if (fb)
>> +		drm_rect_rotate(src, fb->width << 16, fb->height << 16,
>> +				state->base.rotation);
>> +
>> +	ret = drm_plane_helper_check_update(plane, crtc, fb, src,
>> +					     dest, &state->clip,
>>   					     min_scale, max_scale,
>>   					     can_position, true,
>>   					     &state->visible);
>> +
>> +	/* Restore the originl unrotated co-ordinates */
>> +	if (fb)
>> +		drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16,
>> +				    state->base.rotation);
>
> We should put the rotation handling into helper. And someone should
> really just move all the good code from intel_sprite into the helper
> instead of having two totally different ways of doing things.
Yes right.I learned that there is an effort going on unification of 
primary and sprite plane. To put this in helper function is a bigger 
modifications .
In the meantime in android we need this fix. So if you suggest I will 
hold the patch until the unification completes anf float it once again 
if required.
>
>> +	return ret;
>>   }
>>   
>>   static void
>> -- 
>> 1.9.1
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Correcting proper src & dst height - width comparision for 90/270 rotation.
  2015-11-26 18:40   ` Nabendu Maiti
@ 2015-12-07 18:23     ` Nabendu Maiti
  0 siblings, 0 replies; 4+ messages in thread
From: Nabendu Maiti @ 2015-12-07 18:23 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx



On 11/27/2015 12:10 AM, Nabendu Maiti wrote:
>
>
> On 11/18/2015 05:44 PM, Ville Syrjälä wrote:
>> On Wed, Nov 18, 2015 at 05:19:26PM +0530, Nabendu Maiti wrote:
>>> On 90/270 rotation case source width and height was not compared
>>> properly with destination height and width check plane.Which added
>>> erroneous check while doing scaling or normal 90/270 rotation.
>>>
>>> Signed-off-by: Nabendu Maiti <nabendu.bikash.maiti@intel.com>
>>> ---
>>>   drivers/gpu/drm/i915/intel_display.c | 22 ++++++++++++++++++++--
>>>   1 file changed, 20 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/intel_display.c 
>>> b/drivers/gpu/drm/i915/intel_display.c
>>> index 688d484..cd5bb28 100644
>>> --- a/drivers/gpu/drm/i915/intel_display.c
>>> +++ b/drivers/gpu/drm/i915/intel_display.c
>>> @@ -13723,6 +13723,9 @@ intel_check_primary_plane(struct drm_plane 
>>> *plane,
>>>       int min_scale = DRM_PLANE_HELPER_NO_SCALING;
>>>       int max_scale = DRM_PLANE_HELPER_NO_SCALING;
>>>       bool can_position = false;
>>> +    struct drm_rect *src = &state->src;
>>> +    struct drm_rect *dest = &state->dst;
>>> +    int ret = -1;
>>>         /* use scaler when colorkey is not required */
>>>       if (INTEL_INFO(plane->dev)->gen >= 9 &&
>>> @@ -13732,11 +13735,26 @@ intel_check_primary_plane(struct drm_plane 
>>> *plane,
>>>           can_position = true;
>>>       }
>>>   -    return drm_plane_helper_check_update(plane, crtc, fb, 
>>> &state->src,
>>> -                         &state->dst, &state->clip,
>>> +    /*
>>> +     * FIXME the following code does a bunch of fuzzy adjustments 
>>> to the
>>> +     * coordinates and sizes for rotations. We probably need some 
>>> way to
>>> +     * decide whether more strict checking should be done instead.
>>> +     */
>>> +    if (fb)
>>> +        drm_rect_rotate(src, fb->width << 16, fb->height << 16,
>>> +                state->base.rotation);
>>> +
>>> +    ret = drm_plane_helper_check_update(plane, crtc, fb, src,
>>> +                         dest, &state->clip,
>>>                            min_scale, max_scale,
>>>                            can_position, true,
>>>                            &state->visible);
>>> +
>>> +    /* Restore the originl unrotated co-ordinates */
>>> +    if (fb)
>>> +        drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16,
>>> +                    state->base.rotation);
>>
>> We should put the rotation handling into helper. And someone should
>> really just move all the good code from intel_sprite into the helper
>> instead of having two totally different ways of doing things.
> Yes right.I learned that there is an effort going on unification of 
> primary and sprite plane. To put this in helper function is a bigger 
> modifications .
> In the meantime in android we need this fix. So if you suggest I will 
> hold the patch until the unification completes anf float it once again 
> if required.
Any update on this patch or unification patch?

>>
>>> +    return ret;
>>>   }
>>>     static void
>>> -- 
>>> 1.9.1
>>>
>>> _______________________________________________
>>> Intel-gfx mailing list
>>> Intel-gfx@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-07 18:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18 11:49 [PATCH] drm/i915: Correcting proper src & dst height - width comparision for 90/270 rotation Nabendu Maiti
2015-11-18 12:14 ` Ville Syrjälä
2015-11-26 18:40   ` Nabendu Maiti
2015-12-07 18:23     ` Nabendu Maiti

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.