#![allow(missing_docs)]
use drm_sys::*;
ioctl_readwrite!(get_bus_id, DRM_IOCTL_BASE, 0x01, drm_unique);
ioctl_readwrite!(get_client, DRM_IOCTL_BASE, 0x05, drm_client);
ioctl_read!(get_stats, DRM_IOCTL_BASE, 0x06, drm_stats);
ioctl_readwrite!(get_cap, DRM_IOCTL_BASE, 0x0c, drm_get_cap);
ioctl_write_ptr!(set_cap, DRM_IOCTL_BASE, 0x0d, drm_set_client_cap);
ioctl_readwrite!(set_version, DRM_IOCTL_BASE, 0x07, drm_set_version);
ioctl_readwrite!(get_version, DRM_IOCTL_BASE, 0x00, drm_version);
ioctl_read!(get_token, DRM_IOCTL_BASE, 0x02, drm_auth);
ioctl_write_ptr!(auth_token, DRM_IOCTL_BASE, 0x11, drm_auth);
ioctl_none!(acquire_master, DRM_IOCTL_BASE, 0x1e);
ioctl_none!(release_master, DRM_IOCTL_BASE, 0x1f);
ioctl_readwrite!(get_irq_from_bus_id, DRM_IOCTL_BASE, 0x03, drm_irq_busid);
ioctl_readwrite!(wait_vblank, DRM_IOCTL_BASE, 0x3a, drm_wait_vblank);
pub(crate) mod mode {
use drm_sys::*;
use nix::libc::c_uint;
ioctl_readwrite!(get_resources, DRM_IOCTL_BASE, 0xA0, drm_mode_card_res);
ioctl_readwrite!(
get_plane_resources,
DRM_IOCTL_BASE,
0xB5,
drm_mode_get_plane_res
);
ioctl_readwrite!(get_connector, DRM_IOCTL_BASE, 0xA7, drm_mode_get_connector);
ioctl_readwrite!(get_encoder, DRM_IOCTL_BASE, 0xA6, drm_mode_get_encoder);
ioctl_readwrite!(get_crtc, DRM_IOCTL_BASE, 0xA1, drm_mode_crtc);
ioctl_readwrite!(set_crtc, DRM_IOCTL_BASE, 0xA2, drm_mode_crtc);
ioctl_readwrite!(get_gamma, DRM_IOCTL_BASE, 0xA4, drm_mode_crtc_lut);
ioctl_readwrite!(set_gamma, DRM_IOCTL_BASE, 0xA5, drm_mode_crtc_lut);
ioctl_readwrite!(get_fb, DRM_IOCTL_BASE, 0xAD, drm_mode_fb_cmd);
ioctl_readwrite!(add_fb, DRM_IOCTL_BASE, 0xAE, drm_mode_fb_cmd);
ioctl_readwrite!(add_fb2, DRM_IOCTL_BASE, 0xB8, drm_mode_fb_cmd2);
ioctl_readwrite!(rm_fb, DRM_IOCTL_BASE, 0xAF, c_uint);
ioctl_readwrite!(get_plane, DRM_IOCTL_BASE, 0xB6, drm_mode_get_plane);
ioctl_readwrite!(set_plane, DRM_IOCTL_BASE, 0xB7, drm_mode_set_plane);
ioctl_readwrite!(create_dumb, DRM_IOCTL_BASE, 0xB2, drm_mode_create_dumb);
ioctl_readwrite!(map_dumb, DRM_IOCTL_BASE, 0xB3, drm_mode_map_dumb);
ioctl_readwrite!(destroy_dumb, DRM_IOCTL_BASE, 0xB4, drm_mode_destroy_dumb);
ioctl_readwrite!(cursor, DRM_IOCTL_BASE, 0xA3, drm_mode_cursor);
ioctl_readwrite!(cursor2, DRM_IOCTL_BASE, 0xBB, drm_mode_cursor2);
ioctl_readwrite!(get_property, DRM_IOCTL_BASE, 0xAA, drm_mode_get_property);
ioctl_readwrite!(
connector_set_property,
DRM_IOCTL_BASE,
0xAB,
drm_mode_connector_set_property
);
ioctl_readwrite!(
obj_get_properties,
DRM_IOCTL_BASE,
0xB9,
drm_mode_obj_get_properties
);
ioctl_readwrite!(
obj_set_property,
DRM_IOCTL_BASE,
0xBA,
drm_mode_obj_set_property
);
ioctl_readwrite!(get_blob, DRM_IOCTL_BASE, 0xAC, drm_mode_get_blob);
ioctl_readwrite!(create_blob, DRM_IOCTL_BASE, 0xBD, drm_mode_create_blob);
ioctl_readwrite!(destroy_blob, DRM_IOCTL_BASE, 0xBE, drm_mode_destroy_blob);
ioctl_readwrite!(
crtc_page_flip,
DRM_IOCTL_BASE,
0xB0,
drm_mode_crtc_page_flip
);
ioctl_readwrite!(dirty_fb, DRM_IOCTL_BASE, 0xB1, drm_mode_fb_dirty_cmd);
ioctl_readwrite!(atomic, DRM_IOCTL_BASE, 0xBC, drm_mode_atomic);
}
pub(crate) mod gem {
use drm_sys::*;
ioctl_readwrite!(open, DRM_IOCTL_BASE, 0x0b, drm_gem_open);
ioctl_write_ptr!(close, DRM_IOCTL_BASE, 0x09, drm_gem_close);
ioctl_readwrite!(prime_handle_to_fd, DRM_IOCTL_BASE, 0x2d, drm_prime_handle);
ioctl_readwrite!(prime_fd_to_handle, DRM_IOCTL_BASE, 0x2e, drm_prime_handle);
}