[PATCH] drm/i915: drm/i915: Allow i915_gem_object_get_page() on dmabuf as well

Janusz Krzysztofik janusz.krzysztofik at linux.intel.com
Thu Jun 13 09:49:00 UTC 2019


As dmabuf based backing store type uses drm_i915_gem_object_ops, it
behaves as any other normal object with respect to shrinker and memory
management.  In particular, it provides .get/put_pages() callbacks
required by i915_gem_object_get_page().

Let's mark the dmabuf backing store type with
I915_GEM_OBJECT_HAS_STRUCT_PAGE flag introduced with the intention of
marking objects having struct pages so functions which depend on that
functionality can be used on dmabuf backed objects as well.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_dmabuf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
index 5a101a9462d8..401279f35cab 100644
--- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c
+++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
@@ -270,6 +270,7 @@ static void i915_gem_object_put_pages_dmabuf(struct drm_i915_gem_object *obj,
 }
 
 static const struct drm_i915_gem_object_ops i915_gem_object_dmabuf_ops = {
+	.flags = I915_GEM_OBJECT_HAS_STRUCT_PAGE,
 	.get_pages = i915_gem_object_get_pages_dmabuf,
 	.put_pages = i915_gem_object_put_pages_dmabuf,
 };
-- 
2.21.0



More information about the Intel-gfx-trybot mailing list