Lines Matching refs: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()
115 u32 host1x_syncpt_id(struct host1x_syncpt *sp) in host1x_syncpt_id() argument
117 return sp->id; in host1x_syncpt_id()
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()
173 u32 host1x_syncpt_load(struct host1x_syncpt *sp) in host1x_syncpt_load() argument
177 val = host1x_hw_syncpt_load(sp->host, sp); in host1x_syncpt_load()
178 trace_host1x_syncpt_load_min(sp->id, val); in host1x_syncpt_load()
186 u32 host1x_syncpt_load_wait_base(struct host1x_syncpt *sp) in host1x_syncpt_load_wait_base() argument
188 host1x_hw_syncpt_load_wait_base(sp->host, sp); in host1x_syncpt_load_wait_base()
190 return sp->base_val; in host1x_syncpt_load_wait_base()
197 int host1x_syncpt_incr(struct host1x_syncpt *sp) in host1x_syncpt_incr() argument
199 return host1x_hw_syncpt_cpu_incr(sp->host, sp); in host1x_syncpt_incr()
207 static bool syncpt_load_min_is_expired(struct host1x_syncpt *sp, u32 thresh) in syncpt_load_min_is_expired() argument
209 host1x_hw_syncpt_load(sp->host, sp); in syncpt_load_min_is_expired()
211 return host1x_syncpt_is_expired(sp, thresh); in syncpt_load_min_is_expired()
221 int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout, in host1x_syncpt_wait() argument
234 if (host1x_syncpt_is_expired(sp, thresh)) { in host1x_syncpt_wait()
236 *value = host1x_syncpt_load(sp); in host1x_syncpt_wait()
242 val = host1x_hw_syncpt_load(sp->host, sp); in host1x_syncpt_wait()
243 if (host1x_syncpt_is_expired(sp, thresh)) { in host1x_syncpt_wait()
263 err = host1x_intr_add_action(sp->host, sp, thresh, in host1x_syncpt_wait()
280 syncpt_load_min_is_expired(sp, thresh), in host1x_syncpt_wait()
282 if (remain > 0 || host1x_syncpt_is_expired(sp, thresh)) { in host1x_syncpt_wait()
284 *value = host1x_syncpt_load(sp); in host1x_syncpt_wait()
299 dev_warn(sp->host->dev, in host1x_syncpt_wait()
301 current->comm, sp->id, sp->name, in host1x_syncpt_wait()
304 host1x_debug_dump_syncpts(sp->host); in host1x_syncpt_wait()
307 host1x_debug_dump(sp->host); in host1x_syncpt_wait()
313 host1x_intr_put_ref(sp->host, sp->id, ref, true); in host1x_syncpt_wait()
323 bool host1x_syncpt_is_expired(struct host1x_syncpt *sp, u32 thresh) in host1x_syncpt_is_expired() argument
329 current_val = (u32)atomic_read(&sp->min_val); in host1x_syncpt_is_expired()
406 struct host1x_syncpt *sp = container_of(ref, struct host1x_syncpt, ref); in syncpt_release() local
408 atomic_set(&sp->max_val, host1x_syncpt_read(sp)); in syncpt_release()
410 sp->locked = false; in syncpt_release()
412 mutex_lock(&sp->host->syncpt_mutex); in syncpt_release()
414 host1x_syncpt_base_free(sp->base); in syncpt_release()
415 kfree(sp->name); in syncpt_release()
416 sp->base = NULL; in syncpt_release()
417 sp->name = NULL; in syncpt_release()
418 sp->client_managed = false; in syncpt_release()
420 mutex_unlock(&sp->host->syncpt_mutex); in syncpt_release()
431 void host1x_syncpt_put(struct host1x_syncpt *sp) in host1x_syncpt_put() argument
433 if (!sp) in host1x_syncpt_put()
436 kref_put(&sp->ref, syncpt_release); in host1x_syncpt_put()
442 struct host1x_syncpt *sp = host->syncpt; in host1x_syncpt_deinit() local
445 for (i = 0; i < host->info->nb_pts; i++, sp++) in host1x_syncpt_deinit()
446 kfree(sp->name); in host1x_syncpt_deinit()
456 u32 host1x_syncpt_read_max(struct host1x_syncpt *sp) in host1x_syncpt_read_max() argument
460 return (u32)atomic_read(&sp->max_val); in host1x_syncpt_read_max()
471 u32 host1x_syncpt_read_min(struct host1x_syncpt *sp) in host1x_syncpt_read_min() argument
475 return (u32)atomic_read(&sp->min_val); in host1x_syncpt_read_min()
483 u32 host1x_syncpt_read(struct host1x_syncpt *sp) in host1x_syncpt_read() argument
485 return host1x_syncpt_load(sp); in host1x_syncpt_read()
542 struct host1x_syncpt *host1x_syncpt_get(struct host1x_syncpt *sp) in host1x_syncpt_get() argument
544 kref_get(&sp->ref); in host1x_syncpt_get()
546 return sp; in host1x_syncpt_get()
554 struct host1x_syncpt_base *host1x_syncpt_get_base(struct host1x_syncpt *sp) in host1x_syncpt_get_base() argument
556 return sp ? sp->base : NULL; in host1x_syncpt_get_base()