]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: implement dynamic synpt
authorDeepak Nibade <dnibade@nvidia.com>
Fri, 14 Mar 2014 06:25:20 +0000 (11:55 +0530)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Thu, 20 Mar 2014 06:49:36 +0000 (23:49 -0700)
- 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: I02fdfd81d62d215cbb98f4b3f2695bd745fe2402
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/381954
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/video/tegra/host/bus_client.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 1c1fc44885fc70c9676579bbce94fdae1c60f96d..7bb09897c7f953a30e462a35b20abf4ab614e795 100644 (file)
@@ -729,8 +729,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;
 }
@@ -807,10 +810,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 93440c8b181f8c67085668957cd086d40c2e7226..ab1e587dd9205bc686c452ffc96d9e28a4409065 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
 
@@ -572,9 +574,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 : "";
 }
 
@@ -658,6 +659,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)
 {
@@ -666,6 +829,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),
@@ -684,7 +853,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;
@@ -696,6 +866,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,
@@ -721,6 +893,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]) {
@@ -747,6 +923,8 @@ int nvhost_syncpt_init(struct platform_device *dev,
        }
 #endif
 
+       nvhost_reserve_vblank_syncpts(sp);
+
        return err;
 
 fail:
@@ -791,13 +969,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)
@@ -817,9 +1003,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 89f6ead51e4e32cf20c0b3e51cf84e257a45f35b..e81a17eaa5c8182c51c01a42137e39bd63af75e0 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 ed7915d120e4921b9a9c67f0c152ba0771d87fed..13676990463efb62f48b7c8d7a1f8e3acd8f19a5 100644 (file)
@@ -115,7 +115,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,
@@ -156,7 +155,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},
@@ -191,8 +189,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,
@@ -226,10 +222,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,
@@ -262,7 +254,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},
@@ -299,7 +290,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 5b28d4c1a429b635d9a2a51a3a445ca27aa9e762..7dbda1de45c3695cb26630a59c907d7ff58da6f3 100644 (file)
@@ -171,7 +171,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,
@@ -209,7 +208,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,
@@ -250,7 +248,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,
@@ -288,7 +285,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,
@@ -333,7 +329,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},
@@ -373,7 +368,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,
@@ -412,7 +406,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} },
@@ -457,7 +450,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,
@@ -475,7 +467,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,
@@ -494,7 +485,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,
@@ -520,7 +510,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},
@@ -563,7 +551,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,
@@ -579,7 +566,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} },
index 96fbaaee70b35eb1f328a18b8fc19742dc6ca974..febb71da0fff188db8b6f003684f41355204061d 100644 (file)
@@ -111,7 +111,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,
@@ -151,7 +150,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},
@@ -186,8 +184,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,
@@ -220,10 +216,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,
@@ -256,7 +248,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},
@@ -294,7 +285,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 46faeca981e25ac01b02f6ad69a37010a2e57876..012d9e6baf2aff873456abed135f27bc0ca6ad71 100644 (file)
@@ -326,6 +326,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);
 int nvhost_syncpt_read_ext_check(struct platform_device *dev, u32 id, u32 *val);