drm/i915: Refactor ttm ghost obj detection
authorNirmoy Das <nirmoy.das@intel.com>
Fri, 14 Oct 2022 13:14:27 +0000 (15:14 +0200)
committerMatthew Auld <matthew.auld@intel.com>
Wed, 19 Oct 2022 12:29:21 +0000 (13:29 +0100)
commit6667d78a1123d237d66e34923754ebca97d06d39
tree86ec5abb43a5c155df8f3f8569de431bf8260287
parent2d3093fd5ea0e79cc6ca0e80ca56280ea7b4d0bf
drm/i915: Refactor ttm ghost obj detection

Currently i915_ttm_to_gem() returns NULL for ttm ghost
object which makes it unclear when we should add a NULL
check for a caller of i915_ttm_to_gem() as ttm ghost
objects are expected behaviour for certain cases.

Create a separate function to detect ttm ghost object and
use that in places where we expect a ghost obj from ttm.

Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221014131427.21102-1-nirmoy.das@intel.com
drivers/gpu/drm/i915/gem/i915_gem_ttm.c
drivers/gpu/drm/i915/gem/i915_gem_ttm.h
drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c