Lines Matching refs:sp
62 struct host1x_syncpt *sp = host->syncpt; in host1x_syncpt_alloc() local
71 for (i = 0; i < host->info->nb_pts && kref_read(&sp->ref); i++, sp++) in host1x_syncpt_alloc()
78 sp->base = host1x_syncpt_base_request(host); in host1x_syncpt_alloc()
79 if (!sp->base) in host1x_syncpt_alloc()
83 full_name = kasprintf(GFP_KERNEL, "%u-%s", sp->id, name); in host1x_syncpt_alloc()
87 sp->name = full_name; in host1x_syncpt_alloc()
90 sp->client_managed = true; in host1x_syncpt_alloc()
92 sp->client_managed = false; in host1x_syncpt_alloc()
94 kref_init(&sp->ref); in host1x_syncpt_alloc()
97 return sp; in host1x_syncpt_alloc()
100 host1x_syncpt_base_free(sp->base); in host1x_syncpt_alloc()
101 sp->base = NULL; in host1x_syncpt_alloc()
116 u32 host1x_syncpt_id(struct host1x_syncpt *sp) in host1x_syncpt_id() argument
118 return sp->id; in host1x_syncpt_id()
127 u32 host1x_syncpt_incr_max(struct host1x_syncpt *sp, u32 incrs) in host1x_syncpt_incr_max() argument
129 return (u32)atomic_add_return(incrs, &sp->max_val); in host1x_syncpt_incr_max()
183 u32 host1x_syncpt_load(struct host1x_syncpt *sp) in host1x_syncpt_load() argument
187 val = host1x_hw_syncpt_load(sp->host, sp); in host1x_syncpt_load()
188 trace_host1x_syncpt_load_min(sp->id, val); in host1x_syncpt_load()
196 u32 host1x_syncpt_load_wait_base(struct host1x_syncpt *sp) in host1x_syncpt_load_wait_base() argument
198 host1x_hw_syncpt_load_wait_base(sp->host, sp); in host1x_syncpt_load_wait_base()
200 return sp->base_val; in host1x_syncpt_load_wait_base()
207 int host1x_syncpt_incr(struct host1x_syncpt *sp) in host1x_syncpt_incr() argument
209 return host1x_hw_syncpt_cpu_incr(sp->host, sp); in host1x_syncpt_incr()
220 int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout, in host1x_syncpt_wait() argument
226 host1x_hw_syncpt_load(sp->host, sp); in host1x_syncpt_wait()
229 *value = host1x_syncpt_load(sp); in host1x_syncpt_wait()
231 if (host1x_syncpt_is_expired(sp, thresh)) in host1x_syncpt_wait()
239 fence = host1x_fence_create(sp, thresh, false); in host1x_syncpt_wait()
249 *value = host1x_syncpt_load(sp); in host1x_syncpt_wait()
256 host1x_hw_syncpt_load(sp->host, sp); in host1x_syncpt_wait()
257 if (wait_err == 0 && !host1x_syncpt_is_expired(sp, thresh)) in host1x_syncpt_wait()
269 bool host1x_syncpt_is_expired(struct host1x_syncpt *sp, u32 thresh) in host1x_syncpt_is_expired() argument
275 current_val = (u32)atomic_read(&sp->min_val); in host1x_syncpt_is_expired()
342 struct host1x_syncpt *sp = container_of(ref, struct host1x_syncpt, ref); in syncpt_release() local
344 atomic_set(&sp->max_val, host1x_syncpt_read(sp)); in syncpt_release()
346 sp->locked = false; in syncpt_release()
348 mutex_lock(&sp->host->syncpt_mutex); in syncpt_release()
350 host1x_syncpt_base_free(sp->base); in syncpt_release()
351 kfree(sp->name); in syncpt_release()
352 sp->base = NULL; in syncpt_release()
353 sp->name = NULL; in syncpt_release()
354 sp->client_managed = false; in syncpt_release()
356 mutex_unlock(&sp->host->syncpt_mutex); in syncpt_release()
367 void host1x_syncpt_put(struct host1x_syncpt *sp) in host1x_syncpt_put() argument
369 if (!sp) in host1x_syncpt_put()
372 kref_put(&sp->ref, syncpt_release); in host1x_syncpt_put()
378 struct host1x_syncpt *sp = host->syncpt; in host1x_syncpt_deinit() local
381 for (i = 0; i < host->info->nb_pts; i++, sp++) in host1x_syncpt_deinit()
382 kfree(sp->name); in host1x_syncpt_deinit()
392 u32 host1x_syncpt_read_max(struct host1x_syncpt *sp) in host1x_syncpt_read_max() argument
396 return (u32)atomic_read(&sp->max_val); in host1x_syncpt_read_max()
407 u32 host1x_syncpt_read_min(struct host1x_syncpt *sp) in host1x_syncpt_read_min() argument
411 return (u32)atomic_read(&sp->min_val); in host1x_syncpt_read_min()
419 u32 host1x_syncpt_read(struct host1x_syncpt *sp) in host1x_syncpt_read() argument
421 return host1x_syncpt_load(sp); in host1x_syncpt_read()
478 struct host1x_syncpt *host1x_syncpt_get(struct host1x_syncpt *sp) in host1x_syncpt_get() argument
480 kref_get(&sp->ref); in host1x_syncpt_get()
482 return sp; in host1x_syncpt_get()
490 struct host1x_syncpt_base *host1x_syncpt_get_base(struct host1x_syncpt *sp) in host1x_syncpt_get_base() argument
492 return sp ? sp->base : NULL; in host1x_syncpt_get_base()