Commit ca0b954a authored by Christian König's avatar Christian König Committed by Alex Deucher
Browse files

drm/amdgpu: make sure that BOs have a backing store



It's perfectly possible that the BO is about to be destroyed and doesn't
have a backing store associated with it.

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Acked-by: default avatarGuchun Chen <guchun.chen@amd.com>
Tested-by: default avatarMikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e2ad8e2d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1282,8 +1282,12 @@ void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
void amdgpu_bo_get_memory(struct amdgpu_bo *bo,
			  struct amdgpu_mem_stats *stats)
{
	unsigned int domain;
	uint64_t size = amdgpu_bo_size(bo);
	unsigned int domain;

	/* Abort if the BO doesn't currently have a backing store */
	if (!bo->tbo.resource)
		return;

	domain = amdgpu_mem_type_to_domain(bo->tbo.resource->mem_type);
	switch (domain) {