Skip to content

Commit

Permalink
drm/radeon: fix order of doing things in radeon_crtc_cursor_set
Browse files Browse the repository at this point in the history
 if object pin or object lookup in radeon_cursor_set fail, the function
 could leave inconsistent mouse width and hight values in radeon_crtc
 fixed by moving cursor width and height assignments after all
 checks have passed

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Ilija Hadzic authored and Dave Airlie committed May 8, 2011
1 parent 2bbd449 commit 45e5f6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/radeon/radeon_cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ int radeon_crtc_cursor_set(struct drm_crtc *crtc,
return -EINVAL;
}

radeon_crtc->cursor_width = width;
radeon_crtc->cursor_height = height;

obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
if (!obj) {
DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, radeon_crtc->crtc_id);
Expand All @@ -180,6 +177,9 @@ int radeon_crtc_cursor_set(struct drm_crtc *crtc,
if (ret)
goto fail;

radeon_crtc->cursor_width = width;
radeon_crtc->cursor_height = height;

radeon_lock_cursor(crtc, true);
/* XXX only 27 bit offset for legacy cursor */
radeon_set_cursor(crtc, obj, gpu_addr);
Expand Down

0 comments on commit 45e5f6a

Please sign in to comment.