]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/vc4/vc4_irq.c
quota: Wire up quotactl_fd syscall
[linux.git] / drivers / gpu / drm / vc4 / vc4_irq.c
index ffd0a4388752eaef9e703a6073a50425a265680b..e226c24e543f8e423ca5e0fe30e83326fc9a04a6 100644 (file)
@@ -59,15 +59,22 @@ vc4_overflow_mem_work(struct work_struct *work)
 {
        struct vc4_dev *vc4 =
                container_of(work, struct vc4_dev, overflow_mem_work);
-       struct vc4_bo *bo = vc4->bin_bo;
+       struct vc4_bo *bo;
        int bin_bo_slot;
        struct vc4_exec_info *exec;
        unsigned long irqflags;
 
+       mutex_lock(&vc4->bin_bo_lock);
+
+       if (!vc4->bin_bo)
+               goto complete;
+
+       bo = vc4->bin_bo;
+
        bin_bo_slot = vc4_v3d_get_bin_slot(vc4);
        if (bin_bo_slot < 0) {
                DRM_ERROR("Couldn't allocate binner overflow mem\n");
-               return;
+               goto complete;
        }
 
        spin_lock_irqsave(&vc4->job_lock, irqflags);
@@ -98,6 +105,9 @@ vc4_overflow_mem_work(struct work_struct *work)
        V3D_WRITE(V3D_INTCTL, V3D_INT_OUTOMEM);
        V3D_WRITE(V3D_INTENA, V3D_INT_OUTOMEM);
        spin_unlock_irqrestore(&vc4->job_lock, irqflags);
+
+complete:
+       mutex_unlock(&vc4->bin_bo_lock);
 }
 
 static void
@@ -249,8 +259,10 @@ vc4_irq_postinstall(struct drm_device *dev)
        if (!vc4->v3d)
                return 0;
 
-       /* Enable both the render done and out of memory interrupts. */
-       V3D_WRITE(V3D_INTENA, V3D_DRIVER_IRQS);
+       /* Enable the render done interrupts. The out-of-memory interrupt is
+        * enabled as soon as we have a binner BO allocated.
+        */
+       V3D_WRITE(V3D_INTENA, V3D_INT_FLDONE | V3D_INT_FRDONE);
 
        return 0;
 }
This page took 0.034952 seconds and 4 git commands to generate.