drm/i915: Use the active reference on the vma while capturing
[linux-2.6-microblaze.git] / drivers / gpu / drm / i915 / i915_gpu_error.c
index 3e6cbb0..cf6e47a 100644 (file)
@@ -311,6 +311,8 @@ static int compress_page(struct i915_vma_compress *c,
 
                if (zlib_deflate(zstream, Z_NO_FLUSH) != Z_OK)
                        return -EIO;
+
+               cond_resched();
        } while (zstream->avail_in);
 
        /* Fallback to uncompressed if we increase size? */
@@ -397,6 +399,7 @@ static int compress_page(struct i915_vma_compress *c,
        if (!(wc && i915_memcpy_from_wc(ptr, src, PAGE_SIZE)))
                memcpy(ptr, src, PAGE_SIZE);
        dst->pages[dst->page_count++] = ptr;
+       cond_resched();
 
        return 0;
 }
@@ -1309,7 +1312,7 @@ capture_vma(struct intel_engine_capture_vma *next,
        }
 
        strcpy(c->name, name);
-       c->vma = i915_vma_get(vma);
+       c->vma = vma; /* reference held while active */
 
        c->next = next;
        return c;
@@ -1399,7 +1402,6 @@ intel_engine_coredump_add_vma(struct intel_engine_coredump *ee,
                                                 compress));
 
                i915_active_release(&vma->active);
-               i915_vma_put(vma);
 
                capture = this->next;
                kfree(this);