mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/amdgpu: Fix amdgpu_display_supported_domains logic.
Add restriction to dissallow GTT domain if the relevant BO doesn't have USWC flag set to avoid the APU hang scenario. Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
354e6e14ef
commit
f2bd8a0ed7
@@ -191,7 +191,8 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,
|
||||
}
|
||||
|
||||
if (!adev->enable_virtual_display) {
|
||||
r = amdgpu_bo_pin(new_abo, amdgpu_display_supported_domains(adev));
|
||||
r = amdgpu_bo_pin(new_abo,
|
||||
amdgpu_display_supported_domains(adev, new_abo->flags));
|
||||
if (unlikely(r != 0)) {
|
||||
DRM_ERROR("failed to pin new abo buffer before flip\n");
|
||||
goto unreserve;
|
||||
@@ -495,20 +496,25 @@ static const struct drm_framebuffer_funcs amdgpu_fb_funcs = {
|
||||
.create_handle = drm_gem_fb_create_handle,
|
||||
};
|
||||
|
||||
uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev)
|
||||
uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev,
|
||||
uint64_t bo_flags)
|
||||
{
|
||||
uint32_t domain = AMDGPU_GEM_DOMAIN_VRAM;
|
||||
|
||||
#if defined(CONFIG_DRM_AMD_DC)
|
||||
/*
|
||||
* if amdgpu_bo_validate_uswc returns false it means that USWC mappings
|
||||
* if amdgpu_bo_support_uswc returns false it means that USWC mappings
|
||||
* is not supported for this board. But this mapping is required
|
||||
* to avoid hang caused by placement of scanout BO in GTT on certain
|
||||
* APUs. So force the BO placement to VRAM in case this architecture
|
||||
* will not allow USWC mappings.
|
||||
* Also, don't allow GTT domain if the BO doens't have USWC falg set.
|
||||
*/
|
||||
if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type <= CHIP_RAVEN &&
|
||||
adev->flags & AMD_IS_APU && amdgpu_bo_support_uswc(0) &&
|
||||
if (adev->asic_type >= CHIP_CARRIZO &&
|
||||
adev->asic_type <= CHIP_RAVEN &&
|
||||
(adev->flags & AMD_IS_APU) &&
|
||||
(bo_flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC) &&
|
||||
amdgpu_bo_support_uswc(bo_flags) &&
|
||||
amdgpu_device_asic_has_dc_support(adev->asic_type))
|
||||
domain |= AMDGPU_GEM_DOMAIN_GTT;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user