Lines Matching refs:fb

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