diff options
Diffstat (limited to 'drivers/gpu/host1x/syncpt.c')
-rw-r--r-- | drivers/gpu/host1x/syncpt.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c index 4b493453e805..409745b949db 100644 --- a/drivers/gpu/host1x/syncpt.c +++ b/drivers/gpu/host1x/syncpt.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | static struct host1x_syncpt *_host1x_syncpt_alloc(struct host1x *host, | 33 | static struct host1x_syncpt *_host1x_syncpt_alloc(struct host1x *host, |
34 | struct device *dev, | 34 | struct device *dev, |
35 | int client_managed) | 35 | bool client_managed) |
36 | { | 36 | { |
37 | int i; | 37 | int i; |
38 | struct host1x_syncpt *sp = host->syncpt; | 38 | struct host1x_syncpt *sp = host->syncpt; |
@@ -40,7 +40,8 @@ static struct host1x_syncpt *_host1x_syncpt_alloc(struct host1x *host, | |||
40 | 40 | ||
41 | for (i = 0; i < host->info->nb_pts && sp->name; i++, sp++) | 41 | for (i = 0; i < host->info->nb_pts && sp->name; i++, sp++) |
42 | ; | 42 | ; |
43 | if (sp->dev) | 43 | |
44 | if (i >= host->info->nb_pts) | ||
44 | return NULL; | 45 | return NULL; |
45 | 46 | ||
46 | name = kasprintf(GFP_KERNEL, "%02d-%s", sp->id, | 47 | name = kasprintf(GFP_KERNEL, "%02d-%s", sp->id, |
@@ -128,22 +129,11 @@ u32 host1x_syncpt_load_wait_base(struct host1x_syncpt *sp) | |||
128 | } | 129 | } |
129 | 130 | ||
130 | /* | 131 | /* |
131 | * Write a cpu syncpoint increment to the hardware, without touching | ||
132 | * the cache. Caller is responsible for host being powered. | ||
133 | */ | ||
134 | void host1x_syncpt_cpu_incr(struct host1x_syncpt *sp) | ||
135 | { | ||
136 | host1x_hw_syncpt_cpu_incr(sp->host, sp); | ||
137 | } | ||
138 | |||
139 | /* | ||
140 | * Increment syncpoint value from cpu, updating cache | 132 | * Increment syncpoint value from cpu, updating cache |
141 | */ | 133 | */ |
142 | void host1x_syncpt_incr(struct host1x_syncpt *sp) | 134 | int host1x_syncpt_incr(struct host1x_syncpt *sp) |
143 | { | 135 | { |
144 | if (host1x_syncpt_client_managed(sp)) | 136 | return host1x_hw_syncpt_cpu_incr(sp->host, sp); |
145 | host1x_syncpt_incr_max(sp, 1); | ||
146 | host1x_syncpt_cpu_incr(sp); | ||
147 | } | 137 | } |
148 | 138 | ||
149 | /* | 139 | /* |
@@ -331,7 +321,7 @@ int host1x_syncpt_init(struct host1x *host) | |||
331 | host1x_syncpt_restore(host); | 321 | host1x_syncpt_restore(host); |
332 | 322 | ||
333 | /* Allocate sync point to use for clearing waits for expired fences */ | 323 | /* Allocate sync point to use for clearing waits for expired fences */ |
334 | host->nop_sp = _host1x_syncpt_alloc(host, NULL, 0); | 324 | host->nop_sp = _host1x_syncpt_alloc(host, NULL, false); |
335 | if (!host->nop_sp) | 325 | if (!host->nop_sp) |
336 | return -ENOMEM; | 326 | return -ENOMEM; |
337 | 327 | ||
@@ -339,7 +329,7 @@ int host1x_syncpt_init(struct host1x *host) | |||
339 | } | 329 | } |
340 | 330 | ||
341 | struct host1x_syncpt *host1x_syncpt_request(struct device *dev, | 331 | struct host1x_syncpt *host1x_syncpt_request(struct device *dev, |
342 | int client_managed) | 332 | bool client_managed) |
343 | { | 333 | { |
344 | struct host1x *host = dev_get_drvdata(dev->parent); | 334 | struct host1x *host = dev_get_drvdata(dev->parent); |
345 | return _host1x_syncpt_alloc(host, dev, client_managed); | 335 | return _host1x_syncpt_alloc(host, dev, client_managed); |
@@ -353,7 +343,7 @@ void host1x_syncpt_free(struct host1x_syncpt *sp) | |||
353 | kfree(sp->name); | 343 | kfree(sp->name); |
354 | sp->dev = NULL; | 344 | sp->dev = NULL; |
355 | sp->name = NULL; | 345 | sp->name = NULL; |
356 | sp->client_managed = 0; | 346 | sp->client_managed = false; |
357 | } | 347 | } |
358 | 348 | ||
359 | void host1x_syncpt_deinit(struct host1x *host) | 349 | void host1x_syncpt_deinit(struct host1x *host) |