30 #define CURSOR_WIDTH 64
31 #define CURSOR_HEIGHT 64
33 static void radeon_lock_cursor(
struct drm_crtc *
crtc,
bool lock)
90 static void radeon_show_cursor(
struct drm_crtc *crtc)
105 switch (radeon_crtc->
crtc_id) {
122 static void radeon_set_cursor(
struct drm_crtc *crtc,
struct drm_gem_object *obj,
132 gpu_addr & 0xffffffff);
141 gpu_addr & 0xffffffff);
150 struct drm_file *file_priv,
157 struct drm_gem_object *obj;
164 radeon_hide_cursor(crtc);
170 DRM_ERROR(
"bad cursor width or height %d x %d\n", width, height);
176 DRM_ERROR(
"Cannot find cursor object %x for crtc %d\n", handle, radeon_crtc->
crtc_id);
188 radeon_bo_unreserve(robj);
195 radeon_lock_cursor(crtc,
true);
196 radeon_set_cursor(crtc, obj, gpu_addr);
197 radeon_show_cursor(crtc);
198 radeon_lock_cursor(crtc,
false);
206 radeon_bo_unreserve(robj);
208 drm_gem_object_unreference_unlocked(radeon_crtc->
cursor_bo);
214 drm_gem_object_unreference_unlocked(obj);
224 int xorigin = 0, yorigin = 0;
232 DRM_DEBUG(
"x %d y %d c->x %d c->y %d\n", x, y, crtc->
x, crtc->
y);
255 int cursor_end, frame_end;
257 cursor_end = x - xorigin +
w;
258 frame_end = crtc->
x + crtc->
mode.crtc_hdisplay;
259 if (cursor_end >= frame_end) {
260 w = w - (cursor_end - frame_end);
261 if (!(frame_end & 0x7f))
264 if (!(cursor_end & 0x7f))
269 cursor_end = x - xorigin +
w;
270 if (!(cursor_end & 0x7f)) {
278 radeon_lock_cursor(crtc,
true);
305 radeon_lock_cursor(crtc,
false);