<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
p.msipheadera4477989, li.msipheadera4477989, div.msipheadera4477989
{mso-style-name:msipheadera4477989;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="msipheadera4477989" style="margin:0in"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:blue">[AMD Official Use Only]</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Got it, Evans.<o:p></o:p></p>
<p class="MsoNormal">Since HAINAN is very different, need some further confirmation.<o:p></o:p></p>
<p class="MsoNormal">Thanks.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org>
<b>On Behalf Of </b>Evans Jahja<br>
<b>Sent:</b> Monday, August 23, 2021 6:40 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> RE: Voltage control on Southern Island GPU using radeon<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[CAUTION: External Email] <o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">Hi Kenneth,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I understand that changing voltage 'standalone' is not a good idea. In that case, would it be possible to change the voltage table so that it would give a lower clock on certain voltage?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">For example, I would like to change<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">sclk 900, vddc: 1050<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">to<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">sclk 800, vddc: 1050<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Mon, Aug 23, 2021, 14:59 <<a href="mailto:amd-gfx-request@lists.freedesktop.org">amd-gfx-request@lists.freedesktop.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal">Send amd-gfx mailing list submissions to<br>
<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CKenneth.Feng%40amd.com%7C0b14ab3222974cad7fc208d966225a2d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637653120441041294%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Mqu4fj33aPkAwLKNNALu8ZNnj%2Ffn4zGn1F3qzi5SYbA%3D&reserved=0" target="_blank">
https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:amd-gfx-request@lists.freedesktop.org" target="_blank">amd-gfx-request@lists.freedesktop.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:amd-gfx-owner@lists.freedesktop.org" target="_blank">amd-gfx-owner@lists.freedesktop.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of amd-gfx digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. RE: Voltage control on Southern Island GPU using radeon<br>
driver (Feng, Kenneth)<br>
2. RE: [PATCH] drm/amdgpu: add missing cleanups for Polaris12<br>
UVD/VCE on suspend (Quan, Evan)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 23 Aug 2021 07:11:10 +0000<br>
From: "Feng, Kenneth" <<a href="mailto:Kenneth.Feng@amd.com" target="_blank">Kenneth.Feng@amd.com</a>><br>
To: "Koenig, Christian" <<a href="mailto:Christian.Koenig@amd.com" target="_blank">Christian.Koenig@amd.com</a>>, Evans Jahja<br>
<<a href="mailto:evansjahja13@gmail.com" target="_blank">evansjahja13@gmail.com</a>>, "<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a>"<br>
<<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a>><br>
Subject: RE: Voltage control on Southern Island GPU using radeon<br>
driver<br>
Message-ID:<br>
<<a href="mailto:BY5PR12MB55607F9193F1A315210D1B838EC49@BY5PR12MB5560.namprd12.prod.outlook.com" target="_blank">BY5PR12MB55607F9193F1A315210D1B838EC49@BY5PR12MB5560.namprd12.prod.outlook.com</a>><br>
<br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
[AMD Official Use Only]<br>
<br>
Hi Evans<br>
I'm sorry but I don't suggest you manually control the standalone voltage because it's predefined with the clock value.<br>
A decrease of voltage could hit the hardware critical path. You may need to change the clock and voltage together, we call it dpm level change.<br>
Thanks.<br>
<br>
<br>
-----Original Message-----<br>
From: amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org" target="_blank">amd-gfx-bounces@lists.freedesktop.org</a>> On Behalf Of Christian K?nig<br>
Sent: Monday, August 23, 2021 2:26 PM<br>
To: Evans Jahja <<a href="mailto:evansjahja13@gmail.com" target="_blank">evansjahja13@gmail.com</a>>;
<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a><br>
Subject: Re: Voltage control on Southern Island GPU using radeon driver<br>
<br>
[CAUTION: External Email]<br>
<br>
Hi Evans,<br>
<br>
in general the voltage tables are stored in the atombios and the best advice I can give you is to first double check if there isn't an updated BIOS for your hardware.<br>
<br>
But Alex is the expert on power management, especially for those older hardware generations. Maybe he has another idea what to try.<br>
<br>
Regards,<br>
Christian.<br>
<br>
Am 23.08.21 um 03:56 schrieb Evans Jahja:<br>
> Hi, I have a HAINAN GPU below:<br>
><br>
> lspci -nn<br>
> 0a:00.0 Display controller [0380]: Advanced Micro Devices, Inc.<br>
> [AMD/ATI] Sun LE [Radeon HD 8550M / R5 M230] [1002:666f]<br>
><br>
> I run linux 5.13.12 on Arch on a Lenovo B40-70 laptop.<br>
><br>
> I'm trying to understand more on how voltage control works and how I <br>
> can modify the voltage for doing overvoltage / undervoltage on my GPU.<br>
> The reason is I am observing how running programs under high GPU load<br>
> (glmark2) would lead to crashes when I use dpm=1 in either radeon or <br>
> amdgpu driver, which seems to happen when I am reaching power level 4 <br>
> (sclk 900MHz), while a lighter program like glxgears could run and <br>
> switch power levels between 0,1,2 without issue under both drivers. I <br>
> believe my laptop might be faulty, but I would like to take this <br>
> opportunity to try fixing it from the driver's side so that it can run <br>
> anyway, however limited.<br>
><br>
> Right now, I have managed to increase the performance of my GPU by <br>
> manually overwriting the sclk to 630MHz in all performance_levels in <br>
> radeon_pm.c, which surprises me as overriding the clock was not <br>
> possible for me to do previously via sysfs.<br>
><br>
> I've managed to tweak both sclk and mclk (or so I believe), but I <br>
> still cannot tweak the voltage (vddc). The reason is, if I increase <br>
> the sclk to 650MHz, the lockup will happen again. Changing the<br>
> pl->vddc variable does not seem to do anything. After various tracing<br>
> with printk, I understand that on my system:<br>
><br>
> pi->voltage_control = radeon_atom_is_voltage_gpio(rdev,<br>
> SET_VOLTAGE_TYPE_ASIC_VDDC,<br>
> VOLTAGE_OBJ_GPIO_LUT)<br>
><br>
> this returns false, while:<br>
><br>
> si_pi->voltage_control_svi2 =<br>
> radeon_atom_is_voltage_gpio(rdev, SET_VOLTAGE_TYPE_ASIC_VDDC,<br>
> VOLTAGE_OBJ_SVID2);<br>
><br>
> This returns true, so I believe my system is using SVI2 somehow to set <br>
> the voltage. Having no experience with SVI2, I read online and found <br>
> out that SVI2 is a voltage regulator that uses Data / Clock pins to <br>
> clock-in 8 bits of information and convert it to some voltage value <br>
> between OFF, 0.5V -> 1.5V, offering fine control based on some look up <br>
> table.<br>
><br>
> My questions are as follows:<br>
> Is it possible for me to modify my system so that I can manually <br>
> adjust the voltage to my GPU?<br>
><br>
> Thank you very much in advance. This is the first time I deal with <br>
> kernel drivers, so any guidance on the matter helps a lot.<br>
><br>
> - Evans<br>
><br>
><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Mon, 23 Aug 2021 07:59:36 +0000<br>
From: "Quan, Evan" <<a href="mailto:Evan.Quan@amd.com" target="_blank">Evan.Quan@amd.com</a>><br>
To: Alex Deucher <<a href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>><br>
Cc: "Lazar, Lijo" <<a href="mailto:Lijo.Lazar@amd.com" target="_blank">Lijo.Lazar@amd.com</a>>, "Zhu, James"<br>
<<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>>, "<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a>"<br>
<<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a>>, "Liu, Leo" <<a href="mailto:Leo.Liu@amd.com" target="_blank">Leo.Liu@amd.com</a>>,<br>
"Deucher, Alexander" <<a href="mailto:Alexander.Deucher@amd.com" target="_blank">Alexander.Deucher@amd.com</a>>, "Chen, Guchun"<br>
<<a href="mailto:Guchun.Chen@amd.com" target="_blank">Guchun.Chen@amd.com</a>>, "Pan, Xinhui" <<a href="mailto:Xinhui.Pan@amd.com" target="_blank">Xinhui.Pan@amd.com</a>><br>
Subject: RE: [PATCH] drm/amdgpu: add missing cleanups for Polaris12<br>
UVD/VCE on suspend<br>
Message-ID:<br>
<<a href="mailto:DM6PR12MB261946019274A3F1B5C09995E4C49@DM6PR12MB2619.namprd12.prod.outlook.com" target="_blank">DM6PR12MB261946019274A3F1B5C09995E4C49@DM6PR12MB2619.namprd12.prod.outlook.com</a>><br>
<br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
[AMD Official Use Only]<br>
<br>
<br>
<br>
> -----Original Message-----<br>
> From: Alex Deucher <<a href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>><br>
> Sent: Friday, August 20, 2021 10:23 PM<br>
> To: Quan, Evan <<a href="mailto:Evan.Quan@amd.com" target="_blank">Evan.Quan@amd.com</a>><br>
> Cc: Lazar, Lijo <<a href="mailto:Lijo.Lazar@amd.com" target="_blank">Lijo.Lazar@amd.com</a>>; Zhu, James <<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>>;<br>
> <a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a>; Liu, Leo <<a href="mailto:Leo.Liu@amd.com" target="_blank">Leo.Liu@amd.com</a>>; Deucher,<br>
> Alexander <<a href="mailto:Alexander.Deucher@amd.com" target="_blank">Alexander.Deucher@amd.com</a>>; Chen, Guchun<br>
> <<a href="mailto:Guchun.Chen@amd.com" target="_blank">Guchun.Chen@amd.com</a>>; Pan, Xinhui <<a href="mailto:Xinhui.Pan@amd.com" target="_blank">Xinhui.Pan@amd.com</a>><br>
> Subject: Re: [PATCH] drm/amdgpu: add missing cleanups for Polaris12<br>
> UVD/VCE on suspend<br>
> <br>
> On Thu, Aug 19, 2021 at 10:15 PM Quan, Evan <<a href="mailto:Evan.Quan@amd.com" target="_blank">Evan.Quan@amd.com</a>> wrote:<br>
> ><br>
> > [AMD Official Use Only]<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > From: Lazar, Lijo <<a href="mailto:Lijo.Lazar@amd.com" target="_blank">Lijo.Lazar@amd.com</a>><br>
> > Sent: Thursday, August 19, 2021 10:36 PM<br>
> > To: Zhu, James <<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>>; Quan, Evan<br>
> <<a href="mailto:Evan.Quan@amd.com" target="_blank">Evan.Quan@amd.com</a>>;<br>
> > <a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a><br>
> > Cc: Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com" target="_blank">Alexander.Deucher@amd.com</a>>; Chen, Guchun<br>
> > <<a href="mailto:Guchun.Chen@amd.com" target="_blank">Guchun.Chen@amd.com</a>>; Pan, Xinhui <<a href="mailto:Xinhui.Pan@amd.com" target="_blank">Xinhui.Pan@amd.com</a>><br>
> > Subject: RE: [PATCH] drm/amdgpu: add missing cleanups for Polaris12<br>
> > UVD/VCE on suspend<br>
> ><br>
> ><br>
> ><br>
> > [AMD Official Use Only]<br>
> ><br>
> ><br>
> ><br>
> > If that is done ?<br>
> ><br>
> ><br>
> ><br>
> > + amdgpu_device_ip_set_powergating_state(adev,<br>
> AMD_IP_BLOCK_TYPE_UVD,<br>
> > + AMD_PG_STATE_GATE);<br>
> > + amdgpu_device_ip_set_clockgating_state(adev,<br>
> AMD_IP_BLOCK_TYPE_UVD,<br>
> > +<br>
> > + AMD_CG_STATE_GATE);<br>
> ><br>
> ><br>
> ><br>
> > Usual order is CG followed by PG. It comes in the else part, so less likely to<br>
> happen. Nice to fix for code correctness purpose.<br>
> ><br>
> > [Quan, Evan] Thanks Lijo. Make sense to me. However, actually these code<br>
> were copied from amdgpu_uvd_idle_work_handler() of amdgpu_uvd.c.<br>
> Same logic was used there. So, maybe @Zhu, James or @Liu, Leo can share<br>
> some insights about this.<br>
> ><br>
> <br>
> It looks like it is wrong there as well. We should be gating the clocks before<br>
> the power. The order is also wrong in amdgpu_uvd_ring_begin_use(). We<br>
> need to ungate the power before the clocks<br>
[Quan, Evan] I created a patch for this. But during the verification, I got the errors below<br>
[ 87.420822] [drm:uvd_v6_0_start [amdgpu]] *ERROR* UVD not responding, trying to reset the VCPU!!!<br>
[ 88.443029] [drm:uvd_v6_0_start [amdgpu]] *ERROR* UVD not responding, trying to reset the VCPU!!!<br>
[ 89.465386] [drm:uvd_v6_0_start [amdgpu]] *ERROR* UVD not responding, trying to reset the VCPU!!!<br>
[ 90.487629] [drm:uvd_v6_0_start [amdgpu]] *ERROR* UVD not responding, trying to reset the VCPU!!!<br>
[ 91.510380] [drm:uvd_v6_0_start [amdgpu]] *ERROR* UVD not responding, trying to reset the VCPU!!!<br>
[ 92.533782] [drm:uvd_v6_0_start [amdgpu]] *ERROR* UVD not responding, trying to reset the VCPU!!!<br>
[ 93.557400] [drm:uvd_v6_0_start [amdgpu]] *ERROR* UVD not responding, trying to reset the VCPU!!!<br>
[ 94.580708] [drm:uvd_v6_0_start [amdgpu]] *ERROR* UVD not responding, trying to reset the VCPU!!!<br>
[ 95.603832] [drm:uvd_v6_0_start [amdgpu]] *ERROR* UVD not responding, trying to reset the VCPU!!!<br>
[ 96.627727] [drm:uvd_v6_0_start [amdgpu]] *ERROR* UVD not responding, trying to reset the VCPU!!!<br>
[ 96.657453] [drm:uvd_v6_0_start [amdgpu]] *ERROR* UVD not responding, giving up!!!<br>
[ 96.665892] [drm:amdgpu_device_ip_set_powergating_state [amdgpu]] *ERROR* set_powergating_state of IP block <uvd_v6_0> failed -1<br>
[ 97.697422] amdgpu 0000:02:00.0: [drm:amdgpu_ib_ring_tests [amdgpu]] *ERROR* IB test failed on uvd (-110).<br>
[ 98.721432] amdgpu 0000:02:00.0: [drm:amdgpu_ib_ring_tests [amdgpu]] *ERROR* IB test failed on uvd_enc0 (-110).<br>
[ 99.745407] amdgpu 0000:02:00.0: [drm:amdgpu_ib_ring_tests [amdgpu]] *ERROR* IB test failed on uvd_enc1 (-110).<br>
[ 99.857784] [drm:amdgpu_device_delayed_init_work_handler [amdgpu]] *ERROR* ib ring test failed (-110).<br>
<br>
After checking the related source code roughly. It seems the underlaying implementation of -> set_powergating_state(e.g. uvd_v6_0_set_powergating_state ) performs more jobs than just power gating. And I guess maybe some of those jobs needs to be performed
after -> set_clockgating_state. James and Leo may comment more.<br>
<br>
BR<br>
Evan<br>
> <br>
> Alex<br>
> <br>
> <br>
> ><br>
> ><br>
> > BR<br>
> ><br>
> > Evan<br>
> ><br>
> ><br>
> ><br>
> > Thanks,<br>
> ><br>
> > Lijo<br>
> ><br>
> ><br>
> ><br>
> > From: Zhu, James <<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>><br>
> > Sent: Thursday, August 19, 2021 7:49 PM<br>
> > To: Quan, Evan <<a href="mailto:Evan.Quan@amd.com" target="_blank">Evan.Quan@amd.com</a>>;
<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a><br>
> > Cc: Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com" target="_blank">Alexander.Deucher@amd.com</a>>; Chen, Guchun<br>
> > <<a href="mailto:Guchun.Chen@amd.com" target="_blank">Guchun.Chen@amd.com</a>>; Lazar, Lijo <<a href="mailto:Lijo.Lazar@amd.com" target="_blank">Lijo.Lazar@amd.com</a>>; Pan, Xinhui<br>
> > <<a href="mailto:Xinhui.Pan@amd.com" target="_blank">Xinhui.Pan@amd.com</a>><br>
> > Subject: Re: [PATCH] drm/amdgpu: add missing cleanups for Polaris12<br>
> > UVD/VCE on suspend<br>
> ><br>
> ><br>
> ><br>
> > [AMD Official Use Only]<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > Why not move changes into hw_fini?<br>
> ><br>
> ><br>
> ><br>
> > Best Regards!<br>
> ><br>
> ><br>
> ><br>
> > James Zhu<br>
> ><br>
> > ________________________________<br>
> ><br>
> > From: amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org" target="_blank">amd-gfx-bounces@lists.freedesktop.org</a>> on behalf of<br>
> > Evan Quan <<a href="mailto:evan.quan@amd.com" target="_blank">evan.quan@amd.com</a>><br>
> > Sent: Wednesday, August 18, 2021 11:08 PM<br>
> > To: <a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a> <<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a>><br>
> > Cc: Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com" target="_blank">Alexander.Deucher@amd.com</a>>; Chen, Guchun<br>
> > <<a href="mailto:Guchun.Chen@amd.com" target="_blank">Guchun.Chen@amd.com</a>>; Lazar, Lijo <<a href="mailto:Lijo.Lazar@amd.com" target="_blank">Lijo.Lazar@amd.com</a>>; Quan, Evan<br>
> > <<a href="mailto:Evan.Quan@amd.com" target="_blank">Evan.Quan@amd.com</a>>; Pan, Xinhui <<a href="mailto:Xinhui.Pan@amd.com" target="_blank">Xinhui.Pan@amd.com</a>><br>
> > Subject: [PATCH] drm/amdgpu: add missing cleanups for Polaris12<br>
> > UVD/VCE on suspend<br>
> ><br>
> ><br>
> ><br>
> > Perform proper cleanups on UVD/VCE suspend: powergate enablement,<br>
> > clockgating enablement and dpm disablement. This can fix some hangs<br>
> > observed on suspending when UVD/VCE still using(e.g. issue<br>
> > "pm-suspend" when video is still playing).<br>
> ><br>
> > Change-Id: I36f39d9731e0a9638b52d5d92558b0ee9c23a9ed<br>
> > Signed-off-by: Evan Quan <<a href="mailto:evan.quan@amd.com" target="_blank">evan.quan@amd.com</a>><br>
> > Signed-off-by: xinhui pan <<a href="mailto:xinhui.pan@amd.com" target="_blank">xinhui.pan@amd.com</a>><br>
> > ---<br>
> > drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 24<br>
> ++++++++++++++++++++++++<br>
> > drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 23<br>
> +++++++++++++++++++++++<br>
> > 2 files changed, 47 insertions(+)<br>
> ><br>
> > diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c<br>
> > b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c<br>
> > index 4eebf973a065..d0fc6ec18c29 100644<br>
> > --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c<br>
> > +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c<br>
> > @@ -554,6 +554,30 @@ static int uvd_v6_0_suspend(void *handle)<br>
> > int r;<br>
> > struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
> ><br>
> > + /*<br>
> > + * Proper cleanups before halting the HW engine:<br>
> > + * - cancel the delayed idle work<br>
> > + * - enable powergating<br>
> > + * - enable clockgating<br>
> > + * - disable dpm<br>
> > + *<br>
> > + * TODO: to align with the VCN implementation, move the<br>
> > + * jobs for clockgating/powergating/dpm setting to<br>
> > + * ->set_powergating_state().<br>
> > + */<br>
> > + cancel_delayed_work_sync(&adev->uvd.idle_work);<br>
> > +<br>
> > + if (adev->pm.dpm_enabled) {<br>
> > + amdgpu_dpm_enable_uvd(adev, false);<br>
> > + } else {<br>
> > + amdgpu_asic_set_uvd_clocks(adev, 0, 0);<br>
> > + /* shutdown the UVD block */<br>
> > + amdgpu_device_ip_set_powergating_state(adev,<br>
> AMD_IP_BLOCK_TYPE_UVD,<br>
> > + AMD_PG_STATE_GATE);<br>
> > + amdgpu_device_ip_set_clockgating_state(adev,<br>
> AMD_IP_BLOCK_TYPE_UVD,<br>
> > + AMD_CG_STATE_GATE);<br>
> > + }<br>
> > +<br>
> > r = uvd_v6_0_hw_fini(adev);<br>
> > if (r)<br>
> > return r;<br>
> > diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c<br>
> > b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c<br>
> > index 6d9108fa22e0..a594ade5d30a 100644<br>
> > --- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c<br>
> > +++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c<br>
> > @@ -503,6 +503,29 @@ static int vce_v3_0_suspend(void *handle)<br>
> > int r;<br>
> > struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
> ><br>
> > + /*<br>
> > + * Proper cleanups before halting the HW engine:<br>
> > + * - cancel the delayed idle work<br>
> > + * - enable powergating<br>
> > + * - enable clockgating<br>
> > + * - disable dpm<br>
> > + *<br>
> > + * TODO: to align with the VCN implementation, move the<br>
> > + * jobs for clockgating/powergating/dpm setting to<br>
> > + * ->set_powergating_state().<br>
> > + */<br>
> > + cancel_delayed_work_sync(&adev->vce.idle_work);<br>
> > +<br>
> > + if (adev->pm.dpm_enabled) {<br>
> > + amdgpu_dpm_enable_vce(adev, false);<br>
> > + } else {<br>
> > + amdgpu_asic_set_vce_clocks(adev, 0, 0);<br>
> > + amdgpu_device_ip_set_powergating_state(adev,<br>
> AMD_IP_BLOCK_TYPE_VCE,<br>
> > + AMD_PG_STATE_GATE);<br>
> > + amdgpu_device_ip_set_clockgating_state(adev,<br>
> AMD_IP_BLOCK_TYPE_VCE,<br>
> > + AMD_CG_STATE_GATE);<br>
> > + }<br>
> > +<br>
> > r = vce_v3_0_hw_fini(adev);<br>
> > if (r)<br>
> > return r;<br>
> > --<br>
> > 2.29.0<br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CKenneth.Feng%40amd.com%7C0b14ab3222974cad7fc208d966225a2d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637653120441051245%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=uuc1RkDLEtK1Afn%2BzWXvVALBRAQQDmp3BTAeLr0p%2BK4%3D&reserved=0" target="_blank">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
<br>
<br>
------------------------------<br>
<br>
End of amd-gfx Digest, Vol 63, Issue 280<br>
****************************************<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</body>
</html>