https://bugs.freedesktop.org/show_bug.cgi?id=103791
Bug ID: 103791 Summary: Tearing after screen wakeup/on Product: DRI Version: XOrg git Hardware: Other OS: All Status: NEW Severity: normal Priority: medium Component: DRM/AMDgpu Assignee: dri-devel@lists.freedesktop.org Reporter: denisgolovan@yandex.ru
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.
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #1 from denisgolovan@yandex.ru --- Created attachment 135552 --> https://bugs.freedesktop.org/attachment.cgi?id=135552&action=edit xorg.conf
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #2 from denisgolovan@yandex.ru --- Created attachment 135553 --> https://bugs.freedesktop.org/attachment.cgi?id=135553&action=edit dmesg
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #3 from denisgolovan@yandex.ru --- Created attachment 135554 --> https://bugs.freedesktop.org/attachment.cgi?id=135554&action=edit Xorg.0.log
https://bugs.freedesktop.org/show_bug.cgi?id=103791
Michel Dänzer michel@daenzer.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #135554|text/x-log |text/plain mime type| |
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #4 from Michel Dänzer michel@daenzer.net --- 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?
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #5 from denisgolovan@yandex.ru --- (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 :)
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #6 from denisgolovan@yandex.ru --- Created attachment 135701 --> https://bugs.freedesktop.org/attachment.cgi?id=135701&action=edit dmesg + debug
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #7 from denisgolovan@yandex.ru --- See attached dmesg with debug. Tearing appeared after turning display on.
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #8 from denisgolovan@yandex.ru --- Any news on that? Should I report some more information/logs/etc?
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #9 from Michel Dänzer michel@daenzer.net --- Created attachment 135808 --> https://bugs.freedesktop.org/attachment.cgi?id=135808&action=edit 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.
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #10 from Michel Dänzer michel@daenzer.net --- BTW, the patch is completely untested; if it fails to compile, hopefully it won't be hard to fix it up.
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #11 from denisgolovan@yandex.ru --- 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
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #12 from denisgolovan@yandex.ru --- Created attachment 135917 --> https://bugs.freedesktop.org/attachment.cgi?id=135917&action=edit dmesg with debug
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #13 from Michel Dänzer michel@daenzer.net --- Created attachment 135923 --> https://bugs.freedesktop.org/attachment.cgi?id=135923&action=edit drm_vblank_get debugging output
Please do the same with this patch, to see why drm_vblank_get returns -EINVAL.
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #14 from denisgolovan@yandex.ru --- Created attachment 135938 --> https://bugs.freedesktop.org/attachment.cgi?id=135938&action=edit dmesg with vblank debug
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #15 from Michel Dänzer michel@daenzer.net --- Created attachment 135969 --> https://bugs.freedesktop.org/attachment.cgi?id=135969&action=edit Debugging output related to enabling/disabling the vblank interrupt
Another iteration, to find out why the vblank interrupt doesn't get enabled.
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #16 from denisgolovan@yandex.ru --- Created attachment 135989 --> https://bugs.freedesktop.org/attachment.cgi?id=135989&action=edit dmesg with vblank interrupt
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #17 from Michel Dänzer michel@daenzer.net --- 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
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #18 from Anthony Parsons flussence+bz.fdo@gmail.com --- 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
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #19 from denisgolovan@yandex.ru --- Still better to have a proper fix first as New Year present to us (poor users) ;)
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #20 from denisgolovan@yandex.ru --- Doing $ xrandr --output DisplayPort-0 --set TearFree on
... does not help. Tearing is still present.
https://bugs.freedesktop.org/show_bug.cgi?id=103791
--- Comment #21 from Michel Dänzer michel@daenzer.net --- (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
https://bugs.freedesktop.org/show_bug.cgi?id=103791
Michel Dänzer michel@daenzer.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|dri-devel@lists.freedesktop |xorg-driver-ati@lists.x.org |.org | QA Contact| |xorg-team@lists.x.org Component|DRM/AMDgpu |Driver/AMDgpu Version|XOrg git |git Product|DRI |xorg
dri-devel@lists.freedesktop.org