File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -27,15 +27,8 @@ static void __do_clflush(struct drm_i915_gem_object *obj)
2727static int clflush_work (struct dma_fence_work * base )
2828{
2929 struct clflush * clflush = container_of (base , typeof (* clflush ), base );
30- struct drm_i915_gem_object * obj = clflush -> obj ;
31- int err ;
3230
33- err = i915_gem_object_pin_pages (obj );
34- if (err )
35- return err ;
36-
37- __do_clflush (obj );
38- i915_gem_object_unpin_pages (obj );
31+ __do_clflush (clflush -> obj );
3932
4033 return 0 ;
4134}
@@ -44,6 +37,7 @@ static void clflush_release(struct dma_fence_work *base)
4437{
4538 struct clflush * clflush = container_of (base , typeof (* clflush ), base );
4639
40+ i915_gem_object_unpin_pages (clflush -> obj );
4741 i915_gem_object_put (clflush -> obj );
4842}
4943
@@ -63,6 +57,11 @@ static struct clflush *clflush_work_create(struct drm_i915_gem_object *obj)
6357 if (!clflush )
6458 return NULL ;
6559
60+ if (__i915_gem_object_get_pages (obj ) < 0 ) {
61+ kfree (clflush );
62+ return NULL ;
63+ }
64+
6665 dma_fence_work_init (& clflush -> base , & clflush_ops );
6766 clflush -> obj = i915_gem_object_get (obj ); /* obj <-> clflush cycle */
6867
You can’t perform that action at this time.
0 commit comments