非Atomic的参数操作

  1. struct drm_mode_obj_set_property {
  2. __u64 value;
  3. __u32 prop_id;
  4. __u32 obj_id;
  5. __u32 obj_type;
  6. };
  7. parse_property(&prop_args[prop_count], optarg); // 获取 prop的prop_id 和 value
  8. drmModeObjectSetProperty
  9. find_object(....); // 在资源表去匹配prop_id,来 获取 obj_type 是 crtc? connector? plane
  10. DRM_IOCTL(fd, DRM_IOCTL_MODE_OBJ_SETPROPERTY, &prop);
  11. drm_mode_obj_set_property_ioctl
  12. drm_mode_object_find // 去drm_dev->mode_config 里边查找并获取 obj_id
  13. drm_mode_obj_find_prop_id // 在当前obj的属性列表中查找要选择的属性
  14. set_property_atomic // 这里使用atomic来设置属性
  15. drm_atomic_state_alloc // 分配一个新的 struct drm_atomic_state *state;
  16. drm_atomic_set_property
  17. drm_atomic_get_plane_state
  18. drm_atomic_get_existing_plane_state
  19. drm_modeset_lock
  20. plane->funcs->atomic_duplicate_state(plane);
  21. drm_atomic_plane_set_property // !!! 设置属性
  22. drm_atomic_commit
  23. drm_atomic_check_only
  24. drm_atomic_plane_check
  25. ret = config->funcs->atomic_check(state->dev, state);
  26. config->funcs->atomic_commit(state->dev, state, false); // malidp_mode_config_funcs.drm_atomic_helper_commit
  27. commit_work
  28. commit_tail(state);
  29. // mali-dp550 : drm->mode_config.helper_private = &malidp_mode_config_helpers;
  30. funcs = dev->mode_config.helper_private;
  31. funcs->atomic_commit_tail(old_state); or drm_atomic_helper_commit_tail(old_state);
  32. malidp_atomic_commit_tail
  33. drm_atomic_helper_commit_planes
  34. funcs = plane->helper_private; // malidp_de_plane_helper_funcs
  35. funcs->atomic_update(plane, old_plane_state); // !!!!!!! 总算找到了

set_property_atomic 里边的 DPMS是什么? // TBD

  1. set_property_atomic // 在 malidp_init 里边未初始化 mode_config.dpms_property ,这个好像是 控制连接器DPMS状态的默认连接器属性。
  2. // 显示器电源管理标准 (DPMS)提供显示器电源管理功能; //这里先不考虑

几个特别重要的接口:

  1. static const struct drm_mode_config_funcs malidp_mode_config_funcs = {
  2. .fb_create = malidp_fb_create,
  3. .atomic_check = drm_atomic_helper_check,
  4. .atomic_commit = drm_atomic_helper_commit,
  5. };
  6. drm->mode_config.funcs = &malidp_mode_config_funcs;
  7. drm->mode_config.helper_private = &malidp_mode_config_helpers;
  8. static const struct drm_plane_funcs malidp_de_plane_funcs = {
  9. .update_plane = drm_atomic_helper_update_plane,
  10. .disable_plane = drm_atomic_helper_disable_plane,
  11. .destroy = malidp_de_plane_destroy,
  12. .reset = malidp_plane_reset,
  13. .atomic_duplicate_state = malidp_duplicate_plane_state,
  14. .atomic_destroy_state = malidp_destroy_plane_state,
  15. .atomic_print_state = malidp_plane_atomic_print_state,
  16. .format_mod_supported = malidp_format_mod_supported_per_plane,
  17. };
  18. plane->funcs = malidp_de_plane_funcs;
  19. plane->helper_private = malidp_de_plane_helper_funcs

Atomic的代码流程