[PATCH 3/4] drm/amd/dpm: Add PG support for UVD on Carrizo

Tom St Denis tstdenis82 at gmail.com
Thu Jul 21 17:18:47 UTC 2016


Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/cz_dpm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
index 8ba07e79d4cb..a3e710147a69 100644
--- a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
@@ -41,6 +41,8 @@
 #include "gmc/gmc_8_1_d.h"
 #include "bif/bif_5_1_d.h"
 #include "gfx_v8_0.h"
+#include "uvd/uvd_6_0_d.h"
+#include "uvd/uvd_6_0_sh_mask.h"
 
 static void cz_dpm_powergate_uvd(struct amdgpu_device *adev, bool gate);
 static void cz_dpm_powergate_vce(struct amdgpu_device *adev, bool gate);
@@ -2098,6 +2100,15 @@ static void cz_dpm_powergate_uvd(struct amdgpu_device *adev, bool gate)
 	struct cz_power_info *pi = cz_get_pi(adev);
 	int ret;
 
+	if (pi->caps_uvd_pg) {
+		if (pi->uvd_dynamic_pg)
+			WREG32(mmUVD_POWER_STATUS,
+				UVD_POWER_STATUS__UVD_PG_EN_MASK |
+				UVD_POWER_STATUS__UVD_PG_MODE_MASK);
+		else
+			WREG32(mmUVD_POWER_STATUS,
+				UVD_POWER_STATUS__UVD_PG_EN_MASK);
+	}
 	if (pi->uvd_power_gated == gate)
 		return;
 
-- 
2.9.2



More information about the amd-gfx mailing list