Re: amdgpu Xorg.0.log filled with flip queue failed and Page flip failed

2024-04-16 Thread Nam Nguyen
Jonathan Gray writes:

> try the diff below which brings in
> xf86-video-amdgpu-23.0.0..31a092ae71371fb473a3a51f70fe58e1f42e283b
>
> the last commit is the one referenced in:
> https://gitlab.freedesktop.org/drm/amd/-/issues/2852
>
> https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/-/commit/31a092ae71371fb473a3a51f70fe58e1f42e283b

When trying the diff the problem remains.

Here is my Xorg.0.log with starting ezquake causing the repeated messages:
https://messagemode2.com/public/Xorg.txt

Ignore my print debugging of namtsui to ensure I was compiling xenocara
correctly: "namtsui VariableRefresh: disabled"

VariableRefresh is not used because they are set like so:
VariableRefresh: disabled
AsyncFlipSecondaries: disabled
KMS Pageflipping: enabled

https://bbs.archlinux.org/viewtopic.php?id=289042 mentions
AsyncFlipSecondaries false in post 5.

(I initially set HZ to 1000 in the kernel which caused the log file to
fill up faster, but this happens with the default kernel, too.) I tested
with both a single 360 hz monitor displayport and a single 144 hz
monitor displayport. There is the same behavior on both.

>
> Index: driver/xf86-video-amdgpu/man/amdgpu.man
> ===
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/man/amdgpu.man,v
> diff -u -p -r1.4 amdgpu.man
> --- driver/xf86-video-amdgpu/man/amdgpu.man   1 Mar 2023 20:21:10 -   
> 1.4
> +++ driver/xf86-video-amdgpu/man/amdgpu.man   16 Apr 2024 09:55:23 -
> @@ -81,7 +81,8 @@ on. If this option is set, the default v
>  accordingly. If this option isn't set, the default value of the property is
>  .B auto,
>  which means that TearFree is on for rotated outputs, outputs with RandR
> -transforms applied and for RandR 1.4 secondary outputs, otherwise off.
> +transforms applied, for RandR 1.4 secondary outputs and if 'VariableRefresh'
> +is enabled, otherwise it's off.
>  .TP
>  .BI "Option \*qVariableRefresh\*q \*q" boolean \*q
>  Enables support for enabling variable refresh on the Screen's CRTCs
> Index: driver/xf86-video-amdgpu/src/amdgpu_kms.c
> ===
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/amdgpu_kms.c,v
> diff -u -p -r1.6 amdgpu_kms.c
> --- driver/xf86-video-amdgpu/src/amdgpu_kms.c 1 Mar 2023 20:21:10 -   
> 1.6
> +++ driver/xf86-video-amdgpu/src/amdgpu_kms.c 16 Apr 2024 09:55:23 -
> @@ -1657,6 +1657,10 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn
>   from = xf86GetOptValBool(info->Options, 
> OPTION_VARIABLE_REFRESH,
>>vrr_support) ? X_CONFIG 
> : X_DEFAULT;
>  
> + if (info->vrr_support && !info->tear_free)
> + xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
> +"Enabling VariableRefresh while 
> TearFree is disabled can cause instability!\n");
> +
>   xf86DrvMsg(pScrn->scrnIndex, from, "VariableRefresh: 
> %sabled\n",
>  info->vrr_support ? "en" : "dis");
>  
> Index: driver/xf86-video-amdgpu/src/drmmode_display.c
> ===
> RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/drmmode_display.c,v
> diff -u -p -r1.4 drmmode_display.c
> --- driver/xf86-video-amdgpu/src/drmmode_display.c5 Dec 2022 16:41:17 
> -   1.4
> +++ driver/xf86-video-amdgpu/src/drmmode_display.c16 Apr 2024 09:55:23 
> -
> @@ -597,6 +597,7 @@ drmmode_crtc_update_tear_free(xf86CrtcPt
>   (drmmode_output->tear_free == 2 &&
>(crtc->scrn->pScreen->isGPU ||
> info->shadow_primary ||
> +   info->vrr_support ||
> crtc->transformPresent || crtc->rotation != 
> RR_Rotate_0))) {
>   drmmode_crtc->tear_free = TRUE;
>   return;
> @@ -1268,6 +1269,11 @@ drmmode_set_mode(xf86CrtcPtr crtc, struc
>   if (output->crtc != crtc)
>   continue;
>  
> + if (!drmmode_output->mode_output) {
> + ret = FALSE;
> + goto out;
> + }
> +
>   output_ids[output_count] = 
> drmmode_output->mode_output->connector_id;
>   output_count++;
>   }
> @@ -1286,6 +1292,7 @@ drmmode_set_mode(xf86CrtcPtr crtc, struc
>  "failed to set mode: %s\n", strerror(errno));
>   }
>  
> +out:
>   free(output_ids);
>   return ret;
>  }



Re: amdgpu Xorg.0.log filled with flip queue failed and Page flip failed

