#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int)
+#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB0, struct drm_mode_fb_dirty_cmd)
/**
* Device specific ioctls should only be in their respective headers
__u32 handle;
};
+struct drm_mode_fb_dirty_cmd {
+ __u32 fb_id;
+ __u32 flags;
+ __u32 num_clips;
+ __u32 reserved1;
+ __u64 reserved2;
+ __u64 clips_ptr;
+};
+
struct drm_mode_mode_cmd {
__u32 connector_id;
struct drm_mode_modeinfo mode;
return r;
}
+int drmModeDirtyFB(int fd, uint32_t bufferId,
+ drmModeClipPtr clips, uint32_t num_clips)
+{
+ struct drm_mode_fb_dirty_cmd dirty = { 0 };
+
+ dirty.fb_id = bufferId;
+ dirty.clips_ptr = VOID2U64(clips);
+ dirty.num_clips = num_clips;
+
+ return drmIoctl(fd, DRM_IOCTL_MODE_DIRTYFB, &dirty);
+}
+
/*
* Crtc functions
#endif /* _DRM_MODE_H */
+
+/*
+ * Feature defines
+ *
+ * Just because these are defined doesn't mean that the kernel
+ * can do that feature, its just for new code vs old libdrm.
+ */
+#define DRM_MODE_FEATURE_KMS 1
+#define DRM_MODE_FEATURE_DIRTYFB 1
+
+
typedef struct _drmModeRes {
int count_fbs;
uint32_t handle;
} drmModeFB, *drmModeFBPtr;
+typedef struct drm_clip_rect drmModeClip, *drmModeClipPtr;
+
typedef struct _drmModePropertyBlob {
uint32_t id;
uint32_t length;
*/
extern int drmModeRmFB(int fd, uint32_t bufferId);
+/**
+ * Mark a region of a framebuffer as dirty.
+ */
+extern int drmModeDirtyFB(int fd, uint32_t bufferId,
+ drmModeClipPtr clips, uint32_t num_clips);
+
+
/*
* Crtc functions
*/