File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
aero_kernel/src/drivers/drm Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -594,6 +594,16 @@ impl INodeInterface for Drm {
594594 Ok ( 0 )
595595 }
596596
597+ DRM_IOCTL_MODE_MAP_DUMB => {
598+ let struc = VirtAddr :: new ( arg as u64 )
599+ . read_mut :: < DrmModeMapDumb > ( )
600+ . unwrap ( ) ;
601+
602+ let handle = self . find_handle ( struc. handle ) . unwrap ( ) ;
603+ struc. offset = handle. mapping as _ ;
604+ Ok ( 0 )
605+ }
606+
597607 _ => {
598608 // command[8..16] is the ASCII character supposedly unique to each driver.
599609 if command. get_bits ( 8 ..16 ) == DRM_IOCTL_BASE {
Original file line number Diff line number Diff line change @@ -222,6 +222,15 @@ pub struct DrmModeCreateDumb {
222222 pub size : u64 ,
223223}
224224
225+ #[ repr( C ) ]
226+ pub struct DrmModeMapDumb {
227+ pub handle : u32 , // handle for the object being mapped
228+ pub pad : u32 ,
229+ // Fake offset to use for subsequent mmap call. This is a fixed-size
230+ // type for 32/64 compatibility.
231+ pub offset : u64 ,
232+ }
233+
225234// DRM IOCTL constants:
226235pub const DRM_IOCTL_VERSION : usize = drm_iowr :: < DrmVersion > ( 0x00 ) ;
227236pub const DRM_IOCTL_GET_CAP : usize = drm_iowr :: < DrmGetCap > ( 0x0c ) ;
@@ -232,3 +241,4 @@ pub const DRM_IOCTL_GET_CONNECTOR: usize = drm_iowr::<DrmModeGetConnector>(0xa7)
232241pub const DRM_IOCTL_MODE_ADDFB : usize = drm_iowr :: < DrmModeFbCmd > ( 0xae ) ;
233242
234243pub const DRM_IOCTL_MODE_CREATE_DUMB : usize = drm_iowr :: < DrmModeCreateDumb > ( 0xb2 ) ;
244+ pub const DRM_IOCTL_MODE_MAP_DUMB : usize = drm_iowr :: < DrmModeMapDumb > ( 0xb3 ) ;
You can’t perform that action at this time.
0 commit comments