<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">
<p style="font-family:Calibri;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - AMD Internal Distribution Only]<br>
</p>
<br>
<div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Reviewed-by: Shashank Sharma <shashank.sharma@amd.com></div>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards</div>
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Shashank</div>
<hr style="display: inline-block; width: 98%;">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><b>From:</b> Yadav, Arvind<br>
<b>Sent:</b> Tuesday, March 18, 2025 3:54 PM<br>
<b>To:</b> Koenig, Christian; Deucher, Alexander; Khatri, Sunil; Sharma, Shashank<br>
<b>Cc:</b> amd-gfx@lists.freedesktop.org; Yadav, Arvind; Koenig, Christian; Yadav, Arvind<br>
<b>Subject:</b> [PATCH] drm/amdgpu: Fix display freezing issue when resizing apps
</span>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-size: 11pt;">The display is freezing because the amdgpu_userq_wait_ioctl()<br>
is waiting for a non-user queue fence(specifically, the PT update fence).<br>
<br>
RootCause:<br>
The resume_work is initiated by both amdgpu_userq_suspend and<br>
amdgpu_userqueue_ensure_ev_fence at same time. The amdgpu_userq_suspend<br>
signals a dma-fence and subsequently triggers the resume_work, which is<br>
intended to replace the existing fence by creating new dma-fence. However,<br>
following this, the amdgpu_userqueue_ensure_ev_fence schedules another<br>
resume_work that generates a new dma-fence, thereby replacing the one<br>
created by amdgpu_userq_suspend. Consequently, the original fence will<br>
never be signaled.<br>
<br>
Cc: Alex Deucher <alexander.deucher@amd.com><br>
Cc: Christian König <christian.koenig@amd.com><br>
Cc: Shashank Sharma <shashank.sharma@amd.com><br>
Cc: Sunil Khatri <sunil.khatri@amd.com><br>
Signed-off-by: Arvind Yadav <arvind.yadav@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c | 3 +++<br>
1 file changed, 3 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c<br>
index 167951aee502..0075469550b0 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c<br>
@@ -52,6 +52,9 @@ amdgpu_eviction_fence_replace_fence(struct amdgpu_eviction_fence_mgr *evf_mgr,<br>
unsigned long index;<br>
int ret;<br>
<br>
+ if (evf_mgr->ev_fence &&<br>
+ !dma_fence_is_signaled(&evf_mgr->ev_fence->base))<br>
+ return 0;<br>
/*<br>
* Steps to replace eviction fence:<br>
* * lock all objects in exec (caller)<br>
--<br>
2.34.1<br>
<br>
</div>
</div>
</body>
</html>