AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Guttula, Suresh" <Suresh.Guttula-5C7GfCeVMHo@public.gmane.org>
To: "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: "Sharma, Deepak" <Deepak.Sharma-5C7GfCeVMHo@public.gmane.org>,
	"Niu, Haibin" <Haibin.Niu-5C7GfCeVMHo@public.gmane.org>,
	"S, Shirish" <Shirish.S-5C7GfCeVMHo@public.gmane.org>,
	"Guttula, Suresh" <Suresh.Guttula-5C7GfCeVMHo@public.gmane.org>,
	"Agrawal, Akshu" <Akshu.Agrawal-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 3/3] drm/amd:Enable/Disable NBPSTATE on On/OFF of UVD
Date: Fri, 26 Oct 2018 13:45:44 +0000	[thread overview]
Message-ID: <1540561511-15539-3-git-send-email-suresh.guttula@amd.com> (raw)
In-Reply-To: <1540561511-15539-1-git-send-email-suresh.guttula-5C7GfCeVMHo@public.gmane.org>

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 imapct

Signed-off-by: suresh guttula <suresh.guttula@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c          | 17 +++++++++++++++++
 drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c |  4 +++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index e5a6db6..6902719 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -38,6 +38,7 @@
 #include "amdgpu_uvd.h"
 #include "cikd.h"
 #include "uvd/uvd_4_2_d.h"
+#include "hwmgr.h"
 
 /* 1 second timeout */
 #define UVD_IDLE_TIMEOUT	msecs_to_jiffies(1000)
@@ -78,6 +79,7 @@
 #define UVD_GPCOM_VCPU_DATA1	0x03c5
 #define UVD_NO_OP				0x03ff
 #define UVD_BASE_SI				0x3800
+#define WIDTH_4K                3840
 
 /**
  * amdgpu_uvd_cs_ctx - Command submission parser context
@@ -528,6 +530,21 @@ static int amdgpu_uvd_cs_msg_decode(struct amdgpu_device *adev, uint32_t *msg,
 	unsigned image_size, tmp, min_dpb_size, num_dpb_buffer;
 	unsigned min_ctx_size = ~0;
 
+	 //disable Low Memory PState for UVD(4k videos)
+	if (adev->asic_type == CHIP_STONEY && width >= WIDTH_4K) {
+		struct pp_hwmgr  *hwmgr;
+		struct pp_instance *pp_handle =
+			(struct pp_instance *)adev->powerplay.pp_handle;
+		if (pp_handle) {
+			hwmgr = pp_handle->hwmgr;
+			if (hwmgr && hwmgr->hwmgr_func &&
+				hwmgr->hwmgr_func->update_nbdpm_pstate)
+				hwmgr->hwmgr_func->update_nbdpm_pstate(hwmgr,
+									false,
+									true);
+		}
+	}
+
 	image_size = width * height;
 	image_size += image_size / 2;
 	image_size = ALIGN(image_size, 1024);
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c
index 553a203..0bf56f7 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c
@@ -1228,8 +1228,10 @@ static int smu8_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,
 
 static int smu8_dpm_powerdown_uvd(struct pp_hwmgr *hwmgr)
 {
-	if (PP_CAP(PHM_PlatformCaps_UVDPowerGating))
+	if (PP_CAP(PHM_PlatformCaps_UVDPowerGating)) {
+		smu8_nbdpm_pstate_enable_disable(hwmgr, true, true);
 		return smum_send_msg_to_smc(hwmgr, PPSMC_MSG_UVDPowerOFF);
+	}
 	return 0;
 }
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-10-26 13:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26 13:45 [PATCH 1/3] Revert "drm/amd/powerplay: Enable/Disable NBPSTATE on On/OFF of UVD" Guttula, Suresh
     [not found] ` <1540561511-15539-1-git-send-email-suresh.guttula-5C7GfCeVMHo@public.gmane.org>
2018-10-26 13:45   ` [PATCH 2/3] drm/amd/powerplay:add hwmgr callback to update nbpstate on Carrizo Guttula, Suresh
2018-10-26 13:45   ` Guttula, Suresh [this message]
     [not found]     ` <1540561511-15539-3-git-send-email-suresh.guttula-5C7GfCeVMHo@public.gmane.org>
2018-10-31 18:21       ` [PATCH 3/3] drm/amd:Enable/Disable NBPSTATE on On/OFF of UVD Alex Deucher

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=1540561511-15539-3-git-send-email-suresh.guttula@amd.com \
    --to=suresh.guttula-5c7gfcevmho@public.gmane.org \
    --cc=Akshu.Agrawal-5C7GfCeVMHo@public.gmane.org \
    --cc=Deepak.Sharma-5C7GfCeVMHo@public.gmane.org \
    --cc=Haibin.Niu-5C7GfCeVMHo@public.gmane.org \
    --cc=Shirish.S-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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