aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x/hw
diff options
context:
space:
mode:
authorArto Merilainen <amerilainen@nvidia.com>2013-05-29 06:26:08 -0400
committerThierry Reding <thierry.reding@gmail.com>2013-06-22 06:43:55 -0400
commitebae30b1fbcc2cc991ce705cc82e16d1e5ddbf51 (patch)
tree9a483e8a9ad7b41ef69784afe1b106a6ec168bac /drivers/gpu/host1x/hw
parentece66891ff452d5643ac5a61649f632984d83c10 (diff)
gpu: host1x: Rework CPU syncpoint increment
This patch merges host1x_syncpt_cpu_incr to host1x_syncpt_incr() as they are in practise doing the same thing. host1x_syncpt_incr() is also modified to return error codes. User space interface is modified accordingly to pass return values. Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Acked-By: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/gpu/host1x/hw')
-rw-r--r--drivers/gpu/host1x/hw/cdma_hw.c2
-rw-r--r--drivers/gpu/host1x/hw/syncpt_hw.c12
2 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpu/host1x/hw/cdma_hw.c b/drivers/gpu/host1x/hw/cdma_hw.c
index 590b69d91dab..2ee4ad55c4db 100644
--- a/drivers/gpu/host1x/hw/cdma_hw.c
+++ b/drivers/gpu/host1x/hw/cdma_hw.c
@@ -44,7 +44,7 @@ static void cdma_timeout_cpu_incr(struct host1x_cdma *cdma, u32 getptr,
44 u32 i; 44 u32 i;
45 45
46 for (i = 0; i < syncpt_incrs; i++) 46 for (i = 0; i < syncpt_incrs; i++)
47 host1x_syncpt_cpu_incr(cdma->timeout.syncpt); 47 host1x_syncpt_incr(cdma->timeout.syncpt);
48 48
49 /* after CPU incr, ensure shadow is up to date */ 49 /* after CPU incr, ensure shadow is up to date */
50 host1x_syncpt_load(cdma->timeout.syncpt); 50 host1x_syncpt_load(cdma->timeout.syncpt);
diff --git a/drivers/gpu/host1x/hw/syncpt_hw.c b/drivers/gpu/host1x/hw/syncpt_hw.c
index 61174990102a..0cf6095d3367 100644
--- a/drivers/gpu/host1x/hw/syncpt_hw.c
+++ b/drivers/gpu/host1x/hw/syncpt_hw.c
@@ -77,21 +77,19 @@ static u32 syncpt_load(struct host1x_syncpt *sp)
77 * Write a cpu syncpoint increment to the hardware, without touching 77 * Write a cpu syncpoint increment to the hardware, without touching
78 * the cache. 78 * the cache.
79 */ 79 */
80static void syncpt_cpu_incr(struct host1x_syncpt *sp) 80static int syncpt_cpu_incr(struct host1x_syncpt *sp)
81{ 81{
82 struct host1x *host = sp->host; 82 struct host1x *host = sp->host;
83 u32 reg_offset = sp->id / 32; 83 u32 reg_offset = sp->id / 32;
84 84
85 if (!host1x_syncpt_client_managed(sp) && 85 if (!host1x_syncpt_client_managed(sp) &&
86 host1x_syncpt_idle(sp)) { 86 host1x_syncpt_idle(sp))
87 dev_err(host->dev, "Trying to increment syncpoint id %d beyond max\n", 87 return -EINVAL;
88 sp->id);
89 host1x_debug_dump(sp->host);
90 return;
91 }
92 host1x_sync_writel(host, BIT_MASK(sp->id), 88 host1x_sync_writel(host, BIT_MASK(sp->id),
93 HOST1X_SYNC_SYNCPT_CPU_INCR(reg_offset)); 89 HOST1X_SYNC_SYNCPT_CPU_INCR(reg_offset));
94 wmb(); 90 wmb();
91
92 return 0;
95} 93}
96 94
97/* remove a wait pointed to by patch_addr */ 95/* remove a wait pointed to by patch_addr */