| #include "drmP.h" |
| #include "drm.h" |
| #include "drm_crtc_helper.h" |
| |
| #include "glint.h" |
| #include "glint_drv.h" |
| |
| static void glint_user_framebuffer_destroy(struct drm_framebuffer *fb) |
| { |
| drm_framebuffer_cleanup(fb); |
| } |
| |
| static int glint_user_framebuffer_create_handle(struct drm_framebuffer *fb, |
| struct drm_file *file_priv, |
| unsigned int *handle) |
| { |
| return 0; |
| } |
| |
| static const struct drm_framebuffer_funcs glint_fb_funcs = { |
| .destroy = glint_user_framebuffer_destroy, |
| .create_handle = glint_user_framebuffer_create_handle, |
| }; |
| |
| int glint_framebuffer_init(struct drm_device *dev, |
| struct glint_framebuffer *gfb, |
| struct drm_mode_fb_cmd *mode_cmd) |
| { |
| int ret = drm_framebuffer_init(dev, &gfb->base, &glint_fb_funcs); |
| if (ret) { |
| GLINT_ERROR("drm_framebuffer_init failed: %d\n", ret); |
| return ret; |
| } |
| drm_helper_mode_fill_fb_struct(&gfb->base, mode_cmd); |
| |
| return 0; |
| } |