[PATCH v2] drm/radeon/dpm: simplifying low state adjustment's logic for NI
Alex Deucher
alexdeucher at gmail.com
Tue Nov 26 07:20:41 PST 2013
On Tue, Nov 26, 2013 at 1:13 AM, Alexandre Demers
<alexandre.f.demers at gmail.com> wrote:
> While working on a dpm bug (https://bugs.freedesktop.org/show_bug.cgi?id=69723), I stumbled upon a couple of lines in NI dpm where we were reading and setting back the same values for no obvious reason. Simplified the logic.
>
This patch creates some unused variable warnings. While fixing them
up, I found the logic could be further cleaned up. See attached.
Alex
> Signed-off-by: Alexandre Demers <alexandre.f.demers at gmail.com>
> ---
> drivers/gpu/drm/radeon/ni_dpm.c | 17 ++++-------------
> 1 file changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
> index f263390..2a10bbe 100644
> --- a/drivers/gpu/drm/radeon/ni_dpm.c
> +++ b/drivers/gpu/drm/radeon/ni_dpm.c
> @@ -841,21 +841,12 @@ static void ni_apply_state_adjust_rules(struct radeon_device *rdev,
>
> if (disable_mclk_switching) {
> mclk = ps->performance_levels[ps->performance_level_count - 1].mclk;
> - sclk = ps->performance_levels[0].sclk;
> - vddc = ps->performance_levels[0].vddc;
> vddci = ps->performance_levels[ps->performance_level_count - 1].vddci;
> - } else {
> - sclk = ps->performance_levels[0].sclk;
> - mclk = ps->performance_levels[0].mclk;
> - vddc = ps->performance_levels[0].vddc;
> - vddci = ps->performance_levels[0].vddci;
> - }
>
> - /* adjusted low state */
> - ps->performance_levels[0].sclk = sclk;
> - ps->performance_levels[0].mclk = mclk;
> - ps->performance_levels[0].vddc = vddc;
> - ps->performance_levels[0].vddci = vddci;
> + /* adjusted low state */
> + ps->performance_levels[0].mclk = mclk;
> + ps->performance_levels[0].vddci = vddci;
> + }
>
> btc_skip_blacklist_clocks(rdev, max_limits->sclk, max_limits->mclk,
> &ps->performance_levels[0].sclk,
> --
> 1.8.4
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-drm-radeon-dpm-simply-state-adjust-logic-for-NI.patch
Type: text/x-diff
Size: 3047 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20131126/ee01faa6/attachment.patch>
More information about the dri-devel
mailing list