[PATCH] drm/powerplay: enable dpm under pass-through

Zhang, Jerry (Junwei) Jerry.Zhang at amd.com
Tue Aug 21 01:38:23 UTC 2018


On 08/20/2018 11:39 AM, Yintian Tao wrote:
> Repeat enable dpm under pass-through because there is no actually
> hardware-fini and real power-off when guest vm shutdown or reboot.
> Otherwise, under pass-through it will be failed to populate populate

duplicate "populate"

> and upload SCLK MCLK DPM levels due to zero of pcie_speed_table.count.
>
> Change-Id: I7cbc55c650867d00e19241ceea5d98f78b5ac3f5
> Signed-off-by: Yintian Tao <yttao at amd.com>
> ---
>   drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
> index 53207e7..6ef3c87 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
> @@ -75,10 +75,12 @@ int phm_set_power_state(struct pp_hwmgr *hwmgr,
>
>   int phm_enable_dynamic_state_management(struct pp_hwmgr *hwmgr)
>   {
> +	struct amdgpu_device *adev = NULL;
>   	int ret = -EINVAL;;
>   	PHM_FUNC_CHECK(hwmgr);
> +	adev = hwmgr->adev;

It could be simplified as

    struct amdgpu_device *adev = hwmgr->adev;

or use that directly

    amdgpu_passthrough(hwmgr->adev)

apart from that,
Acked-by: Junwei Zhang <Jerry.Zhang at amd.com>

>
> -	if (smum_is_dpm_running(hwmgr)) {
> +	if (smum_is_dpm_running(hwmgr) && !amdgpu_passthrough(adev)) {
>   		pr_info("dpm has been enabled\n");
>   		return 0;
>   	}
>


More information about the amd-gfx mailing list