Lines Matching full:fb

45 /* per-plane info for the fb: */
61 static int omap_framebuffer_dirty(struct drm_framebuffer *fb, in omap_framebuffer_dirty() argument
69 drm_modeset_lock_all(fb->dev); in omap_framebuffer_dirty()
71 drm_for_each_crtc(crtc, fb->dev) in omap_framebuffer_dirty()
74 drm_modeset_unlock_all(fb->dev); in omap_framebuffer_dirty()
85 static u32 get_linear_addr(struct drm_framebuffer *fb, in get_linear_addr() argument
88 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); in get_linear_addr()
92 offset = fb->offsets[n] in get_linear_addr()
94 + (y * fb->pitches[n] / (n == 0 ? 1 : format->vsub)); in get_linear_addr()
99 bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb) in omap_framebuffer_supports_rotation() argument
101 return omap_gem_flags(fb->obj[0]) & OMAP_BO_TILED_MASK; in omap_framebuffer_supports_rotation()
134 /* update ovl info for scanout, handles cases of multi-planar fb's, etc.
136 void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, in omap_framebuffer_update_scanout() argument
141 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); in omap_framebuffer_update_scanout()
145 info->fourcc = fb->format->format; in omap_framebuffer_update_scanout()
161 if (omap_gem_flags(fb->obj[0]) & OMAP_BO_TILED_MASK) { in omap_framebuffer_update_scanout()
173 if (fb->format->format == DRM_FORMAT_UYVY || in omap_framebuffer_update_scanout()
174 fb->format->format == DRM_FORMAT_YUYV) { in omap_framebuffer_update_scanout()
186 omap_gem_rotated_dma_addr(fb->obj[0], orient, x, y, in omap_framebuffer_update_scanout()
191 info->screen_width = omap_gem_tiled_stride(fb->obj[0], orient); in omap_framebuffer_update_scanout()
200 dev_warn(fb->dev->dev, in omap_framebuffer_update_scanout()
201 "rotation '%d' ignored for non-tiled fb\n", in omap_framebuffer_update_scanout()
206 info->paddr = get_linear_addr(fb, format, 0, x, y); in omap_framebuffer_update_scanout()
209 info->screen_width = fb->pitches[0]; in omap_framebuffer_update_scanout()
215 if (fb->format->format == DRM_FORMAT_NV12) { in omap_framebuffer_update_scanout()
217 WARN_ON(!(omap_gem_flags(fb->obj[1]) & OMAP_BO_TILED_MASK)); in omap_framebuffer_update_scanout()
218 omap_gem_rotated_dma_addr(fb->obj[1], orient, x/2, y/2, in omap_framebuffer_update_scanout()
221 info->p_uv_addr = get_linear_addr(fb, format, 1, x, y); in omap_framebuffer_update_scanout()
233 if (fb->format->is_yuv) { in omap_framebuffer_update_scanout()
247 r_info->paddr = get_linear_addr(fb, format, 0, in omap_framebuffer_update_scanout()
249 if (fb->format->format == DRM_FORMAT_NV12) { in omap_framebuffer_update_scanout()
251 get_linear_addr(fb, format, 1, in omap_framebuffer_update_scanout()
258 int omap_framebuffer_pin(struct drm_framebuffer *fb) in omap_framebuffer_pin() argument
260 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); in omap_framebuffer_pin()
261 int ret, i, n = fb->format->num_planes; in omap_framebuffer_pin()
273 ret = omap_gem_pin(fb->obj[i], &plane->dma_addr); in omap_framebuffer_pin()
276 omap_gem_dma_sync_buffer(fb->obj[i], DMA_TO_DEVICE); in omap_framebuffer_pin()
288 omap_gem_unpin(fb->obj[i]); in omap_framebuffer_pin()
298 void omap_framebuffer_unpin(struct drm_framebuffer *fb) in omap_framebuffer_unpin() argument
300 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); in omap_framebuffer_unpin()
301 int i, n = fb->format->num_planes; in omap_framebuffer_unpin()
314 omap_gem_unpin(fb->obj[i]); in omap_framebuffer_unpin()
322 void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m) in omap_framebuffer_describe() argument
324 int i, n = fb->format->num_planes; in omap_framebuffer_describe()
326 seq_printf(m, "fb: %dx%d@%4.4s\n", fb->width, fb->height, in omap_framebuffer_describe()
327 (char *)&fb->format->format); in omap_framebuffer_describe()
331 i, fb->offsets[n], fb->pitches[i]); in omap_framebuffer_describe()
332 omap_gem_describe(fb->obj[i], m); in omap_framebuffer_describe()
344 struct drm_framebuffer *fb; in omap_framebuffer_create() local
350 fb = ERR_PTR(-ENOENT); in omap_framebuffer_create()
355 fb = omap_framebuffer_init(dev, mode_cmd, bos); in omap_framebuffer_create()
356 if (IS_ERR(fb)) in omap_framebuffer_create()
359 return fb; in omap_framebuffer_create()
365 return fb; in omap_framebuffer_create()
373 struct drm_framebuffer *fb = NULL; in omap_framebuffer_init() local
401 fb = &omap_fb->base; in omap_framebuffer_init()
439 fb->obj[i] = bos[i]; in omap_framebuffer_init()
443 drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd); in omap_framebuffer_init()
445 ret = drm_framebuffer_init(dev, fb, &omap_framebuffer_funcs); in omap_framebuffer_init()
451 DBG("create: FB ID: %d (%p)", fb->base.id, fb); in omap_framebuffer_init()
453 return fb; in omap_framebuffer_init()