Skip to content

Commit

Permalink
drm/radeon: Simplify cursor x/yorigin calculation.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michel Dänzer authored and Dave Airlie committed Oct 3, 2011
1 parent b356fe0 commit 7d30952
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/gpu/drm/radeon/radeon_cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,9 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
int w = radeon_crtc->cursor_width;

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

if (ASIC_IS_AVIVO(rdev)) {
int i = 0;
Expand Down

0 comments on commit 7d30952

Please sign in to comment.