Re: [PATCH] drm/amd/powerplay: delete pp dead code on raven

2017-08-25 Thread Alex Deucher
On Fri, Aug 25, 2017 at 6:18 AM, Rex Zhu  wrote:
> Change-Id: Ib2a3cd06c540a90eb33fc9e4ce0f3122c5f2c0d3
> Signed-off-by: Rex Zhu 

Reviewed-by: Alex Deucher 

> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 66 
> --
>  1 file changed, 66 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c 
> b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
> index a5fa546..ebbee5f 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
> @@ -49,29 +49,6 @@
>  int rv_display_clock_voltage_request(struct pp_hwmgr *hwmgr,
> struct pp_display_clock_request *clock_req);
>
> -struct phm_vq_budgeting_record rv_vqtable[] = {
> -/* CUs, SSP low, SSP High, Display Configuration, AWD/non-AWD,
> - * Sustainable GFXCLK, Sustainable FCLK, Sustainable CUs,
> - * unused, unused, unused
> - */
> -   { 11, 30, 60, VQ_DisplayConfig_NoneAWD,  8, 16, 11, 0, 0, 0 },
> -   { 11, 30, 60, VQ_DisplayConfig_AWD,  8, 16, 11, 0, 0, 0 },
> -
> -   {  8, 30, 60, VQ_DisplayConfig_NoneAWD, 10, 16,  8, 0, 0, 0 },
> -   {  8, 30, 60, VQ_DisplayConfig_AWD, 10, 16,  8, 0, 0, 0 },
> -
> -   { 10, 12, 30, VQ_DisplayConfig_NoneAWD,  4, 12, 10, 0, 0, 0 },
> -   { 10, 12, 30, VQ_DisplayConfig_AWD,  4, 12, 10, 0, 0, 0 },
> -
> -   {  8, 12, 30, VQ_DisplayConfig_NoneAWD,  45000, 12,  8, 0, 0, 0 },
> -   {  8, 12, 30, VQ_DisplayConfig_AWD,  45000, 12,  8, 0, 0, 0 },
> -
> -   {  6, 12, 30, VQ_DisplayConfig_NoneAWD,  45000, 12,  6, 0, 0, 0 },
> -   {  6, 12, 30, VQ_DisplayConfig_AWD,  45000, 12,  6, 0, 0, 0 },
> -
> -   {  3, 12, 30, VQ_DisplayConfig_NoneAWD,  45000, 12,  3, 0, 0, 0 },
> -   {  3, 12, 30, VQ_DisplayConfig_AWD,  45000, 12,  3, 0, 0, 0 },
> -};
>
>  static struct rv_power_state *cast_rv_ps(struct pp_hw_power_state *hw_ps)
>  {
> @@ -90,42 +67,6 @@ static const struct rv_power_state *cast_const_rv_ps(
> return (struct rv_power_state *)hw_ps;
>  }
>
> -static int rv_init_vq_budget_table(struct pp_hwmgr *hwmgr)
> -{
> -   uint32_t table_size, i;
> -   struct phm_vq_budgeting_table *ptable;
> -   uint32_t num_entries = ARRAY_SIZE(rv_vqtable);
> -
> -   if (hwmgr->dyn_state.vq_budgeting_table != NULL)
> -   return 0;
> -
> -   table_size = sizeof(struct phm_vq_budgeting_table) +
> -   sizeof(struct phm_vq_budgeting_record) * (num_entries 
> - 1);
> -
> -   ptable = kzalloc(table_size, GFP_KERNEL);
> -   if (NULL == ptable)
> -   return -ENOMEM;
> -
> -   ptable->numEntries = (uint8_t) num_entries;
> -
> -   for (i = 0; i < ptable->numEntries; i++) {
> -   ptable->entries[i].ulCUs = rv_vqtable[i].ulCUs;
> -   ptable->entries[i].ulSustainableSOCPowerLimitLow = 
> rv_vqtable[i].ulSustainableSOCPowerLimitLow;
> -   ptable->entries[i].ulSustainableSOCPowerLimitHigh = 
> rv_vqtable[i].ulSustainableSOCPowerLimitHigh;
> -   ptable->entries[i].ulMinSclkLow = rv_vqtable[i].ulMinSclkLow;
> -   ptable->entries[i].ulMinSclkHigh = 
> rv_vqtable[i].ulMinSclkHigh;
> -   ptable->entries[i].ucDispConfig = rv_vqtable[i].ucDispConfig;
> -   ptable->entries[i].ulDClk = rv_vqtable[i].ulDClk;
> -   ptable->entries[i].ulEClk = rv_vqtable[i].ulEClk;
> -   ptable->entries[i].ulSustainableSclk = 
> rv_vqtable[i].ulSustainableSclk;
> -   ptable->entries[i].ulSustainableCUs = 
> rv_vqtable[i].ulSustainableCUs;
> -   }
> -
> -   hwmgr->dyn_state.vq_budgeting_table = ptable;
> -
> -   return 0;
> -}
> -
>  static int rv_initialize_dpm_defaults(struct pp_hwmgr *hwmgr)
>  {
> struct rv_hwmgr *rv_hwmgr = (struct rv_hwmgr *)(hwmgr->backend);
> @@ -589,8 +530,6 @@ static int rv_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
>
> hwmgr->platform_descriptor.minimumClocksReductionPercentage = 50;
>
> -   rv_init_vq_budget_table(hwmgr);
> -
> return result;
>  }
>
> @@ -635,11 +574,6 @@ static int rv_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
> hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
> }
>
> -   if (NULL != hwmgr->dyn_state.vq_budgeting_table) {
> -   kfree(hwmgr->dyn_state.vq_budgeting_table);
> -   hwmgr->dyn_state.vq_budgeting_table = NULL;
> -   }
> -
> kfree(hwmgr->backend);
> hwmgr->backend = NULL;
>
> --
> 1.9.1
>
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


