Lines Matching refs:fb

60 static int omap_framebuffer_dirty(struct drm_framebuffer *fb,  in omap_framebuffer_dirty()  argument
68 drm_modeset_lock_all(fb->dev); in omap_framebuffer_dirty()
70 drm_for_each_crtc(crtc, fb->dev) in omap_framebuffer_dirty()
73 drm_modeset_unlock_all(fb->dev); in omap_framebuffer_dirty()
84 static u32 get_linear_addr(struct drm_framebuffer *fb, in get_linear_addr() argument
87 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); in get_linear_addr()
91 offset = fb->offsets[n] in get_linear_addr()
93 + (y * fb->pitches[n] / (n == 0 ? 1 : format->vsub)); in get_linear_addr()
98 bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb) in omap_framebuffer_supports_rotation() argument
100 return omap_gem_flags(fb->obj[0]) & OMAP_BO_TILED_MASK; in omap_framebuffer_supports_rotation()
135 void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, in omap_framebuffer_update_scanout() argument
140 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); in omap_framebuffer_update_scanout()
144 info->fourcc = fb->format->format; in omap_framebuffer_update_scanout()
160 if (omap_gem_flags(fb->obj[0]) & OMAP_BO_TILED_MASK) { in omap_framebuffer_update_scanout()
172 if (fb->format->format == DRM_FORMAT_UYVY || in omap_framebuffer_update_scanout()
173 fb->format->format == DRM_FORMAT_YUYV) { in omap_framebuffer_update_scanout()
185 omap_gem_rotated_dma_addr(fb->obj[0], orient, x, y, in omap_framebuffer_update_scanout()
190 info->screen_width = omap_gem_tiled_stride(fb->obj[0], orient); in omap_framebuffer_update_scanout()
199 dev_warn(fb->dev->dev, in omap_framebuffer_update_scanout()
205 info->paddr = get_linear_addr(fb, format, 0, x, y); in omap_framebuffer_update_scanout()
208 info->screen_width = fb->pitches[0]; in omap_framebuffer_update_scanout()
214 if (fb->format->format == DRM_FORMAT_NV12) { in omap_framebuffer_update_scanout()
216 WARN_ON(!(omap_gem_flags(fb->obj[1]) & OMAP_BO_TILED_MASK)); in omap_framebuffer_update_scanout()
217 omap_gem_rotated_dma_addr(fb->obj[1], orient, x/2, y/2, in omap_framebuffer_update_scanout()
220 info->p_uv_addr = get_linear_addr(fb, format, 1, x, y); in omap_framebuffer_update_scanout()
232 if (fb->format->is_yuv) { in omap_framebuffer_update_scanout()
246 r_info->paddr = get_linear_addr(fb, format, 0, in omap_framebuffer_update_scanout()
248 if (fb->format->format == DRM_FORMAT_NV12) { in omap_framebuffer_update_scanout()
250 get_linear_addr(fb, format, 1, in omap_framebuffer_update_scanout()
257 int omap_framebuffer_pin(struct drm_framebuffer *fb) in omap_framebuffer_pin() argument
259 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); in omap_framebuffer_pin()
260 int ret, i, n = fb->format->num_planes; in omap_framebuffer_pin()
272 ret = omap_gem_pin(fb->obj[i], &plane->dma_addr); in omap_framebuffer_pin()
275 omap_gem_dma_sync_buffer(fb->obj[i], DMA_TO_DEVICE); in omap_framebuffer_pin()
287 omap_gem_unpin(fb->obj[i]); in omap_framebuffer_pin()
297 void omap_framebuffer_unpin(struct drm_framebuffer *fb) in omap_framebuffer_unpin() argument
299 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); in omap_framebuffer_unpin()
300 int i, n = fb->format->num_planes; in omap_framebuffer_unpin()
313 omap_gem_unpin(fb->obj[i]); in omap_framebuffer_unpin()
321 void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m) in omap_framebuffer_describe() argument
323 int i, n = fb->format->num_planes; in omap_framebuffer_describe()
325 seq_printf(m, "fb: %dx%d@%4.4s\n", fb->width, fb->height, in omap_framebuffer_describe()
326 (char *)&fb->format->format); in omap_framebuffer_describe()
330 i, fb->offsets[n], fb->pitches[i]); in omap_framebuffer_describe()
331 omap_gem_describe(fb->obj[i], m); in omap_framebuffer_describe()
343 struct drm_framebuffer *fb; in omap_framebuffer_create() local
349 fb = ERR_PTR(-ENOENT); in omap_framebuffer_create()
354 fb = omap_framebuffer_init(dev, mode_cmd, bos); in omap_framebuffer_create()
355 if (IS_ERR(fb)) in omap_framebuffer_create()
358 return fb; in omap_framebuffer_create()
364 return fb; in omap_framebuffer_create()
372 struct drm_framebuffer *fb = NULL; in omap_framebuffer_init() local
400 fb = &omap_fb->base; in omap_framebuffer_init()
438 fb->obj[i] = bos[i]; in omap_framebuffer_init()
442 drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd); in omap_framebuffer_init()
444 ret = drm_framebuffer_init(dev, fb, &omap_framebuffer_funcs); in omap_framebuffer_init()
450 DBG("create: FB ID: %d (%p)", fb->base.id, fb); in omap_framebuffer_init()
452 return fb; in omap_framebuffer_init()