]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amdgpu: Reduce mem_type to domain double indirection
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Mon, 6 May 2024 16:59:56 +0000 (17:59 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 May 2024 21:40:38 +0000 (17:40 -0400)
commit8fb0efb10184c8121719247e5d59e68e7f5617de
tree500dce0776004ca3dded6918b6c900ea57aa9720
parent26e20235ce00219a1ca2fb617d82fa24607190ae
drm/amdgpu: Reduce mem_type to domain double indirection

All apart from AMDGPU_GEM_DOMAIN_GTT memory domains map 1:1 to TTM
placements. And the former be either AMDGPU_PL_PREEMPT or TTM_PL_TT,
depending on AMDGPU_GEM_CREATE_PREEMPTIBLE.

Simplify a few places in the code which convert the TTM placement into
a domain by checking against the current placement directly.

In the conversion AMDGPU_PL_PREEMPT either does not have to be handled
because amdgpu_mem_type_to_domain() cannot return that value anyway.

v2:
 * Remove AMDGPU_PL_PREEMPT handling.

v3:
 * Rebase.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Christian König <christian.koenig@amd.com> # v1
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> # v2
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c