Skip to main content

Module drm_scanout

Module drm_scanout 

Source
Expand description

Reading back what a CRTC shows: the pixels of the framebuffer it scans out. An addition, for the verification of the DRM output on a virtual card (docs/porting/linux-framebuffer-platform.md, section 10): the smoke example and the ControlCatalog compare and save the frame the card shows, not the frame the renderer believes it drew.

The framebuffer of the CRTC is found with DRM_IOCTL_MODE_GETFB, which hands the caller a handle of its buffer object (the caller must be the master of the card or have CAP_SYS_ADMIN); the buffer is mapped with DRM_IOCTL_MODE_MAP_DUMB, which works for a buffer object a driver keeps in memory the processor can map: the dumb buffers that Mesa’s software path on a virtual card (vkms) renders into. A buffer in the memory of a GPU is not readable this way.

Structs§

DrmScanout
The pixels a CRTC shows: rows of pitch bytes, bits_per_pixel per pixel (32 for the XRGB8888 of the DRM output: blue, green, red and an unused byte in memory order).
drm_gem_close
struct drm_gem_close of the kernel.
drm_mode_crtc
struct drm_mode_crtc of the kernel (drm_mode.h).
drm_mode_fb_cmd
struct drm_mode_fb_cmd of the kernel.
drm_mode_map_dumb
struct drm_mode_map_dumb of the kernel.
drm_version
struct drm_version of the kernel: the driver of a card.

Constants§

DRM_IOCTL_GEM_CLOSE
DRM_IOCTL_MODE_GETCRTC
DRM_IOCTL_MODE_GETFB
DRM_IOCTL_MODE_MAP_DUMB
DRM_IOCTL_VERSION

Functions§

driver_name
The name of the driver of the card fd (vkms for the virtual KMS driver), so that a test refuses a card that is not the one it expects before it sets a mode on it.
read_scanout
Reads the framebuffer the CRTC crtc_id of the card fd scans out.