Lines Matching full:fb
16 static void komeda_fb_destroy(struct drm_framebuffer *fb) in komeda_fb_destroy() argument
18 struct komeda_fb *kfb = to_kfb(fb); in komeda_fb_destroy()
21 for (i = 0; i < fb->format->num_planes; i++) in komeda_fb_destroy()
22 drm_gem_object_put(fb->obj[i]); in komeda_fb_destroy()
24 drm_framebuffer_cleanup(fb); in komeda_fb_destroy()
28 static int komeda_fb_create_handle(struct drm_framebuffer *fb, in komeda_fb_create_handle() argument
31 return drm_gem_handle_create(file, fb->obj[0], handle); in komeda_fb_create_handle()
43 struct drm_framebuffer *fb = &kfb->base; in komeda_fb_afbc_size_check() local
44 const struct drm_format_info *info = fb->format; in komeda_fb_afbc_size_check()
55 switch (fb->modifier & AFBC_FORMAT_MOD_BLOCK_SIZE_MASK) { in komeda_fb_afbc_size_check()
66 fb->modifier & AFBC_FORMAT_MOD_BLOCK_SIZE_MASK); in komeda_fb_afbc_size_check()
71 if (fb->modifier & AFBC_FORMAT_MOD_TILED) { in komeda_fb_afbc_size_check()
79 kfb->aligned_w = ALIGN(fb->width, alignment_w); in komeda_fb_afbc_size_check()
80 kfb->aligned_h = ALIGN(fb->height, alignment_h); in komeda_fb_afbc_size_check()
82 if (fb->offsets[0] % alignment_header) { in komeda_fb_afbc_size_check()
91 bpp = komeda_get_afbc_format_bpp(info, fb->modifier); in komeda_fb_afbc_size_check()
95 min_size = kfb->afbc_size + fb->offsets[0]; in komeda_fb_afbc_size_check()
102 fb->obj[0] = obj; in komeda_fb_afbc_size_check()
115 struct drm_framebuffer *fb = &kfb->base; in komeda_fb_none_afbc_size_check() local
116 const struct drm_format_info *info = fb->format; in komeda_fb_none_afbc_size_check()
121 if (komeda_fb_check_src_coords(kfb, 0, 0, fb->width, fb->height)) in komeda_fb_none_afbc_size_check()
130 fb->obj[i] = obj; in komeda_fb_none_afbc_size_check()
133 if ((fb->pitches[i] * block_h) % mdev->chip.bus_width) { in komeda_fb_none_afbc_size_check()
135 i, fb->pitches[i], mdev->chip.bus_width); in komeda_fb_none_afbc_size_check()
139 min_size = komeda_fb_get_pixel_addr(kfb, 0, fb->height, i) in komeda_fb_none_afbc_size_check()
142 DRM_DEBUG_KMS("The fb->obj[%d] size: 0x%zx lower than the minimum requirement: 0x%llx.\n", in komeda_fb_none_afbc_size_check()
148 if (fb->format->num_planes == 3) { in komeda_fb_none_afbc_size_check()
149 if (fb->pitches[1] != fb->pitches[2]) { in komeda_fb_none_afbc_size_check()
191 DRM_DEBUG_KMS("failed to initialize fb\n"); in komeda_fb_create()
211 const struct drm_framebuffer *fb = &kfb->base; in komeda_fb_check_src_coords() local
212 const struct drm_format_info *info = fb->format; in komeda_fb_check_src_coords()
213 u32 block_w = drm_format_info_block_width(fb->format, 0); in komeda_fb_check_src_coords()
214 u32 block_h = drm_format_info_block_height(fb->format, 0); in komeda_fb_check_src_coords()
216 if ((src_x + src_w > fb->width) || (src_y + src_h > fb->height)) { in komeda_fb_check_src_coords()
241 struct drm_framebuffer *fb = &kfb->base; in komeda_fb_get_pixel_addr() local
245 if (plane >= fb->format->num_planes) { in komeda_fb_get_pixel_addr()
250 obj = drm_fb_dma_get_gem_obj(fb, plane); in komeda_fb_get_pixel_addr()
252 offset = fb->offsets[plane]; in komeda_fb_get_pixel_addr()
253 if (!fb->modifier) { in komeda_fb_get_pixel_addr()
254 block_w = drm_format_info_block_width(fb->format, plane); in komeda_fb_get_pixel_addr()
255 block_sz = fb->format->char_per_block[plane]; in komeda_fb_get_pixel_addr()
256 plane_x = x / (plane ? fb->format->hsub : 1); in komeda_fb_get_pixel_addr()
257 plane_y = y / (plane ? fb->format->vsub : 1); in komeda_fb_get_pixel_addr()
260 + plane_y * fb->pitches[plane]; in komeda_fb_get_pixel_addr()
266 /* if the fb can be supported by a specific layer */
270 struct drm_framebuffer *fb = &kfb->base; in komeda_fb_is_layer_supported() local
271 struct komeda_dev *mdev = fb->dev->dev_private; in komeda_fb_is_layer_supported()
272 u32 fourcc = fb->format->format; in komeda_fb_is_layer_supported()
273 u64 modifier = fb->modifier; in komeda_fb_is_layer_supported()
279 DRM_DEBUG_ATOMIC("Layer TYPE: %d doesn't support fb FMT: %p4cc with modifier: 0x%llx.\n", in komeda_fb_is_layer_supported()