aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArto Merilainen <amerilainen@nvidia.com>2013-10-14 08:21:52 -0400
committerThierry Reding <treding@nvidia.com>2013-10-31 04:55:47 -0400
commit8736fe81532182ba0086a371fae0708ea42a2cdf (patch)
tree24fa46183dd65eb55ecf49791eb9e738668033e8
parentb0084031f2c68ba65e3a1776cf4f8a23448afa41 (diff)
gpu: host1x: Add 'flags' field to syncpt request
Functions host1x_syncpt_request() and _host1x_syncpt_alloc() have been taking a separate boolean flag ('client_managed') for indicating if the syncpoint value should be tracked by the host1x driver. This patch converts the field into generic 'flags' field so that we can easily add more information while requesting a syncpoint. Clients are adapted to use the new interface accordingly. Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/drm/tegra/gr2d.c2
-rw-r--r--drivers/gpu/host1x/syncpt.c18
-rw-r--r--include/linux/host1x.h4
3 files changed, 15 insertions, 9 deletions
diff --git a/drivers/gpu/drm/tegra/gr2d.c b/drivers/gpu/drm/tegra/gr2d.c
index 7f4eb110aa85..3a04b97b54a2 100644
--- a/drivers/gpu/drm/tegra/gr2d.c
+++ b/drivers/gpu/drm/tegra/gr2d.c
@@ -43,7 +43,7 @@ static int gr2d_init(struct host1x_client *client)
43 if (!gr2d->channel) 43 if (!gr2d->channel)
44 return -ENOMEM; 44 return -ENOMEM;
45 45
46 client->syncpts[0] = host1x_syncpt_request(client->dev, false); 46 client->syncpts[0] = host1x_syncpt_request(client->dev, 0);
47 if (!client->syncpts[0]) { 47 if (!client->syncpts[0]) {
48 host1x_channel_free(gr2d->channel); 48 host1x_channel_free(gr2d->channel);
49 return -ENOMEM; 49 return -ENOMEM;
diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c
index 03cf2922e469..5b88ba4c974e 100644
--- a/drivers/gpu/host1x/syncpt.c
+++ b/drivers/gpu/host1x/syncpt.c
@@ -30,9 +30,9 @@
30#define SYNCPT_CHECK_PERIOD (2 * HZ) 30#define SYNCPT_CHECK_PERIOD (2 * HZ)
31#define MAX_STUCK_CHECK_COUNT 15 31#define MAX_STUCK_CHECK_COUNT 15
32 32
33static struct host1x_syncpt *_host1x_syncpt_alloc(struct host1x *host, 33static struct host1x_syncpt *host1x_syncpt_alloc(struct host1x *host,
34 struct device *dev, 34 struct device *dev,
35 bool client_managed) 35 unsigned long flags)
36{ 36{
37 int i; 37 int i;
38 struct host1x_syncpt *sp = host->syncpt; 38 struct host1x_syncpt *sp = host->syncpt;
@@ -51,7 +51,11 @@ static struct host1x_syncpt *_host1x_syncpt_alloc(struct host1x *host,
51 51
52 sp->dev = dev; 52 sp->dev = dev;
53 sp->name = name; 53 sp->name = name;
54 sp->client_managed = client_managed; 54
55 if (flags & HOST1X_SYNCPT_CLIENT_MANAGED)
56 sp->client_managed = true;
57 else
58 sp->client_managed = false;
55 59
56 return sp; 60 return sp;
57} 61}
@@ -321,7 +325,7 @@ int host1x_syncpt_init(struct host1x *host)
321 host1x_syncpt_restore(host); 325 host1x_syncpt_restore(host);
322 326
323 /* Allocate sync point to use for clearing waits for expired fences */ 327 /* Allocate sync point to use for clearing waits for expired fences */
324 host->nop_sp = _host1x_syncpt_alloc(host, NULL, false); 328 host->nop_sp = host1x_syncpt_alloc(host, NULL, 0);
325 if (!host->nop_sp) 329 if (!host->nop_sp)
326 return -ENOMEM; 330 return -ENOMEM;
327 331
@@ -329,10 +333,10 @@ int host1x_syncpt_init(struct host1x *host)
329} 333}
330 334
331struct host1x_syncpt *host1x_syncpt_request(struct device *dev, 335struct host1x_syncpt *host1x_syncpt_request(struct device *dev,
332 bool client_managed) 336 unsigned long flags)
333{ 337{
334 struct host1x *host = dev_get_drvdata(dev->parent); 338 struct host1x *host = dev_get_drvdata(dev->parent);
335 return _host1x_syncpt_alloc(host, dev, client_managed); 339 return host1x_syncpt_alloc(host, dev, flags);
336} 340}
337 341
338void host1x_syncpt_free(struct host1x_syncpt *sp) 342void host1x_syncpt_free(struct host1x_syncpt *sp)
diff --git a/include/linux/host1x.h b/include/linux/host1x.h
index f5dd56fbdc3e..eb713dbbae29 100644
--- a/include/linux/host1x.h
+++ b/include/linux/host1x.h
@@ -124,6 +124,8 @@ static inline void host1x_bo_kunmap(struct host1x_bo *bo,
124 * host1x syncpoints 124 * host1x syncpoints
125 */ 125 */
126 126
127#define HOST1X_SYNCPT_CLIENT_MANAGED (1 << 0)
128
127struct host1x_syncpt; 129struct host1x_syncpt;
128struct host1x; 130struct host1x;
129 131
@@ -135,7 +137,7 @@ int host1x_syncpt_incr(struct host1x_syncpt *sp);
135int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout, 137int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout,
136 u32 *value); 138 u32 *value);
137struct host1x_syncpt *host1x_syncpt_request(struct device *dev, 139struct host1x_syncpt *host1x_syncpt_request(struct device *dev,
138 bool client_managed); 140 unsigned long flags);
139void host1x_syncpt_free(struct host1x_syncpt *sp); 141void host1x_syncpt_free(struct host1x_syncpt *sp);
140 142
141/* 143/*