DRM(5) -- FrameBuffer
Framebuffer 帧缓冲区是抽象的内存对象,提供了扫描到 CRTC 的像素源。应用程序通过 IOCTLDRM_IOCTL_MODE_ADDFB(2)来创建 framebuffer,会返回一个不透明句柄,该句柄可以传递给 KMS CRTC、来控制 plane configuration 和 page flip 功能。 framebuffer 依赖底层的内存管理器来分配内存。创建 framebuffer 时,app 需要通过struct drm_mode_fb_cmd2传入一个 memory handle。 Data structures and apis struct drm_framebuffer { struct drm_device *dev; struct list_head head; struct drm_mode_object base; const struct drm_format_info *format; const struct drm_framebuffer_funcs *funcs; unsigned int pitches[DRM_FORMAT_MAX_PLANES]; unsigned int offsets[DRM_FORMAT_MAX_PLANES]; uint64_t modifier; unsigned int width; unsigned int height; int flags; struct list_head filp_head; struct drm_gem_object *obj[DRM_FORMAT_MAX_PLANES]; }; head: fb 链表节点。...