mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 15:18:15 +00:00
drm/radeon: Move hotspot handling out of radeon_set_cursor
It's only needed in radeon_crtc_cursor_set2. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
6d3759fac6
commit
2e007e611b
1 changed files with 17 additions and 19 deletions
|
@ -227,8 +227,7 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int radeon_set_cursor(struct drm_crtc *crtc, struct drm_gem_object *obj,
|
static int radeon_set_cursor(struct drm_crtc *crtc, struct drm_gem_object *obj)
|
||||||
int hot_x, int hot_y)
|
|
||||||
{
|
{
|
||||||
struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
|
struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
|
||||||
struct radeon_device *rdev = crtc->dev->dev_private;
|
struct radeon_device *rdev = crtc->dev->dev_private;
|
||||||
|
@ -267,19 +266,6 @@ static int radeon_set_cursor(struct drm_crtc *crtc, struct drm_gem_object *obj,
|
||||||
WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, radeon_crtc->legacy_cursor_offset);
|
WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, radeon_crtc->legacy_cursor_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hot_x != radeon_crtc->cursor_hot_x ||
|
|
||||||
hot_y != radeon_crtc->cursor_hot_y) {
|
|
||||||
int x, y;
|
|
||||||
|
|
||||||
x = radeon_crtc->cursor_x + radeon_crtc->cursor_hot_x - hot_x;
|
|
||||||
y = radeon_crtc->cursor_y + radeon_crtc->cursor_hot_y - hot_y;
|
|
||||||
|
|
||||||
radeon_cursor_move_locked(crtc, x, y);
|
|
||||||
|
|
||||||
radeon_crtc->cursor_hot_x = hot_x;
|
|
||||||
radeon_crtc->cursor_hot_y = hot_y;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
@ -323,7 +309,21 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc,
|
||||||
radeon_crtc->cursor_height = height;
|
radeon_crtc->cursor_height = height;
|
||||||
|
|
||||||
radeon_lock_cursor(crtc, true);
|
radeon_lock_cursor(crtc, true);
|
||||||
ret = radeon_set_cursor(crtc, obj, hot_x, hot_y);
|
|
||||||
|
if (hot_x != radeon_crtc->cursor_hot_x ||
|
||||||
|
hot_y != radeon_crtc->cursor_hot_y) {
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
x = radeon_crtc->cursor_x + radeon_crtc->cursor_hot_x - hot_x;
|
||||||
|
y = radeon_crtc->cursor_y + radeon_crtc->cursor_hot_y - hot_y;
|
||||||
|
|
||||||
|
radeon_cursor_move_locked(crtc, x, y);
|
||||||
|
|
||||||
|
radeon_crtc->cursor_hot_x = hot_x;
|
||||||
|
radeon_crtc->cursor_hot_y = hot_y;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = radeon_set_cursor(crtc, obj);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
DRM_ERROR("radeon_set_cursor returned %d, not changing cursor\n",
|
DRM_ERROR("radeon_set_cursor returned %d, not changing cursor\n",
|
||||||
|
@ -368,9 +368,7 @@ void radeon_cursor_reset(struct drm_crtc *crtc)
|
||||||
radeon_cursor_move_locked(crtc, radeon_crtc->cursor_x,
|
radeon_cursor_move_locked(crtc, radeon_crtc->cursor_x,
|
||||||
radeon_crtc->cursor_y);
|
radeon_crtc->cursor_y);
|
||||||
|
|
||||||
ret = radeon_set_cursor(crtc, radeon_crtc->cursor_bo,
|
ret = radeon_set_cursor(crtc, radeon_crtc->cursor_bo);
|
||||||
radeon_crtc->cursor_hot_x,
|
|
||||||
radeon_crtc->cursor_hot_y);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
DRM_ERROR("radeon_set_cursor returned %d, not showing "
|
DRM_ERROR("radeon_set_cursor returned %d, not showing "
|
||||||
"cursor\n", ret);
|
"cursor\n", ret);
|
||||||
|
|
Loading…
Add table
Reference in a new issue