aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLajos Molnar <molnar@ti.com>2011-12-16 14:10:48 +0800
committerAndy Green <andy.green@linaro.org>2011-12-26 22:33:12 +0800
commitd9b0a2b2662f7c46f3297ffd32ca394f6de14173 (patch)
tree182c0135da1afafe401909a21e8d00b2eecf98e8
parent810ac6de7e7c20b8176780fd21153a7deac4857a (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,
res = ops->alloc(fmt, blk->width, blk->height, align, offs, blk->key,
gid, pi, &mi);
- if (mi)
+ if (mi) {
blk->phys = mi->blk.phys;
+ blk->id = mi->blk.id;
+ }
return res;
}
EXPORT_SYMBOL(tiler_allocx);
@@ -691,8 +693,10 @@ s32 tiler_mapx(struct tiler_block_t *blk, enum tiler_fmt fmt, u32 gid,
res = ops->map(fmt, blk->width, blk->height, blk->key, gid, pi, &mi,
usr_addr);
- if (mi)
+ if (mi) {
blk->phys = mi->blk.phys;
+ blk->id = mi->blk.id;
+ }
return res;
}
@@ -791,5 +795,6 @@ void tiler_free(struct tiler_block_t *blk)
struct mem_info *mi = ops->lock(blk->key, blk->id, NULL);
if (mi)
ops->unlock_free(mi, true);
+ blk->phys = blk->id = 0;
}
EXPORT_SYMBOL(tiler_free);