diff options
Diffstat (limited to 'sys/linux/dev_dri.txt')
| -rw-r--r-- | sys/linux/dev_dri.txt | 400 |
1 files changed, 361 insertions, 39 deletions
diff --git a/sys/linux/dev_dri.txt b/sys/linux/dev_dri.txt index 643864c95..2449b9c9e 100644 --- a/sys/linux/dev_dri.txt +++ b/sys/linux/dev_dri.txt @@ -3,8 +3,9 @@ include <uapi/asm/ioctl.h> include <uapi/linux/fcntl.h> -include <drm/drm.h> -include <drm/drm_mode.h> +include <uapi/drm/drm.h> +include <uapi/drm/drm_mode.h> +include <uapi/drm/drm_fourcc.h> include <linux/agp_backend.h> resource fd_dri[fd] @@ -13,6 +14,10 @@ resource drm_agp_handle[intptr] resource drm_gem_handle[int32] resource drm_gem_name[int32] +# TODO: these seems to be pretty important things, where does one get these? +type drm_crtc_id int32 +type drm_fb_id int32 + syz_open_dev$dri(dev ptr[in, string["/dev/dri/card#"]], id intptr, flags flags[open_flags]) fd_dri syz_open_dev$dricontrol(dev ptr[in, string["/dev/dri/controlD#"]], id intptr, flags flags[open_flags]) fd_dri syz_open_dev$drirender(dev ptr[in, string["/dev/dri/renderD#"]], id intptr, flags flags[open_flags]) fd_dri @@ -23,7 +28,7 @@ ioctl$DRM_IOCTL_GET_UNIQUE(fd fd_dri, cmd const[DRM_IOCTL_GET_UNIQUE], arg ptr[i ioctl$DRM_IOCTL_GET_MAGIC(fd fd_dri, cmd const[DRM_IOCTL_GET_MAGIC], arg ptr[in, int32]) ioctl$DRM_IOCTL_IRQ_BUSID(fd fd_dri, cmd const[DRM_IOCTL_IRQ_BUSID], arg ptr[in, drm_irq_busid]) ioctl$DRM_IOCTL_GET_MAP(fd fd_dri, cmd const[DRM_IOCTL_GET_MAP], arg ptr[in, drm_map]) -ioctl$DRM_IOCTL_GET_CLIENT(fd fd_dri, cmd const[DRM_IOCTL_GET_CLIENT], arg ptr[in, drm_client]) +ioctl$DRM_IOCTL_GET_CLIENT(fd fd_dri, cmd const[DRM_IOCTL_GET_CLIENT], arg ptr[inout, drm_client]) ioctl$DRM_IOCTL_GET_STATS(fd fd_dri, cmd const[DRM_IOCTL_GET_STATS], arg buffer[out]) ioctl$DRM_IOCTL_GET_CAP(fd fd_dri, cmd const[DRM_IOCTL_GET_CAP], arg ptr[in, drm_get_cap]) ioctl$DRM_IOCTL_SET_CLIENT_CAP(fd fd_dri, cmd const[DRM_IOCTL_SET_CLIENT_CAP], arg ptr[in, drm_get_cap]) @@ -73,31 +78,351 @@ ioctl$DRM_IOCTL_MODE_GETPLANERESOURCES(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETPL ioctl$DRM_IOCTL_MODE_GETCRTC(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETCRTC], arg ptr[in, drm_mode_crtc]) ioctl$DRM_IOCTL_MODE_SETCRTC(fd fd_dri, cmd const[DRM_IOCTL_MODE_SETCRTC], arg ptr[in, drm_mode_crtc]) -#ioctl$DRM_IOCTL_MODE_GETPLANE(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETPLANE], arg ptr[in, drm_mode_get_plane]) -#ioctl$DRM_IOCTL_MODE_SETPLANE(fd fd_dri, cmd const[DRM_IOCTL_MODE_SETPLANE], arg ptr[in, drm_mode_set_plane]) -#ioctl$DRM_IOCTL_MODE_CURSOR(fd fd_dri, cmd const[DRM_IOCTL_MODE_CURSOR], arg ptr[in, drm_mode_cursor]) -#ioctl$DRM_IOCTL_MODE_GETGAMMA(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETGAMMA], arg ptr[in, drm_mode_crtc_lut]) -#ioctl$DRM_IOCTL_MODE_SETGAMMA(fd fd_dri, cmd const[DRM_IOCTL_MODE_SETGAMMA], arg ptr[in, drm_mode_crtc_lut]) -#ioctl$DRM_IOCTL_MODE_GETENCODER(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETENCODER], arg ptr[in, drm_mode_get_encoder]) -#ioctl$DRM_IOCTL_MODE_GETCONNECTOR(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETCONNECTOR], arg ptr[in, drm_mode_get_connector]) -#ioctl$DRM_IOCTL_MODE_GETPROPERTY(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETPROPERTY], arg ptr[in, drm_mode_get_property]) -#ioctl$DRM_IOCTL_MODE_SETPROPERTY(fd fd_dri, cmd const[DRM_IOCTL_MODE_SETPROPERTY], arg ptr[in, drm_mode_connector_set_property]) -#ioctl$DRM_IOCTL_MODE_GETPROPBLOB(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETPROPBLOB], arg ptr[in, drm_mode_get_blob]) -#ioctl$DRM_IOCTL_MODE_GETFB(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETFB], arg ptr[in, drm_mode_fb_cmd]) -#ioctl$DRM_IOCTL_MODE_ADDFB(fd fd_dri, cmd const[DRM_IOCTL_MODE_ADDFB], arg ptr[in, drm_mode_fb_cmd]) -#ioctl$DRM_IOCTL_MODE_ADDFB2(fd fd_dri, cmd const[DRM_IOCTL_MODE_ADDFB2], arg ptr[in, drm_mode_fb_cmd2]) -#ioctl$DRM_IOCTL_MODE_RMFB(fd fd_dri, cmd const[DRM_IOCTL_MODE_RMFB], arg ptr[in, int32]) -#ioctl$DRM_IOCTL_MODE_PAGE_FLIP(fd fd_dri, cmd const[DRM_IOCTL_MODE_PAGE_FLIP], arg ptr[in, drm_mode_crtc_page_flip]) -#ioctl$DRM_IOCTL_MODE_DIRTYFB(fd fd_dri, cmd const[DRM_IOCTL_MODE_DIRTYFB], arg ptr[in, drm_mode_fb_dirty_cmd]) -#ioctl$DRM_IOCTL_MODE_CREATE_DUMB(fd fd_dri, cmd const[DRM_IOCTL_MODE_CREATE_DUMB], arg ptr[in, drm_mode_create_dumb]) -#ioctl$DRM_IOCTL_MODE_MAP_DUMB(fd fd_dri, cmd const[DRM_IOCTL_MODE_MAP_DUMB], arg ptr[in, drm_mode_map_dumb]) -#ioctl$DRM_IOCTL_MODE_DESTROY_DUMB(fd fd_dri, cmd const[DRM_IOCTL_MODE_DESTROY_DUMB], arg ptr[in, drm_mode_destroy_dumb]) -#ioctl$DRM_IOCTL_MODE_OBJ_GETPROPERTIES(fd fd_dri, cmd const[DRM_IOCTL_MODE_OBJ_GETPROPERTIES], arg ptr[in, drm_mode_obj_get_properties]) -#ioctl$DRM_IOCTL_MODE_OBJ_SETPROPERTY(fd fd_dri, cmd const[DRM_IOCTL_MODE_OBJ_SETPROPERTY], arg ptr[in, drm_mode_obj_set_property]) -#ioctl$DRM_IOCTL_MODE_CURSOR2(fd fd_dri, cmd const[DRM_IOCTL_MODE_CURSOR2], arg ptr[in, drm_mode_cursor2]) -#ioctl$DRM_IOCTL_MODE_ATOMIC(fd fd_dri, cmd const[DRM_IOCTL_MODE_ATOMIC], arg ptr[in, drm_mode_atomic]) -#ioctl$DRM_IOCTL_MODE_CREATEPROPBLOB(fd fd_dri, cmd const[DRM_IOCTL_MODE_CREATEPROPBLOB], arg ptr[in, drm_mode_create_blob]) -#ioctl$DRM_IOCTL_MODE_DESTROYPROPBLOB(fd fd_dri, cmd const[DRM_IOCTL_MODE_DESTROYPROPBLOB], arg ptr[in, drm_mode_destroy_blob]) +ioctl$DRM_IOCTL_MODE_GETPLANE(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETPLANE], arg ptr[in, drm_mode_get_plane]) +ioctl$DRM_IOCTL_MODE_SETPLANE(fd fd_dri, cmd const[DRM_IOCTL_MODE_SETPLANE], arg ptr[in, drm_mode_set_plane]) + +resource drm_plane_id[int32] + +drm_mode_get_plane_res { + ids ptr64[out, array[drm_plane_id]] + cnt len[ids, int32] +} + +drm_mode_get_plane { + plane_id drm_plane_id +# These are outputs: + crtc_id const[0, int32] + fb_id const[0, int32] + possible_crtcs const[0, int32] + gamma_size const[0, int32] + count_format_types len[format_type_ptr, int32] + format_type_ptr ptr64[out, array[int32]] +} + +drm_mode_set_plane { + plane_id drm_plane_id + crtc_id drm_crtc_id + fb_id drm_fb_id + flags int32 + crtc_x int32 + crtc_y int32 + crtc_w int32 + crtc_h int32 + src_x int32 + src_y int32 + src_h int32 + src_w int32 +} + +ioctl$DRM_IOCTL_MODE_CURSOR(fd fd_dri, cmd const[DRM_IOCTL_MODE_CURSOR], arg ptr[in, drm_mode_cursor]) +ioctl$DRM_IOCTL_MODE_CURSOR2(fd fd_dri, cmd const[DRM_IOCTL_MODE_CURSOR2], arg ptr[in, drm_mode_cursor2]) + +drm_mode_cursor { + flags flags[drm_mode_cursor_flags, int32] + crtc_id drm_crtc_id + x int32 + y int32 + width int32 + height int32 + handle int32 +} + +drm_mode_cursor2 { + flags flags[drm_mode_cursor_flags, int32] + crtc_id drm_crtc_id + x int32 + y int32 + width int32 + height int32 + handle int32 + hot_x int32 + hot_y int32 +} + +drm_mode_cursor_flags = DRM_MODE_CURSOR_BO, DRM_MODE_CURSOR_MOVE + +ioctl$DRM_IOCTL_MODE_GETGAMMA(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETGAMMA], arg ptr[in, drm_mode_crtc_lut]) +ioctl$DRM_IOCTL_MODE_SETGAMMA(fd fd_dri, cmd const[DRM_IOCTL_MODE_SETGAMMA], arg ptr[in, drm_mode_crtc_lut]) + +drm_mode_crtc_lut { + crtc_id drm_crtc_id +# gamma_size needs to be equal to gamma_size passed to DRM_IOCTL_MODE_SETCRTC. + gamma_size len[red, int32] + red ptr64[in, array[int16]] +# NEED: these should be of the same size as red. + green ptr64[in, array[int16]] + blue ptr64[in, array[int16]] +} + +ioctl$DRM_IOCTL_MODE_GETENCODER(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETENCODER], arg ptr[in, drm_mode_get_encoder]) + +drm_mode_get_encoder { +# TODO: where does one get these? + encoder_id int32 +# Outputs: + encoder_type const[0, int32] + crtc_id const[0, int32] + possible_crtcs const[0, int32] + possible_clones const[0, int32] +} + +ioctl$DRM_IOCTL_MODE_GETCONNECTOR(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETCONNECTOR], arg ptr[in, drm_mode_get_connector]) + +drm_mode_get_connector { +# Everything except for connector_id are outputs. + encoders_ptr ptr64[out, array[int32]] + modes_ptr ptr64[out, array[int32]] + props_ptr ptr64[out, array[int32]] + prop_values_ptr ptr64[out, array[int32]] + count_modes len[modes_ptr, int32] + count_props len[props_ptr, int32] + count_encoders len[count_modes, int32] + encoder_id const[0, int32] +# TODO: where does one get these? + connector_id int32 + connector_type const[0, int32] + connector_type_id const[0, int32] + connection const[0, int32] + mm_width const[0, int32] + mm_height const[0, int32] + subpixel const[0, int32] + pad const[0, int32] +} + +ioctl$DRM_IOCTL_MODE_GETPROPERTY(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETPROPERTY], arg ptr[in, drm_mode_get_property]) +ioctl$DRM_IOCTL_MODE_SETPROPERTY(fd fd_dri, cmd const[DRM_IOCTL_MODE_SETPROPERTY], arg ptr[in, drm_mode_connector_set_property]) +ioctl$DRM_IOCTL_MODE_GETPROPBLOB(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETPROPBLOB], arg ptr[in, drm_mode_get_blob]) +ioctl$DRM_IOCTL_MODE_OBJ_GETPROPERTIES(fd fd_dri, cmd const[DRM_IOCTL_MODE_OBJ_GETPROPERTIES], arg ptr[in, drm_mode_obj_get_properties]) +ioctl$DRM_IOCTL_MODE_OBJ_SETPROPERTY(fd fd_dri, cmd const[DRM_IOCTL_MODE_OBJ_SETPROPERTY], arg ptr[in, drm_mode_obj_set_property]) +ioctl$DRM_IOCTL_MODE_CREATEPROPBLOB(fd fd_dri, cmd const[DRM_IOCTL_MODE_CREATEPROPBLOB], arg ptr[inout, drm_mode_create_blob]) +ioctl$DRM_IOCTL_MODE_DESTROYPROPBLOB(fd fd_dri, cmd const[DRM_IOCTL_MODE_DESTROYPROPBLOB], arg ptr[in, drm_mode_destroy_blob]) + +drm_mode_get_property { + values_ptr ptr64[out, array[int64]] + enum_blob_ptr ptr64[out, array[drm_mode_property_enum]] +# TODO: where does one get these? + prop_id int32 + flags const[0, int32] + name array[const[0, int8], DRM_PROP_NAME_LEN] + count_values len[values_ptr, int32] + count_enum_blobs len[enum_blob_ptr, int32] +} + +drm_mode_property_enum { + value int64 + name array[const[0, int8], DRM_PROP_NAME_LEN] +} + +drm_mode_connector_set_property { + value int64 + prop_id int32 + connector_id int32 +} + +drm_mode_obj_set_property { + value int64 + prop_id int32 + obj_id int32 + obj_type flags[drm_obj_type, int32] +} + +drm_obj_type = DRM_MODE_OBJECT_CRTC, DRM_MODE_OBJECT_CONNECTOR, DRM_MODE_OBJECT_ENCODER, DRM_MODE_OBJECT_MODE, DRM_MODE_OBJECT_PROPERTY, DRM_MODE_OBJECT_FB, DRM_MODE_OBJECT_BLOB, DRM_MODE_OBJECT_PLANE, DRM_MODE_OBJECT_ANY + +drm_mode_obj_get_properties { + props_ptr ptr64[in, array[int32]] +# NEED: this should be the same size as props_ptr. + prop_values_ptr ptr64[out, array[int64]] + count_props len[props_ptr, int32] + obj_id int32 + obj_type flags[drm_obj_type, int32] +} + +# TODO: are there pre-existing blobs? what ids do they have? +resource drm_blob_id[int32]: 0, 1, 2 + +drm_mode_get_blob { + blob_id drm_blob_id + length len[data, int32] + data ptr64[out, array[int8]] +} + +drm_mode_create_blob { + data ptr64[in, array[int8]] + length len[data, int32] +# Output: + blob_id drm_blob_id[opt] +} + +drm_mode_destroy_blob { + blob_id drm_blob_id +} + +ioctl$DRM_IOCTL_MODE_GETFB(fd fd_dri, cmd const[DRM_IOCTL_MODE_GETFB], arg ptr[in, drm_mode_fb_cmd]) +ioctl$DRM_IOCTL_MODE_ADDFB(fd fd_dri, cmd const[DRM_IOCTL_MODE_ADDFB], arg ptr[in, drm_mode_fb_cmd]) +ioctl$DRM_IOCTL_MODE_ADDFB2(fd fd_dri, cmd const[DRM_IOCTL_MODE_ADDFB2], arg ptr[in, drm_mode_fb_cmd2]) + +drm_mode_fb_cmd { + fb_id drm_fb_id + width int32 + height int32 + pitch int32 + bpp int32 + depth int32 + handle int32 +} + +drm_mode_fb_cmd2 { + fb_id drm_fb_id + width int32 + height int32 + pixel_format int32 + flags flags[drm_mode_fb_flags, int32] + handles array[int32, 4] + pitches array[int32, 4] + offsets array[int32, 4] + modifier array[int32, 4] +} + +drm_mode_fb_flags = DRM_MODE_FB_INTERLACED, DRM_MODE_FB_MODIFIERS + +ioctl$DRM_IOCTL_MODE_RMFB(fd fd_dri, cmd const[DRM_IOCTL_MODE_RMFB], arg ptr[in, drm_fb_id]) +ioctl$DRM_IOCTL_MODE_PAGE_FLIP(fd fd_dri, cmd const[DRM_IOCTL_MODE_PAGE_FLIP], arg ptr[in, drm_mode_crtc_page_flip_target]) + +drm_mode_crtc_page_flip_target { + crtc_id drm_crtc_id + fb_id drm_fb_id + flags flags[drm_page_flip_flags, int32] + sequence int32 + user_data int64 +} + +drm_page_flip_flags = DRM_MODE_PAGE_FLIP_EVENT, DRM_MODE_PAGE_FLIP_ASYNC, DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE, DRM_MODE_PAGE_FLIP_TARGET_RELATIVE + +ioctl$DRM_IOCTL_MODE_DIRTYFB(fd fd_dri, cmd const[DRM_IOCTL_MODE_DIRTYFB], arg ptr[in, drm_mode_fb_dirty_cmd]) + +drm_mode_fb_dirty_cmd { + fb_id drm_fb_id + flags flags[drm_mode_fb_dirty_flags, int32] + color int32 + num_clips len[clips_ptr, int32] + clips_ptr ptr64[in, array[drm_clip_rect]] +} + +drm_clip_rect { + x1 int16 + y1 int16 + x2 int16 + y2 int16 +} + +drm_mode_fb_dirty_flags = DRM_MODE_FB_DIRTY_ANNOTATE_COPY, DRM_MODE_FB_DIRTY_ANNOTATE_FILL + +ioctl$DRM_IOCTL_MODE_CREATE_DUMB(fd fd_dri, cmd const[DRM_IOCTL_MODE_CREATE_DUMB], arg ptr[inout, drm_mode_create_dumb]) +ioctl$DRM_IOCTL_MODE_MAP_DUMB(fd fd_dri, cmd const[DRM_IOCTL_MODE_MAP_DUMB], arg ptr[in, drm_mode_map_dumb]) +ioctl$DRM_IOCTL_MODE_DESTROY_DUMB(fd fd_dri, cmd const[DRM_IOCTL_MODE_DESTROY_DUMB], arg ptr[in, drm_mode_destroy_dumb]) + +resource drm_dumb_handle[int32] + +drm_mode_create_dumb { + height int32 + width int32 + bpp int32 + flags int32 +# Outputs: + handle drm_dumb_handle[opt] + pitch const[0, int32] + size const[0, int64] +} + +drm_mode_map_dumb { + handle drm_dumb_handle + pad const[0, int32] + offset const[0, int64] +} + +drm_mode_destroy_dumb { + handle drm_dumb_handle +} + +ioctl$DRM_IOCTL_MODE_ATOMIC(fd fd_dri, cmd const[DRM_IOCTL_MODE_ATOMIC], arg ptr[in, drm_mode_atomic]) + +drm_mode_atomic { + flags flags[drm_mode_atomic_flags, int32] + count_objs len[objs_ptr, int32] + objs_ptr ptr64[in, array[int32]] +# NEED: this array is probably parallel to objs_ptr. + count_props_ptr ptr64[in, array[int32]] + props_ptr ptr64[in, array[int32]] + prop_values_ptr ptr64[in, array[int32]] + reserved const[0, int64] + user_data int64 +} + +drm_mode_atomic_flags = DRM_MODE_PAGE_FLIP_EVENT, DRM_MODE_ATOMIC_TEST_ONLY, DRM_MODE_ATOMIC_NONBLOCK, DRM_MODE_ATOMIC_ALLOW_MODESET + +# TODO: describe SYNCOBJ ioctls (but we don't have any DRIVER_SYNCOBJ hardware). +#resource drm_syncobj[int32] + +#ioctl$DRM_IOCTL_SYNCOBJ_CREATE(fd fd_dri, cmd const[DRM_IOCTL_SYNCOBJ_CREATE], arg ptr[in, drm_syncobj_create]) +#ioctl$DRM_IOCTL_SYNCOBJ_DESTROY(fd fd_dri, cmd const[DRM_IOCTL_SYNCOBJ_DESTROY], arg ptr[in, drm_syncobj_destroy]) +#ioctl$DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD(fd fd_dri, cmd const[DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD], arg ptr[in, XXXXX]) +#ioctl$DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE(fd fd_dri, cmd const[DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE], arg ptr[in, XXXXX]) +#ioctl$DRM_IOCTL_SYNCOBJ_TRANSFER(fd fd_dri, cmd const[DRM_IOCTL_SYNCOBJ_TRANSFER], arg ptr[in, XXXXX]) +#ioctl$DRM_IOCTL_SYNCOBJ_WAIT(fd fd_dri, cmd const[DRM_IOCTL_SYNCOBJ_WAIT], arg ptr[in, XXXXX]) +#ioctl$DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT(fd fd_dri, cmd const[DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT], arg ptr[in, XXXXX]) +#ioctl$DRM_IOCTL_SYNCOBJ_RESET(fd fd_dri, cmd const[DRM_IOCTL_SYNCOBJ_RESET], arg ptr[in, XXXXX]) +#ioctl$DRM_IOCTL_SYNCOBJ_SIGNAL(fd fd_dri, cmd const[DRM_IOCTL_SYNCOBJ_SIGNAL], arg ptr[in, XXXXX]) +#ioctl$DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL(fd fd_dri, cmd const[DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL], arg ptr[in, XXXXX]) +#ioctl$DRM_IOCTL_SYNCOBJ_QUERY(fd fd_dri, cmd const[DRM_IOCTL_SYNCOBJ_QUERY], arg ptr[in, XXXXX]) + +#drm_syncobj_create { +# handle drm_syncobj[opt] +# flags bool32 +#} + +#drm_syncobj_destroy { +# handle drm_syncobj +# pad const[0, int32] +#} + +# TODO: describe SEQUENCE ioctls (but we don't have DRIVER_MODESET hardware). +#ioctl$DRM_IOCTL_CRTC_GET_SEQUENCE(fd fd_dri, cmd const[DRM_IOCTL_CRTC_GET_SEQUENCE], arg ptr[in, XXXXX]) +#ioctl$DRM_IOCTL_CRTC_QUEUE_SEQUENCE(fd fd_dri, cmd const[DRM_IOCTL_CRTC_QUEUE_SEQUENCE], arg ptr[in, XXXXX]) + +ioctl$DRM_IOCTL_MODE_CREATE_LEASE(fd fd_dri, cmd const[DRM_IOCTL_MODE_CREATE_LEASE], arg ptr[in, drm_mode_create_lease]) +ioctl$DRM_IOCTL_MODE_LIST_LESSEES(fd fd_dri, cmd const[DRM_IOCTL_MODE_LIST_LESSEES], arg ptr[in, drm_mode_list_lessees]) +ioctl$DRM_IOCTL_MODE_GET_LEASE(fd fd_dri, cmd const[DRM_IOCTL_MODE_GET_LEASE], arg ptr[in, drm_mode_get_lease]) +ioctl$DRM_IOCTL_MODE_REVOKE_LEASE(fd fd_dri, cmd const[DRM_IOCTL_MODE_REVOKE_LEASE], arg ptr[in, drm_mode_revoke_lease]) + +resource drm_lessee_id[int32] + +drm_mode_create_lease { +# TODO: what are these "object ids"? where does one get these? + object_ids ptr64[in, array[int32]] + object_count len[object_ids, int32] + flags flags[drm_mode_create_lease_flag, int32] +# Outputs: + lessee_id drm_lessee_id[opt] + fd fd[opt] +} + +drm_mode_create_lease_flag = O_CLOEXEC, O_NONBLOCK + +drm_mode_list_lessees { + count_lessees len[lessees_ptr, int32] + pad const[0, int32] + lessees_ptr ptr64[out, array[drm_lessee_id]] +} + +drm_mode_get_lease { + count_objects len[objects_ptr, int32] + pad const[0, int32] + objects_ptr ptr64[out, array[int32]] +} + +drm_mode_revoke_lease { + lessee_id drm_lessee_id +} drm_version { maj int32 @@ -147,10 +472,12 @@ drm_client { } drm_get_cap { - cap int64 - val int64 + cap flags[drm_cap, int64] + val const[0, int64] } +drm_cap = DRM_CAP_DUMB_BUFFER, DRM_CAP_VBLANK_HIGH_CRTC, DRM_CAP_DUMB_PREFERRED_DEPTH, DRM_CAP_DUMB_PREFER_SHADOW, DRM_CAP_PRIME, DRM_PRIME_CAP_IMPORT, DRM_PRIME_CAP_EXPORT, DRM_CAP_TIMESTAMP_MONOTONIC, DRM_CAP_ASYNC_PAGE_FLIP, DRM_CAP_CURSOR_WIDTH, DRM_CAP_CURSOR_HEIGHT, DRM_CAP_ADDFB2_MODIFIERS, DRM_CAP_PAGE_FLIP_TARGET, DRM_CAP_CRTC_IN_VBLANK_EVENT, DRM_CAP_SYNCOBJ, DRM_CAP_SYNCOBJ_TIMELINE + drm_set_version { di_maj int32 di_min int32 @@ -286,21 +613,16 @@ drm_mode_card_res { } drm_prime_handle { - handle drm_gem_handle + handle drm_gem_handle[opt] flags flags[dup_flags, int32] - fd fd_dri -} - -drm_mode_get_plane_res { - ids ptr64[out, array[int32]] - cnt len[ids, int32] + fd fd_dri[opt] } drm_mode_crtc { set_connectors_ptr ptr64[in, array[int32]] count_connectors len[set_connectors_ptr, int32] - crtc_id int32 - fb_id int32 + crtc_id drm_crtc_id + fb_id drm_fb_id x int32 y int32 gamma_size int32 |
