[Intel-gfx] [RFC PATCH 078/162] drm/i915: Return error value when bo not in LMEM for discrete
Matthew Auld
matthew.auld at intel.com
Fri Nov 27 12:05:54 UTC 2020
From: Mohammed Khajapasha <mohammed.khajapasha at intel.com>
Return EREMOTE value when frame buffer object is not backed by LMEM
for discrete. If Local memory is supported by hardware the framebuffer
backing gem objects should be from local memory.
Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha at intel.com>
Cc: Michael J. Ruhl <michael.j.ruhl at intel.com>
Cc: Animesh Manna <animesh.manna at intel.com>
---
drivers/gpu/drm/i915/display/intel_display.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 8a7945f55278..95ed1e06ea55 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -18054,11 +18054,20 @@ intel_user_framebuffer_create(struct drm_device *dev,
struct drm_framebuffer *fb;
struct drm_i915_gem_object *obj;
struct drm_mode_fb_cmd2 mode_cmd = *user_mode_cmd;
+ struct drm_i915_private *i915;
obj = i915_gem_object_lookup(filp, mode_cmd.handles[0]);
if (!obj)
return ERR_PTR(-ENOENT);
+ /* object is backed with LMEM for discrete */
+ i915 = to_i915(obj->base.dev);
+ if (HAS_LMEM(i915) && !i915_gem_object_is_lmem(obj)) {
+ /* object is "remote", not in local memory */
+ i915_gem_object_put(obj);
+ return ERR_PTR(-EREMOTE);
+ }
+
fb = intel_framebuffer_create(obj, &mode_cmd);
i915_gem_object_put(obj);
--
2.26.2
More information about the Intel-gfx
mailing list