<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">In that case, </p>
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Zhu, Rex <Rex.Zhu@amd.com><br>
<b>Sent:</b> Thursday, August 23, 2018 8:41:28 AM<br>
<b>To:</b> Alex Deucher<br>
<b>Cc:</b> Wu, Hersen; amd-gfx list<br>
<b>Subject:</b> RE: [PATCH] drm/amdgpu: Remove duplicated power source update</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Alex,<br>
<br>
We get initial state in amdgpu_device_init.<br>
<br>
Best Regards<br>
Rex<br>
<br>
 <br>
<br>
> -----Original Message-----<br>
> From: Alex Deucher <alexdeucher@gmail.com><br>
> Sent: Thursday, August 23, 2018 8:37 PM<br>
> To: Zhu, Rex <Rex.Zhu@amd.com><br>
> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>; Wu, Hersen<br>
> <hersenxs.wu@amd.com><br>
> Subject: Re: [PATCH] drm/amdgpu: Remove duplicated power source update<br>
> <br>
> On Thu, Aug 23, 2018 at 2:40 AM Rex Zhu <Rex.Zhu@amd.com> wrote:<br>
> ><br>
> > when ac/dc switch, driver will be notified by acpi event.<br>
> > then the power source will be updated. so don't need to get power<br>
> > source when set power state.<br>
> <br>
> Don't we need this to get the initial state?  Maybe we should move this to<br>
> one of the init functions if we don't already check there.<br>
> <br>
> Alex<br>
> <br>
> ><br>
> > Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
> > ---<br>
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 --------<br>
> >  1 file changed, 8 deletions(-)<br>
> ><br>
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> > index daa55fb..3e51e9c 100644<br>
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> > @@ -1933,14 +1933,6 @@ void amdgpu_pm_compute_clocks(struct<br>
> amdgpu_device *adev)<br>
> >                         amdgpu_fence_wait_empty(ring);<br>
> >         }<br>
> ><br>
> > -       mutex_lock(&adev->pm.mutex);<br>
> > -       /* update battery/ac status */<br>
> > -       if (power_supply_is_system_supplied() > 0)<br>
> > -               adev->pm.ac_power = true;<br>
> > -       else<br>
> > -               adev->pm.ac_power = false;<br>
> > -       mutex_unlock(&adev->pm.mutex);<br>
> > -<br>
> >         if (adev->powerplay.pp_funcs->dispatch_tasks) {<br>
> >                 if (!amdgpu_device_has_dc_support(adev)) {<br>
> >                         mutex_lock(&adev->pm.mutex);<br>
> > --<br>
> > 1.9.1<br>
> ><br>
> > _______________________________________________<br>
> > amd-gfx mailing list<br>
> > amd-gfx@lists.freedesktop.org<br>
> > <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>