]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: hard-code syncpts for t114
authorDeepak Nibade <dnibade@nvidia.com>
Mon, 10 Feb 2014 12:24:02 +0000 (17:54 +0530)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Thu, 20 Mar 2014 06:51:33 +0000 (23:51 -0700)
- hard code syncpts for gr3d, gr2d and syncpt no. 17 for T114
- this is to maintain user space dependency on hard-coded syncpts

- syncpt no. 17 is wrongly used by some of the graphics tests which
  require this syncpt to be reserved as client_managed syncpt

- keep this hard-coded part for t114 under #ifdef
  CONFIG_ARCH_TEGRA_11x_SOC

Bug 1305024

Change-Id: I18dc36018ca5cb95a191dd6f3eaa145d90391608
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/381961
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/video/tegra/host/nvhost_syncpt.c
drivers/video/tegra/host/t114/t114.c
include/linux/nvhost.h

index cf6f6ac7ff81dc4ad6ed2469dfed3a923e5fed55..67c5ca622bcad4d5b11f8e0d437352456fda6e4e 100644 (file)
@@ -66,7 +66,11 @@ int nvhost_syncpt_get_waitbase(struct nvhost_channel *ch, int id)
        for (i = 0; i < NVHOST_MODULE_MAX_SYNCPTS && pdata->syncpts[i]; ++i)
                ret |= (pdata->syncpts[i] == id);
 
+#ifdef CONFIG_ARCH_TEGRA_11x_SOC
+       if (!ret || (id == NVSYNCPT_2D_0))
+#else
        if (!ret)
+#endif
                return NVSYNCPT_INVALID;
 
        return pdata->waitbases[0];
@@ -835,6 +839,29 @@ static void nvhost_reserve_syncpts(struct nvhost_syncpt *sp)
        mutex_unlock(&sp->syncpt_mutex);
 }
 
+#ifdef CONFIG_ARCH_TEGRA_11x_SOC
+static void nvhost_reserve_gr_syncpt(struct nvhost_syncpt *sp)
+{
+       mutex_lock(&sp->syncpt_mutex);
+
+       sp->assigned[NVSYNCPT_2D_0] = true;
+       sp->syncpt_names[NVSYNCPT_2D_0] = "2d_0";
+
+       sp->assigned[NVSYNCPT_2D_1] = true;
+       sp->client_managed[NVSYNCPT_2D_1] = true;
+       sp->syncpt_names[NVSYNCPT_2D_1] = "2d_1";
+
+       /* HACK: some tests for t114 require syncpt 17
+        * to be reserved as client managed
+        */
+       sp->assigned[17] = true;
+       sp->client_managed[17] = true;
+       sp->syncpt_names[17] = "3d_1";
+
+       mutex_unlock(&sp->syncpt_mutex);
+}
+#endif
+
 int nvhost_syncpt_init(struct platform_device *dev,
                struct nvhost_syncpt *sp)
 {
@@ -943,6 +970,9 @@ int nvhost_syncpt_init(struct platform_device *dev,
         * external dependencies / constraints
         */
        nvhost_reserve_syncpts(sp);
+#ifdef CONFIG_ARCH_TEGRA_11x_SOC
+       nvhost_reserve_gr_syncpt(sp);
+#endif
 
        return err;
 
index 84cfaaffe54d11d5cc47b3a5f2d368866d2155bf..951e2e73382c767722bfa72fbb60e776358b367a 100644 (file)
@@ -96,6 +96,7 @@ 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,
@@ -136,6 +137,7 @@ 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},
index 486c99c842a5bd6d58903138399e3dfc73daeef2..48b1ce177a2a238b6ba86737fb5f7bd04d16f433 100644 (file)
@@ -54,6 +54,8 @@ struct nvhost_as_moduleops;
 #define NVSYNCPT_GRAPHICS_HOST         (0)     /* t20, t30, t114, t148 */
 
 #define NVSYNCPT_AVP_0                 (10)    /* t20, t30, t114, t148 */
+#define NVSYNCPT_2D_0                  (18)
+#define NVSYNCPT_2D_1                  (19)
 #define NVSYNCPT_3D                    (22)    /* t20, t30, t114, t148 */
 #define NVSYNCPT_VBLANK0               (26)    /* t20, t30, t114, t148 */
 #define NVSYNCPT_VBLANK1               (27)    /* t20, t30, t114, t148 */