接前一篇文章:KWin、libdrm、DRM从上到下全过程 —— drmModeAddFBxxx(32)
上一回了开始对于drm_gem_handle_create_tail函数的解析,对于函数的注释和第一段代码进行了讲解,本回开始对于drm_gem_handle_create_tail函数的核心功能代码进行解析。为了便于理解,再次贴出drm_gem_handle_create_tail函数的源码,在drivers/gpu/drm/drm_gem.c中,如下:
/*** drm_gem_handle_create_tail - internal functions to create a handle* @file_priv: drm file-private structure to register the handle for* @obj: object to register* @handlep: pointer to return the created handle to the caller** This expects the &drm_device.object_name_lock to be held already and will* drop it before returning. Used to avoid races in establishing new handles* wh