<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<font size="2"><span style="font-size:11pt;"></span></font>On 2018-02-01 03:02 PM, Alex Deucher wrote:<br>
<div style="color: rgb(0, 0, 0);">
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">> On Thu, Feb 1, 2018 at 2:44 PM, <mikita.lipski@amd.com> wrote:<br>
>> From: Mikita Lipski <mikita.lipski@amd.com><br>
>><br>
>> Call dm_suspend function instead of drm_kms suspend function in<br>
>> order to cache current state<br>
>><br>
>> Call DM_resume first to restore dc hardware, then amdgpu_dm_display_resume<br>
>> to restore dal's cached state.<br>
> <br>
>> We already call the IP block suspend and resume functions in<br>
> amdgpu_device_ip_suspend() which is called by amdgpu_device_reset(),<br>
<font size="2"><span style="font-size:11pt;">></span></font>> at least when we do a hard reset. They will end up getting called<br>
<br>
<font size="2"><span style="font-size:11pt;">></span></font>I missed that. I think we just need to drop the existing DC and drm_atomic_helper_* calls in amdgpu_device_gpu_recover and call amdgpu_dm_display_resume after amdgpu_device_ip_resume_phase2 in amdgpu_device_reset.<br>
<br>
<font size="2"><span style="font-size:11pt;">></span></font>I really don't like the way we call amdgpu_dm_display_resume separately from the .resume hook now. We initially implemented it because in amdgpu_device_resume we need cursor pinning to happen before
really resuming DC. Not sure if we can move the cursor pinning to before amdgpu_device_ip_resume in that function. If we can we can just move amdgpu_dm_display_resume into the proper .resume hook, and clean up both resume and gpu_recover code.<br>
<br>
<font size="2"><span style="font-size:11pt;">></span></font>> twice in that case with this change. Perhaps a better solution would<br>
<font size="2"><span style="font-size:11pt;">></span></font>> be to only call the drm_atomic_helper_* functions when we have a hard<br>
<font size="2"><span style="font-size:11pt;">></span></font>> reset rather than a soft one.<br>
<br>
<font size="2"><span style="font-size:11pt;">></span></font>amdgpu_dm_display_resume will already call the drm_atomic_helper_ functions. We should really call them in gpu_recover, unless we need to re-apply the state on a soft reset, but then we probably want
to block this call from a hard reset.<br>
<br>
<font size="2"><span style="font-size:11pt;">></span></font>Harry<br>
<br>
If cursor pinning doesn't need powering DC beforehand - we can introduce phase 3 ip resume, as you suggested earlier, and call it after pinning the cursor instead of phase2.<br>
<br>
Nick<br>
<br>
<font size="2"><span style="font-size:11pt;">></span></font>> <br>
<font size="2"><span style="font-size:11pt;">></span></font>> Alex<br>
<font size="2"><span style="font-size:11pt;">></span></font>> <br>
<font size="2"><span style="font-size:11pt;">></span></font>> <br>
>><br>
>> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com><br>
>> ---<br>
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++------<br>
>> 1 file changed, 4 insertions(+), 6 deletions(-)<br>
>><br>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
>> index 850453e..b55c929 100644<br>
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
>> @@ -2616,7 +2616,6 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,<br>
>> int amdgpu_device_gpu_recover(struct amdgpu_device *adev,<br>
>> struct amdgpu_job *job, bool force)<br>
>> {<br>
>> - struct drm_atomic_state *state = NULL;<br>
>> uint64_t reset_flags = 0;<br>
>> int i, r, resched;<br>
>><br>
>> @@ -2640,9 +2639,9 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,<br>
>> /* block TTM */<br>
>> resched = ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);<br>
>> /* store modesetting */<br>
>> - if (amdgpu_device_has_dc_support(adev))<br>
>> - state = drm_atomic_helper_suspend(adev->ddev);<br>
>> -<br>
>> + if (amdgpu_device_has_dc_support(adev)){<br>
>> + adev->ip_blocks[5].version->funcs->suspend(adev);<br>
>> + }<br>
>> /* block scheduler */<br>
>> for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {<br>
>> struct amdgpu_ring *ring = adev->rings[i];<br>
>> @@ -2727,8 +2726,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,<br>
>> }<br>
>><br>
>> if (amdgpu_device_has_dc_support(adev)) {<br>
>> - if (drm_atomic_helper_resume(adev->ddev, state))<br>
>> - dev_info(adev->dev, "drm resume failed:%d\n", r);<br>
>> + adev->ip_blocks[5].version->funcs->resume(adev);<br>
>> amdgpu_dm_display_resume(adev);<br>
>> } else {<br>
>> drm_helper_resume_force_mode(adev->ddev);<br>
>> --<br>
>> 2.7.4<br>
>><br>
>> _______________________________________________<br>
>> amd-gfx mailing list<br>
>> amd-gfx@lists.freedesktop.org<br>
>> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" id="LPlnk308191" previewremoved="true">
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" id="LPlnk248224" previewremoved="true">
https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
> <br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>