2024-04-16 Thread Jonathan Gray
On Tue, Apr 16, 2024 at 02:32:17AM -0700, Nam Nguyen wrote:
> >Synopsis:amdgpu Xorg.0.log filled with flip queue failed and Page flip 
> >failed
> >Category:system
> >Environment:
>   System  : OpenBSD 7.5
>   Details : OpenBSD 7.5-current (GENERIC.MP) #25: Mon Apr 15 12:00:00 
> MDT 2024
>
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> 
>   Architecture: OpenBSD.amd64
>   Machine : amd64
> >Description:
> 
> /var/log/Xorg.0.log gets filled up with the same repeating error while
> watching mpv yt-dlp and playing games/ezquake. This is on 6800xt amd64
> 3900x.
> 
> $ du -sh /var/log/Xorg.0.log  
> 1017M   /var/log/Xorg.0.log
> 
> >How-To-Repeat:
> 
> watch mpv yt-dlp several times leaves only two lines per video:
> [76.172] (WW) AMDGPU(0): flip queue failed: Invalid argument
> [76.172] (WW) AMDGPU(0): Page flip failed: Invalid argument
> [96.004] (WW) AMDGPU(0): flip queue failed: Invalid argument
> [96.004] (WW) AMDGPU(0): Page flip failed: Invalid argument
> [96.792] (WW) AMDGPU(0): flip queue failed: Invalid argument
> [96.792] (WW) AMDGPU(0): Page flip failed: Invalid argument

try the diff below which brings in
xf86-video-amdgpu-23.0.0..31a092ae71371fb473a3a51f70fe58e1f42e283b

the last commit is the one referenced in:
https://gitlab.freedesktop.org/drm/amd/-/issues/2852

https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/-/commit/31a092ae71371fb473a3a51f70fe58e1f42e283b

Index: driver/xf86-video-amdgpu/man/amdgpu.man
===
RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/man/amdgpu.man,v
diff -u -p -r1.4 amdgpu.man
--- driver/xf86-video-amdgpu/man/amdgpu.man 1 Mar 2023 20:21:10 -   
1.4
+++ driver/xf86-video-amdgpu/man/amdgpu.man 16 Apr 2024 09:55:23 -
@@ -81,7 +81,8 @@ on. If this option is set, the default v
 accordingly. If this option isn't set, the default value of the property is
 .B auto,
 which means that TearFree is on for rotated outputs, outputs with RandR
-transforms applied and for RandR 1.4 secondary outputs, otherwise off.
+transforms applied, for RandR 1.4 secondary outputs and if 'VariableRefresh'
+is enabled, otherwise it's off.
 .TP
 .BI "Option \*qVariableRefresh\*q \*q" boolean \*q
 Enables support for enabling variable refresh on the Screen's CRTCs
Index: driver/xf86-video-amdgpu/src/amdgpu_kms.c
===
RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/amdgpu_kms.c,v
diff -u -p -r1.6 amdgpu_kms.c
--- driver/xf86-video-amdgpu/src/amdgpu_kms.c   1 Mar 2023 20:21:10 -   
1.6
+++ driver/xf86-video-amdgpu/src/amdgpu_kms.c   16 Apr 2024 09:55:23 -
@@ -1657,6 +1657,10 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn
from = xf86GetOptValBool(info->Options, 
OPTION_VARIABLE_REFRESH,
 >vrr_support) ? X_CONFIG 
: X_DEFAULT;
 
+   if (info->vrr_support && !info->tear_free)
+   xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+  "Enabling VariableRefresh while 
TearFree is disabled can cause instability!\n");
+
xf86DrvMsg(pScrn->scrnIndex, from, "VariableRefresh: 
%sabled\n",
   info->vrr_support ? "en" : "dis");
 
Index: driver/xf86-video-amdgpu/src/drmmode_display.c
===
RCS file: /cvs/xenocara/driver/xf86-video-amdgpu/src/drmmode_display.c,v
diff -u -p -r1.4 drmmode_display.c
--- driver/xf86-video-amdgpu/src/drmmode_display.c  5 Dec 2022 16:41:17 
-   1.4
+++ driver/xf86-video-amdgpu/src/drmmode_display.c  16 Apr 2024 09:55:23 
-
@@ -597,6 +597,7 @@ drmmode_crtc_update_tear_free(xf86CrtcPt
(drmmode_output->tear_free == 2 &&
 (crtc->scrn->pScreen->isGPU ||
  info->shadow_primary ||
+ info->vrr_support ||
  crtc->transformPresent || crtc->rotation != 
RR_Rotate_0))) {
drmmode_crtc->tear_free = TRUE;
return;
@@ -1268,6 +1269,11 @@ drmmode_set_mode(xf86CrtcPtr crtc, struc
if (output->crtc != crtc)
continue;
 
+   if (!drmmode_output->mode_output) {
+   ret = FALSE;
+   goto out;
+   }
+
output_ids[output_count] = 
drmmode_output->mode_output->connector_id;
output_count++;
}
@@ -1286,6 +1292,7 @@ drmmode_set_mode(xf86CrtcPtr crtc, struc
   "failed to set mode: %s\n", strerror(errno));
}
 
+out:
free(output_ids);
return ret;
 }