]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: Remove hwctx
authorArto Merilainen <amerilainen@nvidia.com>
Thu, 23 Oct 2014 10:49:46 +0000 (13:49 +0300)
committerGerrit Code Review <gerrit2@nvidia.com>
Tue, 4 Nov 2014 08:23:17 +0000 (00:23 -0800)
hwctx does not have any active users anymore. Therefore, remove it.

Change-Id: I78491a038a7d2a7ed35b5c0f46c17fc141edde67
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
21 files changed:
drivers/video/tegra/host/bus_client.c
drivers/video/tegra/host/chip_support.h
drivers/video/tegra/host/flcn/flcn.c
drivers/video/tegra/host/flcn/flcn.h
drivers/video/tegra/host/host1x/host1x_cdma.c
drivers/video/tegra/host/host1x/host1x_channel.c
drivers/video/tegra/host/host1x/host1x_debug.c
drivers/video/tegra/host/host1x/host1x_hwctx.h [deleted file]
drivers/video/tegra/host/nvhost_cdma.c
drivers/video/tegra/host/nvhost_cdma.h
drivers/video/tegra/host/nvhost_channel.c
drivers/video/tegra/host/nvhost_channel.h
drivers/video/tegra/host/nvhost_hwctx.h [deleted file]
drivers/video/tegra/host/nvhost_intr.c
drivers/video/tegra/host/nvhost_job.c
drivers/video/tegra/host/nvhost_job.h
drivers/video/tegra/host/t124/t124.c
drivers/video/tegra/host/t124/t124.h
drivers/video/tegra/host/t210/t210.c
drivers/video/tegra/host/tsec/tsec.c
drivers/video/tegra/host/vii2c/vii2c.c

index e1249b902c1b0768f83ad993dd7c92e78f9c2de3..bf37bf2d9ab5a69e4efbbaf50a592004c8f02274 100644 (file)
@@ -51,7 +51,6 @@
 #include "nvhost_syncpt.h"
 #include "nvhost_channel.h"
 #include "nvhost_job.h"
-#include "nvhost_hwctx.h"
 #include "nvhost_sync.h"
 
 DEFINE_MUTEX(channel_lock);
@@ -173,7 +172,6 @@ int nvhost_write_module_regs(struct platform_device *ndev,
 
 struct nvhost_channel_userctx {
        struct nvhost_channel *ch;
-       struct nvhost_hwctx *hwctx;
        struct nvhost_job *job;
        u32 timeout;
        u32 priority;
@@ -205,18 +203,6 @@ static int nvhost_channelrelease(struct inode *inode, struct file *filp)
 
        nvhost_module_remove_client(priv->ch->dev, priv);
 
-       if (priv->hwctx) {
-               struct nvhost_channel *ch = priv->ch;
-               struct nvhost_hwctx *ctx = priv->hwctx;
-
-               mutex_lock(&ch->submitlock);
-               if (ch->cur_ctx == ctx)
-                       ch->cur_ctx = NULL;
-               mutex_unlock(&ch->submitlock);
-
-               priv->hwctx->h->put(priv->hwctx);
-       }
-
        if (priv->job)
                nvhost_job_put(priv->job);
 
@@ -286,16 +272,12 @@ static int __nvhost_channelopen(struct inode *inode,
        if (nvhost_module_add_client(ch->dev, priv))
                goto fail_add_client;
 
-       if (ch->ctxhandler && ch->ctxhandler->alloc) {
-               ret = nvhost_module_busy(ch->dev);
-               if (ret)
-                       goto fail_priv;
+       /* Check that the device can be powered */
+       ret = nvhost_module_busy(ch->dev);
+       if (ret)
+               goto fail_power_on;
+       nvhost_module_idle(ch->dev);
 
-               priv->hwctx = ch->ctxhandler->alloc(ch->ctxhandler, ch);
-               nvhost_module_idle(ch->dev);
-               if (!priv->hwctx)
-                       goto fail_priv;
-       }
        priv->priority = NVHOST_PRIORITY_MEDIUM;
        priv->clientid = atomic_add_return(1,
                        &nvhost_get_host(ch->dev)->clientid);
@@ -311,8 +293,8 @@ static int __nvhost_channelopen(struct inode *inode,
                priv->timeout = 0;
        mutex_unlock(&channel_lock);
        return 0;
-fail_priv:
-       nvhost_module_remove_client(ch->dev, priv);
+
+fail_power_on:
 fail_add_client:
        kfree(priv);
 fail:
@@ -400,7 +382,6 @@ static int nvhost_ioctl_channel_submit(struct nvhost_channel_userctx *ctx,
                return -EINVAL;
 
        job = nvhost_job_alloc(ctx->ch,
-                       ctx->hwctx,
                        num_cmdbufs,
                        num_relocs,
                        num_waitchks,
@@ -476,9 +457,7 @@ static int nvhost_ioctl_channel_submit(struct nvhost_channel_userctx *ctx,
        if (err)
                goto fail;
 
-       /* set valid id for hwctx_syncpt_idx if hwctx does not provide one */
-       if (!ctx->hwctx || ctx->hwctx->h->syncpt == NVSYNCPT_INVALID)
-               hwctx_syncpt_idx = 0;
+       hwctx_syncpt_idx = 0;
 
        /*
         * Go through each syncpoint from userspace. Here we:
@@ -504,10 +483,6 @@ static int nvhost_ioctl_channel_submit(struct nvhost_channel_userctx *ctx,
                /* Store */
                job->sp[i].id = sp.syncpt_id;
                job->sp[i].incrs = sp.syncpt_incrs;
-
-               /* Find hwctx syncpoint */
-               if (ctx->hwctx && (job->sp[i].id == ctx->hwctx->h->syncpt))
-                       hwctx_syncpt_idx = i;
        }
 
        /* Is hwctx_syncpt_idx valid? */
@@ -972,13 +947,10 @@ static long nvhost_channelctl(struct file *filp,
                dev_dbg(&priv->ch->dev->dev,
                        "%s: setting buffer timeout (%d ms) for userctx 0x%p\n",
                        __func__, priv->timeout, priv);
-               if (priv->hwctx)
-                       priv->hwctx->timeout_ms_max = timeout;
                break;
        }
        case NVHOST_IOCTL_CHANNEL_GET_TIMEDOUT:
-               ((struct nvhost_get_param_args *)buf)->value =
-                               priv->hwctx->has_timedout;
+               ((struct nvhost_get_param_args *)buf)->value = false;
                break;
        case NVHOST_IOCTL_CHANNEL_SET_PRIORITY:
                priv->priority =
@@ -1046,10 +1018,6 @@ static long nvhost_channelctl(struct file *filp,
                dev_dbg(&priv->ch->dev->dev,
                        "%s: setting buffer timeout (%d ms) for userctx 0x%p\n",
                        __func__, priv->timeout, priv);
-               if (priv->hwctx) {
-                       priv->hwctx->timeout_ms_max = timeout;
-                       priv->hwctx->timeout_debug_dump = timeout_debug_dump;
-               }
                break;
        }
        default:
@@ -1076,23 +1044,6 @@ static const struct file_operations nvhost_channelops = {
        .unlocked_ioctl = nvhost_channelctl
 };
 
-struct nvhost_hwctx *nvhost_channel_get_file_hwctx(int fd)
-{
-       struct nvhost_channel_userctx *userctx;
-       struct file *f = fget(fd);
-       if (!f)
-               return 0;
-
-       if (f->f_op != &nvhost_channelops) {
-               fput(f);
-               return 0;
-       }
-
-       userctx = (struct nvhost_channel_userctx *)f->private_data;
-       fput(f);
-       return userctx->hwctx;
-}
-
 static struct {
        int class_id;
        const char *dev_name;
index f327c7ed6038f3283610d646b9404e33fee2c05b..b668dcf346da2dda7ab9082c6637a67290817d52 100644 (file)
@@ -31,7 +31,6 @@ struct nvhost_intr;
 struct nvhost_syncpt;
 struct nvhost_userctx_timeout;
 struct nvhost_channel;
-struct nvhost_hwctx;
 struct nvhost_cdma;
 struct nvhost_job;
 struct push_buffer;
index 85ee713f0f884085854dba577dfcdebef7eeb8c2..41b20ec5ee5c5a2e3595bddbe4773375be6fdbb7 100644 (file)
@@ -409,22 +409,6 @@ int nvhost_vic_finalize_poweron(struct platform_device *pdev)
        return 0;
 }
 
-int nvhost_vic_prepare_poweroff(struct platform_device *dev)
-{
-       struct nvhost_device_data *pdata = nvhost_get_devdata(dev);
-       struct nvhost_channel *ch = pdata->channels[0];
-
-       nvhost_dbg_fn("");
-
-       if (ch && ch->dev) {
-               mutex_lock(&ch->submitlock);
-               ch->cur_ctx = NULL;
-               mutex_unlock(&ch->submitlock);
-       }
-
-       return 0;
-}
-
 int nvhost_vic_aggregate_constraints(struct platform_device *dev,
                                     int clk_index,
                                     unsigned long floor_rate,
index 0e7764ded63b1fec6935e5ec8d091fce254e06d9..8c887cdc3b70ad02f008261ccdb7c38ca300c1fe 100644 (file)
@@ -81,10 +81,6 @@ struct flcn {
        u32 *mapped;
 };
 
-struct nvhost_hwctx_handler *nvhost_vic03_alloc_hwctx_handler(
-               u32 syncpt, struct nvhost_channel *ch);
-
-
 int nvhost_vic_prepare_poweroff(struct platform_device *);
 int nvhost_flcn_finalize_poweron(struct platform_device *);
 int nvhost_vic_finalize_poweron(struct platform_device *);
index 902d2bb106b7434d125b297dce72abc020a6a0da..2fe7e221a76c864795bb438153ca545d0bb6f775 100644 (file)
@@ -546,10 +546,10 @@ static void cdma_timeout_handler(struct work_struct *work)
                syncpt_val = nvhost_syncpt_read_min(&dev->syncpt,
                                cdma->timeout.sp[i].id);
                dev_warn(&dev->dev->dev,
-                       "%s: timeout: %d (%s) ctx 0x%p, HW thresh %d, done %d\n",
+                       "%s: timeout: %d (%s) client %d, HW thresh %d, done %d\n",
                        __func__, cdma->timeout.sp[i].id,
                        syncpt_op().name(sp, cdma->timeout.sp[i].id),
-                       cdma->timeout.ctx, syncpt_val,
+                       cdma->timeout.clientid, syncpt_val,
                        cdma->timeout.sp[i].fence);
        }
 
index 1ef1b71b8a6e492769e79804ce21865acf47e24f..fa3838ebca1d2ef3916fb7e7726b7b4c85c92b14 100644 (file)
 #include "class_ids.h"
 #include "nvhost_acm.h"
 #include "nvhost_job.h"
-#include "nvhost_hwctx.h"
 #include <trace/events/nvhost.h>
 #include <linux/slab.h>
 #include "nvhost_sync.h"
 
-#include "nvhost_hwctx.h"
 #include "nvhost_intr.h"
 #include "class_ids.h"
 #include "debug.h"
@@ -63,43 +61,6 @@ static void serialize(struct nvhost_job *job)
        }
 }
 
-static bool ctxsave_needed(struct nvhost_job *job, struct nvhost_hwctx *cur_ctx)
-{
-       struct nvhost_channel *ch = job->ch;
-
-       if (!cur_ctx || ch->cur_ctx == job->hwctx ||
-                       ch->cur_ctx->has_timedout ||
-                       !ch->cur_ctx->h->save_push)
-               return false;
-       else
-               return true;
-}
-
-static void submit_ctxsave(struct nvhost_job *job, struct nvhost_hwctx *cur_ctx)
-{
-       struct nvhost_master *host = nvhost_get_host(job->ch->dev);
-       struct nvhost_channel *ch = job->ch;
-       u32 syncval;
-
-       /* Is a save needed? */
-       if (!ctxsave_needed(job, cur_ctx))
-               return;
-
-       /* Adjust the syncpoint max */
-       job->sp[job->hwctx_syncpt_idx].incrs +=
-               cur_ctx->save_incrs;
-       syncval = nvhost_syncpt_incr_max(&host->syncpt,
-                       job->sp[job->hwctx_syncpt_idx].id,
-                       cur_ctx->save_incrs);
-
-       /* Send the save to channel */
-       cur_ctx->valid = true;
-       cur_ctx->h->save_push(cur_ctx, &ch->cdma);
-       nvhost_job_get_hwctx(job, cur_ctx);
-
-       trace_nvhost_channel_context_save(ch->dev->name, cur_ctx);
-}
-
 static void add_sync_waits(struct nvhost_channel *ch, int fd)
 {
        struct nvhost_master *host = nvhost_get_host(ch->dev);
@@ -154,31 +115,6 @@ static void add_sync_waits(struct nvhost_channel *ch, int fd)
        sync_fence_put(fence);
 }
 
-static void submit_ctxrestore(struct nvhost_job *job)
-{
-       struct nvhost_master *host = nvhost_get_host(job->ch->dev);
-       struct nvhost_channel *ch = job->ch;
-       u32 syncval;
-       struct nvhost_hwctx *ctx = job->hwctx;
-
-       /* First check if we have a valid context to restore */
-       if (ch->cur_ctx == job->hwctx || !job->hwctx ||
-               !job->hwctx->valid ||
-               !ctx->h->restore_push)
-               return;
-
-       /* Increment syncpt max */
-       job->sp[job->hwctx_syncpt_idx].incrs += ctx->restore_incrs;
-       syncval = nvhost_syncpt_incr_max(&host->syncpt,
-                       job->sp[job->hwctx_syncpt_idx].id,
-                       ctx->restore_incrs);
-
-       /* Send restore buffer to channel */
-       ctx->h->restore_push(ctx, &ch->cdma);
-
-       trace_nvhost_channel_context_restore(ch->dev->name, ctx);
-}
-
 static void submit_nullkickoff(struct nvhost_job *job, u32 user_syncpt_incrs)
 {
        struct nvhost_channel *ch = job->ch;
@@ -272,10 +208,6 @@ static int host1x_channel_submit(struct nvhost_job *job)
 
        memset(completed_waiters, 0, sizeof(void *) * job->num_syncpts);
 
-       /* Bail out on timed out contexts */
-       if (job->hwctx && job->hwctx->has_timedout)
-               return -ETIMEDOUT;
-
        /* Turn on the client module and host1x */
        for (i = 0; i < job->num_syncpts; ++i) {
                err = nvhost_module_busy(ch->dev);
@@ -329,10 +261,6 @@ static int host1x_channel_submit(struct nvhost_job *job)
        /* submit_ctxsave() and submit_ctxrestore() use the channel syncpt */
        user_syncpt_incrs = hwctx_sp->incrs;
 
-       submit_ctxsave(job, ch->cur_ctx);
-       submit_ctxrestore(job);
-       ch->cur_ctx = job->hwctx;
-
        /* determine fences for all syncpoints */
        for (i = 0; i < job->num_syncpts; ++i) {
                u32 incrs = (i == job->hwctx_syncpt_idx) ?
@@ -385,22 +313,6 @@ error:
        return err;
 }
 
-static inline int hwctx_handler_init(struct nvhost_channel *ch)
-{
-       int err = 0;
-
-       struct nvhost_device_data *pdata = platform_get_drvdata(ch->dev);
-       u32 syncpt = NVSYNCPT_INVALID;
-
-       if (pdata->alloc_hwctx_handler) {
-               ch->ctxhandler = pdata->alloc_hwctx_handler(syncpt, ch);
-               if (!ch->ctxhandler)
-                       err = -ENOMEM;
-       }
-
-       return err;
-}
-
 #ifdef _hw_host1x04_channel_h_
 static int t124_channel_init_gather_filter(struct nvhost_channel *ch)
 {
@@ -434,7 +346,7 @@ static int host1x_channel_init(struct nvhost_channel *ch,
 
        ch->aperture = host1x_channel_aperture(dev->aperture, ch->chid);
 
-       return hwctx_handler_init(ch);
+       return 0;
 }
 
 static const struct nvhost_channel_ops host1x_channel_ops = {
index ffb1e83d9d91641f311edaf253e552e204801a9b..9beb984c6cd2d8e4a1a3deadc5c3ecbd4d05133f 100644 (file)
@@ -79,14 +79,13 @@ static void show_channel_gathers(struct output *o, struct nvhost_cdma *cdma)
        job = list_first_entry(&cdma->sync_queue, struct nvhost_job, list);
 
        nvhost_debug_output(o, "\n%p: JOB, syncpt_id=%d, syncpt_val=%d,"
-                       " first_get=%08x, timeout=%d, ctx=%p,"
+                       " first_get=%08x, timeout=%d,"
                        " num_slots=%d, num_handles=%d\n",
                        job,
                        job->sp ? job->sp->id : -1,
                        job->sp ? job->sp->fence : -1,
                        job->first_get,
                        job->timeout,
-                       job->hwctx,
                        job->num_slots,
                        job->num_unpins);
 
diff --git a/drivers/video/tegra/host/host1x/host1x_hwctx.h b/drivers/video/tegra/host/host1x/host1x_hwctx.h
deleted file mode 100644 (file)
index 587b8f1..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * drivers/video/tegra/host/host1x/host1x_hwctx.h
- *
- * Tegra Graphics Host HOST1X Hardware Context Interface
- *
- * Copyright (c) 2012-2013, NVIDIA Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-#ifndef __NVHOST_HOST1X_HWCTX_H
-#define __NVHOST_HOST1X_HWCTX_H
-
-#include <linux/kref.h>
-#include "nvhost_hwctx.h"
-
-struct nvhost_hwctx_handler;
-struct nvhost_channel;
-struct sg_table;
-
-#define to_host1x_hwctx_handler(handler) \
-       container_of((handler), struct host1x_hwctx_handler, h)
-#define to_host1x_hwctx(h) container_of((h), struct host1x_hwctx, hwctx)
-#define host1x_hwctx_handler(_hwctx) to_host1x_hwctx_handler((_hwctx)->hwctx.h)
-
-struct host1x_hwctx {
-       struct nvhost_hwctx hwctx;
-
-       u32 restore_size;
-       u32 *cpuva;
-       dma_addr_t iova;
-       bool mem_flag;
-};
-
-struct host1x_hwctx_handler {
-       struct nvhost_hwctx_handler h;
-
-       u32 restore_size;
-       u32 restore_incrs;
-       u32 save_incrs;
-       u32 save_slots;
-       u32 save_size;
-       u32 *cpuva;
-       dma_addr_t iova;
-};
-
-#endif
index edef0108be6e64359f70ac1625f6c4b797d8aca4..8ceab10efce01e203002382530dc1ad17aa9d1e6 100644 (file)
@@ -21,7 +21,6 @@
 #include "nvhost_cdma.h"
 #include "nvhost_channel.h"
 #include "nvhost_job.h"
-#include "nvhost_hwctx.h"
 #include "dev.h"
 #include "debug.h"
 #include "chip_support.h"
@@ -134,7 +133,6 @@ static void cdma_start_timer_locked(struct nvhost_cdma *cdma,
                return;
        }
 
-       cdma->timeout.ctx = job->hwctx;
        cdma->timeout.clientid = job->clientid;
        cdma->timeout.sp = job->sp;
        cdma->timeout.num_syncpts = job->num_syncpts;
@@ -157,7 +155,6 @@ static void stop_cdma_timer_locked(struct nvhost_cdma *cdma)
        while (ret)
                ret = cancel_delayed_work_sync(&cdma->timeout.wq);
 
-       cdma->timeout.ctx = NULL;
        cdma->timeout.clientid = 0;
 }
 
@@ -357,9 +354,6 @@ out:
 
        /* roll back DMAGET and start up channel again */
        cdma_op().timeout_teardown_end(cdma, get_restart);
-
-       if (cdma->timeout.ctx)
-               cdma->timeout.ctx->has_timedout = true;
 }
 
 /**
index 49dc594f1ee5923d728bf29ec70c39a75748ab59..c7c547e8cb1841c8b3236dbcb90a6f174ad66bf4 100644 (file)
@@ -60,7 +60,6 @@ struct buffer_timeout {
        struct nvhost_job_syncpt *sp;   /* buffer syncpoint information */
        ktime_t start_ktime;            /* starting time */
        /* context timeout information */
-       struct nvhost_hwctx *ctx;
        int clientid;
        bool timeout_debug_dump;
        int num_syncpts;
index 63a42ed185b61064d4f2241670834c1a33f2e1c0..21eac9de0037e851e359ae884b6e60a6b63936c3 100644 (file)
@@ -22,7 +22,6 @@
 #include "dev.h"
 #include "nvhost_acm.h"
 #include "nvhost_job.h"
-#include "nvhost_hwctx.h"
 #include "chip_support.h"
 
 #include <trace/events/nvhost.h>
@@ -185,9 +184,6 @@ static int nvhost_channel_unmap_locked(struct nvhost_channel *ch)
 
        ch->chid = NVHOST_INVALID_CHANNEL;
        ch->dev = NULL;
-       kfree(ch->ctxhandler);
-       ch->ctxhandler = NULL;
-       ch->cur_ctx = NULL;
        ch->aperture = NULL;
        ch->refcount = 0;
        pdata->channels[ch->dev_chid] = NULL;
@@ -403,55 +399,3 @@ struct nvhost_channel *nvhost_alloc_channel_internal(int chindex,
 
        return ch;
 }
-
-static struct nvhost_hwctx *alloc_hwctx(struct nvhost_hwctx_handler *h,
-               struct nvhost_channel *ch)
-{
-       struct nvhost_hwctx *ctx;
-
-       ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
-       if (!ctx)
-               return NULL;
-
-       kref_init(&ctx->ref);
-       ctx->h = h;
-       ctx->channel = ch;
-       ctx->valid = true;
-
-       return ctx;
-}
-
-static void free_hwctx(struct kref *ref)
-{
-       struct nvhost_hwctx *ctx = container_of(ref, struct nvhost_hwctx, ref);
-
-       kfree(ctx);
-}
-
-static void get_hwctx(struct nvhost_hwctx *ctx)
-{
-       kref_get(&ctx->ref);
-}
-
-static void put_hwctx(struct nvhost_hwctx *ctx)
-{
-       kref_put(&ctx->ref, free_hwctx);
-}
-
-struct nvhost_hwctx_handler *nvhost_alloc_hwctx_handler(u32 syncpt,
-       struct nvhost_channel *ch)
-{
-       struct nvhost_hwctx_handler *p;
-
-       p = kzalloc(sizeof(*p), GFP_KERNEL);
-       if (!p)
-               return NULL;
-
-       p->syncpt = NVSYNCPT_INVALID;
-
-       p->alloc = alloc_hwctx;
-       p->get   = get_hwctx;
-       p->put   = put_hwctx;
-
-       return p;
-}
index 38a044c0f1d75bd7be550c536f71aabda0f92faf..41a937c61fa7fa6983eff0be2556943f76bdd11d 100644 (file)
@@ -34,7 +34,6 @@
 struct nvhost_master;
 struct platform_device;
 struct nvhost_channel;
-struct nvhost_hwctx;
 
 struct nvhost_channel_ops {
        const char *soc_name;
@@ -51,9 +50,7 @@ struct nvhost_channel {
        int dev_chid;
        struct mutex submitlock;
        void __iomem *aperture;
-       struct nvhost_hwctx *cur_ctx;
        struct platform_device *dev;
-       struct nvhost_hwctx_handler *ctxhandler;
        struct nvhost_cdma cdma;
 
        /* the address space block here
@@ -84,7 +81,6 @@ void nvhost_putchannel(struct nvhost_channel *ch, int cnt);
 int nvhost_channel_suspend(struct nvhost_channel *ch);
 
 int nvhost_channel_read_reg(struct nvhost_channel *channel,
-       struct nvhost_hwctx *hwctx,
        u32 offset, u32 *value);
 
 struct nvhost_channel *nvhost_alloc_channel_internal(int chindex,
@@ -92,9 +88,4 @@ struct nvhost_channel *nvhost_alloc_channel_internal(int chindex,
 
 void nvhost_channel_init_gather_filter(struct nvhost_channel *ch);
 
-struct nvhost_hwctx *nvhost_channel_get_file_hwctx(int fd);
-
-struct nvhost_hwctx_handler *nvhost_alloc_hwctx_handler(u32 syncpt,
-       struct nvhost_channel *ch);
-
 #endif
diff --git a/drivers/video/tegra/host/nvhost_hwctx.h b/drivers/video/tegra/host/nvhost_hwctx.h
deleted file mode 100644 (file)
index 5fdf241..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Tegra Graphics Host Hardware Context Interface
- *
- * Copyright (c) 2010-2014, NVIDIA Corporation.  All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __NVHOST_HWCTX_H
-#define __NVHOST_HWCTX_H
-
-#include <linux/string.h>
-#include <linux/kref.h>
-
-#include <linux/nvhost.h>
-
-struct nvhost_channel;
-struct nvhost_cdma;
-struct mem_mgr;
-struct dma_buf;
-struct nvhost_dbg_session;
-
-struct nvhost_hwctx {
-       struct kref ref;
-       struct nvhost_hwctx_handler *h;
-       struct nvhost_channel *channel;
-       bool valid;
-       bool has_timedout;
-       u32 timeout_ms_max;
-       bool timeout_debug_dump;
-
-       u32 save_incrs;
-       u32 save_slots;
-
-       u32 restore_incrs;
-       void *priv; /* chip support state */
-
-       struct list_head as_share_bound_list_node;
-       struct nvhost_as_share *as_share;
-};
-
-struct nvhost_hwctx_handler {
-       struct nvhost_hwctx * (*alloc) (struct nvhost_hwctx_handler *h,
-                       struct nvhost_channel *ch);
-       void (*get) (struct nvhost_hwctx *ctx);
-       void (*put) (struct nvhost_hwctx *ctx);
-       void (*save_push) (struct nvhost_hwctx *ctx,
-                       struct nvhost_cdma *cdma);
-       void (*restore_push) (struct nvhost_hwctx *ctx,
-                       struct nvhost_cdma *cdma);
-       u32 syncpt;
-       void *priv;
-};
-
-
-struct hwctx_reginfo {
-       unsigned int offset:12;
-       unsigned int count:16;
-       unsigned int type:2;
-        unsigned int rst_off;  //restore reg offset.
-};
-
-enum {
-       HWCTX_REGINFO_DIRECT = 0,
-       HWCTX_REGINFO_INDIRECT,
-       HWCTX_REGINFO_INDIRECT_4X
-};
-
-#define HWCTX_REGINFO(offset, count, type) {offset, count, HWCTX_REGINFO_##type, offset}
-#define HWCTX_REGINFO_RST(offset, count, type, rst) {offset, count, HWCTX_REGINFO_##type, rst}
-
-#endif
index f672bbb1a258406faed78ddd9692f917487474d5..b919dfa25682e8f3a6639b27a27f20b6c0d83657 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/gk20a.h>
 
 #include "nvhost_channel.h"
-#include "nvhost_hwctx.h"
 #include "chip_support.h"
 
 /*** Wait list management ***/
index 07b7b5531711a9c336f966a78f3105f07fcfedf5..c20f9c2cc7c56f322045d6b81616a11880363368 100644 (file)
@@ -27,7 +27,6 @@
 #include <trace/events/nvhost.h>
 #include "nvhost_channel.h"
 #include "nvhost_job.h"
-#include "nvhost_hwctx.h"
 #include "nvhost_syncpt.h"
 #include "dev.h"
 #include "chip_support.h"
@@ -93,7 +92,6 @@ static void init_fields(struct nvhost_job *job,
 }
 
 struct nvhost_job *nvhost_job_alloc(struct nvhost_channel *ch,
-               struct nvhost_hwctx *hwctx,
                int num_cmdbufs, int num_relocs, int num_waitchks,
                int num_syncpts)
 {
@@ -112,10 +110,7 @@ struct nvhost_job *nvhost_job_alloc(struct nvhost_channel *ch,
 
        kref_init(&job->ref);
        job->ch = ch;
-       job->hwctx = hwctx;
        job->size = size;
-       if (hwctx)
-               hwctx->h->get(hwctx);
 
        init_fields(job, num_cmdbufs, num_relocs, num_waitchks, num_syncpts);
 
@@ -131,10 +126,6 @@ static void job_free(struct kref *ref)
 {
        struct nvhost_job *job = container_of(ref, struct nvhost_job, ref);
 
-       if (job->hwctxref)
-               job->hwctxref->h->put(job->hwctxref);
-       if (job->hwctx)
-               job->hwctx->h->put(job->hwctx);
        if (job->error_notifier_ref)
                dma_buf_put(job->error_notifier_ref);
        if (job->size <= PAGE_SIZE)
@@ -143,17 +134,6 @@ static void job_free(struct kref *ref)
                vfree(job);
 }
 
-/* Acquire reference to a hardware context. Used for keeping saved contexts in
- * memory. */
-void nvhost_job_get_hwctx(struct nvhost_job *job, struct nvhost_hwctx *hwctx)
-{
-       if (job->hwctxref)
-               job->hwctxref->h->put(job->hwctxref);
-
-       job->hwctxref = hwctx;
-       hwctx->h->get(hwctx);
-}
-
 void nvhost_job_put(struct nvhost_job *job)
 {
        kref_put(&job->ref, job_free);
@@ -514,8 +494,6 @@ void nvhost_job_dump(struct device *dev, struct nvhost_job *job)
                job->first_get);
        dev_info(dev, "    TIMEOUT     %d\n",
                job->timeout);
-       dev_info(dev, "    CTX 0x%p\n",
-               job->hwctx);
        dev_info(dev, "    NUM_SLOTS   %d\n",
                job->num_slots);
        dev_info(dev, "    NUM_HANDLES %d\n",
index 344344bf81c29528f1cf5599daa5304855b8d160..0c091db7f1258e1c520fe5d6453db4e8aa249366 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/dma-buf.h>
 
 struct nvhost_channel;
-struct nvhost_hwctx;
 struct nvhost_waitchk;
 struct nvhost_syncpt;
 struct sg_table;
@@ -76,7 +75,6 @@ struct nvhost_job {
        struct nvhost_channel *ch;
 
        /* Hardware context valid for this client */
-       struct nvhost_hwctx *hwctx;
        int clientid;
 
        /* Gathers and their memory */
@@ -122,9 +120,6 @@ struct nvhost_job {
        int first_get;
        int num_slots;
 
-       /* Context to be freed */
-       struct nvhost_hwctx *hwctxref;
-
        /* Set to true to force an added wait-for-idle before the job */
        int serialize;
 
@@ -138,7 +133,6 @@ struct nvhost_job {
  * accomodate the submit announced in submit header.
  */
 struct nvhost_job *nvhost_job_alloc(struct nvhost_channel *ch,
-               struct nvhost_hwctx *hwctx,
                int num_cmdbufs, int num_relocs, int num_waitchks,
                int num_syncpts);
 
@@ -153,11 +147,6 @@ void nvhost_job_add_gather(struct nvhost_job *job,
  */
 void nvhost_job_get(struct nvhost_job *job);
 
-/*
- * Increment reference for a hardware context.
- */
-void nvhost_job_get_hwctx(struct nvhost_job *job, struct nvhost_hwctx *hwctx);
-
 /*
  * Decrement reference job, free if goes to zero.
  */
index ba3f1a92514ea0b2d19e76adc74c2b9bcbc3e0ad..4e443bf35c8bbe1e9aaab4b1a768cabc38c31f6c 100644 (file)
@@ -137,7 +137,6 @@ struct nvhost_device_data t124_isp_info = {
        .finalize_poweron = nvhost_isp_t124_finalize_poweron,
        .prepare_poweroff = nvhost_isp_t124_prepare_poweroff,
        .ctrl_ops         = &tegra_isp_ctrl_ops,
-       .alloc_hwctx_handler = nvhost_alloc_hwctx_handler,
        .gather_filter_enabled = true,
 };
 static struct platform_device tegra_isp01_device = {
@@ -178,7 +177,6 @@ struct nvhost_device_data t124_ispb_info = {
        .finalize_poweron = nvhost_isp_t124_finalize_poweron,
        .prepare_poweroff = nvhost_isp_t124_prepare_poweroff,
        .ctrl_ops         = &tegra_isp_ctrl_ops,
-       .alloc_hwctx_handler = nvhost_alloc_hwctx_handler,
        .gather_filter_enabled = true,
 };
 
@@ -231,7 +229,6 @@ struct nvhost_device_data t124_vi_info = {
        .finalize_poweron = nvhost_vi_finalize_poweron,
        .ctrl_ops         = &tegra_vi_ctrl_ops,
        .reset            = nvhost_vi_reset_all,
-       .alloc_hwctx_handler = nvhost_alloc_hwctx_handler,
        .gather_filter_enabled = true,
 };
 EXPORT_SYMBOL(t124_vi_info);
@@ -271,7 +268,6 @@ struct nvhost_device_data t124_vi_info = {
        .ctrl_ops         = &tegra_vi_ctrl_ops,
        .reset            = nvhost_vi_reset,
        .slave         = &tegra_vi01b_device,
-       .alloc_hwctx_handler = nvhost_alloc_hwctx_handler,
        .gather_filter_enabled = true,
 };
 EXPORT_SYMBOL(t124_vi_info);
@@ -310,7 +306,6 @@ struct nvhost_device_data t124_vib_info = {
        .ctrl_ops         = &tegra_vi_ctrl_ops,
        .master           = &tegra_vi01_device,
        .reset            = nvhost_vi_reset,
-       .alloc_hwctx_handler = nvhost_alloc_hwctx_handler,
        .gather_filter_enabled = true,
 };
 
@@ -429,7 +424,6 @@ struct nvhost_device_data t124_vic_info = {
        NVHOST_DEFAULT_CLOCKGATE_DELAY,
        .moduleid      = NVHOST_MODULE_VIC,
        .class                  = NV_GRAPHICS_VIC_CLASS_ID,
-       .alloc_hwctx_handler    = nvhost_alloc_hwctx_handler,
        .can_powergate          = true,
        .engine_can_cg          = true,
        .engine_cg_regs         = t12x_vic_gating_registers,
@@ -437,7 +431,6 @@ struct nvhost_device_data t124_vic_info = {
        .powergate_delay        = 500,
        .powergate_ids          = { TEGRA_POWERGATE_VIC, -1 },
        .finalize_poweron       = nvhost_vic_finalize_poweron,
-       .prepare_poweroff       = nvhost_vic_prepare_poweroff,
        .scaling_init           = nvhost_scale3d_init,
        .scaling_deinit         = nvhost_scale3d_deinit,
        .busy                   = nvhost_scale_notify_busy,
index 7cee92369b5338f6fd16ed736e8f20dd4429b605..529e741e93d810149a4ee3aea383d177635e2af2 100644 (file)
@@ -40,9 +40,6 @@ int nvhost_init_t124_cpuaccess_support(struct nvhost_master *,
                struct nvhost_chip_support *);
 int nvhost_init_t124_as_support(struct nvhost_chip_support *);
 
-/* these sort of stick out, per module support */
-int t124_nvhost_hwctx_handler_init(struct nvhost_channel *ch);
-
 struct gk20a;
 
 struct t124 {
index b80f5dac2bcbda59941916b58c391ba4866f7a38..2c22e8155ef1d70622a4d6b8ba60af05f84699b2 100644 (file)
@@ -95,7 +95,6 @@ struct nvhost_device_data t21_isp_info = {
        .prepare_poweroff       = nvhost_isp_t124_prepare_poweroff,
        .moduleid               = NVHOST_MODULE_ISP,
        .ctrl_ops               = &tegra_isp_ctrl_ops,
-       .alloc_hwctx_handler    = nvhost_alloc_hwctx_handler,
        .gather_filter_enabled  = true,
        .bond_out_id            = BOND_OUT_ISP,
 };
@@ -121,7 +120,6 @@ struct nvhost_device_data t21_ispb_info = {
        .finalize_poweron       = nvhost_isp_t210_finalize_poweron,
        .prepare_poweroff       = nvhost_isp_t124_prepare_poweroff,
        .ctrl_ops               = &tegra_isp_ctrl_ops,
-       .alloc_hwctx_handler    = nvhost_alloc_hwctx_handler,
        .gather_filter_enabled  = true,
        .bond_out_id            = BOND_OUT_ISP,
 };
@@ -154,7 +152,6 @@ struct nvhost_device_data t21_vi_info = {
                {"emc", 0, NVHOST_MODULE_ID_EXTERNAL_MEMORY_CONTROLLER} },
        .ctrl_ops               = &tegra_vi_ctrl_ops,
        .num_channels           = 6,
-       .alloc_hwctx_handler    = nvhost_alloc_hwctx_handler,
        .slcg_notifier_enable   = true,
        .gather_filter_enabled  = true,
        .bond_out_id            = BOND_OUT_VI,
@@ -181,7 +178,6 @@ struct nvhost_device_data t21_vib_info = {
        .moduleid               = NVHOST_MODULE_VI,
        .ctrl_ops               = &tegra_vi_ctrl_ops,
        .num_channels           = 1,
-       .alloc_hwctx_handler    = nvhost_alloc_hwctx_handler,
        .gather_filter_enabled  = true,
        .bond_out_id            = BOND_OUT_VI,
 };
@@ -217,7 +213,6 @@ struct nvhost_device_data t21_vi_info = {
        .ctrl_ops               = &tegra_vi_ctrl_ops,
        .slave                  = &tegra_vi01b_device,
        .num_channels           = 1,
-       .alloc_hwctx_handler    = nvhost_alloc_hwctx_handler,
        .gather_filter_enabled  = true,
        .bond_out_id            = BOND_OUT_VI,
 };
@@ -410,8 +405,6 @@ struct nvhost_device_data t21_vic_info = {
        .powergate_delay        = 500,
        .moduleid               = NVHOST_MODULE_VIC,
        .class                  = NV_GRAPHICS_VIC_CLASS_ID,
-       .alloc_hwctx_handler    = nvhost_alloc_hwctx_handler,
-       .prepare_poweroff       = nvhost_vic_prepare_poweroff,
        .engine_cg_regs         = t21x_vic_gating_registers,
        .engine_can_cg          = true,
        .poweron_toggle_slcg    = true,
index 46f73ac444382638285833e590f6d6adaa0c8dd3..3b31f9155d54ffdff1091f406835ba62abb2f570 100644 (file)
@@ -47,7 +47,6 @@
 #include "nvhost_cdma.h"
 #include "host1x/host1x01_hardware.h"
 #include "class_ids.h"
-#include "host1x/host1x_hwctx.h"
 #include "tsec_methods.h"
 #include "tsec_drv.h"
 
@@ -318,7 +317,7 @@ void tsec_execute_method(dma_addr_t dma_handle,
                goto exit;
        }
 
-       job = nvhost_job_alloc(channel, NULL, 0, 0, 0, syncpt_incrs);
+       job = nvhost_job_alloc(channel, 0, 0, 0, syncpt_incrs);
        if (!job) {
                err = -ENOMEM;
                goto exit;
index e8b44018852a628493b89eca6a91f24678226c81..c3901c8c7e9b9400b43fd484c05d631800dd114c 100644 (file)
@@ -39,8 +39,6 @@
 #include "nvhost_cdma.h"
 #include "host1x/host1x01_hardware.h"
 #include "class_ids.h"
-#include "host1x/host1x_hwctx.h"
-#include "class_ids.h"
 #include "nvhost_cdma.h"
 #include "t210/t210.h"