Lines Matching full:fb
43 * @fb: Framebuffer
53 struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb, in drm_gem_fb_get_obj() argument
56 struct drm_device *dev = fb->dev; in drm_gem_fb_get_obj()
58 if (drm_WARN_ON_ONCE(dev, plane >= ARRAY_SIZE(fb->obj))) in drm_gem_fb_get_obj()
60 else if (drm_WARN_ON_ONCE(dev, !fb->obj[plane])) in drm_gem_fb_get_obj()
63 return fb->obj[plane]; in drm_gem_fb_get_obj()
69 struct drm_framebuffer *fb, in drm_gem_fb_init() argument
77 drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd); in drm_gem_fb_init()
80 fb->obj[i] = obj[i]; in drm_gem_fb_init()
82 ret = drm_framebuffer_init(dev, fb, funcs); in drm_gem_fb_init()
91 * @fb: Framebuffer
97 void drm_gem_fb_destroy(struct drm_framebuffer *fb) in drm_gem_fb_destroy() argument
101 for (i = 0; i < fb->format->num_planes; i++) in drm_gem_fb_destroy()
102 drm_gem_object_put(fb->obj[i]); in drm_gem_fb_destroy()
104 drm_framebuffer_cleanup(fb); in drm_gem_fb_destroy()
105 kfree(fb); in drm_gem_fb_destroy()
111 * @fb: Framebuffer
122 int drm_gem_fb_create_handle(struct drm_framebuffer *fb, struct drm_file *file, in drm_gem_fb_create_handle() argument
125 return drm_gem_handle_create(file, fb->obj[0], handle); in drm_gem_fb_create_handle()
136 * @fb: framebuffer object
152 struct drm_framebuffer *fb, in drm_gem_fb_init_with_funcs() argument
164 drm_dbg_kms(dev, "Failed to get FB format info\n"); in drm_gem_fb_init_with_funcs()
202 ret = drm_gem_fb_init(dev, fb, mode_cmd, objs, i, funcs); in drm_gem_fb_init_with_funcs()
238 struct drm_framebuffer *fb; in drm_gem_fb_create_with_funcs() local
241 fb = kzalloc(sizeof(*fb), GFP_KERNEL); in drm_gem_fb_create_with_funcs()
242 if (!fb) in drm_gem_fb_create_with_funcs()
245 ret = drm_gem_fb_init_with_funcs(dev, fb, file, mode_cmd, funcs); in drm_gem_fb_create_with_funcs()
247 kfree(fb); in drm_gem_fb_create_with_funcs()
251 return fb; in drm_gem_fb_create_with_funcs()
331 * @fb: the framebuffer
345 * fb->format->num_planes elements.
352 int drm_gem_fb_vmap(struct drm_framebuffer *fb, struct iosys_map *map, in drm_gem_fb_vmap() argument
359 for (i = 0; i < fb->format->num_planes; ++i) { in drm_gem_fb_vmap()
360 obj = drm_gem_fb_get_obj(fb, i); in drm_gem_fb_vmap()
371 for (i = 0; i < fb->format->num_planes; ++i) { in drm_gem_fb_vmap()
375 iosys_map_incr(&data[i], fb->offsets[i]); in drm_gem_fb_vmap()
384 obj = drm_gem_fb_get_obj(fb, i); in drm_gem_fb_vmap()
395 * @fb: the framebuffer
402 void drm_gem_fb_vunmap(struct drm_framebuffer *fb, struct iosys_map *map) in drm_gem_fb_vunmap() argument
404 unsigned int i = fb->format->num_planes; in drm_gem_fb_vunmap()
409 obj = drm_gem_fb_get_obj(fb, i); in drm_gem_fb_vunmap()
419 static void __drm_gem_fb_end_cpu_access(struct drm_framebuffer *fb, enum dma_data_direction dir, in __drm_gem_fb_end_cpu_access() argument
428 obj = drm_gem_fb_get_obj(fb, num_planes); in __drm_gem_fb_end_cpu_access()
436 drm_err(fb->dev, "dma_buf_end_cpu_access(%u, %d) failed: %d\n", in __drm_gem_fb_end_cpu_access()
443 * @fb: the framebuffer
455 int drm_gem_fb_begin_cpu_access(struct drm_framebuffer *fb, enum dma_data_direction dir) in drm_gem_fb_begin_cpu_access() argument
462 for (i = 0; i < fb->format->num_planes; ++i) { in drm_gem_fb_begin_cpu_access()
463 obj = drm_gem_fb_get_obj(fb, i); in drm_gem_fb_begin_cpu_access()
479 __drm_gem_fb_end_cpu_access(fb, dir, i); in drm_gem_fb_begin_cpu_access()
486 * @fb: the framebuffer
495 void drm_gem_fb_end_cpu_access(struct drm_framebuffer *fb, enum dma_data_direction dir) in drm_gem_fb_end_cpu_access() argument
497 __drm_gem_fb_end_cpu_access(fb, dir, fb->format->num_planes); in drm_gem_fb_end_cpu_access()