gitignore: Ignore various generated files
[platform/upstream/libdrm.git] / xf86drmMode.c
index 04fdf1f..6b60c35 100644 (file)
@@ -351,8 +351,11 @@ drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId)
        r->x               = crtc.x;
        r->y               = crtc.y;
        r->mode_valid      = crtc.mode_valid;
-       if (r->mode_valid)
+       if (r->mode_valid) {
                memcpy(&r->mode, &crtc.mode, sizeof(struct drm_mode_modeinfo));
+               r->width = crtc.mode.hdisplay;
+               r->height = crtc.mode.vdisplay;
+       }
        r->buffer_id       = crtc.fb_id;
        r->gamma_size      = crtc.gamma_size;
        return r;
@@ -397,6 +400,21 @@ int drmModeSetCursor(int fd, uint32_t crtcId, uint32_t bo_handle, uint32_t width
        return DRM_IOCTL(fd, DRM_IOCTL_MODE_CURSOR, &arg);
 }
 
+int drmModeSetCursor2(int fd, uint32_t crtcId, uint32_t bo_handle, uint32_t width, uint32_t height, int32_t hot_x, int32_t hot_y)
+{
+       struct drm_mode_cursor2 arg;
+
+       arg.flags = DRM_MODE_CURSOR_BO;
+       arg.crtc_id = crtcId;
+       arg.width = width;
+       arg.height = height;
+       arg.handle = bo_handle;
+       arg.hot_x = hot_x;
+       arg.hot_y = hot_y;
+
+       return DRM_IOCTL(fd, DRM_IOCTL_MODE_CURSOR2, &arg);
+}
+
 int drmModeMoveCursor(int fd, uint32_t crtcId, int x, int y)
 {
        struct drm_mode_cursor arg;