RE: [PATCH] drm/amd/powerplay: delete pp dead code on raven

2017-08-25 Thread Zhang, Hawking
Reviewed-by: Hawking Zhang 

Regards,
Hawking
-Original Message-
From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf Of Rex 
Zhu
Sent: Friday, August 25, 2017 18:18
To: amd-gfx@lists.freedesktop.org
Cc: Zhu, Rex 
Subject: [PATCH] drm/amd/powerplay: delete pp dead code on raven

Change-Id: Ib2a3cd06c540a90eb33fc9e4ce0f3122c5f2c0d3
Signed-off-by: Rex Zhu 
---
 drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 66 --
 1 file changed, 66 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
index a5fa546..ebbee5f 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
@@ -49,29 +49,6 @@
 int rv_display_clock_voltage_request(struct pp_hwmgr *hwmgr,
struct pp_display_clock_request *clock_req);
 
-struct phm_vq_budgeting_record rv_vqtable[] = {
-/* CUs, SSP low, SSP High, Display Configuration, AWD/non-AWD,
- * Sustainable GFXCLK, Sustainable FCLK, Sustainable CUs,
- * unused, unused, unused
- */
-   { 11, 30, 60, VQ_DisplayConfig_NoneAWD,  8, 16, 11, 0, 0, 0 },
-   { 11, 30, 60, VQ_DisplayConfig_AWD,  8, 16, 11, 0, 0, 0 },
-
-   {  8, 30, 60, VQ_DisplayConfig_NoneAWD, 10, 16,  8, 0, 0, 0 },
-   {  8, 30, 60, VQ_DisplayConfig_AWD, 10, 16,  8, 0, 0, 0 },
-
-   { 10, 12, 30, VQ_DisplayConfig_NoneAWD,  4, 12, 10, 0, 0, 0 },
-   { 10, 12, 30, VQ_DisplayConfig_AWD,  4, 12, 10, 0, 0, 0 },
-
-   {  8, 12, 30, VQ_DisplayConfig_NoneAWD,  45000, 12,  8, 0, 0, 0 },
-   {  8, 12, 30, VQ_DisplayConfig_AWD,  45000, 12,  8, 0, 0, 0 },
-
-   {  6, 12, 30, VQ_DisplayConfig_NoneAWD,  45000, 12,  6, 0, 0, 0 },
-   {  6, 12, 30, VQ_DisplayConfig_AWD,  45000, 12,  6, 0, 0, 0 },
-
-   {  3, 12, 30, VQ_DisplayConfig_NoneAWD,  45000, 12,  3, 0, 0, 0 },
-   {  3, 12, 30, VQ_DisplayConfig_AWD,  45000, 12,  3, 0, 0, 0 },
-};
 
 static struct rv_power_state *cast_rv_ps(struct pp_hw_power_state *hw_ps)  { 
@@ -90,42 +67,6 @@ static const struct rv_power_state *cast_const_rv_ps(
return (struct rv_power_state *)hw_ps;  }
 
-static int rv_init_vq_budget_table(struct pp_hwmgr *hwmgr) -{
-   uint32_t table_size, i;
-   struct phm_vq_budgeting_table *ptable;
-   uint32_t num_entries = ARRAY_SIZE(rv_vqtable);
-
-   if (hwmgr->dyn_state.vq_budgeting_table != NULL)
-   return 0;
-
-   table_size = sizeof(struct phm_vq_budgeting_table) +
-   sizeof(struct phm_vq_budgeting_record) * (num_entries - 
1);
-
-   ptable = kzalloc(table_size, GFP_KERNEL);
-   if (NULL == ptable)
-   return -ENOMEM;
-
-   ptable->numEntries = (uint8_t) num_entries;
-
-   for (i = 0; i < ptable->numEntries; i++) {
-   ptable->entries[i].ulCUs = rv_vqtable[i].ulCUs;
-   ptable->entries[i].ulSustainableSOCPowerLimitLow = 
rv_vqtable[i].ulSustainableSOCPowerLimitLow;
-   ptable->entries[i].ulSustainableSOCPowerLimitHigh = 
rv_vqtable[i].ulSustainableSOCPowerLimitHigh;
-   ptable->entries[i].ulMinSclkLow = rv_vqtable[i].ulMinSclkLow;
-   ptable->entries[i].ulMinSclkHigh = rv_vqtable[i].ulMinSclkHigh;
-   ptable->entries[i].ucDispConfig = rv_vqtable[i].ucDispConfig;
-   ptable->entries[i].ulDClk = rv_vqtable[i].ulDClk;
-   ptable->entries[i].ulEClk = rv_vqtable[i].ulEClk;
-   ptable->entries[i].ulSustainableSclk = 
rv_vqtable[i].ulSustainableSclk;
-   ptable->entries[i].ulSustainableCUs = 
rv_vqtable[i].ulSustainableCUs;
-   }
-
-   hwmgr->dyn_state.vq_budgeting_table = ptable;
-
-   return 0;
-}
-
 static int rv_initialize_dpm_defaults(struct pp_hwmgr *hwmgr)  {
struct rv_hwmgr *rv_hwmgr = (struct rv_hwmgr *)(hwmgr->backend); @@ 
-589,8 +530,6 @@ static int rv_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
 
hwmgr->platform_descriptor.minimumClocksReductionPercentage = 50;
 
-   rv_init_vq_budget_table(hwmgr);
-
return result;
 }
 
@@ -635,11 +574,6 @@ static int rv_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL;
}
 
-   if (NULL != hwmgr->dyn_state.vq_budgeting_table) {
-   kfree(hwmgr->dyn_state.vq_budgeting_table);
-   hwmgr->dyn_state.vq_budgeting_table = NULL;
-   }
-
kfree(hwmgr->backend);
hwmgr->backend = NULL;
 
--
1.9.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx