drm/i915/ttm: audit remaining bo->resource
authorMatthew Auld <matthew.auld@intel.com>
Mon, 30 Jan 2023 12:06:32 +0000 (12:06 +0000)
committerChristian König <christian.koenig@amd.com>
Mon, 6 Feb 2023 11:10:07 +0000 (12:10 +0100)
commit58c7ee0676bace7a7aae8a3e21ec8d09eab1c895
tree49dd2a10ae820ae5d55e94b3b97352e3e5bcbf60
parentfde789e8339c60c8c58e5a71fa819fcfe52d839e
drm/i915/ttm: audit remaining bo->resource

In the near future TTM will have NULL bo->resource when the object is
initially created, plus after calling into pipeline-gutting. Try to
handle the remaining cases. In practice NULL bo->resource should be
taken to mean swapped-out or purged object.

v2 (Andrzej):
  - Rather make i915_ttm_cpu_maps_iomem() return false with NULL
    resource.

References: 516198d317d8 ("drm/i915: audit bo->resource usage v3")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230130101230.25347-2-matthew.auld@intel.com
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Acked-by: Christian König <ckoenig.leichtzumerken@gmail.com>
Signed-off-by: Christian König <christian.koenig@amd.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
drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c