STRUCT DRM_MODE_CREATE_DUMB(9)
β¨ NAME β¨
okay so bestie, welcome to struct drm_mode_create_dumb(9) from the Kernel API Manual β this is the struct for creating a KMS dumb buffer for scanout. It's giving "simple buffer, but make it display-ready," no cap. π
β¨
πΈ SYNOPSIS πΈ
struct drm_mode_create_dumb {
__u32 height;
__u32 width;
__u32 bpp;
__u32 flags;
__u32 handle;
__u32 pitch;
__u64 size;
};
π«Ά Members π«Ά
heightβ buffer height in pixels.widthβ buffer width in pixels.bppβ color mode.flagsβ must be zero. Literally zero, bestie. π¨handleβ buffer object handle.pitchβ number of bytes between two consecutive lines.sizeβ size of the whole buffer in bytes.
π DESCRIPTION π
User-space fills height, width, bpp and flags. If the IOCTL succeeds, the kernel fills handle, pitch and size. That's the whole trade, iykyk. π«Ά
The value of bpp is a color-mode number describing a specific format or a variant thereof. The value often corresponds to the number of bits per pixel for most modes β although, yes, there are exceptions. Each color mode maps to a DRM format plus a number of modes with similar pixel layout. Framebuffer layout is always linear. π
Support for all modes and formats is optional. Even if dumb-buffer creation with a certain color mode succeeds, it is not guaranteed that the DRM driver supports any of the related formats. Most drivers support a color mode of 32 with a format of DRM_FORMAT_XRGB8888 on their primary plane. β¨
Here's the color-mode tea, fr fr: π
- Color mode
32β framebuffer format:DRM_FORMAT_XRGB8888; compatible formats:DRM_FORMAT_BGRX8888,DRM_FORMAT_RGBX8888,DRM_FORMAT_XBGR8888. - Color mode
24β framebuffer format:DRM_FORMAT_RGB888; compatible formats:DRM_FORMAT_BGR888. - Color mode
16β framebuffer format:DRM_FORMAT_RGB565; compatible formats:DRM_FORMAT_BGR565. - Color mode
15β framebuffer format:DRM_FORMAT_XRGB1555; compatible formats:DRM_FORMAT_BGRX1555,DRM_FORMAT_RGBX1555,DRM_FORMAT_XBGR1555. - Color mode
8β framebuffer format:DRM_FORMAT_C8; compatible formats:DRM_FORMAT_D8,DRM_FORMAT_R8. - Color mode
4β framebuffer format:DRM_FORMAT_C4; compatible formats:DRM_FORMAT_D4,DRM_FORMAT_R4. - Color mode
2β framebuffer format:DRM_FORMAT_C2; compatible formats:DRM_FORMAT_D2,DRM_FORMAT_R2. - Color mode
1β framebuffer format:DRM_FORMAT_C1; compatible formats:DRM_FORMAT_D1,DRM_FORMAT_R1.
β οΈ Color modes of10,12,15,30and64are only supported for use by legacy user space. Please don't use them in new code. Other modes are not support. π
π¨ Do not attempt to allocate anything but linear framebuffer memory with single-plane RGB data. Allocation of other framebuffer layouts requires dedicated ioctls in the respective DRM driver. That part is not a vibe-check situation, it's a hard boundary. π
π₯ SEE ALSO π₯
- Kernel file
./include/uapi/drm/drm_mode.hoverview(9) struct drm_mode_modeinfo(9)struct drm_mode_get_plane(9)struct drm_mode_get_connector(9)struct drm_mode_property_enum(9)struct drm_mode_get_property(9)struct drm_mode_fb_cmd2(9)enum drm_colorop_type(9)enum drm_colorop_lut3d_interpolation_type(9)enum drm_colorop_lut1d_interpolation_type(9)struct drm_plane_size_hint(9)struct hdr_metadata_infoframe(9)struct hdr_output_metadata(9)DRM_MODE_PAGE_FLIP_EVENT(9)DRM_MODE_PAGE_FLIP_ASYNC(9)DRM_MODE_PAGE_FLIP_FLAGS(9)DRM_MODE_ATOMIC_TEST_ONLY(9)DRM_MODE_ATOMIC_NONBLOCK(9)DRM_MODE_ATOMIC_ALLOW_MODESET(9)DRM_MODE_ATOMIC_FLAGS(9)struct drm_mode_create_blob(9)struct drm_mode_destroy_blob(9)struct drm_mode_create_lease(9)struct drm_mode_list_lessees(9)struct drm_mode_get_lease(9)struct drm_mode_revoke_lease(9)struct drm_mode_rect(9)struct drm_mode_closefb(9)
Sign-off tea β: this page comes from ./include/uapi/drm, dated October 2026, and its manual identity is struct drm_mode_create_dumb(9). Slay, go make that dumb buffer. π
π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms