Lines Matching full:vc4
101 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_v3d_debugfs_ident() local
102 int ret = vc4_v3d_pm_get(vc4); in vc4_v3d_debugfs_ident()
117 vc4_v3d_pm_put(vc4); in vc4_v3d_debugfs_ident()
128 vc4_v3d_pm_get(struct vc4_dev *vc4) in vc4_v3d_pm_get() argument
130 if (WARN_ON_ONCE(vc4->is_vc5)) in vc4_v3d_pm_get()
133 mutex_lock(&vc4->power_lock); in vc4_v3d_pm_get()
134 if (vc4->power_refcount++ == 0) { in vc4_v3d_pm_get()
135 int ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); in vc4_v3d_pm_get()
138 vc4->power_refcount--; in vc4_v3d_pm_get()
139 mutex_unlock(&vc4->power_lock); in vc4_v3d_pm_get()
143 mutex_unlock(&vc4->power_lock); in vc4_v3d_pm_get()
149 vc4_v3d_pm_put(struct vc4_dev *vc4) in vc4_v3d_pm_put() argument
151 if (WARN_ON_ONCE(vc4->is_vc5)) in vc4_v3d_pm_put()
154 mutex_lock(&vc4->power_lock); in vc4_v3d_pm_put()
155 if (--vc4->power_refcount == 0) { in vc4_v3d_pm_put()
156 pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); in vc4_v3d_pm_put()
157 pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); in vc4_v3d_pm_put()
159 mutex_unlock(&vc4->power_lock); in vc4_v3d_pm_put()
164 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_v3d_init_hw() local
173 int vc4_v3d_get_bin_slot(struct vc4_dev *vc4) in vc4_v3d_get_bin_slot() argument
175 struct drm_device *dev = &vc4->base; in vc4_v3d_get_bin_slot()
181 if (WARN_ON_ONCE(vc4->is_vc5)) in vc4_v3d_get_bin_slot()
185 spin_lock_irqsave(&vc4->job_lock, irqflags); in vc4_v3d_get_bin_slot()
186 slot = ffs(~vc4->bin_alloc_used); in vc4_v3d_get_bin_slot()
190 vc4->bin_alloc_used |= BIT(slot); in vc4_v3d_get_bin_slot()
191 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_v3d_get_bin_slot()
198 exec = vc4_last_render_job(vc4); in vc4_v3d_get_bin_slot()
201 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_v3d_get_bin_slot()
237 static int bin_bo_alloc(struct vc4_dev *vc4) in bin_bo_alloc() argument
239 struct vc4_v3d *v3d = vc4->v3d; in bin_bo_alloc()
256 struct vc4_bo *bo = vc4_bo_create(&vc4->base, size, true, in bin_bo_alloc()
273 vc4->bin_bo = bo; in bin_bo_alloc()
291 vc4->bin_alloc_size = 512 * 1024; in bin_bo_alloc()
292 vc4->bin_alloc_used = 0; in bin_bo_alloc()
293 vc4->bin_alloc_overflow = 0; in bin_bo_alloc()
294 WARN_ON_ONCE(sizeof(vc4->bin_alloc_used) * 8 != in bin_bo_alloc()
295 bo->base.base.size / vc4->bin_alloc_size); in bin_bo_alloc()
297 kref_init(&vc4->bin_bo_kref); in bin_bo_alloc()
324 int vc4_v3d_bin_bo_get(struct vc4_dev *vc4, bool *used) in vc4_v3d_bin_bo_get() argument
328 if (WARN_ON_ONCE(vc4->is_vc5)) in vc4_v3d_bin_bo_get()
331 mutex_lock(&vc4->bin_bo_lock); in vc4_v3d_bin_bo_get()
336 if (vc4->bin_bo) in vc4_v3d_bin_bo_get()
337 kref_get(&vc4->bin_bo_kref); in vc4_v3d_bin_bo_get()
339 ret = bin_bo_alloc(vc4); in vc4_v3d_bin_bo_get()
345 mutex_unlock(&vc4->bin_bo_lock); in vc4_v3d_bin_bo_get()
352 struct vc4_dev *vc4 = container_of(ref, struct vc4_dev, bin_bo_kref); in bin_bo_release() local
354 if (WARN_ON_ONCE(!vc4->bin_bo)) in bin_bo_release()
357 drm_gem_object_put(&vc4->bin_bo->base.base); in bin_bo_release()
358 vc4->bin_bo = NULL; in bin_bo_release()
361 void vc4_v3d_bin_bo_put(struct vc4_dev *vc4) in vc4_v3d_bin_bo_put() argument
363 if (WARN_ON_ONCE(vc4->is_vc5)) in vc4_v3d_bin_bo_put()
366 mutex_lock(&vc4->bin_bo_lock); in vc4_v3d_bin_bo_put()
367 kref_put(&vc4->bin_bo_kref, bin_bo_release); in vc4_v3d_bin_bo_put()
368 mutex_unlock(&vc4->bin_bo_lock); in vc4_v3d_bin_bo_put()
375 struct vc4_dev *vc4 = v3d->vc4; in vc4_v3d_runtime_suspend() local
377 vc4_irq_disable(&vc4->base); in vc4_v3d_runtime_suspend()
387 struct vc4_dev *vc4 = v3d->vc4; in vc4_v3d_runtime_resume() local
394 vc4_v3d_init_hw(&vc4->base); in vc4_v3d_runtime_resume()
396 vc4_irq_enable(&vc4->base); in vc4_v3d_runtime_resume()
405 struct vc4_dev *vc4 = to_vc4_dev(drm); in vc4_v3d_debugfs_init() local
406 struct vc4_v3d *v3d = vc4->v3d; in vc4_v3d_debugfs_init()
408 if (!vc4->v3d) in vc4_v3d_debugfs_init()
422 struct vc4_dev *vc4 = to_vc4_dev(drm); in vc4_v3d_bind() local
441 vc4->v3d = v3d; in vc4_v3d_bind()
442 v3d->vc4 = vc4; in vc4_v3d_bind()
451 vc4->irq = ret; in vc4_v3d_bind()
474 ret = vc4_irq_install(drm, vc4->irq); in vc4_v3d_bind()
495 struct vc4_dev *vc4 = to_vc4_dev(drm); in vc4_v3d_unbind() local
506 vc4->v3d = NULL; in vc4_v3d_unbind()
531 { .compatible = "brcm,vc4-v3d" },