Add drm MODE_GET_PROPERTY, MODE_SET_PROPERTY and MODE_GET_PROP_BLOB
This commit is contained in:
+37
-4
@@ -6,10 +6,12 @@ use core::{
|
||||
};
|
||||
|
||||
pub use drm_sys::{
|
||||
__kernel_size_t, drm_get_cap, drm_mode_card_res, drm_mode_create_dumb, drm_mode_crtc,
|
||||
drm_mode_destroy_dumb, drm_mode_fb_cmd, drm_mode_fb_cmd2, drm_mode_get_connector,
|
||||
drm_mode_get_encoder, drm_mode_get_plane, drm_mode_get_plane_res, drm_mode_map_dumb,
|
||||
drm_mode_modeinfo, drm_mode_obj_get_properties, drm_set_client_cap, drm_version,
|
||||
__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,
|
||||
};
|
||||
|
||||
pub const VERSION: u64 = 0;
|
||||
@@ -111,6 +113,37 @@ define_ioctl_data! {
|
||||
}
|
||||
}
|
||||
|
||||
pub const MODE_GET_PROPERTY: u64 = 0xAA;
|
||||
define_ioctl_data! {
|
||||
struct drm_mode_get_property, DrmModeGetProperty {
|
||||
values_ptr: u64 [array<u64, count_values>],
|
||||
enum_blob_ptr: u64 [array<drm_mode_property_enum, count_enum_blobs>],
|
||||
prop_id: u32,
|
||||
flags: u32,
|
||||
name: [c_char; DRM_PROP_NAME_LEN as usize],
|
||||
count_values: u32,
|
||||
count_enum_blobs: u32,
|
||||
}
|
||||
}
|
||||
|
||||
pub const MODE_SET_PROPERTY: u64 = 0xAB;
|
||||
define_ioctl_data! {
|
||||
struct drm_mode_connector_set_property, DrmModeConnectorSetProperty {
|
||||
value: u64,
|
||||
prop_id: u32,
|
||||
connector_id: u32,
|
||||
}
|
||||
}
|
||||
|
||||
pub const MODE_GET_PROP_BLOB: u64 = 0xAC;
|
||||
define_ioctl_data! {
|
||||
struct drm_mode_get_blob, DrmModeGetBlob {
|
||||
blob_id: u32,
|
||||
length: u32,
|
||||
data: u64 [array<u8, length>],
|
||||
}
|
||||
}
|
||||
|
||||
pub const MODE_GET_FB: u64 = 0xAD;
|
||||
pub const MODE_ADD_FB: u64 = 0xAE;
|
||||
define_ioctl_data! {
|
||||
|
||||
@@ -97,6 +97,9 @@ pub(super) unsafe fn ioctl(fd: c_int, func: u8, buf: IoctlBuffer) -> Result<c_in
|
||||
0xA1 => dev.read_write_ioctl::<drm_mode_crtc>(buf, MODE_GET_CRTC),
|
||||
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),
|
||||
0xAA => dev.read_write_ioctl::<drm_mode_get_property>(buf, MODE_GET_PROPERTY),
|
||||
0xAB => dev.read_write_ioctl::<drm_mode_connector_set_property>(buf, MODE_SET_PROPERTY),
|
||||
0xAC => dev.read_write_ioctl::<drm_mode_get_blob>(buf, MODE_GET_PROP_BLOB),
|
||||
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),
|
||||
|
||||
Reference in New Issue
Block a user