dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon/kms: fix cursor image off-by-one error
@ 2011-09-30  2:07 Nicholas Miell
  2011-09-30 13:53 ` Michel Dänzer
  0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Miell @ 2011-09-30  2:07 UTC (permalink / raw)
  To: dri-devel; +Cc: michel, Nicholas Miell

The mouse cursor hotspot calculation when the cursor is partially off the
top or left side of the screen was off by one.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41158

Signed-off-by: Nicholas Miell <nmiell@gmail.com>
---
 drivers/gpu/drm/radeon/radeon_cursor.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c
index 3189a7e..c495575 100644
--- a/drivers/gpu/drm/radeon/radeon_cursor.c
+++ b/drivers/gpu/drm/radeon/radeon_cursor.c
@@ -209,9 +209,9 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
 	int w = radeon_crtc->cursor_width;
 
 	if (x < 0)
-		xorigin = -x + 1;
+		xorigin = -x;
 	if (y < 0)
-		yorigin = -y + 1;
+		yorigin = -y;
 	if (xorigin >= CURSOR_WIDTH)
 		xorigin = CURSOR_WIDTH - 1;
 	if (yorigin >= CURSOR_HEIGHT)
-- 
1.7.6.2

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

* Re: [PATCH] drm/radeon/kms: fix cursor image off-by-one error
  2011-09-30  2:07 [PATCH] drm/radeon/kms: fix cursor image off-by-one error Nicholas Miell
@ 2011-09-30 13:53 ` Michel Dänzer
  0 siblings, 0 replies; 2+ messages in thread
From: Michel Dänzer @ 2011-09-30 13:53 UTC (permalink / raw)
  To: Nicholas Miell; +Cc: dri-devel

On Don, 2011-09-29 at 19:07 -0700, Nicholas Miell wrote: 
> The mouse cursor hotspot calculation when the cursor is partially off the
> top or left side of the screen was off by one.
> 
> Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41158
> 
> Signed-off-by: Nicholas Miell <nmiell@gmail.com>
> ---
>  drivers/gpu/drm/radeon/radeon_cursor.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c
> index 3189a7e..c495575 100644
> --- a/drivers/gpu/drm/radeon/radeon_cursor.c
> +++ b/drivers/gpu/drm/radeon/radeon_cursor.c
> @@ -209,9 +209,9 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
>  	int w = radeon_crtc->cursor_width;
>  
>  	if (x < 0)
> -		xorigin = -x + 1;
> +		xorigin = -x;
>  	if (y < 0)
> -		yorigin = -y + 1;
> +		yorigin = -y;
>  	if (xorigin >= CURSOR_WIDTH)
>  		xorigin = CURSOR_WIDTH - 1;
>  	if (yorigin >= CURSOR_HEIGHT)

While you're at it, might be worth combining with the lines below to
something like

	if (x < 0)
		xorigin = min(-x, CURSOR_WIDTH - 1);
        if (y < 0)
                yorigin = min(-y, CURSOR_HEIGHT - 1);

Either way though,

Reviewed-by: Michel Dänzer <michel@daenzer.net>
.

-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2011-09-30 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-30  2:07 [PATCH] drm/radeon/kms: fix cursor image off-by-one error Nicholas Miell
2011-09-30 13:53 ` Michel Dänzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox