drm_atomic_commit函数在提交state之前,会先通过drm_atomic_check_only检查state是否符合要求。如果state参数不正确,该函数会立即返回并报告错误。提交流程包括检查状态、准备更新、触发异步提交和清理资源。详细来说,如果state标记为异步更新,先调用drm_atomic_helper_prepare_planes准备更新平面,然后调用drm_atomic_...
前面讲完drm_atomic_commit函数先调用drm_atomic_check_only检查完参数的合法性;最后调用config->funcs->atomic_commit,此函数是drm驱动初始化drm_mode_config时创建的。可以由SOC厂商实现,也可以使用drm-core中的helper函数:drm_atomic_helper_commit。 为了方便我们更好的理解atomic_commit函数,先得搞清楚drm_atomic_...
运行结果:和上文的drm-planes.c 一样 1 ./drm-atomic-ctrcs 实验现象: 按下按键,屏幕显示红绿蓝三条横。 21.2.3. 实验分析 本例以DRM应用编程–drm-planes实验为框架修改部分内容所得,这里,我只分析与drm-planes有差异得地方。 drm_init 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ...
* * This hook is used by the probe helpers to filter the mode list in * drm_helper_probe_single_connector_modes(), and it is used by the * atomic helpers to validate modes supplied by userspace in * drm_atomic_helper_check_modeset(). * * This function is optional. * * NOTE: *...
将上面的 Legacy code 转换为 Atomic 版本: #include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> #include <linux/hrtimer.h> static struct drm_device drm; static struct drm_plane primary; static str...
│ ├── drm_atomic_helper.c │ ├── drm_atomic_state_helper.c │ ├── drm_atomic_uapi.c │ ├── drm_auth.c │ ├── drm_blend.c │ ├── drm_bridge.c--bridge添加、删除、附着、去附着等操作。│ ├── drm_bufs.c ...
static const struct drm_plane_helper_funcs plane_helper_funcs = { // 预先对图层进行处理 .prepare_fb = vop_plane_prepare_fb, // 图层显示完成后的处理 .cleanup_fb = vop_plane_cleanup_fb, // 在显示前进行参数检查 .atomic_check = vop_plane_atomic_check, ...
int (*mode_set_base_atomic)(struct drm_crtc *crtc, struct drm_framebuffer *fb, int x, int y, enum mode_set_atomic); //关闭crtc void (*disable)(struct drm_crtc *crtc); /*检查待更新的drm_crtc_state, * drm_atomic_helper_check() --> drm_atomic_helper_check_planes()会调用 ...
* This function uses drm_gem_plane_helper_prepare_fb() to extract the fences * from &drm_gem_object.resv and attaches them to the plane state for the atomic * helper to wait on. This is necessary to correctly implement implicit
#include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_fb_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_probe_helper.h> ...