On Fri, Jan 19, 2018 at 3:10 AM, Rex Zhu <Rex.Zhu at amd.com> wrote: > Change-Id: Iea7d6ffe3d0139fa4780256e3975f966e2dc4d72 > Signed-off-by: Rex Zhu <Rex.Zhu at amd.com> Please add a commit message. Something like: drm/amd/pp: Disable OD feature if VBIOS limits Check the vbios to determine whether we can enable OD. You may want to make the messages pr_debug. I could go either way on that. With the commit message added: Reviewed-by: Alex Deucher <alexander.deucher at amd.com> > --- > drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c | 8 ++++---- > drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c | 11 +++++------ > drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c | 8 ++++---- > 3 files changed, 13 insertions(+), 14 deletions(-) > > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c > index b49d65c..624c220 100644 > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c > @@ -836,10 +836,10 @@ static int init_over_drive_limits( > hwmgr->platform_descriptor.maxOverdriveVDDC = 0; > hwmgr->platform_descriptor.overdriveVDDCStep = 0; > > - if (hwmgr->platform_descriptor.overdriveLimit.engineClock > 0 \ > - && hwmgr->platform_descriptor.overdriveLimit.memoryClock > 0) { > - phm_cap_set(hwmgr->platform_descriptor.platformCaps, > - PHM_PlatformCaps_ACOverdriveSupport); > + if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 \ > + || hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) { > + hwmgr->od_enabled = false; > + pr_info("OverDrive feature not support by VBIOS\n"); > } > > return 0; > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c > index c3e7e34..b1d4a10 100644 > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c > @@ -1074,12 +1074,11 @@ static int init_overdrive_limits(struct pp_hwmgr *hwmgr, > powerplay_table, > (const ATOM_FIRMWARE_INFO_V2_1 *)fw_info); > > - if (hwmgr->platform_descriptor.overdriveLimit.engineClock > 0 > - && hwmgr->platform_descriptor.overdriveLimit.memoryClock > 0 > - && !phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, > - PHM_PlatformCaps_OverdriveDisabledByPowerBudget)) > - phm_cap_set(hwmgr->platform_descriptor.platformCaps, > - PHM_PlatformCaps_ACOverdriveSupport); > + if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 > + && hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) { > + hwmgr->od_enabled = false; > + pr_info("OverDrive feature not support by VBIOS\n"); > + } > > return result; > } > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c > index f14c761..8dc1aed 100644 > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c > @@ -267,10 +267,10 @@ static int init_over_drive_limits( > hwmgr->platform_descriptor.maxOverdriveVDDC = 0; > hwmgr->platform_descriptor.overdriveVDDCStep = 0; > > - if (hwmgr->platform_descriptor.overdriveLimit.engineClock > 0 && > - hwmgr->platform_descriptor.overdriveLimit.memoryClock > 0) { > - phm_cap_set(hwmgr->platform_descriptor.platformCaps, > - PHM_PlatformCaps_ACOverdriveSupport); > + if (hwmgr->platform_descriptor.overdriveLimit.engineClock == 0 || > + hwmgr->platform_descriptor.overdriveLimit.memoryClock == 0) { > + hwmgr->od_enabled = false; > + pr_info("OverDrive feature not support by VBIOS\n"); > } > > return 0; > -- > 1.9.1 > > _______________________________________________ > amd-gfx mailing list > amd-gfx at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx