diff --git a/redox-ioctl/src/drm.rs b/redox-ioctl/src/drm.rs index a81f69fa68..d54be2beb3 100644 --- a/redox-ioctl/src/drm.rs +++ b/redox-ioctl/src/drm.rs @@ -7,11 +7,11 @@ use core::{ 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_destroy_dumb, - drm_mode_fb_cmd, drm_mode_fb_cmd2, 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_set_client_cap, drm_version, + 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_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_set_client_cap, drm_version, }; pub const VERSION: u64 = 0; @@ -66,6 +66,7 @@ define_ioctl_data! { } pub const MODE_GET_CRTC: u64 = 0xA1; +pub const MODE_SET_CRTC: u64 = 0xA2; define_ioctl_data! { struct drm_mode_crtc, DrmModeCrtc { set_connectors_ptr: u64 [array], @@ -80,6 +81,19 @@ define_ioctl_data! { } } +pub const MODE_CURSOR: u64 = 0xA3; +define_ioctl_data! { + struct drm_mode_cursor, DrmModeCursor { + flags: u32, + crtc_id: u32, + x: i32, + y:i32, + width:u32, + height:u32, + handle:u32, + } +} + pub const MODE_GET_ENCODER: u64 = 0xA6; define_ioctl_data! { struct drm_mode_get_encoder, DrmModeGetEncoder { @@ -232,6 +246,21 @@ define_ioctl_data! { } } +pub const MODE_CURSOR2: u64 = 0xBB; +define_ioctl_data! { + struct drm_mode_cursor2, DrmModeCursor2 { + flags: u32, + crtc_id: u32, + x: i32, + y: i32, + width: u32, + height: u32, + handle: u32, + hot_x: i32, + hot_y: i32, + } +} + pub const MODE_GET_FB2: u64 = 0xCE; define_ioctl_data! { struct drm_mode_fb_cmd2, DrmModeFbCmd2 { diff --git a/src/header/sys_ioctl/redox/drm.rs b/src/header/sys_ioctl/redox/drm.rs index 850ac5b88a..70fcced2b2 100644 --- a/src/header/sys_ioctl/redox/drm.rs +++ b/src/header/sys_ioctl/redox/drm.rs @@ -95,6 +95,8 @@ pub(super) unsafe fn ioctl(fd: c_int, func: u8, buf: IoctlBuffer) -> Result unsafe { dev.write_ioctl::(buf, SET_CLIENT_CAP) }, 0xA0 => unsafe { dev.read_write_ioctl::(buf, MODE_CARD_RES) }, 0xA1 => unsafe { dev.read_write_ioctl::(buf, MODE_GET_CRTC) }, + 0xA2 => unsafe { dev.read_write_ioctl::(buf, MODE_SET_CRTC) }, + 0xA3 => unsafe { dev.write_ioctl::(buf, MODE_CURSOR) }, 0xA6 => unsafe { dev.read_write_ioctl::(buf, MODE_GET_ENCODER) }, 0xA7 => unsafe { dev.read_write_ioctl::(buf, MODE_GET_CONNECTOR) }, 0xAA => unsafe { dev.read_write_ioctl::(buf, MODE_GET_PROPERTY) }, @@ -113,6 +115,7 @@ pub(super) unsafe fn ioctl(fd: c_int, func: u8, buf: IoctlBuffer) -> Result unsafe { dev.read_write_ioctl::(buf, MODE_OBJ_GET_PROPERTIES) }, + 0xBB => unsafe { dev.write_ioctl::(buf, MODE_CURSOR2) }, 0xCE => unsafe { dev.read_write_ioctl::(buf, MODE_GET_FB2) }, _ => { todo_skip!(