Merge branch 'drm9' into 'master'
Add drm MODE_ADD_FB and MODE_RM_FB See merge request redox-os/relibc!828
This commit is contained in:
+15
-1
@@ -1,7 +1,7 @@
|
||||
use alloc::vec::Vec;
|
||||
use core::{
|
||||
cmp,
|
||||
ffi::{c_char, c_int},
|
||||
ffi::{c_char, c_int, c_uint},
|
||||
iter, mem, slice,
|
||||
};
|
||||
|
||||
@@ -112,6 +112,7 @@ define_ioctl_data! {
|
||||
}
|
||||
|
||||
pub const MODE_GET_FB: u64 = 0xAD;
|
||||
pub const MODE_ADD_FB: u64 = 0xAE;
|
||||
define_ioctl_data! {
|
||||
struct drm_mode_fb_cmd, DrmModeFbCmd {
|
||||
fb_id: u32,
|
||||
@@ -124,6 +125,19 @@ define_ioctl_data! {
|
||||
}
|
||||
}
|
||||
|
||||
pub const MODE_RM_FB: u64 = 0xAF;
|
||||
define_ioctl_data! {
|
||||
struct standin_for_uint, StandinForUint {
|
||||
inner: c_uint,
|
||||
}
|
||||
}
|
||||
|
||||
#[repr(transparent)]
|
||||
#[allow(non_camel_case_types)]
|
||||
pub struct standin_for_uint {
|
||||
pub inner: c_uint,
|
||||
}
|
||||
|
||||
pub const MODE_CREATE_DUMB: u64 = 0xB2;
|
||||
define_ioctl_data! {
|
||||
struct drm_mode_create_dumb, DrmModeCreateDumb {
|
||||
|
||||
@@ -98,6 +98,8 @@ pub(super) unsafe fn ioctl(fd: c_int, func: u8, buf: IoctlBuffer) -> Result<c_in
|
||||
0xA6 => dev.read_write_ioctl::<drm_mode_get_encoder>(buf, MODE_GET_ENCODER),
|
||||
0xA7 => dev.read_write_ioctl::<drm_mode_get_connector>(buf, MODE_GET_CONNECTOR),
|
||||
0xAD => dev.read_write_ioctl::<drm_mode_fb_cmd>(buf, MODE_GET_FB),
|
||||
0xAE => dev.read_write_ioctl::<drm_mode_fb_cmd>(buf, MODE_ADD_FB),
|
||||
0xAF => dev.read_write_ioctl::<standin_for_uint>(buf, MODE_RM_FB),
|
||||
0xB2 => dev.read_write_ioctl::<drm_mode_create_dumb>(buf, MODE_CREATE_DUMB),
|
||||
0xB3 => dev.read_write_ioctl::<drm_mode_map_dumb>(buf, MODE_MAP_DUMB),
|
||||
0xB4 => dev.read_write_ioctl::<drm_mode_destroy_dumb>(buf, MODE_DESTROY_DUMB),
|
||||
|
||||
Reference in New Issue
Block a user