Lines Matching full:fb
42 /* per-plane info for the fb: */
58 static int omap_framebuffer_dirty(struct drm_framebuffer *fb, in omap_framebuffer_dirty() argument
66 drm_modeset_lock_all(fb->dev); in omap_framebuffer_dirty()
68 drm_for_each_crtc(crtc, fb->dev) in omap_framebuffer_dirty()
71 drm_modeset_unlock_all(fb->dev); in omap_framebuffer_dirty()
82 static u32 get_linear_addr(struct drm_framebuffer *fb, in get_linear_addr() argument
85 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); in get_linear_addr()
89 offset = fb->offsets[n] in get_linear_addr()
91 + (y * fb->pitches[n] / (n == 0 ? 1 : format->vsub)); in get_linear_addr()
96 bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb) in omap_framebuffer_supports_rotation() argument
98 return omap_gem_flags(fb->obj[0]) & OMAP_BO_TILED_MASK; in omap_framebuffer_supports_rotation()
131 /* update ovl info for scanout, handles cases of multi-planar fb's, etc.
133 void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, in omap_framebuffer_update_scanout() argument
136 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); in omap_framebuffer_update_scanout()
140 info->fourcc = fb->format->format; in omap_framebuffer_update_scanout()
156 if (omap_gem_flags(fb->obj[0]) & OMAP_BO_TILED_MASK) { in omap_framebuffer_update_scanout()
168 if (fb->format->format == DRM_FORMAT_UYVY || in omap_framebuffer_update_scanout()
169 fb->format->format == DRM_FORMAT_YUYV) { in omap_framebuffer_update_scanout()
181 omap_gem_rotated_dma_addr(fb->obj[0], orient, x, y, in omap_framebuffer_update_scanout()
186 info->screen_width = omap_gem_tiled_stride(fb->obj[0], orient); in omap_framebuffer_update_scanout()
195 dev_warn(fb->dev->dev, in omap_framebuffer_update_scanout()
196 "rotation '%d' ignored for non-tiled fb\n", in omap_framebuffer_update_scanout()
201 info->paddr = get_linear_addr(fb, format, 0, x, y); in omap_framebuffer_update_scanout()
204 info->screen_width = fb->pitches[0]; in omap_framebuffer_update_scanout()
210 if (fb->format->format == DRM_FORMAT_NV12) { in omap_framebuffer_update_scanout()
212 WARN_ON(!(omap_gem_flags(fb->obj[1]) & OMAP_BO_TILED_MASK)); in omap_framebuffer_update_scanout()
213 omap_gem_rotated_dma_addr(fb->obj[1], orient, x/2, y/2, in omap_framebuffer_update_scanout()
216 info->p_uv_addr = get_linear_addr(fb, format, 1, x, y); in omap_framebuffer_update_scanout()
224 int omap_framebuffer_pin(struct drm_framebuffer *fb) in omap_framebuffer_pin() argument
226 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); in omap_framebuffer_pin()
227 int ret, i, n = fb->format->num_planes; in omap_framebuffer_pin()
239 ret = omap_gem_pin(fb->obj[i], &plane->dma_addr); in omap_framebuffer_pin()
242 omap_gem_dma_sync_buffer(fb->obj[i], DMA_TO_DEVICE); in omap_framebuffer_pin()
254 omap_gem_unpin(fb->obj[i]); in omap_framebuffer_pin()
264 void omap_framebuffer_unpin(struct drm_framebuffer *fb) in omap_framebuffer_unpin() argument
266 struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); in omap_framebuffer_unpin()
267 int i, n = fb->format->num_planes; in omap_framebuffer_unpin()
280 omap_gem_unpin(fb->obj[i]); in omap_framebuffer_unpin()
288 void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m) in omap_framebuffer_describe() argument
290 int i, n = fb->format->num_planes; in omap_framebuffer_describe()
292 seq_printf(m, "fb: %dx%d@%4.4s\n", fb->width, fb->height, in omap_framebuffer_describe()
293 (char *)&fb->format->format); in omap_framebuffer_describe()
297 i, fb->offsets[n], fb->pitches[i]); in omap_framebuffer_describe()
298 omap_gem_describe(fb->obj[i], m); in omap_framebuffer_describe()
310 struct drm_framebuffer *fb; in omap_framebuffer_create() local
316 fb = ERR_PTR(-ENOENT); in omap_framebuffer_create()
321 fb = omap_framebuffer_init(dev, mode_cmd, bos); in omap_framebuffer_create()
322 if (IS_ERR(fb)) in omap_framebuffer_create()
325 return fb; in omap_framebuffer_create()
331 return fb; in omap_framebuffer_create()
339 struct drm_framebuffer *fb = NULL; in omap_framebuffer_init() local
367 fb = &omap_fb->base; in omap_framebuffer_init()
405 fb->obj[i] = bos[i]; in omap_framebuffer_init()
409 drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd); in omap_framebuffer_init()
411 ret = drm_framebuffer_init(dev, fb, &omap_framebuffer_funcs); in omap_framebuffer_init()
417 DBG("create: FB ID: %d (%p)", fb->base.id, fb); in omap_framebuffer_init()
419 return fb; in omap_framebuffer_init()