diff options
author | Matthew Auld <matthew.auld@intel.com> | 2021-01-14 18:24:01 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2021-01-15 08:00:03 +0000 |
commit | 7d58fef2e70af4a8d3d45f541c9d814b4d0060ba (patch) | |
tree | 36fab23505a65ebbc49209879512e6f37d6bbd74 /drivers/gpu/drm/i915/gem/i915_gem_create.c | |
parent | dcaccaf0e83a97750985bdb866649cc952b127cf (diff) |
drm/i915/gem: sanity check object size in gem_create
Depending on the regions min_page_size we might need to adjust the
object size, ensure this matches our expectations.
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20210114182402.840247-2-matthew.auld@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/gem/i915_gem_create.c')
-rw-r--r-- | drivers/gpu/drm/i915/gem/i915_gem_create.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_create.c b/drivers/gpu/drm/i915/gem/i915_gem_create.c index ce923ed49eee..45d60e3d98e3 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_create.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_create.c @@ -32,6 +32,8 @@ i915_gem_create(struct drm_file *file, if (IS_ERR(obj)) return PTR_ERR(obj); + GEM_BUG_ON(size != obj->base.size); + ret = drm_gem_handle_create(file, &obj->base, &handle); /* drop reference from allocate - handle holds it now */ i915_gem_object_put(obj); |