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
pitchbytes,bits_per_pixelper pixel (32 for theXRGB8888of the DRM output: blue, green, red and an unused byte in memory order). - drm_
gem_ close struct drm_gem_closeof the kernel.- drm_
mode_ crtc struct drm_mode_crtcof the kernel (drm_mode.h).- drm_
mode_ fb_ cmd struct drm_mode_fb_cmdof the kernel.- drm_
mode_ map_ dumb struct drm_mode_map_dumbof the kernel.- drm_
version struct drm_versionof 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(vkmsfor 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_idof the cardfdscans out.