gitignore: Ignore various generated files
[platform/upstream/libdrm.git] / xf86drmMode.c
index a60c7cb..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;
@@ -575,7 +593,7 @@ drmModePropertyPtr drmModeGetProperty(int fd, uint32_t property_id)
        if (prop.count_values)
                prop.values_ptr = VOID2U64(drmMalloc(prop.count_values * sizeof(uint64_t)));
 
-       if (prop.count_enum_blobs && (prop.flags & DRM_MODE_PROP_ENUM))
+       if (prop.count_enum_blobs && (prop.flags & (DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BITMASK)))
                prop.enum_blob_ptr = VOID2U64(drmMalloc(prop.count_enum_blobs * sizeof(struct drm_mode_property_enum)));
 
        if (prop.count_enum_blobs && (prop.flags & DRM_MODE_PROP_BLOB)) {
@@ -597,7 +615,7 @@ drmModePropertyPtr drmModeGetProperty(int fd, uint32_t property_id)
        r->flags = prop.flags;
        if (prop.count_values)
                r->values = drmAllocCpy(U642VOID(prop.values_ptr), prop.count_values, sizeof(uint64_t));
-       if (prop.flags & DRM_MODE_PROP_ENUM) {
+       if (prop.flags & (DRM_MODE_PROP_ENUM | DRM_MODE_PROP_BITMASK)) {
                r->count_enums = prop.count_enum_blobs;
                r->enums = drmAllocCpy(U642VOID(prop.enum_blob_ptr), prop.count_enum_blobs, sizeof(struct drm_mode_property_enum));
        } else if (prop.flags & DRM_MODE_PROP_BLOB) {