KWin、libdrm、DRM从上到下全过程 —— drmModeAddFBxxx(16)

接前一篇文章:KWin、libdrm、DRM从上到下全过程 —— drmModeAddFBxxx(15)

本回按照上回中说的,开始对于drivers/gpu/drm/i915/display/intel_fb.c中的intel_user_framebuffer_create函数进行解析。再次贴出intel_user_framebuffer_create函数源码:

struct drm_framebuffer *
intel_user_framebuffer_create(struct drm_device *dev,
			      struct drm_file *filp,
			      const struct drm_mode_fb_cmd2 *user_mode_cmd)
{
	struct drm_framebuffer *fb;
	struct drm_i915_gem_object *obj;
	struct drm_mode_fb_cmd2 mode_cmd = *user_mode_cmd;
	struct drm_i915_private *i915;
 
	obj = i915_gem_object_lookup(filp, mode_cmd.handles[0]);
	if (!obj)
		return ERR_PTR(-ENOENT);
 
	/* object is backed with LMEM for discrete */
	i915 = to_i915(obj->base.dev);
	if (HAS_LMEM(i915) && !i915_gem_object_can_migrate(obj, INTEL_REGION_LM

你可能感兴趣的:(DRM,KWin,libdrm,DRM)