summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorG, Manjunath Kondaiah <manjugk@ti.com>2010-11-15 11:09:18 +0530
committerG, Manjunath Kondaiah <manjugk@ti.com>2010-11-15 11:09:18 +0530
commitb0839fd6c5d964838cdce7b5faa34436dbc7ac97 (patch)
tree3f81031419c777de0be78c6bcd016783876488ea
parent9856fe407105936bef024d90e11d8e5ec2426263 (diff)
parentd5c2de6f3d42b585038faf131720d93a8adbd4a7 (diff)
Merge remote branch 'tiler/for-integ' into L24.11ti-2.6.35-omap4-L24.11-p3
-rw-r--r--drivers/media/video/tiler/tiler.c19
-rw-r--r--drivers/media/video/tiler/tiler_pack.c4
2 files changed, 12 insertions, 11 deletions
diff --git a/drivers/media/video/tiler/tiler.c b/drivers/media/video/tiler/tiler.c
index cfd54a1c0f80..1c117eb04b37 100644
--- a/drivers/media/video/tiler/tiler.c
+++ b/drivers/media/video/tiler/tiler.c
@@ -572,6 +572,12 @@ static void _m_unregister_buf(struct __buf_info *_b)
kfree(_b);
}
+static int tiler_notify_event(int event, void *data)
+{
+ return blocking_notifier_call_chain(&tiler_device->notifier,
+ event, data);
+}
+
/**
* Free all info kept by a process:
*
@@ -590,6 +596,9 @@ static void _m_free_process_info(struct process_info *pi)
struct __buf_info *_b = NULL, *_b_ = NULL;
bool ai_autofreed, need2free;
+ if (!list_empty(&pi->bufs))
+ tiler_notify_event(TILER_DEVICE_CLOSE, NULL);
+
/* unregister all buffers */
list_for_each_entry_safe(_b, _b_, &pi->bufs, by_pid)
_m_unregister_buf(_b);
@@ -1401,12 +1410,6 @@ s32 tiler_reserve(u32 n, struct tiler_buf_info *b)
}
EXPORT_SYMBOL(tiler_reserve);
-static int tiler_notify_event(int event, void *data)
-{
- return blocking_notifier_call_chain(&tiler_device->notifier,
- event, data);
-}
-
int tiler_reg_notifier(struct notifier_block *nb)
{
if (!nb)
@@ -1483,10 +1486,8 @@ static s32 tiler_release(struct inode *ip, struct file *filp)
mutex_lock(&mtx);
/* free resources if last device in this process */
- if (0 == --pi->refs) {
- tiler_notify_event(TILER_DEVICE_CLOSE, NULL);
+ if (0 == --pi->refs)
_m_free_process_info(pi);
- }
mutex_unlock(&mtx);
diff --git a/drivers/media/video/tiler/tiler_pack.c b/drivers/media/video/tiler/tiler_pack.c
index e21846909bc3..14273a7726fd 100644
--- a/drivers/media/video/tiler/tiler_pack.c
+++ b/drivers/media/video/tiler/tiler_pack.c
@@ -144,7 +144,7 @@ void tiler_alloc_packed_nv12(s32 *count, u32 width, u32 height, void **y_sysptr,
void *buf[MAX_BUFS_TO_PACK];
int n_buf, buf_w[MAX_BUFS_TO_PACK];
- char packing[] = {
+ static const char packing[] = {
/* min(i), max(w), aligned, buffers to alloc */
5, 16, 0, 2,
/* buffer widths in a + b * w(y) + c * w(uv) */
@@ -215,7 +215,7 @@ void tiler_alloc_packed_nv12(s32 *count, u32 width, u32 height, void **y_sysptr,
while (i < *count) {
int n_alloc = *count - i;
- char *p = packing;
+ char *p = (char *)packing;
n_buf = 0;
/* skip packings that do not apply */