]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/gpu/drm/i915/i915_drv.h
drm/i915: check for ERR_PTR from i915_gem_object_pin_map()
authorDave Gordon <david.s.gordon@intel.com>
Tue, 12 Apr 2016 13:46:16 +0000 (14:46 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Wed, 20 Apr 2016 15:59:03 +0000 (16:59 +0100)
commit8305216ff831ebc47d6335f577448e6c0453fc82
tree5c4f2130dd75a4f120ad448bedcc194db060cbaf
parent86e06cc0c0ecf3fdfe04ff48fccb34891767d514
drm/i915: check for ERR_PTR from i915_gem_object_pin_map()

The newly-introduced function i915_gem_object_pin_map() returns an
ERR_PTR (not NULL) if the pin-and-map opertaion fails, so that's what we
must check for. And it's nicer not to assign such a pointer-or-error to
a structure being filled in until after it's been validated, so we
should keep it local and avoid exporting a bogus pointer. Also, for
clarity and symmetry, we should clear 'virtual_start' along with 'vma'
when unmapping a ringbuffer.

Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_ringbuffer.c