diff options
author | Mohammed Khajapasha <mohammed.khajapasha@intel.com> | 2021-04-27 09:54:17 +0100 |
---|---|---|
committer | Matthew Auld <matthew.auld@intel.com> | 2021-04-27 16:21:47 +0100 |
commit | 229e22845e81c3d3b4b32bdd69c6a7f345fb0197 (patch) | |
tree | 87f7379615c162274d41871f1636896d40a8a957 | |
parent | 4bc91dbde0da2f88b1f3660e8d17dacd2e929a62 (diff) | |
download | linux-229e22845e81c3d3b4b32bdd69c6a7f345fb0197.tar.gz linux-229e22845e81c3d3b4b32bdd69c6a7f345fb0197.tar.bz2 linux-229e22845e81c3d3b4b32bdd69c6a7f345fb0197.zip |
drm/i915: Return error value when bo not in LMEM for discrete
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@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210427085417.120246-7-matthew.auld@intel.com
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_display.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 7cd19ff40ed3..fe2624b8f76c 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -63,6 +63,7 @@ #include "display/intel_vdsc.h" #include "display/intel_vrr.h" +#include "gem/i915_gem_lmem.h" #include "gem/i915_gem_object.h" #include "gt/intel_rps.h" @@ -11274,11 +11275,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); |