接前一篇文章:KWin、libdrm、DRM从上到下全过程 —— drmModeAddFBxxx(10)
上一回弄清楚了drivers/gpu/drm/drm_framebuffer.c中的framebuffer_check函数中for (i = 0; i < info->num_planes; i++)中的前三句变量赋值代码,本回继续往下进行解析。为了便于理解,再次贴出其代码:
for (i = 0; i < info->num_planes; i++) {unsigned int width = fb_plane_width(r->width, info, i);unsigned int height = fb_plane_height(r->height, info, i);unsigned int block_size = info->char_per_block[i];u64 min_pitch = drm_format_info_min_pitch(info, i, width);if (!block_size && (r->modifier[i] == DRM_FORMAT_MOD_LINEAR)) {drm_dbg_kms(dev, "Format requires non-linear modifier for plane %d\n", i);return -EINVAL;}if (!r->handles[i]) {drm_dbg_kms(