[1/6] drm/i915: Fix i845/i865 cursor width
diff mbox series

Message ID 20191028113036.27553-1-ville.syrjala@linux.intel.com
State New
Headers show
Series
  • [1/6] drm/i915: Fix i845/i865 cursor width
Related show

Commit Message

Ville Syrjälä Oct. 28, 2019, 11:30 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The change from the uapi coordinates to the internal coordinates
broke the cursor on i845/i865 due to src and dst getting swapped.
Fix it.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fixes: 3a612765f423 ("drm/i915: Remove cursor use of properties for coordinates")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maarten Lankhorst Oct. 28, 2019, 2:20 p.m. UTC | #1
Op 28-10-2019 om 12:30 schreef Ville Syrjala:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The change from the uapi coordinates to the internal coordinates
> broke the cursor on i845/i865 due to src and dst getting swapped.
> Fix it.
>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Fixes: 3a612765f423 ("drm/i915: Remove cursor use of properties for coordinates")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 0f0c582a56d5..47a3aef0fb61 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -10947,7 +10947,7 @@ static void i845_update_cursor(struct intel_plane *plane,
>  	unsigned long irqflags;
>  
>  	if (plane_state && plane_state->base.visible) {
> -		unsigned int width = drm_rect_width(&plane_state->base.src);
> +		unsigned int width = drm_rect_width(&plane_state->base.dst);
>  		unsigned int height = drm_rect_height(&plane_state->base.dst);
>  
>  		cntl = plane_state->ctl |

Yeah, I guess theoretically fixes, should be ok regardless because no scaling is supported on the cursor so rectangles are identical. :)

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Ville Syrjälä Oct. 28, 2019, 3:05 p.m. UTC | #2
On Mon, Oct 28, 2019 at 03:20:34PM +0100, Maarten Lankhorst wrote:
> Op 28-10-2019 om 12:30 schreef Ville Syrjala:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > The change from the uapi coordinates to the internal coordinates
> > broke the cursor on i845/i865 due to src and dst getting swapped.
> > Fix it.
> >
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Fixes: 3a612765f423 ("drm/i915: Remove cursor use of properties for coordinates")
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_display.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 0f0c582a56d5..47a3aef0fb61 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -10947,7 +10947,7 @@ static void i845_update_cursor(struct intel_plane *plane,
> >  	unsigned long irqflags;
> >  
> >  	if (plane_state && plane_state->base.visible) {
> > -		unsigned int width = drm_rect_width(&plane_state->base.src);
> > +		unsigned int width = drm_rect_width(&plane_state->base.dst);
> >  		unsigned int height = drm_rect_height(&plane_state->base.dst);
> >  
> >  		cntl = plane_state->ctl |
> 
> Yeah, I guess theoretically fixes, should be ok regardless because no scaling is supported on the cursor so rectangles are identical. :)

No. One is .16 fixed point other is integer. Ie. totally broken atm,
as proven by the cursor being smeared over the whole screen on my i865.

> 
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Maarten Lankhorst Oct. 28, 2019, 3:57 p.m. UTC | #3
Op 28-10-2019 om 16:05 schreef Ville Syrjälä:
> On Mon, Oct 28, 2019 at 03:20:34PM +0100, Maarten Lankhorst wrote:
>> Op 28-10-2019 om 12:30 schreef Ville Syrjala:
>>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>
>>> The change from the uapi coordinates to the internal coordinates
>>> broke the cursor on i845/i865 due to src and dst getting swapped.
>>> Fix it.
>>>
>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>> Fixes: 3a612765f423 ("drm/i915: Remove cursor use of properties for coordinates")
>>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>> ---
>>>  drivers/gpu/drm/i915/display/intel_display.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
>>> index 0f0c582a56d5..47a3aef0fb61 100644
>>> --- a/drivers/gpu/drm/i915/display/intel_display.c
>>> +++ b/drivers/gpu/drm/i915/display/intel_display.c
>>> @@ -10947,7 +10947,7 @@ static void i845_update_cursor(struct intel_plane *plane,
>>>  	unsigned long irqflags;
>>>  
>>>  	if (plane_state && plane_state->base.visible) {
>>> -		unsigned int width = drm_rect_width(&plane_state->base.src);
>>> +		unsigned int width = drm_rect_width(&plane_state->base.dst);
>>>  		unsigned int height = drm_rect_height(&plane_state->base.dst);
>>>  
>>>  		cntl = plane_state->ctl |
>> Yeah, I guess theoretically fixes, should be ok regardless because no scaling is supported on the cursor so rectangles are identical. :)
> No. One is .16 fixed point other is integer. Ie. totally broken atm,
> as proven by the cursor being smeared over the whole screen on my i865.
>
Ah right, missed that. :)

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 0f0c582a56d5..47a3aef0fb61 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -10947,7 +10947,7 @@  static void i845_update_cursor(struct intel_plane *plane,
 	unsigned long irqflags;
 
 	if (plane_state && plane_state->base.visible) {
-		unsigned int width = drm_rect_width(&plane_state->base.src);
+		unsigned int width = drm_rect_width(&plane_state->base.dst);
 		unsigned int height = drm_rect_height(&plane_state->base.dst);
 
 		cntl = plane_state->ctl |