Lines Matching full:v3d
20 v3d_init_core(struct v3d_dev *v3d, int core) in v3d_init_core() argument
28 if (v3d->ver < 40) in v3d_init_core()
40 v3d_init_hw_state(struct v3d_dev *v3d) in v3d_init_hw_state() argument
42 v3d_init_core(v3d, 0); in v3d_init_hw_state()
46 v3d_idle_axi(struct v3d_dev *v3d, int core) in v3d_idle_axi() argument
48 V3D_CORE_WRITE(core, V3D_GMP_CFG(v3d->ver), V3D_GMP_CFG_STOP_REQ); in v3d_idle_axi()
50 if (wait_for((V3D_CORE_READ(core, V3D_GMP_STATUS(v3d->ver)) & in v3d_idle_axi()
59 v3d_idle_gca(struct v3d_dev *v3d) in v3d_idle_gca() argument
61 if (v3d->ver >= 41) in v3d_idle_gca()
74 v3d_reset_by_bridge(struct v3d_dev *v3d) in v3d_reset_by_bridge() argument
97 v3d_reset_v3d(struct v3d_dev *v3d) in v3d_reset_v3d() argument
99 if (v3d->reset) in v3d_reset_v3d()
100 reset_control_reset(v3d->reset); in v3d_reset_v3d()
102 v3d_reset_by_bridge(v3d); in v3d_reset_v3d()
104 v3d_init_hw_state(v3d); in v3d_reset_v3d()
108 v3d_reset(struct v3d_dev *v3d) in v3d_reset() argument
110 struct drm_device *dev = &v3d->drm; in v3d_reset()
119 v3d_idle_axi(v3d, 0); in v3d_reset()
121 v3d_idle_gca(v3d); in v3d_reset()
122 v3d_reset_v3d(v3d); in v3d_reset()
124 v3d_mmu_set_page_table(v3d); in v3d_reset()
125 v3d_irq_reset(v3d); in v3d_reset()
127 v3d_perfmon_stop(v3d, v3d->active_perfmon, false); in v3d_reset()
133 v3d_flush_l3(struct v3d_dev *v3d) in v3d_flush_l3() argument
135 if (v3d->ver < 41) { in v3d_flush_l3()
141 if (v3d->ver < 33) { in v3d_flush_l3()
149 * uniforms and instructions on V3D 3.2.
152 v3d_invalidate_l2c(struct v3d_dev *v3d, int core) in v3d_invalidate_l2c() argument
154 if (v3d->ver > 32) in v3d_invalidate_l2c()
164 v3d_flush_l2t(struct v3d_dev *v3d, int core) in v3d_flush_l2t() argument
173 mutex_lock(&v3d->cache_clean_lock); in v3d_flush_l2t()
177 mutex_unlock(&v3d->cache_clean_lock); in v3d_flush_l2t()
189 v3d_clean_caches(struct v3d_dev *v3d) in v3d_clean_caches() argument
191 struct drm_device *dev = &v3d->drm; in v3d_clean_caches()
202 mutex_lock(&v3d->cache_clean_lock); in v3d_clean_caches()
212 mutex_unlock(&v3d->cache_clean_lock); in v3d_clean_caches()
219 v3d_invalidate_slices(struct v3d_dev *v3d, int core) in v3d_invalidate_slices() argument
229 v3d_invalidate_caches(struct v3d_dev *v3d) in v3d_invalidate_caches() argument
236 v3d_flush_l3(v3d); in v3d_invalidate_caches()
237 v3d_invalidate_l2c(v3d, 0); in v3d_invalidate_caches()
238 v3d_flush_l2t(v3d, 0); in v3d_invalidate_caches()
239 v3d_invalidate_slices(v3d, 0); in v3d_invalidate_caches()
245 struct v3d_dev *v3d = to_v3d_dev(dev); in v3d_gem_init() local
250 struct v3d_queue_state *queue = &v3d->queue[i]; in v3d_gem_init()
257 spin_lock_init(&v3d->mm_lock); in v3d_gem_init()
258 spin_lock_init(&v3d->job_lock); in v3d_gem_init()
259 ret = drmm_mutex_init(dev, &v3d->bo_lock); in v3d_gem_init()
262 ret = drmm_mutex_init(dev, &v3d->reset_lock); in v3d_gem_init()
265 ret = drmm_mutex_init(dev, &v3d->sched_lock); in v3d_gem_init()
268 ret = drmm_mutex_init(dev, &v3d->cache_clean_lock); in v3d_gem_init()
276 drm_mm_init(&v3d->mm, 1, pt_size / sizeof(u32) - 1); in v3d_gem_init()
278 v3d->pt = dma_alloc_wc(v3d->drm.dev, pt_size, in v3d_gem_init()
279 &v3d->pt_paddr, in v3d_gem_init()
281 if (!v3d->pt) { in v3d_gem_init()
282 drm_mm_takedown(&v3d->mm); in v3d_gem_init()
283 dev_err(v3d->drm.dev, in v3d_gem_init()
288 v3d_init_hw_state(v3d); in v3d_gem_init()
289 v3d_mmu_set_page_table(v3d); in v3d_gem_init()
291 ret = v3d_sched_init(v3d); in v3d_gem_init()
293 drm_mm_takedown(&v3d->mm); in v3d_gem_init()
294 dma_free_coherent(v3d->drm.dev, 4096 * 1024, (void *)v3d->pt, in v3d_gem_init()
295 v3d->pt_paddr); in v3d_gem_init()
304 struct v3d_dev *v3d = to_v3d_dev(dev); in v3d_gem_destroy() local
306 v3d_sched_fini(v3d); in v3d_gem_destroy()
309 * unregistering V3D. in v3d_gem_destroy()
311 WARN_ON(v3d->bin_job); in v3d_gem_destroy()
312 WARN_ON(v3d->render_job); in v3d_gem_destroy()
313 WARN_ON(v3d->tfu_job); in v3d_gem_destroy()
314 WARN_ON(v3d->csd_job); in v3d_gem_destroy()
316 drm_mm_takedown(&v3d->mm); in v3d_gem_destroy()
318 dma_free_coherent(v3d->drm.dev, 4096 * 1024, (void *)v3d->pt, in v3d_gem_destroy()
319 v3d->pt_paddr); in v3d_gem_destroy()