aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/radeon/evergreen.c28
-rw-r--r--drivers/gpu/drm/radeon/evergreend.h1
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.c3
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.h2
4 files changed, 34 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 973df064c14f..21cbd2e90f3b 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -1006,6 +1006,34 @@ static void evergreen_init_golden_registers(struct radeon_device *rdev)
1006 } 1006 }
1007} 1007}
1008 1008
1009/**
1010 * evergreen_get_allowed_info_register - fetch the register for the info ioctl
1011 *
1012 * @rdev: radeon_device pointer
1013 * @reg: register offset in bytes
1014 * @val: register value
1015 *
1016 * Returns 0 for success or -EINVAL for an invalid register
1017 *
1018 */
1019int evergreen_get_allowed_info_register(struct radeon_device *rdev,
1020 u32 reg, u32 *val)
1021{
1022 switch (reg) {
1023 case GRBM_STATUS:
1024 case GRBM_STATUS_SE0:
1025 case GRBM_STATUS_SE1:
1026 case SRBM_STATUS:
1027 case SRBM_STATUS2:
1028 case DMA_STATUS_REG:
1029 case UVD_STATUS:
1030 *val = RREG32(reg);
1031 return 0;
1032 default:
1033 return -EINVAL;
1034 }
1035}
1036
1009void evergreen_tiling_fields(unsigned tiling_flags, unsigned *bankw, 1037void evergreen_tiling_fields(unsigned tiling_flags, unsigned *bankw,
1010 unsigned *bankh, unsigned *mtaspect, 1038 unsigned *bankh, unsigned *mtaspect,
1011 unsigned *tile_split) 1039 unsigned *tile_split)
diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h
index a8d1d5240fcb..4aa5f755572b 100644
--- a/drivers/gpu/drm/radeon/evergreend.h
+++ b/drivers/gpu/drm/radeon/evergreend.h
@@ -1520,6 +1520,7 @@
1520#define UVD_UDEC_DBW_ADDR_CONFIG 0xef54 1520#define UVD_UDEC_DBW_ADDR_CONFIG 0xef54
1521#define UVD_RBC_RB_RPTR 0xf690 1521#define UVD_RBC_RB_RPTR 0xf690
1522#define UVD_RBC_RB_WPTR 0xf694 1522#define UVD_RBC_RB_WPTR 0xf694
1523#define UVD_STATUS 0xf6bc
1523 1524
1524/* 1525/*
1525 * PM4 1526 * PM4
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c
index f2c343717c4b..0db4ee71fa69 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -1344,6 +1344,7 @@ static struct radeon_asic evergreen_asic = {
1344 .mc_wait_for_idle = &evergreen_mc_wait_for_idle, 1344 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
1345 .get_xclk = &rv770_get_xclk, 1345 .get_xclk = &rv770_get_xclk,
1346 .get_gpu_clock_counter = &r600_get_gpu_clock_counter, 1346 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1347 .get_allowed_info_register = evergreen_get_allowed_info_register,
1347 .gart = { 1348 .gart = {
1348 .tlb_flush = &evergreen_pcie_gart_tlb_flush, 1349 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1349 .get_page_entry = &rs600_gart_get_page_entry, 1350 .get_page_entry = &rs600_gart_get_page_entry,
@@ -1437,6 +1438,7 @@ static struct radeon_asic sumo_asic = {
1437 .mc_wait_for_idle = &evergreen_mc_wait_for_idle, 1438 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
1438 .get_xclk = &r600_get_xclk, 1439 .get_xclk = &r600_get_xclk,
1439 .get_gpu_clock_counter = &r600_get_gpu_clock_counter, 1440 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1441 .get_allowed_info_register = evergreen_get_allowed_info_register,
1440 .gart = { 1442 .gart = {
1441 .tlb_flush = &evergreen_pcie_gart_tlb_flush, 1443 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1442 .get_page_entry = &rs600_gart_get_page_entry, 1444 .get_page_entry = &rs600_gart_get_page_entry,
@@ -1529,6 +1531,7 @@ static struct radeon_asic btc_asic = {
1529 .mc_wait_for_idle = &evergreen_mc_wait_for_idle, 1531 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
1530 .get_xclk = &rv770_get_xclk, 1532 .get_xclk = &rv770_get_xclk,
1531 .get_gpu_clock_counter = &r600_get_gpu_clock_counter, 1533 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1534 .get_allowed_info_register = evergreen_get_allowed_info_register,
1532 .gart = { 1535 .gart = {
1533 .tlb_flush = &evergreen_pcie_gart_tlb_flush, 1536 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1534 .get_page_entry = &rs600_gart_get_page_entry, 1537 .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 3e1346d585b3..b632e35248b1 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -548,6 +548,8 @@ struct radeon_fence *evergreen_copy_dma(struct radeon_device *rdev,
548 unsigned num_gpu_pages, 548 unsigned num_gpu_pages,
549 struct reservation_object *resv); 549 struct reservation_object *resv);
550int evergreen_get_temp(struct radeon_device *rdev); 550int evergreen_get_temp(struct radeon_device *rdev);
551int evergreen_get_allowed_info_register(struct radeon_device *rdev,
552 u32 reg, u32 *val);
551int sumo_get_temp(struct radeon_device *rdev); 553int sumo_get_temp(struct radeon_device *rdev);
552int tn_get_temp(struct radeon_device *rdev); 554int tn_get_temp(struct radeon_device *rdev);
553int cypress_dpm_init(struct radeon_device *rdev); 555int cypress_dpm_init(struct radeon_device *rdev);