Lines Matching full:sp
61 struct host1x_syncpt *sp = host->syncpt; in host1x_syncpt_alloc() local
70 for (i = 0; i < host->info->nb_pts && kref_read(&sp->ref); i++, sp++) in host1x_syncpt_alloc()
77 sp->base = host1x_syncpt_base_request(host); in host1x_syncpt_alloc()
78 if (!sp->base) in host1x_syncpt_alloc()
82 full_name = kasprintf(GFP_KERNEL, "%u-%s", sp->id, name); in host1x_syncpt_alloc()
86 sp->name = full_name; in host1x_syncpt_alloc()
89 sp->client_managed = true; in host1x_syncpt_alloc()
91 sp->client_managed = false; in host1x_syncpt_alloc()
93 kref_init(&sp->ref); in host1x_syncpt_alloc()
96 return sp; in host1x_syncpt_alloc()
99 host1x_syncpt_base_free(sp->base); in host1x_syncpt_alloc()
100 sp->base = NULL; in host1x_syncpt_alloc()
109 * @sp: host1x syncpoint
115 u32 host1x_syncpt_id(struct host1x_syncpt *sp) in host1x_syncpt_id() argument
117 return sp->id; in host1x_syncpt_id()
123 * @sp: host1x syncpoint
126 u32 host1x_syncpt_incr_max(struct host1x_syncpt *sp, u32 incrs) in host1x_syncpt_incr_max() argument
128 return (u32)atomic_add_return(incrs, &sp->max_val); in host1x_syncpt_incr_max()
182 u32 host1x_syncpt_load(struct host1x_syncpt *sp) in host1x_syncpt_load() argument
186 val = host1x_hw_syncpt_load(sp->host, sp); in host1x_syncpt_load()
187 trace_host1x_syncpt_load_min(sp->id, val); in host1x_syncpt_load()
195 u32 host1x_syncpt_load_wait_base(struct host1x_syncpt *sp) in host1x_syncpt_load_wait_base() argument
197 host1x_hw_syncpt_load_wait_base(sp->host, sp); in host1x_syncpt_load_wait_base()
199 return sp->base_val; in host1x_syncpt_load_wait_base()
204 * @sp: host1x syncpoint
206 int host1x_syncpt_incr(struct host1x_syncpt *sp) in host1x_syncpt_incr() argument
208 return host1x_hw_syncpt_cpu_incr(sp->host, sp); in host1x_syncpt_incr()
216 static bool syncpt_load_min_is_expired(struct host1x_syncpt *sp, u32 thresh) in syncpt_load_min_is_expired() argument
218 host1x_hw_syncpt_load(sp->host, sp); in syncpt_load_min_is_expired()
220 return host1x_syncpt_is_expired(sp, thresh); in syncpt_load_min_is_expired()
225 * @sp: host1x syncpoint
230 int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout, in host1x_syncpt_wait() argument
239 *value = host1x_syncpt_load(sp); in host1x_syncpt_wait()
241 if (host1x_syncpt_is_expired(sp, thresh)) in host1x_syncpt_wait()
257 err = host1x_intr_add_action(sp->host, sp, thresh, in host1x_syncpt_wait()
274 syncpt_load_min_is_expired(sp, thresh), in host1x_syncpt_wait()
276 if (remain > 0 || host1x_syncpt_is_expired(sp, thresh)) { in host1x_syncpt_wait()
278 *value = host1x_syncpt_load(sp); in host1x_syncpt_wait()
293 dev_warn(sp->host->dev, in host1x_syncpt_wait()
295 current->comm, sp->id, sp->name, in host1x_syncpt_wait()
298 host1x_debug_dump_syncpts(sp->host); in host1x_syncpt_wait()
301 host1x_debug_dump(sp->host); in host1x_syncpt_wait()
307 host1x_intr_put_ref(sp->host, sp->id, ref, true); in host1x_syncpt_wait()
317 bool host1x_syncpt_is_expired(struct host1x_syncpt *sp, u32 thresh) in host1x_syncpt_is_expired() argument
323 current_val = (u32)atomic_read(&sp->min_val); in host1x_syncpt_is_expired()
390 struct host1x_syncpt *sp = container_of(ref, struct host1x_syncpt, ref); in syncpt_release() local
392 atomic_set(&sp->max_val, host1x_syncpt_read(sp)); in syncpt_release()
394 sp->locked = false; in syncpt_release()
396 mutex_lock(&sp->host->syncpt_mutex); in syncpt_release()
398 host1x_syncpt_base_free(sp->base); in syncpt_release()
399 kfree(sp->name); in syncpt_release()
400 sp->base = NULL; in syncpt_release()
401 sp->name = NULL; in syncpt_release()
402 sp->client_managed = false; in syncpt_release()
404 mutex_unlock(&sp->host->syncpt_mutex); in syncpt_release()
409 * @sp: host1x syncpoint
415 void host1x_syncpt_put(struct host1x_syncpt *sp) in host1x_syncpt_put() argument
417 if (!sp) in host1x_syncpt_put()
420 kref_put(&sp->ref, syncpt_release); in host1x_syncpt_put()
426 struct host1x_syncpt *sp = host->syncpt; in host1x_syncpt_deinit() local
429 for (i = 0; i < host->info->nb_pts; i++, sp++) in host1x_syncpt_deinit()
430 kfree(sp->name); in host1x_syncpt_deinit()
435 * @sp: host1x syncpoint
440 u32 host1x_syncpt_read_max(struct host1x_syncpt *sp) in host1x_syncpt_read_max() argument
444 return (u32)atomic_read(&sp->max_val); in host1x_syncpt_read_max()
450 * @sp: host1x syncpoint
455 u32 host1x_syncpt_read_min(struct host1x_syncpt *sp) in host1x_syncpt_read_min() argument
459 return (u32)atomic_read(&sp->min_val); in host1x_syncpt_read_min()
465 * @sp: host1x syncpoint
467 u32 host1x_syncpt_read(struct host1x_syncpt *sp) in host1x_syncpt_read() argument
469 return host1x_syncpt_load(sp); in host1x_syncpt_read()
524 * @sp: syncpoint
526 struct host1x_syncpt *host1x_syncpt_get(struct host1x_syncpt *sp) in host1x_syncpt_get() argument
528 kref_get(&sp->ref); in host1x_syncpt_get()
530 return sp; in host1x_syncpt_get()
536 * @sp: host1x syncpoint
538 struct host1x_syncpt_base *host1x_syncpt_get_base(struct host1x_syncpt *sp) in host1x_syncpt_get_base() argument
540 return sp ? sp->base : NULL; in host1x_syncpt_get_base()