diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2011-09-30 11:16:51 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-10-03 13:37:35 -0400 |
commit | 7d309529b4c1a6281549bf86681cdfb4fbed49ed (patch) | |
tree | 7369f2788f0cd48e68c7c3566198d9e4c0abef41 /drivers | |
parent | b356fe0afe9aa2cfdc7be0bae22ea1c93afc2451 (diff) |
drm/radeon: Simplify cursor x/yorigin calculation.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_cursor.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c index c495575b2e1c..bac8ee7990a7 100644 --- a/drivers/gpu/drm/radeon/radeon_cursor.c +++ b/drivers/gpu/drm/radeon/radeon_cursor.c | |||
@@ -209,13 +209,9 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc, | |||
209 | int w = radeon_crtc->cursor_width; | 209 | int w = radeon_crtc->cursor_width; |
210 | 210 | ||
211 | if (x < 0) | 211 | if (x < 0) |
212 | xorigin = -x; | 212 | xorigin = min(-x, CURSOR_WIDTH - 1); |
213 | if (y < 0) | 213 | if (y < 0) |
214 | yorigin = -y; | 214 | yorigin = min(-y, CURSOR_HEIGHT - 1); |
215 | if (xorigin >= CURSOR_WIDTH) | ||
216 | xorigin = CURSOR_WIDTH - 1; | ||
217 | if (yorigin >= CURSOR_HEIGHT) | ||
218 | yorigin = CURSOR_HEIGHT - 1; | ||
219 | 215 | ||
220 | if (ASIC_IS_AVIVO(rdev)) { | 216 | if (ASIC_IS_AVIVO(rdev)) { |
221 | int i = 0; | 217 | int i = 0; |