Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Arto Merilainen and committed by
Thierry Reding
8736fe81 b0084031

+15 -9
+1 -1
drivers/gpu/drm/tegra/gr2d.c
··· 43 43 if (!gr2d->channel) 44 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 47 if (!client->syncpts[0]) { 48 48 host1x_channel_free(gr2d->channel); 49 49 return -ENOMEM;
+11 -7
drivers/gpu/host1x/syncpt.c
··· 30 30 #define SYNCPT_CHECK_PERIOD (2 * HZ) 31 31 #define MAX_STUCK_CHECK_COUNT 15 32 32 33 - static struct host1x_syncpt *_host1x_syncpt_alloc(struct host1x *host, 34 - struct device *dev, 35 - bool client_managed) 33 + static struct host1x_syncpt *host1x_syncpt_alloc(struct host1x *host, 34 + struct device *dev, 35 + unsigned long flags) 36 36 { 37 37 int i; 38 38 struct host1x_syncpt *sp = host->syncpt; ··· 51 51 52 52 sp->dev = dev; 53 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 60 return sp; 57 61 } ··· 325 321 host1x_syncpt_restore(host); 326 322 327 323 /* Allocate sync point to use for clearing waits for expired fences */ 328 - host->nop_sp = _host1x_syncpt_alloc(host, NULL, false); 324 + host->nop_sp = host1x_syncpt_alloc(host, NULL, 0); 329 325 if (!host->nop_sp) 330 326 return -ENOMEM; 331 327 ··· 333 329 } 334 330 335 331 struct host1x_syncpt *host1x_syncpt_request(struct device *dev, 336 - bool client_managed) 332 + unsigned long flags) 337 333 { 338 334 struct host1x *host = dev_get_drvdata(dev->parent); 339 - return _host1x_syncpt_alloc(host, dev, client_managed); 335 + return host1x_syncpt_alloc(host, dev, flags); 340 336 } 341 337 342 338 void host1x_syncpt_free(struct host1x_syncpt *sp)
+3 -1
include/linux/host1x.h
··· 124 124 * host1x syncpoints 125 125 */ 126 126 127 + #define HOST1X_SYNCPT_CLIENT_MANAGED (1 << 0) 128 + 127 129 struct host1x_syncpt; 128 130 struct host1x; 129 131 ··· 137 135 int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout, 138 136 u32 *value); 139 137 struct host1x_syncpt *host1x_syncpt_request(struct device *dev, 140 - bool client_managed); 138 + unsigned long flags); 141 139 void host1x_syncpt_free(struct host1x_syncpt *sp); 142 140 143 141 /*