aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2014-10-01 09:51:29 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-03-19 12:26:40 -0400
commite66582f9ff2fac4c3fddac4f06ebb0e9623485f5 (patch)
treeb1af026d87bc0e67399a3e371a76dabc4a2565fd
parentff609975e1cd8a58ee862fb3188e8b01b935131d (diff)
drm/radeon: add get_allowed_info_register for cayman/TN
Registers that can be fetched from the info ioctl. Tested-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/ni.c29
-rw-r--r--drivers/gpu/drm/radeon/nid.h1
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.h2
4 files changed, 34 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index dab00812abaa..e8a496ff007e 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -828,6 +828,35 @@ out:
828 return err; 828 return err;
829} 829}
830 830
831/**
832 * cayman_get_allowed_info_register - fetch the register for the info ioctl
833 *
834 * @rdev: radeon_device pointer
835 * @reg: register offset in bytes
836 * @val: register value
837 *
838 * Returns 0 for success or -EINVAL for an invalid register
839 *
840 */
841int cayman_get_allowed_info_register(struct radeon_device *rdev,
842 u32 reg, u32 *val)
843{
844 switch (reg) {
845 case GRBM_STATUS:
846 case GRBM_STATUS_SE0:
847 case GRBM_STATUS_SE1:
848 case SRBM_STATUS:
849 case SRBM_STATUS2:
850 case (DMA_STATUS_REG + DMA0_REGISTER_OFFSET):
851 case (DMA_STATUS_REG + DMA1_REGISTER_OFFSET):
852 case UVD_STATUS:
853 *val = RREG32(reg);
854 return 0;
855 default:
856 return -EINVAL;
857 }
858}
859
831int tn_get_temp(struct radeon_device *rdev) 860int tn_get_temp(struct radeon_device *rdev)
832{ 861{
833 u32 temp = RREG32_SMC(TN_CURRENT_GNB_TEMP) & 0x7ff; 862 u32 temp = RREG32_SMC(TN_CURRENT_GNB_TEMP) & 0x7ff;
diff --git a/drivers/gpu/drm/radeon/nid.h b/drivers/gpu/drm/radeon/nid.h
index 6b44580440d0..2e5cdc4e98a1 100644
--- a/drivers/gpu/drm/radeon/nid.h
+++ b/drivers/gpu/drm/radeon/nid.h
@@ -1086,6 +1086,7 @@
1086#define UVD_UDEC_DBW_ADDR_CONFIG 0xEF54 1086#define UVD_UDEC_DBW_ADDR_CONFIG 0xEF54
1087#define UVD_RBC_RB_RPTR 0xF690 1087#define UVD_RBC_RB_RPTR 0xF690
1088#define UVD_RBC_RB_WPTR 0xF694 1088#define UVD_RBC_RB_WPTR 0xF694
1089#define UVD_STATUS 0xf6bc
1089 1090
1090/* 1091/*
1091 * PM4 1092 * PM4
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c
index 0db4ee71fa69..37d7cd7c6c46 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -1668,6 +1668,7 @@ static struct radeon_asic cayman_asic = {
1668 .mc_wait_for_idle = &evergreen_mc_wait_for_idle, 1668 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
1669 .get_xclk = &rv770_get_xclk, 1669 .get_xclk = &rv770_get_xclk,
1670 .get_gpu_clock_counter = &r600_get_gpu_clock_counter, 1670 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1671 .get_allowed_info_register = cayman_get_allowed_info_register,
1671 .gart = { 1672 .gart = {
1672 .tlb_flush = &cayman_pcie_gart_tlb_flush, 1673 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1673 .get_page_entry = &rs600_gart_get_page_entry, 1674 .get_page_entry = &rs600_gart_get_page_entry,
@@ -1772,6 +1773,7 @@ static struct radeon_asic trinity_asic = {
1772 .mc_wait_for_idle = &evergreen_mc_wait_for_idle, 1773 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
1773 .get_xclk = &r600_get_xclk, 1774 .get_xclk = &r600_get_xclk,
1774 .get_gpu_clock_counter = &r600_get_gpu_clock_counter, 1775 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1776 .get_allowed_info_register = cayman_get_allowed_info_register,
1775 .gart = { 1777 .gart = {
1776 .tlb_flush = &cayman_pcie_gart_tlb_flush, 1778 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1777 .get_page_entry = &rs600_gart_get_page_entry, 1779 .get_page_entry = &rs600_gart_get_page_entry,
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index b632e35248b1..dca6bc89bc1c 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -651,6 +651,8 @@ uint32_t cayman_dma_get_wptr(struct radeon_device *rdev,
651 struct radeon_ring *ring); 651 struct radeon_ring *ring);
652void cayman_dma_set_wptr(struct radeon_device *rdev, 652void cayman_dma_set_wptr(struct radeon_device *rdev,
653 struct radeon_ring *ring); 653 struct radeon_ring *ring);
654int cayman_get_allowed_info_register(struct radeon_device *rdev,
655 u32 reg, u32 *val);
654 656
655int ni_dpm_init(struct radeon_device *rdev); 657int ni_dpm_init(struct radeon_device *rdev);
656void ni_dpm_setup_asic(struct radeon_device *rdev); 658void ni_dpm_setup_asic(struct radeon_device *rdev);