aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLajos Molnar <molnar@ti.com>2010-07-14 16:02:21 -0400
committerPaolo Pisati <paolo.pisati@canonical.com>2012-08-17 04:19:01 -0400
commit2be83b8ffaa5c54789ea209789fc55ad4583ea0c (patch)
tree7ae18f063a677c4e7c27ab685fe57cb2b0e8f740
parent083b4da425fb5cb1f153da396b9e72f6cbd6276e (diff)
TILER: Added tilview_create to create views from a pointer.
This circumvents the idea of tilview, but is needed and omap_vout and dss2 cannot currently share a tilview object. Once 2D areas areas are integrated into dss2, this method can be removed. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
-rw-r--r--arch/arm/mach-omap2/include/mach/tiler.h14
-rw-r--r--drivers/media/video/tiler/tiler-geom.c13
2 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/include/mach/tiler.h b/arch/arm/mach-omap2/include/mach/tiler.h
index 175b8ffac85..a598fe51ffd 100644
--- a/arch/arm/mach-omap2/include/mach/tiler.h
+++ b/arch/arm/mach-omap2/include/mach/tiler.h
@@ -268,6 +268,20 @@ s32 tiler_reservex_nv12(u32 n, u32 width, u32 height, u32 align, u32 offs,
268 u32 gid, pid_t pid); 268 u32 gid, pid_t pid);
269 269
270/** 270/**
271 * Create a view based on a tiler address and width and height
272 *
273 * This method should only be used as a last resort, if tilview object cannot
274 * be passed because of incoherence with other view 2D objects that must be
275 * supported.
276 *
277 * @param view Pointer to a view where the information will be stored
278 * @param ssptr MUST BE a tiler address
279 * @param width view width
280 * @param height view height
281 */
282void tilview_create(struct tiler_view_t *view, u32 phys, u32 width, u32 height);
283
284/**
271 * Obtains the view information for a tiler block 285 * Obtains the view information for a tiler block
272 * 286 *
273 * @param view Pointer to a view where the information will be stored 287 * @param view Pointer to a view where the information will be stored
diff --git a/drivers/media/video/tiler/tiler-geom.c b/drivers/media/video/tiler/tiler-geom.c
index ca9dd735e16..a988a635c0c 100644
--- a/drivers/media/video/tiler/tiler-geom.c
+++ b/drivers/media/video/tiler/tiler-geom.c
@@ -186,6 +186,19 @@ static u32 tiler_get_address(u32 orient, enum tiler_fmt fmt, u32 x, u32 y)
186 return TIL_ADDR((tmp << alignment), orient, fmt); 186 return TIL_ADDR((tmp << alignment), orient, fmt);
187} 187}
188 188
189void tilview_create(struct tiler_view_t *view, u32 phys, u32 width, u32 height)
190{
191 BUG_ON(!is_tiler_addr(phys));
192
193 view->tsptr = phys & ~MASK_VIEW;
194 view->bpp = geom[TILER_FMT(phys)].bpp_m;
195 view->width = width;
196 view->height = height;
197 view->h_inc = view->bpp;
198 view->v_inc = tiler_stride(view->tsptr);
199}
200EXPORT_SYMBOL(tilview_create);
201
189void tilview_get(struct tiler_view_t *view, struct tiler_block_t *blk) 202void tilview_get(struct tiler_view_t *view, struct tiler_block_t *blk)
190{ 203{
191 view->tsptr = blk->phys & ~MASK_VIEW; 204 view->tsptr = blk->phys & ~MASK_VIEW;