diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4177-drm-amd-display-enable-hostvm-based-on-roimmu-active.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4177-drm-amd-display-enable-hostvm-based-on-roimmu-active.patch | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4177-drm-amd-display-enable-hostvm-based-on-roimmu-active.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4177-drm-amd-display-enable-hostvm-based-on-roimmu-active.patch new file mode 100644 index 00000000..1840beaf --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4177-drm-amd-display-enable-hostvm-based-on-roimmu-active.patch @@ -0,0 +1,87 @@ +From 029033b0e5f6415f7e129232b13f402a41763c9d Mon Sep 17 00:00:00 2001 +From: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> +Date: Wed, 2 Oct 2019 15:19:41 -0400 +Subject: [PATCH 4177/4736] drm/amd/display: enable hostvm based on roimmu + active for dcn2.1 + +Enabling hostvm when ROIMMU is not active seems to break GPUVM. +This fixes the issue by not enabling hostvm if ROIMMU is not +activated. + +Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> +Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> +Reviewed-by: Roman Li <Roman.Li@amd.com> +--- + .../drm/amd/display/dc/dcn21/dcn21_hubbub.c | 40 ++++++++++++------- + 1 file changed, 25 insertions(+), 15 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c +index 8e7e79f44272..bd247e5e753e 100644 +--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c +@@ -22,6 +22,7 @@ + * Authors: AMD + * + */ ++#include <linux/delay.h> + #include "dm_services.h" + #include "dcn20/dcn20_hubbub.h" + #include "dcn21_hubbub.h" +@@ -71,30 +72,39 @@ static uint32_t convert_and_clamp( + void dcn21_dchvm_init(struct hubbub *hubbub) + { + struct dcn20_hubbub *hubbub1 = TO_DCN20_HUBBUB(hubbub); ++ uint32_t riommu_active; ++ int i; + + //Init DCHVM block + REG_UPDATE(DCHVM_CTRL0, HOSTVM_INIT_REQ, 1); + + //Poll until RIOMMU_ACTIVE = 1 +- //TODO: Figure out interval us and retry count +- REG_WAIT(DCHVM_RIOMMU_STAT0, RIOMMU_ACTIVE, 1, 5, 100); ++ for (i = 0; i < 100; i++) { ++ REG_GET(DCHVM_RIOMMU_STAT0, RIOMMU_ACTIVE, &riommu_active); + +- //Reflect the power status of DCHUBBUB +- REG_UPDATE(DCHVM_RIOMMU_CTRL0, HOSTVM_POWERSTATUS, 1); ++ if (riommu_active) ++ break; ++ else ++ udelay(5); ++ } ++ ++ if (riommu_active) { ++ //Reflect the power status of DCHUBBUB ++ REG_UPDATE(DCHVM_RIOMMU_CTRL0, HOSTVM_POWERSTATUS, 1); + +- //Start rIOMMU prefetching +- REG_UPDATE(DCHVM_RIOMMU_CTRL0, HOSTVM_PREFETCH_REQ, 1); ++ //Start rIOMMU prefetching ++ REG_UPDATE(DCHVM_RIOMMU_CTRL0, HOSTVM_PREFETCH_REQ, 1); + +- // Enable dynamic clock gating +- REG_UPDATE_4(DCHVM_CLK_CTRL, +- HVM_DISPCLK_R_GATE_DIS, 0, +- HVM_DISPCLK_G_GATE_DIS, 0, +- HVM_DCFCLK_R_GATE_DIS, 0, +- HVM_DCFCLK_G_GATE_DIS, 0); ++ // Enable dynamic clock gating ++ REG_UPDATE_4(DCHVM_CLK_CTRL, ++ HVM_DISPCLK_R_GATE_DIS, 0, ++ HVM_DISPCLK_G_GATE_DIS, 0, ++ HVM_DCFCLK_R_GATE_DIS, 0, ++ HVM_DCFCLK_G_GATE_DIS, 0); + +- //Poll until HOSTVM_PREFETCH_DONE = 1 +- //TODO: Figure out interval us and retry count +- REG_WAIT(DCHVM_RIOMMU_STAT0, HOSTVM_PREFETCH_DONE, 1, 5, 100); ++ //Poll until HOSTVM_PREFETCH_DONE = 1 ++ REG_WAIT(DCHVM_RIOMMU_STAT0, HOSTVM_PREFETCH_DONE, 1, 5, 100); ++ } + } + + int hubbub21_init_dchub(struct hubbub *hubbub, +-- +2.17.1 + |