Lines Matching defs:vc4

103 	struct vc4_dev *vc4 = to_vc4_dev(dev);
104 int ret = vc4_v3d_pm_get(vc4);
119 vc4_v3d_pm_put(vc4);
130 vc4_v3d_pm_get(struct vc4_dev *vc4)
132 mutex_lock(&vc4->power_lock);
133 if (vc4->power_refcount++ == 0) {
134 int ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
137 vc4->power_refcount--;
138 mutex_unlock(&vc4->power_lock);
142 mutex_unlock(&vc4->power_lock);
148 vc4_v3d_pm_put(struct vc4_dev *vc4)
150 mutex_lock(&vc4->power_lock);
151 if (--vc4->power_refcount == 0) {
152 pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev);
153 pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev);
155 mutex_unlock(&vc4->power_lock);
160 struct vc4_dev *vc4 = to_vc4_dev(dev);
169 int vc4_v3d_get_bin_slot(struct vc4_dev *vc4)
171 struct drm_device *dev = &vc4->base;
178 spin_lock_irqsave(&vc4->job_lock, irqflags);
179 slot = ffs(~vc4->bin_alloc_used);
183 vc4->bin_alloc_used |= BIT(slot);
184 spin_unlock_irqrestore(&vc4->job_lock, irqflags);
191 exec = vc4_last_render_job(vc4);
194 spin_unlock_irqrestore(&vc4->job_lock, irqflags);
230 static int bin_bo_alloc(struct vc4_dev *vc4)
232 struct vc4_v3d *v3d = vc4->v3d;
249 struct vc4_bo *bo = vc4_bo_create(&vc4->base, size, true,
266 vc4->bin_bo = bo;
284 vc4->bin_alloc_size = 512 * 1024;
285 vc4->bin_alloc_used = 0;
286 vc4->bin_alloc_overflow = 0;
287 WARN_ON_ONCE(sizeof(vc4->bin_alloc_used) * 8 !=
288 bo->base.base.size / vc4->bin_alloc_size);
290 kref_init(&vc4->bin_bo_kref);
317 int vc4_v3d_bin_bo_get(struct vc4_dev *vc4, bool *used)
321 mutex_lock(&vc4->bin_bo_lock);
326 if (vc4->bin_bo)
327 kref_get(&vc4->bin_bo_kref);
329 ret = bin_bo_alloc(vc4);
335 mutex_unlock(&vc4->bin_bo_lock);
342 struct vc4_dev *vc4 = container_of(ref, struct vc4_dev, bin_bo_kref);
344 if (WARN_ON_ONCE(!vc4->bin_bo))
347 drm_gem_object_put(&vc4->bin_bo->base.base);
348 vc4->bin_bo = NULL;
351 void vc4_v3d_bin_bo_put(struct vc4_dev *vc4)
353 mutex_lock(&vc4->bin_bo_lock);
354 kref_put(&vc4->bin_bo_kref, bin_bo_release);
355 mutex_unlock(&vc4->bin_bo_lock);
362 struct vc4_dev *vc4 = v3d->vc4;
364 vc4_irq_uninstall(&vc4->base);
374 struct vc4_dev *vc4 = v3d->vc4;
381 vc4_v3d_init_hw(&vc4->base);
384 enable_irq(vc4->base.irq);
385 vc4_irq_postinstall(&vc4->base);
395 struct vc4_dev *vc4 = to_vc4_dev(drm);
414 vc4->v3d = v3d;
415 v3d->vc4 = vc4;
472 struct vc4_dev *vc4 = to_vc4_dev(drm);
485 vc4->v3d = NULL;
511 { .compatible = "brcm,vc4-v3d" },