Hi Sometimes after screen wakeup/turning on I start to experience tearing. Tear free mode works fine before sleep/turning display off. My hardware is XFX Radeon RX580. Software: kernel-4.13.13+ck1, xorg-1.19.5, xf86-video-amdgpu (git 3a4f7422913093ed9e26b73ecd7f9e773478cb1e), libdrm-2.4.88 See dmesg, Xorg.0.log, xorg.conf attached.
Created attachment 135552 [details] xorg.conf
Created attachment 135553 [details] dmesg
Created attachment 135554 [details] Xorg.0.log
We need to find out why the kernel starts returning -EINVAL from the page flip and wait for vblank ioctls. Can you try writing 255 to /sys/module/drm/parameters/debug before reproducing the problem, and attach the resulting dmesg output? (Note that writing non-0 to /sys/module/drm/parameters/debug will cause a lot of debugging output to be generated, so you'll want to write 0 to it again soon afterwards) In case that doesn't reveal why -EINVAL is being returned, are you able to recompile the drm.ko / amdgpu.ko kernel modules with a patch applied?
(In reply to Michel Dänzer from comment #4) > We need to find out why the kernel starts returning -EINVAL from the page > flip and wait for vblank ioctls. > > Can you try writing 255 to /sys/module/drm/parameters/debug before > reproducing the problem, and attach the resulting dmesg output? (Note that > writing non-0 to /sys/module/drm/parameters/debug will cause a lot of > debugging output to be generated, so you'll want to write 0 to it again soon > afterwards) Got it. I'll attach dmesg as soon as I reproduce the issue. > In case that doesn't reveal why -EINVAL is being returned, are you able to > recompile the drm.ko / amdgpu.ko kernel modules with a patch applied? Sure. Gentoo is there :)
Created attachment 135701 [details] dmesg + debug
See attached dmesg with debug. Tearing appeared after turning display on.
Any news on that? Should I report some more information/logs/etc?
Created attachment 135808 [details] [review] Add debugging output why the ioctls return -EINVAL Sorry, been busy with other fires. Please recompile the drm.ko module with this patch applied, reproduce the result with the resulting binary and attach the dmesg output.
BTW, the patch is completely untested; if it fails to compile, hopefully it won't be hard to fix it up.
Yes, I fixed some small issues with the patch. Now I have following appear in dmesg: [ 2108.319205] [drm] drm_crtc_vblank_get returned -EINVAL [ 2108.319235] [drm] crtc 0 failed to acquire vblank counter, -22
Created attachment 135917 [details] dmesg with debug
Created attachment 135923 [details] [review] drm_vblank_get debugging output Please do the same with this patch, to see why drm_vblank_get returns -EINVAL.
Created attachment 135938 [details] dmesg with vblank debug
Created attachment 135969 [details] [review] Debugging output related to enabling/disabling the vblank interrupt Another iteration, to find out why the vblank interrupt doesn't get enabled.
Created attachment 135989 [details] dmesg with vblank interrupt
Thanks. I think I see what's happening, but I need some time to think about how to address it. Meanwhile, you should be able to re-enable TearFree by forcing a modeset, e.g. by re-enabling the TearFree property: xrandr --output DisplayPort-0 --set TearFree on
Hi, I'm seeing the same problem on an RX550 (polaris12). Running xrandr doesn't seem to work as a workaround but flipping VTs does. Would having the debug output for this one be useful, or was the other log enough? kernel 4.14.5-zen+ xorg 1.19.5 xf86-video-amdgpu 1.4.0 libdrm 2.4.88
Still better to have a proper fix first as New Year present to us (poor users) ;)
Doing $ xrandr --output DisplayPort-0 --set TearFree on ... does not help. Tearing is still present.
(In reply to Anthony Parsons from comment #18) > Running xrandr doesn't seem to work as a workaround but flipping VTs does. Have you tried turning it off and on again? (Who gets the reference? :) xrandr --output DisplayPort-0 --set TearFree off xrandr --output DisplayPort-0 --set TearFree on
Does https://gitlab.freedesktop.org/daenzer/xf86-video-amdgpu/commits/TearFree-flip-failure-retry help? If not, please attach the log file captured after reproducing the problem with a driver built from that branch.
I am on 4.18.12 now. The bug no longer reproduces.
FWIW, https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/merge_requests/15 is merged now.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.