video: tegra: nvmap: support to findout if client is kernel client
Krishna Reddy [Thu, 5 Sep 2013 18:44:04 +0000 (11:44 -0700)]
add support to find out if client is kernel client.

Change-Id: Ibc6926583f9ffa24d81c8175141b2d4d758c054a
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/271082

drivers/video/tegra/nvmap/nvmap_dev.c
drivers/video/tegra/nvmap/nvmap_priv.h

index 4237574..22e1964 100644 (file)
@@ -541,6 +541,7 @@ struct nvmap_client *nvmap_create_client(struct nvmap_device *dev,
 
        client->name = name;
        client->super = true;
+       client->kernel_client = true;
        client->handle_refs = RB_ROOT;
 
        atomic_set(&client->iovm_commit, 0);
@@ -678,6 +679,7 @@ static int nvmap_open(struct inode *inode, struct file *filp)
                return -ENOMEM;
        trace_nvmap_open(priv, priv->name);
 
+       priv->kernel_client = false;
        priv->super = (filp->f_op == &nvmap_super_fops);
 
        filp->f_mapping->backing_dev_info = &nvmap_bdi;
index 8cd4174..edae624 100644 (file)
@@ -187,6 +187,7 @@ struct nvmap_client {
        size_t                          iovm_limit;
        struct mutex                    ref_lock;
        bool                            super;
+       bool                            kernel_client;
        atomic_t                        count;
        struct task_struct              *task;
        struct list_head                list;