aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLajos Molnar <molnar@ti.com>2010-07-14 16:10:38 -0400
committerPaolo Pisati <paolo.pisati@canonical.com>2012-08-17 04:19:01 -0400
commit1e9c8176b83ab3be8f9f73b3c5b4d979a11838ab (patch)
treec0fc674178f21946cea3097156dbc19d60e6e887
parent0a0cf73167664aa26a80827229d7238cf960560f (diff)
TILER: Fixed id & physical address handing of tiler_alloc/free.
id is now populated by tiler_alloc/map. This is needed for tiler_free to work. id and physical address is cleared on tiler_free. This is needed for tiler_alloc to work if called using the same tiler_block_t structure. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
-rw-r--r--drivers/media/video/tiler/tiler-iface.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/video/tiler/tiler-iface.c b/drivers/media/video/tiler/tiler-iface.c
index 55ae1d6c2ba..ff653628a28 100644
--- a/drivers/media/video/tiler/tiler-iface.c
+++ b/drivers/media/video/tiler/tiler-iface.c
@@ -662,8 +662,10 @@ s32 tiler_allocx(struct tiler_block_t *blk, enum tiler_fmt fmt,
662 662
663 res = ops->alloc(fmt, blk->width, blk->height, align, offs, blk->key, 663 res = ops->alloc(fmt, blk->width, blk->height, align, offs, blk->key,
664 gid, pi, &mi); 664 gid, pi, &mi);
665 if (mi) 665 if (mi) {
666 blk->phys = mi->blk.phys; 666 blk->phys = mi->blk.phys;
667 blk->id = mi->blk.id;
668 }
667 return res; 669 return res;
668} 670}
669EXPORT_SYMBOL(tiler_allocx); 671EXPORT_SYMBOL(tiler_allocx);
@@ -691,8 +693,10 @@ s32 tiler_mapx(struct tiler_block_t *blk, enum tiler_fmt fmt, u32 gid,
691 693
692 res = ops->map(fmt, blk->width, blk->height, blk->key, gid, pi, &mi, 694 res = ops->map(fmt, blk->width, blk->height, blk->key, gid, pi, &mi,
693 usr_addr); 695 usr_addr);
694 if (mi) 696 if (mi) {
695 blk->phys = mi->blk.phys; 697 blk->phys = mi->blk.phys;
698 blk->id = mi->blk.id;
699 }
696 return res; 700 return res;
697 701
698} 702}
@@ -791,5 +795,6 @@ void tiler_free(struct tiler_block_t *blk)
791 struct mem_info *mi = ops->lock(blk->key, blk->id, NULL); 795 struct mem_info *mi = ops->lock(blk->key, blk->id, NULL);
792 if (mi) 796 if (mi)
793 ops->unlock_free(mi, true); 797 ops->unlock_free(mi, true);
798 blk->phys = blk->id = 0;
794} 799}
795EXPORT_SYMBOL(tiler_free); 800EXPORT_SYMBOL(tiler_free);