Lines Matching refs:sp
61 struct host1x_syncpt *sp = host->syncpt; in host1x_syncpt_alloc() local
64 for (i = 0; i < host->info->nb_pts && sp->name; i++, sp++) in host1x_syncpt_alloc()
71 sp->base = host1x_syncpt_base_request(host); in host1x_syncpt_alloc()
72 if (!sp->base) in host1x_syncpt_alloc()
76 name = kasprintf(GFP_KERNEL, "%02d-%s", sp->id, in host1x_syncpt_alloc()
81 sp->dev = dev; in host1x_syncpt_alloc()
82 sp->name = name; in host1x_syncpt_alloc()
85 sp->client_managed = true; in host1x_syncpt_alloc()
87 sp->client_managed = false; in host1x_syncpt_alloc()
89 return sp; in host1x_syncpt_alloc()
92 u32 host1x_syncpt_id(struct host1x_syncpt *sp) in host1x_syncpt_id() argument
94 return sp->id; in host1x_syncpt_id()
101 u32 host1x_syncpt_incr_max(struct host1x_syncpt *sp, u32 incrs) in host1x_syncpt_incr_max() argument
103 return (u32)atomic_add_return(incrs, &sp->max_val); in host1x_syncpt_incr_max()
146 u32 host1x_syncpt_load(struct host1x_syncpt *sp) in host1x_syncpt_load() argument
149 val = host1x_hw_syncpt_load(sp->host, sp); in host1x_syncpt_load()
150 trace_host1x_syncpt_load_min(sp->id, val); in host1x_syncpt_load()
158 u32 host1x_syncpt_load_wait_base(struct host1x_syncpt *sp) in host1x_syncpt_load_wait_base() argument
161 host1x_hw_syncpt_load_wait_base(sp->host, sp); in host1x_syncpt_load_wait_base()
162 val = sp->base_val; in host1x_syncpt_load_wait_base()
169 int host1x_syncpt_incr(struct host1x_syncpt *sp) in host1x_syncpt_incr() argument
171 return host1x_hw_syncpt_cpu_incr(sp->host, sp); in host1x_syncpt_incr()
179 static bool syncpt_load_min_is_expired(struct host1x_syncpt *sp, u32 thresh) in syncpt_load_min_is_expired() argument
181 host1x_hw_syncpt_load(sp->host, sp); in syncpt_load_min_is_expired()
182 return host1x_syncpt_is_expired(sp, thresh); in syncpt_load_min_is_expired()
188 int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout, in host1x_syncpt_wait() argument
201 if (host1x_syncpt_is_expired(sp, thresh)) { in host1x_syncpt_wait()
203 *value = host1x_syncpt_load(sp); in host1x_syncpt_wait()
208 val = host1x_hw_syncpt_load(sp->host, sp); in host1x_syncpt_wait()
209 if (host1x_syncpt_is_expired(sp, thresh)) { in host1x_syncpt_wait()
228 err = host1x_intr_add_action(sp->host, sp->id, thresh, in host1x_syncpt_wait()
243 syncpt_load_min_is_expired(sp, thresh), in host1x_syncpt_wait()
245 if (remain > 0 || host1x_syncpt_is_expired(sp, thresh)) { in host1x_syncpt_wait()
247 *value = host1x_syncpt_load(sp); in host1x_syncpt_wait()
257 dev_warn(sp->host->dev, in host1x_syncpt_wait()
259 current->comm, sp->id, sp->name, in host1x_syncpt_wait()
262 host1x_debug_dump_syncpts(sp->host); in host1x_syncpt_wait()
264 host1x_debug_dump(sp->host); in host1x_syncpt_wait()
268 host1x_intr_put_ref(sp->host, sp->id, ref); in host1x_syncpt_wait()
278 bool host1x_syncpt_is_expired(struct host1x_syncpt *sp, u32 thresh) in host1x_syncpt_is_expired() argument
283 current_val = (u32)atomic_read(&sp->min_val); in host1x_syncpt_is_expired()
284 future_val = (u32)atomic_read(&sp->max_val); in host1x_syncpt_is_expired()
328 if (!host1x_syncpt_client_managed(sp)) in host1x_syncpt_is_expired()
335 int host1x_syncpt_patch_wait(struct host1x_syncpt *sp, void *patch_addr) in host1x_syncpt_patch_wait() argument
337 return host1x_hw_syncpt_patch_wait(sp->host, sp, patch_addr); in host1x_syncpt_patch_wait()
385 void host1x_syncpt_free(struct host1x_syncpt *sp) in host1x_syncpt_free() argument
387 if (!sp) in host1x_syncpt_free()
390 host1x_syncpt_base_free(sp->base); in host1x_syncpt_free()
391 kfree(sp->name); in host1x_syncpt_free()
392 sp->base = NULL; in host1x_syncpt_free()
393 sp->dev = NULL; in host1x_syncpt_free()
394 sp->name = NULL; in host1x_syncpt_free()
395 sp->client_managed = false; in host1x_syncpt_free()
402 struct host1x_syncpt *sp = host->syncpt; in host1x_syncpt_deinit() local
403 for (i = 0; i < host->info->nb_pts; i++, sp++) in host1x_syncpt_deinit()
404 kfree(sp->name); in host1x_syncpt_deinit()
411 u32 host1x_syncpt_read_max(struct host1x_syncpt *sp) in host1x_syncpt_read_max() argument
414 return (u32)atomic_read(&sp->max_val); in host1x_syncpt_read_max()
421 u32 host1x_syncpt_read_min(struct host1x_syncpt *sp) in host1x_syncpt_read_min() argument
424 return (u32)atomic_read(&sp->min_val); in host1x_syncpt_read_min()
428 u32 host1x_syncpt_read(struct host1x_syncpt *sp) in host1x_syncpt_read() argument
430 return host1x_syncpt_load(sp); in host1x_syncpt_read()
457 struct host1x_syncpt_base *host1x_syncpt_get_base(struct host1x_syncpt *sp) in host1x_syncpt_get_base() argument
459 return sp ? sp->base : NULL; in host1x_syncpt_get_base()