接前一篇文章:KWin、libdrm、DRM从上到下全过程 —— drmModeAddFBxxx(3)
上一回讲解了drm_mode_addfb2函数中的第一步暨第一个函数drm_core_check_feature。本回继续对于drm_mode_addfb2函数往下进行解析。为了便于理解,再次贴出其代码,在drivers/gpu/drm/drm_framebuffer.c中,如下:
- /**
- * drm_mode_addfb2 - add an FB to the graphics configuration
- * @dev: drm device for the ioctl
- * @data: data pointer for the ioctl
- * @file_priv: drm file for the ioctl call
- *
- * Add a new FB to the specified CRTC, given a user request with format. This is
- * the 2nd version of the addfb ioctl, which supports multi-planar framebuffers
- * and uses fourcc codes as pixel format specifiers.
- *
- * Called by the user via ioctl.
- *
- * Returns:
- * Zero on success, negative errno on failure.
- */
- int drm_mode_addfb2(struct drm_device *dev,
- void