Merge branch 'drm12' into 'master'
drm: Support MODE_PAGE_FLIP and MODE_DIRTYFB See merge request redox-os/relibc!1096
This commit is contained in:
+26
-2
@@ -4,11 +4,13 @@ use core::{
|
||||
ffi::{c_char, c_int, c_uint},
|
||||
iter, mem, slice,
|
||||
};
|
||||
use drm_sys::drm_clip_rect;
|
||||
|
||||
pub use drm_sys::{
|
||||
__kernel_size_t, DRM_PROP_NAME_LEN, drm_get_cap, drm_mode_card_res,
|
||||
drm_mode_connector_set_property, drm_mode_create_dumb, drm_mode_crtc, drm_mode_cursor,
|
||||
drm_mode_cursor2, drm_mode_destroy_dumb, drm_mode_fb_cmd, drm_mode_fb_cmd2, drm_mode_get_blob,
|
||||
drm_mode_connector_set_property, drm_mode_create_dumb, drm_mode_crtc,
|
||||
drm_mode_crtc_page_flip_target, drm_mode_cursor, drm_mode_cursor2, drm_mode_destroy_dumb,
|
||||
drm_mode_fb_cmd, drm_mode_fb_cmd2, drm_mode_fb_dirty_cmd, drm_mode_get_blob,
|
||||
drm_mode_get_connector, drm_mode_get_encoder, drm_mode_get_plane, drm_mode_get_plane_res,
|
||||
drm_mode_get_property, drm_mode_map_dumb, drm_mode_modeinfo, drm_mode_obj_get_properties,
|
||||
drm_mode_property_enum, drm_mode_set_plane, drm_set_client_cap, drm_version,
|
||||
@@ -185,6 +187,28 @@ pub struct standin_for_uint {
|
||||
pub inner: c_uint,
|
||||
}
|
||||
|
||||
pub const MODE_PAGE_FLIP: u64 = 0xB0;
|
||||
define_ioctl_data! {
|
||||
struct drm_mode_crtc_page_flip_target, DrmModeCrtcPageFlipTarget {
|
||||
crtc_id: u32,
|
||||
fb_id: u32,
|
||||
flags: u32,
|
||||
sequence: u32,
|
||||
user_data: u64,
|
||||
}
|
||||
}
|
||||
|
||||
pub const MODE_DIRTYFB: u64 = 0xB1;
|
||||
define_ioctl_data! {
|
||||
struct drm_mode_fb_dirty_cmd, DrmModeFbDirtyCmd {
|
||||
fb_id: u32,
|
||||
flags: u32,
|
||||
color: u32,
|
||||
num_clips: u32,
|
||||
clips_ptr: u64 [array<drm_clip_rect, num_clips>],
|
||||
}
|
||||
}
|
||||
|
||||
pub const MODE_CREATE_DUMB: u64 = 0xB2;
|
||||
define_ioctl_data! {
|
||||
struct drm_mode_create_dumb, DrmModeCreateDumb {
|
||||
|
||||
@@ -107,6 +107,10 @@ pub(super) unsafe fn ioctl(fd: c_int, func: u8, buf: IoctlBuffer) -> Result<c_in
|
||||
0xAD => unsafe { dev.read_write_ioctl::<drm_mode_fb_cmd>(buf, MODE_GET_FB) },
|
||||
0xAE => unsafe { dev.read_write_ioctl::<drm_mode_fb_cmd>(buf, MODE_ADD_FB) },
|
||||
0xAF => unsafe { dev.read_write_ioctl::<standin_for_uint>(buf, MODE_RM_FB) },
|
||||
0xB0 => unsafe {
|
||||
dev.read_write_ioctl::<drm_mode_crtc_page_flip_target>(buf, MODE_PAGE_FLIP)
|
||||
},
|
||||
0xB1 => unsafe { dev.read_write_ioctl::<drm_mode_fb_dirty_cmd>(buf, MODE_DIRTYFB) },
|
||||
0xB2 => unsafe { dev.read_write_ioctl::<drm_mode_create_dumb>(buf, MODE_CREATE_DUMB) },
|
||||
0xB3 => unsafe { dev.read_write_ioctl::<drm_mode_map_dumb>(buf, MODE_MAP_DUMB) },
|
||||
0xB4 => unsafe { dev.read_write_ioctl::<drm_mode_destroy_dumb>(buf, MODE_DESTROY_DUMB) },
|
||||
|
||||
Reference in New Issue
Block a user