Skip to content

Commit c92501e

Browse files
uapi::drm: add DRM_IOCTL_GET_CRTC and DRM_IOCTL_SET_CRTC
Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
1 parent c15f5fd commit c92501e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/uapi/src/drm.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,23 @@ pub struct DrmModeCardRes {
109109
pub max_height: u32,
110110
}
111111

112+
#[repr(C)]
113+
pub struct DrmModeCrtc {
114+
pub set_connectors_ptr: u64,
115+
pub count_connectors: u32,
116+
117+
pub crtc_id: u32, // crtc ID
118+
pub fb_id: u32, // framebuffer ID
119+
120+
pub x: u32, // x position on the framebuffer
121+
pub y: u32, // y position on the framebuffer
122+
123+
pub gamma_size: u32,
124+
pub mode_valid: u32,
125+
126+
pub mode: DrmModeInfo,
127+
}
128+
112129
#[repr(u32)]
113130
#[derive(Copy, Clone, Debug)]
114131
pub enum DrmModeConStatus {
@@ -236,6 +253,8 @@ pub const DRM_IOCTL_VERSION: usize = drm_iowr::<DrmVersion>(0x00);
236253
pub const DRM_IOCTL_GET_CAP: usize = drm_iowr::<DrmGetCap>(0x0c);
237254

238255
pub const DRM_IOCTL_MODE_GETRESOURCES: usize = drm_iowr::<DrmModeCardRes>(0xa0);
256+
pub const DRM_IOCTL_GET_CRTC: usize = drm_iowr::<DrmModeCrtc>(0xa1);
257+
pub const DRM_IOCTL_SET_CRTC: usize = drm_iowr::<DrmModeCrtc>(0xa2);
239258
pub const DRM_IOCTL_GET_ENCODER: usize = drm_iowr::<DrmModeGetEncoder>(0xa6);
240259
pub const DRM_IOCTL_GET_CONNECTOR: usize = drm_iowr::<DrmModeGetConnector>(0xa7);
241260
pub const DRM_IOCTL_MODE_ADDFB: usize = drm_iowr::<DrmModeFbCmd>(0xae);

0 commit comments

Comments
 (0)