原博客地址如下:https://blog.csdn.net/hexiaolong2009/article/details/105180621
在驱动例程的示例4当中,有一个函数drm_fb_cma_creat找不到,如下:
static const struct drm_mode_config_funcs vkms_mode_funcs = {
.fb_create = drm_fb_cma_create,
};
上网搜了一下,发现这个东西:
发现rockchip里有类似的定义,于是开始翻源码,发现:
static const struct drm_mode_config_funcs rockchip_drm_mode_config_funcs = {
.fb_create = rockchip_fb_create,
.output_poll_changed = drm_fb_helper_output_poll_changed,
.atomic_check = drm_atomic_helper_check,
.atomic_commit = drm_atomic_helper_commit,
};
继续翻,找rockchip_fb_creat函数的定义,找到
static struct drm_framebuffer *
rockchip_fb_create(struct drm_device *dev, struct drm_file *file,
const struct drm_mode_fb_cmd2 *mode_cmd)
最后在drm_gem_framebuffer_helper.h找到一个函数drm_gem_fb_create(),定义如下:
struct drm_framebuffer *
drm_gem_fb_create(struct drm_device *dev, struct drm_file *file,
const struct drm_mode_fb_cmd2 *mode_cmd);
和drm_fb_cma_creat函数一致,可能是函数的名字改了,换成这个函数就可以编译了