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

2023-12-23 10:47:13

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

上一回解析了drm_gem_open函数的上游函数drm_file_alloc函数。本回正式开始对于drm_gem_open函数进行解析。为了便于理解,再次贴出drm_file_alloc函数和drm_gem_open函数源码。

  • drm_file_alloc函数

drm_file_alloc函数在drivers/gpu/drm/drm_file.c中,代码如下:

/**
 * drm_file_alloc - allocate file context
 * @minor: minor to allocate on
 *
 * This allocates a new DRM file context. It is not linked into any context and
 * can be used by the caller freely. Note that the context keeps a pointer to
 * @minor, so it must be freed before @minor is.
 *
 * RETURNS:
 * Pointer to newly allocated context, ERR_PTR on failure.
 */
struct drm_file *drm_file_alloc(struct drm_minor *minor)
{
	struct drm_device *dev = minor->dev;
	struct drm_file *fi

文章来源:https://blog.csdn.net/phmatthaus/article/details/135159456
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。