aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGuttula, Suresh <Suresh.Guttula@amd.com>2018-11-16 01:50:37 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-11-26 15:47:34 -0500
commit8ca606de76a212b8c2b8212f82a13f8201cc3117 (patch)
tree81f08b2232d824d2fc5d9e31da0c68450686c7bb /drivers
parente5bbf0e9ef0d1875050201eeb0239b040f09ed5b (diff)
drm/amd:Enable/Disable NBPSTATE on On/OFF of UVD
We observe black lines (underflow) on display when playing a 4K video with UVD. On Disabling Low memory P state this issue is not seen. In this patch ,disabling low memory P state only when video size >= 4k. Multiple runs of power measurement shows no impact Signed-off-by: suresh guttula <suresh.guttula@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c13
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h2
3 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index 7235cd0b0fa9..0de8650c5d6e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -33,6 +33,8 @@
33#include <linux/hwmon.h> 33#include <linux/hwmon.h>
34#include <linux/hwmon-sysfs.h> 34#include <linux/hwmon-sysfs.h>
35#include <linux/nospec.h> 35#include <linux/nospec.h>
36#include "hwmgr.h"
37#define WIDTH_4K 3840
36 38
37static int amdgpu_debugfs_pm_init(struct amdgpu_device *adev); 39static int amdgpu_debugfs_pm_init(struct amdgpu_device *adev);
38 40
@@ -1956,6 +1958,17 @@ void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable)
1956 amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_UVD, !enable); 1958 amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_UVD, !enable);
1957 mutex_unlock(&adev->pm.mutex); 1959 mutex_unlock(&adev->pm.mutex);
1958 } 1960 }
1961 /* enable/disable Low Memory PState for UVD (4k videos) */
1962 if (adev->asic_type == CHIP_STONEY &&
1963 adev->uvd.decode_image_width >= WIDTH_4K) {
1964 struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
1965
1966 if (hwmgr && hwmgr->hwmgr_func &&
1967 hwmgr->hwmgr_func->update_nbdpm_pstate)
1968 hwmgr->hwmgr_func->update_nbdpm_pstate(hwmgr,
1969 !enable,
1970 true);
1971 }
1959} 1972}
1960 1973
1961void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable) 1974void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index 69896f451e8a..4e5d13e41f6a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -692,6 +692,8 @@ static int amdgpu_uvd_cs_msg_decode(struct amdgpu_device *adev, uint32_t *msg,
692 buf_sizes[0x1] = dpb_size; 692 buf_sizes[0x1] = dpb_size;
693 buf_sizes[0x2] = image_size; 693 buf_sizes[0x2] = image_size;
694 buf_sizes[0x4] = min_ctx_size; 694 buf_sizes[0x4] = min_ctx_size;
695 /* store image width to adjust nb memory pstate */
696 adev->uvd.decode_image_width = width;
695 return 0; 697 return 0;
696} 698}
697 699
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h
index a3ab1a41060f..5eb63288d157 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h
@@ -65,6 +65,8 @@ struct amdgpu_uvd {
65 struct drm_sched_entity entity; 65 struct drm_sched_entity entity;
66 struct delayed_work idle_work; 66 struct delayed_work idle_work;
67 unsigned harvest_config; 67 unsigned harvest_config;
68 /* store image width to adjust nb memory state */
69 unsigned decode_image_width;
68}; 70};
69 71
70int amdgpu_uvd_sw_init(struct amdgpu_device *adev); 72int amdgpu_uvd_sw_init(struct amdgpu_device *adev);