]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: implement dynamic synpt
authorDeepak Nibade <dnibade@nvidia.com>
Thu, 23 Jan 2014 06:14:06 +0000 (11:44 +0530)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Fri, 14 Feb 2014 06:13:16 +0000 (22:13 -0800)
- implement dynamic syncpoint assignment framework

- provide API nvhost_get_syncpt_client_managed() to get client managed
  syncpt which is requested by display, avp, and tegra_camera drivers

- provide API nvhost_get_syncpt_host_managed() for host managed syncpts
- this API is used by host1x clients and gpu

- provide API nvhost_free_syncpt() to free a syncpt

- both client managed and host managed APIs call nvhost_get_syncpt() to
  find a free syncpt and reserve it

- remove static syncpt mappings from nvhost_device_data of all clients

- keep VBLANK syncpts hard-coded until we resolve the conflicts with
  hard coded syncpt increments from bootloader

Bug 1305024

Change-Id: I403aa3f246de190707764fcac6ae295ff5f738f0
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/360963
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/video/tegra/host/bus_client.c
drivers/video/tegra/host/gk20a/channel_gk20a.c
drivers/video/tegra/host/gk20a/channel_gk20a.h
drivers/video/tegra/host/gk20a/platform_gk20a_tegra.c
drivers/video/tegra/host/nvhost_syncpt.c
drivers/video/tegra/host/nvhost_syncpt.h
drivers/video/tegra/host/t114/t114.c
drivers/video/tegra/host/t124/t124.c
drivers/video/tegra/host/t148/t148.c
include/linux/nvhost.h

index 15c7b79c11d2daeb88562b3b69f929fed942e71b..d55ab6618675f89914bdb945e6464d1725024e58 100644 (file)
@@ -737,8 +737,11 @@ static u32 create_mask(u32 *words, int num)
 {
        int i;
        u32 word = 0;
-       for (i = 0; i < num && words[i] && words[i] < 32; i++)
+       for (i = 0; i < num; i++) {
+               if (!words[i] || words[i] > 31)
+                       continue;
                word |= BIT(words[i]);
+       }
 
        return word;
 }
@@ -815,10 +818,20 @@ static long nvhost_channelctl(struct file *filp,
                        platform_get_drvdata(priv->ch->dev);
                struct nvhost_get_param_arg *arg =
                        (struct nvhost_get_param_arg *)buf;
-               if (arg->param >= NVHOST_MODULE_MAX_SYNCPTS
-                               || !pdata->syncpts[arg->param])
+               if (arg->param >= NVHOST_MODULE_MAX_SYNCPTS)
                        return -EINVAL;
-               arg->value = pdata->syncpts[arg->param];
+               /* if we already have required syncpt then return it ... */
+               if (pdata->syncpts[arg->param]) {
+                       arg->value = pdata->syncpts[arg->param];
+                       break;
+               }
+               /* ... otherwise get a new syncpt dynamically */
+               arg->value = nvhost_get_syncpt_host_managed(pdata->pdev,
+                                                           arg->param);
+               if (!arg->value)
+                       return -EAGAIN;
+               /* ... and store it for further references */
+               pdata->syncpts[arg->param] = arg->value;
                break;
        }
        case NVHOST_IOCTL_CHANNEL_GET_WAITBASES:
index a6a3e13d531c3e05f5bcf0f8a8508d7ee5cbaddc..9ee7a97a16e0470213cdd0e9b63ad2b7a39c1ff1 100644 (file)
@@ -29,6 +29,7 @@
 #include "nvhost_as.h"
 #include "debug.h"
 #include "nvhost_sync.h"
+#include "nvhost_syncpt.h"
 
 #include "gk20a.h"
 #include "dbg_gpu_gk20a.h"
@@ -416,12 +417,11 @@ static int channel_gk20a_update_runlist(struct channel_gk20a *c, bool add)
 
 void gk20a_disable_channel_no_update(struct channel_gk20a *ch)
 {
-       struct nvhost_device_data *pdata = nvhost_get_devdata(ch->g->dev);
        struct nvhost_master *host = host_from_gk20a_channel(ch);
 
        /* ensure no fences are pending */
        nvhost_syncpt_set_min_eq_max(&host->syncpt,
-                                    ch->hw_chid + pdata->syncpt_base);
+                                    ch->syncpt_id);
 
        /* disable channel */
        gk20a_writel(ch->g, ccsr_channel_r(ch->hw_chid),
@@ -693,6 +693,10 @@ unbind:
 
        mutex_unlock(&ch->dbg_s_lock);
 
+       /* free the syncpt used for this channel */
+       nvhost_free_syncpt(ch->syncpt_id);
+       ch->syncpt_id = 0;
+
        /* ALWAYS last */
        release_used_channel(f, ch);
 }
@@ -720,6 +724,7 @@ struct nvhost_hwctx *gk20a_open_channel(struct nvhost_channel *ch,
        struct gk20a *g = get_gk20a(ch->dev);
        struct fifo_gk20a *f = &g->fifo;
        struct channel_gk20a *ch_gk20a;
+       struct nvhost_device_data *pdata = nvhost_get_devdata(g->dev);
 
        ch_gk20a = acquire_unused_channel(f);
        if (ch_gk20a == NULL) {
@@ -728,6 +733,14 @@ struct nvhost_hwctx *gk20a_open_channel(struct nvhost_channel *ch,
                return 0;
        }
 
+       /* get a free syncpt id */
+       ch_gk20a->syncpt_id = nvhost_get_syncpt_host_managed(pdata->pdev,
+                                                       ch_gk20a->hw_chid);
+       if (!ch_gk20a->syncpt_id) {
+               nvhost_err(dev_from_gk20a(g), "could not get free syncpt");
+               return 0;
+       }
+
        ctx->priv = ch_gk20a;
        ch_gk20a->g = g;
        /* note the ch here is the same for *EVERY* gk20a channel */
@@ -1152,7 +1165,6 @@ static int gk20a_alloc_channel_gpfifo(struct channel_gk20a *c,
                                      struct nvhost_alloc_gpfifo_args *args)
 {
        struct gk20a *g = c->g;
-       struct nvhost_device_data *pdata = nvhost_get_devdata(g->dev);
        struct device *d = dev_from_gk20a(g);
        struct vm_gk20a *ch_vm;
        u32 gpfifo_size;
@@ -1181,7 +1193,7 @@ static int gk20a_alloc_channel_gpfifo(struct channel_gk20a *c,
 
        c->last_submit_fence.valid        = false;
        c->last_submit_fence.syncpt_value = 0;
-       c->last_submit_fence.syncpt_id    = c->hw_chid + pdata->syncpt_base;
+       c->last_submit_fence.syncpt_id    = c->syncpt_id;
 
        c->ramfc.offset = 0;
        c->ramfc.size = ram_in_ramfc_s() / 8;
@@ -1552,7 +1564,6 @@ static int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
                                u32 flags)
 {
        struct gk20a *g = c->g;
-       struct nvhost_device_data *pdata = nvhost_get_devdata(g->dev);
        struct device *d = dev_from_gk20a(g);
        struct nvhost_syncpt *sp = syncpt_from_gk20a(g);
        u32 i, incr_id = ~0, wait_id = ~0, wait_value = 0;
@@ -1589,7 +1600,7 @@ static int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
                                           num_entries,
                                           flags,
                                           fence->syncpt_id, fence->value,
-                                          c->hw_chid + pdata->syncpt_base);
+                                          c->syncpt_id);
        check_gp_put(g, c);
        update_gp_get(g, c);
 
@@ -1733,7 +1744,7 @@ static int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
 
        if (incr_cmd) {
                int j = 0;
-               incr_id = c->hw_chid + pdata->syncpt_base;
+               incr_id = c->syncpt_id;
                fence->syncpt_id = incr_id;
                fence->value     = nvhost_syncpt_incr_max(sp, incr_id, 1);
 
@@ -1856,7 +1867,6 @@ int gk20a_init_channel_support(struct gk20a *g, u32 chid)
 int gk20a_channel_finish(struct channel_gk20a *ch, unsigned long timeout)
 {
        struct nvhost_syncpt *sp = syncpt_from_gk20a(ch->g);
-       struct nvhost_device_data *pdata = nvhost_get_devdata(ch->g->dev);
        struct nvhost_fence fence;
        int err = 0;
 
@@ -1869,7 +1879,7 @@ int gk20a_channel_finish(struct channel_gk20a *ch, unsigned long timeout)
 
        if (!(ch->last_submit_fence.valid && ch->last_submit_fence.wfi)) {
                nvhost_dbg_fn("issuing wfi, incr to finish the channel");
-               fence.syncpt_id = ch->hw_chid + pdata->syncpt_base;
+               fence.syncpt_id = ch->syncpt_id;
                err = gk20a_channel_submit_wfi_fence(ch->g, ch,
                                                     sp, &fence);
        }
@@ -2081,7 +2091,6 @@ int gk20a_channel_suspend(struct gk20a *g)
        struct nvhost_fence fence;
        struct nvhost_syncpt *sp = syncpt_from_gk20a(g);
        struct device *d = dev_from_gk20a(g);
-       struct nvhost_device_data *pdata = nvhost_get_devdata(g->dev);
        int err;
 
        nvhost_dbg_fn("");
@@ -2090,7 +2099,7 @@ int gk20a_channel_suspend(struct gk20a *g)
        for (chid = 0; chid < f->num_channels; chid++) {
                struct channel_gk20a *c = &f->channel[chid];
                if (c->in_use && c->obj_class != KEPLER_C) {
-                       fence.syncpt_id = chid + pdata->syncpt_base;
+                       fence.syncpt_id = c->syncpt_id;
                        err = gk20a_channel_submit_wfi_fence(g,
                                        c, sp, &fence);
                        if (err) {
index 262f9627b9d4e0f3b82d655410fd13dd646c0881..6d7067c9cd359c13fa8879a6e7346a81d563420c 100644 (file)
@@ -85,6 +85,8 @@ struct channel_gk20a {
        bool vpr;
        pid_t pid;
 
+       u32 syncpt_id;
+
        struct mem_mgr *memmgr;
        struct nvhost_channel *ch;
        struct nvhost_hwctx *hwctx;
index f9f0ff16c3812d65af640a3c5065c6f01089756f..c591b5d9f550421a6ddaf9ea0d91add987ba24cf 100644 (file)
@@ -136,8 +136,6 @@ static struct resource gk20a_tegra_resources[] = {
 
 struct gk20a_platform gk20a_tegra_platform = {
        .nvhost = {
-               .syncpts                = {NVSYNCPT_GK20A_BASE},
-               .syncpt_base            = NVSYNCPT_GK20A_BASE,
                .class                  = NV_GRAPHICS_GPU_CLASS_ID,
                .clocks                 = {{"PLLG_ref", UINT_MAX},
                                           {"pwr", 204000000},
index eac590404fce07caec8a6e384d84fdc326300a76..fb9aaa2bcd63ebcb6f83e2e29eadcefacf9523ec 100644 (file)
@@ -35,6 +35,8 @@
 #include "chip_support.h"
 #include "nvhost_channel.h"
 
+#include "host1x/host1x.h"
+
 #define MAX_SYNCPT_LENGTH      5
 #define NUM_SYSFS_ENTRY                4
 
@@ -557,9 +559,8 @@ struct nvhost_sync_timeline *nvhost_syncpt_timeline(struct nvhost_syncpt *sp,
 
 static const char *get_syncpt_name(struct nvhost_syncpt *sp, int id)
 {
-       struct host1x_device_info *info = &syncpt_to_dev(sp)->info;
        const char *name = NULL;
-       name = info->syncpt_names[id];
+       name = sp->syncpt_names[id];
        return name ? name : "";
 }
 
@@ -643,6 +644,168 @@ static int nvhost_syncpt_timeline_attr(struct nvhost_master *host,
        return 0;
 }
 
+/**
+ * performs a sequential search and returns first free syncpt id
+ */
+static u32 nvhost_find_free_syncpt(struct nvhost_syncpt *sp)
+{
+       u32 i;
+
+       for (i = NVHOST_FREE_SYNCPT_BASE; i < nvhost_syncpt_nb_pts(sp); ++i)
+               if (!sp->assigned[i])
+                       return i;
+
+       return 0;
+}
+
+/**
+ * marks a free syncpt id as reserved
+ */
+static int nvhost_reserve_syncpt(struct nvhost_syncpt *sp, u32 id,
+                                       bool client_managed)
+{
+       /* is it already reserved ? */
+       if (id < NVHOST_FREE_SYNCPT_BASE || sp->assigned[id])
+               return -EINVAL;
+
+       sp->assigned[id] = true;
+       sp->client_managed[id] = client_managed;
+
+       return 0;
+}
+
+/**
+ * assigns a name to syncpt
+ */
+static int nvhost_syncpt_assign_name(struct nvhost_syncpt *sp, u32 id,
+                                       const char *syncpt_name)
+{
+       if (id < NVHOST_FREE_SYNCPT_BASE || !sp->assigned[id])
+               return -EINVAL;
+
+       sp->syncpt_names[id] = syncpt_name;
+
+       return 0;
+}
+
+static u32 nvhost_get_syncpt(struct nvhost_syncpt *sp, bool client_managed,
+                                       const char *syncpt_name)
+{
+       u32 id;
+       int err = 0;
+       struct nvhost_master *host = syncpt_to_dev(sp);
+       struct device *d = &host->dev->dev;
+
+       mutex_lock(&sp->syncpt_mutex);
+
+       /* find a syncpt which is free */
+       id = nvhost_find_free_syncpt(sp);
+       if (!id) {
+               nvhost_err(d, "failed to get new free syncpt\n");
+               mutex_unlock(&sp->syncpt_mutex);
+               return 0;
+       }
+
+       /* if we get one, then reserve it */
+       err = nvhost_reserve_syncpt(sp, id, client_managed);
+       if (err) {
+               nvhost_err(d, "syncpt reservation failed\n");
+               mutex_unlock(&sp->syncpt_mutex);
+               return 0;
+       }
+
+       /* assign a name for debugging purpose */
+       err = nvhost_syncpt_assign_name(sp, id, syncpt_name);
+       if (err) {
+               nvhost_err(d, "syncpt name assignment failed\n");
+               mutex_unlock(&sp->syncpt_mutex);
+               return 0;
+       }
+
+       mutex_unlock(&sp->syncpt_mutex);
+
+       return id;
+}
+
+/**
+ * Interface to get a new free (host managed) syncpt dynamically
+ */
+u32 nvhost_get_syncpt_host_managed(struct platform_device *pdev,
+                                       u32 param)
+{
+       u32 id;
+       char *syncpt_name;
+       struct nvhost_master *nvhost_master = nvhost_get_host(pdev);
+
+       syncpt_name = kasprintf(GFP_KERNEL, "%s_%d",
+                               dev_name(&pdev->dev), param);
+
+       id = nvhost_get_syncpt(&nvhost_master->syncpt, false, syncpt_name);
+       if (!id) {
+               nvhost_err(&pdev->dev, "failed to get syncpt\n");
+               return 0;
+       }
+
+       return id;
+}
+
+/**
+ * Interface to get a new free (client managed) syncpt dynamically
+ */
+u32 nvhost_get_syncpt_client_managed(const char *syncpt_name)
+{
+       u32 id;
+       struct nvhost_master *host = nvhost;
+
+       if (!syncpt_name)
+               syncpt_name = kasprintf(GFP_KERNEL, "client_managed");
+
+       id = nvhost_get_syncpt(&host->syncpt, true, syncpt_name);
+       if (!id) {
+               nvhost_err(&host->dev->dev, "failed to get syncpt\n");
+               return 0;
+       }
+
+       return id;
+}
+EXPORT_SYMBOL_GPL(nvhost_get_syncpt_client_managed);
+
+/**
+ * API to mark in-use syncpt as free
+ */
+void nvhost_free_syncpt(u32 id)
+{
+       struct nvhost_master *host = nvhost;
+       struct nvhost_syncpt *sp = &host->syncpt;
+
+       WARN_ON(!sp->assigned[id]);
+
+       mutex_lock(&sp->syncpt_mutex);
+
+       /* set to default state */
+       sp->assigned[id] = false;
+       sp->client_managed[id] = false;
+       kfree(sp->syncpt_names[id]);
+       sp->syncpt_names[id] = NULL;
+
+       mutex_unlock(&sp->syncpt_mutex);
+}
+
+static void nvhost_reserve_vblank_syncpts(struct nvhost_syncpt *sp)
+{
+       mutex_lock(&sp->syncpt_mutex);
+
+       sp->assigned[NVSYNCPT_VBLANK0] = true;
+       sp->client_managed[NVSYNCPT_VBLANK0] = true;
+       sp->syncpt_names[NVSYNCPT_VBLANK0] = "vblank0";
+
+       sp->assigned[NVSYNCPT_VBLANK1] = true;
+       sp->client_managed[NVSYNCPT_VBLANK1] = true;
+       sp->syncpt_names[NVSYNCPT_VBLANK1] = "vblank1";
+
+       mutex_unlock(&sp->syncpt_mutex);
+}
+
 int nvhost_syncpt_init(struct platform_device *dev,
                struct nvhost_syncpt *sp)
 {
@@ -651,6 +814,12 @@ int nvhost_syncpt_init(struct platform_device *dev,
        int err = 0;
 
        /* Allocate structs for min, max and base values */
+       sp->assigned = kzalloc(sizeof(bool) * nvhost_syncpt_nb_pts(sp),
+                       GFP_KERNEL);
+       sp->client_managed = kzalloc(sizeof(bool) * nvhost_syncpt_nb_pts(sp),
+                       GFP_KERNEL);
+       sp->syncpt_names = kzalloc(sizeof(char *) * nvhost_syncpt_nb_pts(sp),
+                       GFP_KERNEL);
        sp->min_val = kzalloc(sizeof(atomic_t) * nvhost_syncpt_nb_pts(sp),
                        GFP_KERNEL);
        sp->max_val = kzalloc(sizeof(atomic_t) * nvhost_syncpt_nb_pts(sp),
@@ -669,7 +838,8 @@ int nvhost_syncpt_init(struct platform_device *dev,
        }
 #endif
 
-       if (!(sp->min_val && sp->max_val && sp->base_val && sp->lock_counts)) {
+       if (!(sp->assigned && sp->client_managed && sp->min_val && sp->max_val
+                    && sp->base_val && sp->lock_counts)) {
                /* frees happen in the deinit */
                err = -ENOMEM;
                goto fail;
@@ -681,6 +851,8 @@ int nvhost_syncpt_init(struct platform_device *dev,
                goto fail;
        }
 
+       mutex_init(&sp->syncpt_mutex);
+
        /* Allocate two attributes for each sync point: min and max */
        sp->syncpt_attrs = kzalloc(sizeof(*sp->syncpt_attrs)
                        * nvhost_syncpt_nb_pts(sp) * NUM_SYSFS_ENTRY,
@@ -706,6 +878,10 @@ int nvhost_syncpt_init(struct platform_device *dev,
                if (err)
                        goto fail;
 
+               /* initialize syncpt status */
+               sp->assigned[i] = false;
+               sp->client_managed[i] = false;
+
 #ifdef CONFIG_TEGRA_GRHOST_SYNC
                sp->timeline[i] = nvhost_sync_timeline_create(sp, i);
                if (!sp->timeline[i]) {
@@ -732,6 +908,8 @@ int nvhost_syncpt_init(struct platform_device *dev,
        }
 #endif
 
+       nvhost_reserve_vblank_syncpts(sp);
+
        return err;
 
 fail:
@@ -776,13 +954,21 @@ void nvhost_syncpt_deinit(struct nvhost_syncpt *sp)
        kfree(sp->syncpt_attrs);
        sp->syncpt_attrs = NULL;
 
+       kfree(sp->syncpt_names);
+       sp->syncpt_names = NULL;
+
+       kfree(sp->client_managed);
+       sp->client_managed = NULL;
+
+       kfree(sp->assigned);
+       sp->assigned = NULL;
+
        nvhost_syncpt_deinit_timeline(sp);
 }
 
 int nvhost_syncpt_client_managed(struct nvhost_syncpt *sp, u32 id)
 {
-       u64 mask = 1ULL << id;
-       return !!(syncpt_to_dev(sp)->info.client_managed & mask);
+       return sp->client_managed[id];
 }
 
 int nvhost_syncpt_nb_pts(struct nvhost_syncpt *sp)
@@ -802,9 +988,7 @@ int nvhost_syncpt_nb_mlocks(struct nvhost_syncpt *sp)
 
 void nvhost_syncpt_set_manager(struct nvhost_syncpt *sp, int id, bool client)
 {
-       u64 mask = 1ULL << id;
-       syncpt_to_dev(sp)->info.client_managed &= ~mask;
-       syncpt_to_dev(sp)->info.client_managed |= client ? mask : 0;
+       sp->client_managed[id] = client;
 }
 
 /* public sync point API */
index f8e3b170240dada8bfb10ecb7bea08c4dd3d3d80..2387164ecb11d6f2b9def103bdb660bd163d0191 100644 (file)
@@ -26,6 +26,9 @@
 #include <linux/nvhost.h>
 #include <linux/atomic.h>
 
+/* when searching for free syncpt id, start from this base */
+#define NVHOST_FREE_SYNCPT_BASE 1
+
 struct nvhost_syncpt;
 
 /* Attribute struct for sysfs min and max attributes */
@@ -36,7 +39,10 @@ struct nvhost_syncpt_attr {
 };
 
 struct nvhost_syncpt {
+       bool *assigned;
+       bool *client_managed;
        struct kobject *kobj;
+       struct mutex syncpt_mutex;
        atomic_t *min_val;
        atomic_t *max_val;
        u32 *base_val;
@@ -56,6 +62,10 @@ struct nvhost_syncpt {
 int nvhost_syncpt_init(struct platform_device *, struct nvhost_syncpt *);
 void nvhost_syncpt_deinit(struct nvhost_syncpt *);
 
+u32 nvhost_get_syncpt_host_managed(struct platform_device *pdata,
+                                  u32 param);
+void nvhost_free_syncpt(u32 id);
+
 #define syncpt_to_dev(sp) container_of(sp, struct nvhost_master, syncpt)
 #define SYNCPT_CHECK_PERIOD (2 * HZ)
 #define MAX_STUCK_CHECK_COUNT 15
index a21af70f6cebea599576a5b6958b572dbd33e7ed..24c35531dc7a67b136ab6026d8a0649161ec0475 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Tegra Graphics Init for Tegra11 Architecture Chips
  *
- * Copyright (c) 2011-2013, NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2011-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,
@@ -117,7 +117,6 @@ static struct platform_device tegra_host1x02_device = {
 struct nvhost_device_data t11_gr3d_info = {
        .version        = 3,
        .index          = 1,
-       .syncpts        = {NVSYNCPT_3D},
        .waitbases      = {NVWAITBASE_3D},
        .modulemutexes  = {NVMODMUTEX_3D},
        .class          = NV_GRAPHICS_3D_CLASS_ID,
@@ -158,7 +157,6 @@ static struct platform_device tegra_gr3d03_device = {
 struct nvhost_device_data t11_gr2d_info = {
        .version        = 2,
        .index          = 2,
-       .syncpts        = {NVSYNCPT_2D_0, NVSYNCPT_2D_1},
        .waitbases      = {NVWAITBASE_2D_0, NVWAITBASE_2D_1},
        .modulemutexes  = {NVMODMUTEX_2D_FULL, NVMODMUTEX_2D_SIMPLE,
                          NVMODMUTEX_2D_SB_A, NVMODMUTEX_2D_SB_B},
@@ -193,8 +191,6 @@ static struct resource isp_resources[] = {
 
 struct nvhost_device_data t11_isp_info = {
        .index          = 3,
-       .syncpts        = {NVSYNCPT_VI_ISP_2, NVSYNCPT_VI_ISP_3,
-                         NVSYNCPT_VI_ISP_4},
        .keepalive      = true,
        NVHOST_MODULE_NO_POWERGATE_IDS,
        NVHOST_DEFAULT_CLOCKGATE_DELAY,
@@ -228,10 +224,6 @@ static struct resource vi_resources[] = {
 
 struct nvhost_device_data t11_vi_info = {
        .index          = 4,
-       .syncpts        = {NVSYNCPT_CSI_VI_0, NVSYNCPT_CSI_VI_1,
-                         NVSYNCPT_VI_ISP_0, NVSYNCPT_VI_ISP_1,
-                         NVSYNCPT_VI_ISP_2, NVSYNCPT_VI_ISP_3,
-                         NVSYNCPT_VI_ISP_4},
        .modulemutexes  = {NVMODMUTEX_VI},
        .clocks         = { {"host1x", 136000000, 6} },
        .exclusive      = true,
@@ -264,7 +256,6 @@ static struct resource msenc_resources[] = {
 struct nvhost_device_data t11_msenc_info = {
        .version        = NVHOST_ENCODE_MSENC_VER(2, 0),
        .index          = 5,
-       .syncpts        = {NVSYNCPT_MSENC},
        .waitbases      = {NVWAITBASE_MSENC},
        .class          = NV_VIDEO_ENCODE_MSENC_CLASS_ID,
        .clocks        = { {"msenc", UINT_MAX, 107, TEGRA_MC_CLIENT_MSENC},
@@ -301,7 +292,6 @@ static struct resource tsec_resources[] = {
 struct nvhost_device_data t11_tsec_info = {
        .version        = NVHOST_ENCODE_TSEC_VER(1, 0),
        .index          = 7,
-       .syncpts        = {NVSYNCPT_TSEC},
        .waitbases      = {NVWAITBASE_TSEC},
        .class          = NV_TSEC_CLASS_ID,
        .exclusive      = false,
index f046e04e628f31c1bbf88049ff3b837d02dd4dd5..0120f2f121d28332324dbee74df9493b897a81e8 100644 (file)
@@ -175,7 +175,6 @@ static struct resource isp_resources[] = {
 static struct platform_device tegra_isp01b_device;
 struct nvhost_device_data t124_isp_info = {
        /* FIXME: control clocks from user space instead of hard-coding here */
-       .syncpts         = NV_ISP_0_SYNCPTS,
        .moduleid        = NVHOST_MODULE_ISP,
        .modulemutexes   = {NVMODMUTEX_ISP_0},
        .exclusive       = true,
@@ -213,7 +212,6 @@ static struct resource ispb_resources[] = {
 
 struct nvhost_device_data t124_ispb_info = {
        /* FIXME: control clocks from user space instead of hard-coding here */
-       .syncpts         = NV_ISP_1_SYNCPTS,
        .moduleid        = (1 << 16) | NVHOST_MODULE_ISP,
        .modulemutexes   = {NVMODMUTEX_ISP_1},
        .exclusive       = true,
@@ -254,7 +252,6 @@ static struct platform_device tegra_vi01b_device;
 struct nvhost_device_data t124_vi_info = {
        /* FIXME: resolve powergating dependency with DIS */
        /* FIXME: control clocks from user space instead of hard-coding here */
-       .syncpts          = NV_VI_0_SYNCPTS,
        .moduleid         = NVHOST_MODULE_VI,
        .modulemutexes    = {NVMODMUTEX_VI_0},
        .exclusive        = true,
@@ -292,7 +289,6 @@ static struct platform_device tegra_vi01_device = {
 struct nvhost_device_data t124_vib_info = {
        /* FIXME: resolve powergating dependency with DIS */
        /* FIXME: control clocks from user space instead of hard-coding here */
-       .syncpts          = NV_VI_1_SYNCPTS,
        .moduleid         = (1 << 16 | NVHOST_MODULE_VI),
        .modulemutexes    = {NVMODMUTEX_VI_1},
        .exclusive        = true,
@@ -337,7 +333,6 @@ static struct resource msenc_resources[] = {
 
 struct nvhost_device_data t124_msenc_info = {
        .version        = NVHOST_ENCODE_MSENC_VER(3, 1),
-       .syncpts        = {NVSYNCPT_MSENC, NVSYNCPT_MSENC_SLICE},
        .waitbases      = {NVWAITBASE_MSENC},
        .class          = NV_VIDEO_ENCODE_MSENC_CLASS_ID,
        .clocks         = {{"msenc", UINT_MAX, 0, TEGRA_MC_CLIENT_MSENC},
@@ -377,7 +372,6 @@ static struct resource tsec_resources[] = {
 
 struct nvhost_device_data t124_tsec_info = {
        .version       = NVHOST_ENCODE_TSEC_VER(1, 0),
-       .syncpts       = {NVSYNCPT_TSEC},
        .waitbases     = {NVWAITBASE_TSEC},
        .class         = NV_TSEC_CLASS_ID,
        .exclusive     = true,
@@ -416,7 +410,6 @@ static struct resource vic03_resources[] = {
 };
 
 struct nvhost_device_data t124_vic_info = {
-       .syncpts                = {NVSYNCPT_VIC},
        .modulemutexes          = {NVMODMUTEX_VIC},
        .clocks                 = {{"vic03", UINT_MAX, 0, TEGRA_MC_CLIENT_VIC},
                                  {"emc", UINT_MAX} },
@@ -461,7 +454,6 @@ struct platform_device tegra_vic03_device = {
 
 struct nvhost_device_data t132_isp_info = {
        /* FIXME: control clocks from user space instead of hard-coding here */
-       .syncpts         = NV_ISP_0_SYNCPTS,
        .moduleid        = NVHOST_MODULE_ISP,
        .modulemutexes   = {NVMODMUTEX_ISP_0},
        .exclusive       = true,
@@ -478,7 +470,6 @@ struct nvhost_device_data t132_isp_info = {
 
 struct nvhost_device_data t132_ispb_info = {
        /* FIXME: control clocks from user space instead of hard-coding here */
-       .syncpts         = NV_ISP_1_SYNCPTS,
        .moduleid        = (1 << 16) | NVHOST_MODULE_ISP,
        .modulemutexes   = {NVMODMUTEX_ISP_1},
        .exclusive       = true,
@@ -496,7 +487,6 @@ struct nvhost_device_data t132_ispb_info = {
 struct nvhost_device_data t132_vi_info = {
        /* FIXME: resolve powergating dependency with DIS */
        /* FIXME: control clocks from user space instead of hard-coding here */
-       .syncpts          = NV_VI_0_SYNCPTS,
        .moduleid         = NVHOST_MODULE_VI,
        .modulemutexes    = {NVMODMUTEX_VI_0},
        .exclusive        = true,
@@ -521,7 +511,6 @@ struct nvhost_device_data t132_vi_info = {
 struct nvhost_device_data t132_vib_info = {
        /* FIXME: resolve powergating dependency with DIS */
        /* FIXME: control clocks from user space instead of hard-coding here */
-       .syncpts          = NV_VI_1_SYNCPTS,
        .moduleid         = (1 << 16 | NVHOST_MODULE_VI),
        .modulemutexes    = {NVMODMUTEX_VI_1},
        .exclusive        = true,
@@ -546,7 +535,6 @@ struct nvhost_device_data t132_vib_info = {
 
 struct nvhost_device_data t132_msenc_info = {
        .version        = NVHOST_ENCODE_MSENC_VER(3, 1),
-       .syncpts        = {NVSYNCPT_MSENC, NVSYNCPT_MSENC_SLICE},
        .waitbases      = {NVWAITBASE_MSENC},
        .class          = NV_VIDEO_ENCODE_MSENC_CLASS_ID,
        .clocks         = {{"msenc", UINT_MAX, 0, TEGRA_MC_CLIENT_MSENC},
@@ -562,7 +550,6 @@ struct nvhost_device_data t132_msenc_info = {
 
 struct nvhost_device_data t132_tsec_info = {
        .version       = NVHOST_ENCODE_TSEC_VER(1, 0),
-       .syncpts       = {NVSYNCPT_TSEC},
        .waitbases     = {NVWAITBASE_TSEC},
        .class         = NV_TSEC_CLASS_ID,
        .exclusive     = true,
@@ -578,7 +565,6 @@ struct nvhost_device_data t132_tsec_info = {
 
 #ifdef CONFIG_ARCH_TEGRA_VIC
 struct nvhost_device_data t132_vic_info = {
-       .syncpts                = {NVSYNCPT_VIC},
        .modulemutexes          = {NVMODMUTEX_VIC},
        .clocks                 = {{"vic03", UINT_MAX, 0, TEGRA_MC_CLIENT_VIC},
                                  {"emc", UINT_MAX} },
@@ -599,8 +585,6 @@ struct nvhost_device_data t132_vic_info = {
 
 #if defined(CONFIG_TEGRA_GK20A)
 struct nvhost_device_data t132_gk20a_info = {
-       .syncpts                = {NVSYNCPT_GK20A_BASE},
-       .syncpt_base            = NVSYNCPT_GK20A_BASE,
        .class                  = NV_GRAPHICS_GPU_CLASS_ID,
        .clocks                 = {{"PLLG_ref", UINT_MAX},
                                   {"pwr", 204000000},
index 0fc5e39ef542d40c2479a50a9f29e2aa6f7518a2..29c3fd4a254b6c2b7dc9772e4749e3e1546267c6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Tegra Graphics Init for T148 Architecture Chips
  *
- * Copyright (c) 2012-2013, NVIDIA Corporation.  All rights reserved.
+ * Copyright (c) 2012-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,
@@ -113,7 +113,6 @@ static struct platform_device tegra_host1x03_device = {
 struct nvhost_device_data t14_gr3d_info = {
        .version        = 3,
        .index          = 1,
-       .syncpts        = {NVSYNCPT_3D},
        .waitbases      = {NVWAITBASE_3D},
        .modulemutexes  = {NVMODMUTEX_3D},
        .class          = NV_GRAPHICS_3D_CLASS_ID,
@@ -153,7 +152,6 @@ static struct platform_device tegra_gr3d03_device = {
 
 struct nvhost_device_data t14_gr2d_info = {
        .index          = 2,
-       .syncpts        = {NVSYNCPT_2D_0, NVSYNCPT_2D_1},
        .waitbases      = {NVWAITBASE_2D_0, NVWAITBASE_2D_1},
        .modulemutexes  = {NVMODMUTEX_2D_FULL, NVMODMUTEX_2D_SIMPLE,
                          NVMODMUTEX_2D_SB_A, NVMODMUTEX_2D_SB_B},
@@ -188,8 +186,6 @@ static struct resource isp_resources[] = {
 
 struct nvhost_device_data t14_isp_info = {
        .index          = 3,
-       .syncpts        = {NVSYNCPT_VI_ISP_2, NVSYNCPT_VI_ISP_3,
-                         NVSYNCPT_VI_ISP_4},
        NVHOST_MODULE_NO_POWERGATE_IDS,
        NVHOST_DEFAULT_CLOCKGATE_DELAY,
        .moduleid       = NVHOST_MODULE_ISP,
@@ -222,10 +218,6 @@ static struct resource vi_resources[] = {
 
 struct nvhost_device_data t14_vi_info = {
        .index          = 4,
-       .syncpts        = {NVSYNCPT_CSI_VI_0, NVSYNCPT_CSI_VI_1,
-                         NVSYNCPT_VI_ISP_0, NVSYNCPT_VI_ISP_1,
-                         NVSYNCPT_VI_ISP_2, NVSYNCPT_VI_ISP_3,
-                         NVSYNCPT_VI_ISP_4},
        .modulemutexes  = {NVMODMUTEX_VI_0},
        .clocks         = { {"host1x", 136000000, 6} },
        .exclusive      = true,
@@ -258,7 +250,6 @@ static struct resource msenc_resources[] = {
 struct nvhost_device_data t14_msenc_info = {
        .version        = NVHOST_ENCODE_MSENC_VER(3, 0),
        .index          = 5,
-       .syncpts        = {NVSYNCPT_MSENC},
        .waitbases      = {NVWAITBASE_MSENC},
        .class          = NV_VIDEO_ENCODE_MSENC_CLASS_ID,
        .clocks         = { {"msenc", UINT_MAX, 107, TEGRA_MC_CLIENT_MSENC},
@@ -296,7 +287,6 @@ static struct resource tsec_resources[] = {
 struct nvhost_device_data t14_tsec_info = {
        .version        = NVHOST_ENCODE_TSEC_VER(1,0),
        .index          = 7,
-       .syncpts        = {NVSYNCPT_TSEC},
        .waitbases      = {NVWAITBASE_TSEC},
        .class          = NV_TSEC_CLASS_ID,
        .exclusive      = false,
index d1b029367bb3fd24d84019c866cdfd7384c491e2..e0853030f89a26c626502a44fdd0ebdbb8e511fa 100644 (file)
@@ -343,6 +343,7 @@ int nvhost_module_busy_ext(struct platform_device *dev);
 void nvhost_module_idle_ext(struct platform_device *dev);
 
 /* public host1x sync-point management APIs */
+u32 nvhost_get_syncpt_client_managed(const char *syncpt_name);
 u32 nvhost_syncpt_incr_max_ext(struct platform_device *dev, u32 id, u32 incrs);
 void nvhost_syncpt_cpu_incr_ext(struct platform_device *dev, u32 id);
 u32 nvhost_syncpt_read_ext(struct platform_device *dev, u32 id);