Linux drm commit

drm_repaint_flush // https://gitlab.freedesktop.org/wayland/weston/-/blob/main/libweston/backend-drm/drm.c#L1209
  drm_repaint_flush_device
    drm_pending_state_apply
      drm_pending_state_apply_atomic
        drmModeObjectGetProperties
        drm_output_apply_state_atomic
        crtc_add_prop
        plane_add_prop
        drmModeAtomicCommit
drmModeAtomicAlloc
drmModeAtomicAddProperty
drmModeAtomicCommit
  DRM_IOCTL(fd, DRM_IOCTL_MODE_ATOMIC, &atomic) // https://gitlab.freedesktop.org/mesa/libdrm/-/blob/main/xf86drmMode.c#L1612
    DRM_IOCTL_DEF(DRM_IOCTL_MODE_ATOMIC, drm_mode_atomic_ioctl, DRM_MASTER) // https://sourcegraph.com/r/github.com/torvalds/linux/-/blob/drivers/gpu/drm/drm_ioctl.c?L701
      drm_atomic_nonblocking_commit
        drm_atomic_check_only
        config->funcs->atomic_commit
          .atomic_commit = drm_atomic_helper_commit
            commit_work
              commit_tail
                funcs->atomic_commit_tail(state)
                drm_atomic_helper_commit_tail(state)
      drm_atomic_commit
void drm_atomic_helper_commit_tail(struct drm_atomic_state *state)
{
	drm_atomic_helper_commit_modeset_disables(dev, state);

	drm_atomic_helper_commit_planes(dev, state, 0);

	drm_atomic_helper_commit_modeset_enables(dev, state);

	drm_atomic_helper_fake_vblank(state);

	drm_atomic_helper_commit_hw_done(state);

	drm_atomic_helper_wait_for_vblanks(dev, state);

	drm_atomic_helper_cleanup_planes(dev, state);
}

linux

https://sourcegraph.com/r/github.com/torvalds/linux
https://github1s.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_atomic_helper.c

libdrm

https://www.linuxfromscratch.org/blfs/view/svn/x/libdrm.html
https://dri.freedesktop.org/libdrm/
https://gitlab.freedesktop.org/mesa
https://cn.x-cmd.com/install/libdrm

weston

https://gitlab.freedesktop.org/wayland/weston
https://github1s.com/qnx/weston
https://github.dev/qnx/weston

参考链接

DRM(Direct Rendering Manager)学习简介:https://blog.csdn.net/hexiaolong2009/article/details/83720940
Linux显卡驱动,DRM Atomic接口简说:https://blog.csdn.net/xuelin273/article/details/140112368

Weston中shm window渲染显示过程分析:https://zhuanlan.zhihu.com/p/419740978

posted @ 2026-02-28 18:54  21code  阅读(2)  评论(0)    收藏  举报