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

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

上一回讲解了drivers/gpu/drm/drm_framebuffer.c中的framebuffer_check函数中for (i = 0; i < info->num_planes; i++)中的前两个参数检查,本回按说应该继续往下讲解,但由于上一回距离再前一篇文章间隔了大半个月,惯性被打断了,因此在衔接上出现了点问题,漏讲了for循环中的第4个赋值语句,本回就来补讲一下这一行代码。

代码片段如下:

u64 min_pitch = drm_format_info_min_pitch(info, i, width);

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

/**
 * drm_format_info_min_pitch - computes the minimum required pitch in bytes
 * @info: pixel format info
 * @plane: plane index
 * @buffer_width: buffer width in pixels
 *
 * Returns:
 * The minimum required pitch in bytes for a buffer by taki

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