aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie2014-11-14 23:56:35 -0600
committersrinivas pulukuru2015-01-30 16:04:01 -0600
commitccb75122cdbfd120a715aad1d94275118a0c1ea2 (patch)
treeb348ca63abe9b2bb5ccb7ce1a26eabfdcfa785ec
parent5f74733530adf53accb97485b054f0b76995cbcd (diff)
downloadlibdrm-ccb75122cdbfd120a715aad1d94275118a0c1ea2.tar.gz
libdrm-ccb75122cdbfd120a715aad1d94275118a0c1ea2.tar.xz
libdrm-ccb75122cdbfd120a715aad1d94275118a0c1ea2.zip
drm: add hotspot cursor interface support.
Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: srinivas pulukuru <srinivas.pulukuru@ti.com>
-rw-r--r--include/drm/drm.h1
-rw-r--r--include/drm/drm_mode.h13
-rw-r--r--xf86drmMode.c15
-rw-r--r--xf86drmMode.h1
4 files changed, 30 insertions, 0 deletions
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 3e5b9424..2630e668 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -734,6 +734,7 @@ struct drm_prime_handle {
734#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) 734#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
735#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) 735#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties)
736#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) 736#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property)
737#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2)
737 738
738/** 739/**
739 * Device specific ioctls should only be in their respective headers 740 * Device specific ioctls should only be in their respective headers
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
index 62ba997f..d41d76bc 100644
--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -390,6 +390,19 @@ struct drm_mode_cursor {
390 __u32 handle; 390 __u32 handle;
391}; 391};
392 392
393struct drm_mode_cursor2 {
394 __u32 flags;
395 __u32 crtc_id;
396 __s32 x;
397 __s32 y;
398 __u32 width;
399 __u32 height;
400 /* driver specific handle */
401 __u32 handle;
402 __s32 hot_x;
403 __s32 hot_y;
404};
405
393struct drm_mode_crtc_lut { 406struct drm_mode_crtc_lut {
394 __u32 crtc_id; 407 __u32 crtc_id;
395 __u32 gamma_size; 408 __u32 gamma_size;
diff --git a/xf86drmMode.c b/xf86drmMode.c
index f603ceb2..6b60c35e 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -400,6 +400,21 @@ int drmModeSetCursor(int fd, uint32_t crtcId, uint32_t bo_handle, uint32_t width
400 return DRM_IOCTL(fd, DRM_IOCTL_MODE_CURSOR, &arg); 400 return DRM_IOCTL(fd, DRM_IOCTL_MODE_CURSOR, &arg);
401} 401}
402 402
403int drmModeSetCursor2(int fd, uint32_t crtcId, uint32_t bo_handle, uint32_t width, uint32_t height, int32_t hot_x, int32_t hot_y)
404{
405 struct drm_mode_cursor2 arg;
406
407 arg.flags = DRM_MODE_CURSOR_BO;
408 arg.crtc_id = crtcId;
409 arg.width = width;
410 arg.height = height;
411 arg.handle = bo_handle;
412 arg.hot_x = hot_x;
413 arg.hot_y = hot_y;
414
415 return DRM_IOCTL(fd, DRM_IOCTL_MODE_CURSOR2, &arg);
416}
417
403int drmModeMoveCursor(int fd, uint32_t crtcId, int x, int y) 418int drmModeMoveCursor(int fd, uint32_t crtcId, int x, int y)
404{ 419{
405 struct drm_mode_cursor arg; 420 struct drm_mode_cursor arg;
diff --git a/xf86drmMode.h b/xf86drmMode.h
index 8e400340..f8a817cd 100644
--- a/xf86drmMode.h
+++ b/xf86drmMode.h
@@ -378,6 +378,7 @@ int drmModeSetCrtc(int fd, uint32_t crtcId, uint32_t bufferId,
378 */ 378 */
379int drmModeSetCursor(int fd, uint32_t crtcId, uint32_t bo_handle, uint32_t width, uint32_t height); 379int drmModeSetCursor(int fd, uint32_t crtcId, uint32_t bo_handle, uint32_t width, uint32_t height);
380 380
381int drmModeSetCursor2(int fd, uint32_t crtcId, uint32_t bo_handle, uint32_t width, uint32_t height, int32_t hot_x, int32_t hot_y);
381/** 382/**
382 * Move the cursor on crtc 383 * Move the cursor on crtc
383 */ 384 */