Bug 97873

Summary: Video tearing since update xf86-video-ati (1:7.7.0-1 -> 1:7.7.1-1)
Product: xorg Reporter: tobias.brunn
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: joeri.exelmans
Version: 7.7 (2012.06)   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Xorg.0.log
none
xrandr output
none
Pass pitch from drmmode_crtc_scanout_allocate to drmmode_create_bo_pixmap none

Description tobias.brunn 2016-09-20 13:41:06 UTC
OS: 4.7.4-1-ARCH x86_64 GNU/Linux
VGA controller: [AMD/ATI] Wrestler [Radeon HD 6310]

20-radeon.conf 
Section "Device"
	Identifier  "Radeon"
	Driver "radeon"
	Option "AccelMethod" "glamor"
        Option "DRI" "3"
        Option "TearFree" "on"
EndSection

Connection: HDMI

Since update xf86-video-ati (1:7.7.0-1 -> 1:7.7.1-1) I have strong tearing in every video played: 

There is a tearing line from the upper left corner of the screen wich leads in a 45° angle down for ca. 10% - 15% of screen width and than becomes a horizontal line over the rest of the screen.

Downgrading to xf86-video-ati 1:7.7.0-1 solves the issue.
Comment 1 Michel Dänzer 2016-09-21 01:45:09 UTC
Any chance you can bisect which upstream Git commit introduced the problem?

If not, please attach the Xorg log file and the output of xrandr for both versions. Which video player are you testing with?
Comment 2 tobias.brunn 2016-09-23 21:35:52 UTC
Created attachment 126747 [details]
Xorg.0.log

Xorg.0.log
Comment 3 tobias.brunn 2016-09-23 21:39:40 UTC
Created attachment 126748 [details]
xrandr output

Players tested with tearing bug occuring:

Chromium (html5 flash)
Kodi 16.1-4
VLC 2.2.4-3
Comment 4 Michel Dänzer 2016-09-25 07:55:36 UTC
Please attach the Xorg log file and xrandr output from 7.7.0 as well.
Comment 5 joeri.exelmans 2016-12-22 10:46:36 UTC
Exactly the same problem here. Tearing starting from upper left corner, in a 45% angle and then horizontally somewhere in the 1/3 upper part of the screen. Clearly some attempt at VSync is being made cause the lower half of the screen is always perfectly smooth.

OS: Ubuntu Gnome 16.04
Radeon HD 6320
Using radeon driver from Oibaf PPA (package named xserver-xorg-video-radeon, version: 1:7.8.99+git1612191933.720dd0~gd~x)

It's not just a video playback problem, in Gnome (Mutter compositor) the tearing applies to the entire screen, so it also occurs when dragging a window. There is no tearing when starting a 'Gnome on Wayland' session. Also no tearing when running Kodi in Wayland (through XWayland, which works surprisingly well).

I'm using almost the same configuration as tobias.brunn:

20-radeon.conf 
Section "Device"
	Identifier  "Radeon"
	Driver "radeon"
        Option "DRI" "3"
        Option "TearFree" "on"
EndSection

Removing options DRI3 and TearFree makes no difference.
Comment 6 Michel Dänzer 2017-01-05 02:24:10 UTC
Created attachment 128763 [details] [review]
Pass pitch from drmmode_crtc_scanout_allocate to drmmode_create_bo_pixmap

Does this patch fix the problem?
Comment 7 joeri.exelmans 2017-01-05 09:28:07 UTC
I'll try to build the driver (I've never done this before) and tell you if the patch fixes it. Maybe I'll also try to trace the git commit that caused the problem.

Just found out that I also have the problem with a Radeon HD 4770 (with the same super-recent driver from Oibaf PPA), so it may apply to a lot of users.
Comment 8 joeri.exelmans 2017-01-05 20:27:47 UTC
Yes, your patch solved the problem on the HD 6320.

I also no longer seem to have the problem with the HD 4770 (unpatched 1:7.8.99+git1612191933.720dd0~gd~x)...
Comment 9 joeri.exelmans 2017-01-05 21:31:39 UTC
Many thanks, movies look great again :)

I don't have the slightest clue what the patch does, so is it OK to use the patched driver until a fix makes it to the master branch?
Comment 10 Michel Dänzer 2017-01-07 06:50:30 UTC
Thanks for the report and testing, fixed in Git master:

commit ea30d856ba5e7274c8ea499293b8b0e721b8e082
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Jan 6 17:36:05 2017 +0900

    Pass pitch from drmmode_crtc_scanout_allocate to drmmode_create_bo_pixmap
Comment 11 Barto 2017-01-21 00:14:32 UTC
the bug ( tearing ) is still here with xf86-video- 1:7.8.99.r16.gea30d856-1,

see this recent bugreport in archlinux bugzilla :

https://bugs.archlinux.org/task/52620

I have a radeon HD4650, and the tearing is visible with all players ( vlc, mplayer, kaffeine )
Comment 12 Michel Dänzer 2017-01-21 07:30:14 UTC
(In reply to Barto from comment #11)
> the bug ( tearing ) is still here with xf86-video- 1:7.8.99.r16.gea30d856-1,

It can't be the same problem then. Please file your own report and attach at least the Xorg log file and output of dmesg and glxinfo.

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.