drm/i915: Introduce drm_i915_gem_object_ops
In order to specialise functions depending upon the type of object, we
can attach vfuncs to each object via a new ->ops pointer.
For instance, this will be used in future patches to only bind pages from
a dma-buf for the duration that the object is used by the GPU - and so
prevent them from pinning those pages for the entire of the object.
v2: Bonus comments.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
index 43c9530..e4f1141 100644
--- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c
+++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
@@ -41,7 +41,7 @@
if (ret)
return ERR_PTR(ret);
- ret = i915_gem_object_get_pages_gtt(obj);
+ ret = i915_gem_object_get_pages(obj);
if (ret) {
sg = ERR_PTR(ret);
goto out;
@@ -89,7 +89,7 @@
goto out_unlock;
}
- ret = i915_gem_object_get_pages_gtt(obj);
+ ret = i915_gem_object_get_pages(obj);
if (ret) {
mutex_unlock(&dev->struct_mutex);
return ERR_PTR(ret);