aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-06-19 21:48:52 -0400
committerDave Airlie <airlied@redhat.com>2013-06-27 19:13:39 -0400
commit4c813d4d759c0e6b83bfd73795e9526493556dc2 (patch)
tree5cab2327d0db876f86fc72cb4acac23d58107cba /include
parentc19b3e238d7573cbe0bb60f4578b7d1de4a13746 (diff)
drm: add hotspot support for cursors.
So it looks like for virtual hw cursors on QXL we need to inform the "hw" device what the cursor hotspot parameters are. This makes sense if you think the host has to draw the cursor and interpret clicks from it. However the current modesetting interface doesn't support passing the hotspot information from userspace. This implements a new cursor ioctl, that takes the hotspot info as well, userspace can try calling the new interface and if it gets -ENOSYS it means its on an older kernel and can just fallback. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/drm/drm_crtc.h5
-rw-r--r--include/uapi/drm/drm.h1
-rw-r--r--include/uapi/drm/drm_mode.h13
3 files changed, 19 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 0fd007af8de9..663c3ab47752 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -339,6 +339,9 @@ struct drm_crtc_funcs {
339 /* cursor controls */ 339 /* cursor controls */
340 int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv, 340 int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv,
341 uint32_t handle, uint32_t width, uint32_t height); 341 uint32_t handle, uint32_t width, uint32_t height);
342 int (*cursor_set2)(struct drm_crtc *crtc, struct drm_file *file_priv,
343 uint32_t handle, uint32_t width, uint32_t height,
344 int32_t hot_x, int32_t hot_y);
342 int (*cursor_move)(struct drm_crtc *crtc, int x, int y); 345 int (*cursor_move)(struct drm_crtc *crtc, int x, int y);
343 346
344 /* Set gamma on the CRTC */ 347 /* Set gamma on the CRTC */
@@ -1018,6 +1021,8 @@ extern int drm_mode_setplane(struct drm_device *dev,
1018 void *data, struct drm_file *file_priv); 1021 void *data, struct drm_file *file_priv);
1019extern int drm_mode_cursor_ioctl(struct drm_device *dev, 1022extern int drm_mode_cursor_ioctl(struct drm_device *dev,
1020 void *data, struct drm_file *file_priv); 1023 void *data, struct drm_file *file_priv);
1024extern int drm_mode_cursor2_ioctl(struct drm_device *dev,
1025 void *data, struct drm_file *file_priv);
1021extern int drm_mode_addfb(struct drm_device *dev, 1026extern int drm_mode_addfb(struct drm_device *dev,
1022 void *data, struct drm_file *file_priv); 1027 void *data, struct drm_file *file_priv);
1023extern int drm_mode_addfb2(struct drm_device *dev, 1028extern int drm_mode_addfb2(struct drm_device *dev,
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 5a57be68bab7..238a166b9fe6 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -732,6 +732,7 @@ struct drm_prime_handle {
732#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) 732#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
733#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) 733#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties)
734#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) 734#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property)
735#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2)
735 736
736/** 737/**
737 * Device specific ioctls should only be in their respective headers 738 * Device specific ioctls should only be in their respective headers
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 090e5331ab7e..53db7cea373b 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -388,6 +388,19 @@ struct drm_mode_cursor {
388 __u32 handle; 388 __u32 handle;
389}; 389};
390 390
391struct drm_mode_cursor2 {
392 __u32 flags;
393 __u32 crtc_id;
394 __s32 x;
395 __s32 y;
396 __u32 width;
397 __u32 height;
398 /* driver specific handle */
399 __u32 handle;
400 __s32 hot_x;
401 __s32 hot_y;
402};
403
391struct drm_mode_crtc_lut { 404struct drm_mode_crtc_lut {
392 __u32 crtc_id; 405 __u32 crtc_id;
393 __u32 gamma_size; 406 __u32 gamma_size;