dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: [PATCH 3/3] drm/radeon/dpm: only need to reprogram uvd if uvd pg is enabled
Date: Thu, 29 Aug 2013 17:24:50 -0400	[thread overview]
Message-ID: <1377811490-4649-3-git-send-email-alexander.deucher@amd.com> (raw)
In-Reply-To: <1377811490-4649-1-git-send-email-alexander.deucher@amd.com>

Avoid needless uvd reprogramming if uvd powergating is disabled.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/radeon/kv_dpm.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c
index a102077..15a6f67 100644
--- a/drivers/gpu/drm/radeon/kv_dpm.c
+++ b/drivers/gpu/drm/radeon/kv_dpm.c
@@ -1491,17 +1491,20 @@ void kv_dpm_powergate_uvd(struct radeon_device *rdev, bool gate)
 	pi->uvd_power_gated = gate;
 
 	if (gate) {
-		uvd_v1_0_stop(rdev);
-		cik_update_cg(rdev, RADEON_CG_BLOCK_UVD, false);
+		if (pi->caps_uvd_pg) {
+			uvd_v1_0_stop(rdev);
+			cik_update_cg(rdev, RADEON_CG_BLOCK_UVD, false);
+		}
 		kv_update_uvd_dpm(rdev, gate);
 		if (pi->caps_uvd_pg)
 			kv_notify_message_to_smu(rdev, PPSMC_MSG_UVDPowerOFF);
 	} else {
-		if (pi->caps_uvd_pg)
+		if (pi->caps_uvd_pg) {
 			kv_notify_message_to_smu(rdev, PPSMC_MSG_UVDPowerON);
-		uvd_v4_2_resume(rdev);
-		uvd_v1_0_start(rdev);
-		cik_update_cg(rdev, RADEON_CG_BLOCK_UVD, true);
+			uvd_v4_2_resume(rdev);
+			uvd_v1_0_start(rdev);
+			cik_update_cg(rdev, RADEON_CG_BLOCK_UVD, true);
+		}
 		kv_update_uvd_dpm(rdev, gate);
 	}
 }
-- 
1.8.3.1

  parent reply	other threads:[~2013-08-29 21:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29 21:24 [PATCH 1/3] drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume Alex Deucher
2013-08-29 21:24 ` [PATCH 2/3] drm/radeon: check the return value of uvd_v1_0_start in uvd_v1_0_init Alex Deucher
2013-08-29 21:24 ` Alex Deucher [this message]
2013-08-30  6:49 ` [PATCH 1/3] drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1377811490-4649-3-git-send-email-alexander.deucher@amd.com \
    --to=alexdeucher@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox