From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 102646] Screen flickering under amdgpu-experimental [buggy auto power profile] Date: Thu, 18 Apr 2019 00:40:32 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0703197685==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id A2BA26E0B4 for ; Thu, 18 Apr 2019 00:40:33 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0703197685== Content-Type: multipart/alternative; boundary="15555480335.72F687B2E.19374" Content-Transfer-Encoding: 7bit --15555480335.72F687B2E.19374 Date: Thu, 18 Apr 2019 00:40:33 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D102646 --- Comment #82 from kyrottimus@yahoo.com --- My solution, well more of a workaround and since I had this problem even wi= th default MESA that comes packaged with Kernel 5.05.XX, was to retune my moni= tor to my GPU instead of letting my GPU try to do it automatically the other way around or waiting on updated kernel/drivers/firmware/microcode to address t= his problem for me. TL:DR--using xrandr to tell my monitor to stay in step with my GPU. This fixed it for me, your mileage may vary: Below is an example of commands in the terminal to activate a new monitor refresh rate in the "display" settings in Manjaro Linux to tune your monito= r to a precise frequency: in the case of a Radeon (Polaris) RX580 or RX590 and a 75Hz (max) ASUS VG245H HDMI gaming monitor, my target was 73Hz (~-2Hz from peak) to run with the GPU properly without any horizontal black/green line flickering. I chose 73Hz because I already tried tuning to my monitor's closest accurate refresh rate (74.89Hz) manually off the reported 75Hz and it still flickere= d, and the next closest setting for my Monitor was ~73Hz. Keep in mind, with the below example, your variables need to be pulled from both the cvt command at the top (with your desired resolution/refresh rate plugged in after the cvt command) and then plug that "Modeline" part (after= the word Modeline) into the xrandr --newmode command.=20=20 YOUR COMMANDS WILL PROBABLY NEED DIFFERENT VARIABLES. Then, using xrandr -q find your display type and ID (for me it was HDMI-A-0) and plug that into your final command along with your desired resolution/refresh info: example here of=20 $ xrandr --verbose --addmode HDMI-A-0 "1920x1080_73.00" *******BEGIN TERMINAL EXAMPLE******** [username@thisalinuxpc ~]$ cvt 1920 1080 73 # 1920x1080 72.87 Hz (CVT) hsync: 82.27 kHz; pclk: 213.25 MHz Modeline "1920x1080_73.00" 213.25 1920 2056 2256 2592 1080 1083 1088 1129 -hsync +vsync [username@thisalinuxpc ~]$ xrandr --newmode "1920x1080_73.00" 213.25 1920 2056 2256 2592 1080 1083 1088 1129 -hsync +vsync [username@thisalinuxpc ~]$ xrandr -q Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384 DisplayPort-0 disconnected (normal left inverted right x axis y axis) DisplayPort-1 disconnected (normal left inverted right x axis y axis) HDMI-A-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 531mm x 299mm 1920x1080 60.00*+ 74.99 50.00 59.94=20=20 1600x1200 60.00=20=20 1680x1050 59.88=20=20 1280x1024 75.02 60.02=20=20 1440x900 59.90=20=20 1280x960 60.00=20=20 1366x768 59.79=20=20 1280x800 60.00=20=20 1152x864 75.00=20=20 1280x720 60.00 50.00 59.94=20=20 1024x768 75.03 70.07 60.00=20=20 832x624 74.55=20=20 800x600 72.19 75.00 60.32 56.25=20=20 720x576 50.00=20=20 720x480 60.00 59.94=20=20 640x480 75.00 72.81 66.67 60.00 59.94=20=20 720x400 70.08=20=20 HDMI-A-1 disconnected (normal left inverted right x axis y axis) DVI-D-0 disconnected (normal left inverted right x axis y axis) 1920x1080_73.00 (0x6f2) 213.250MHz -HSync +VSync h: width 1920 start 2056 end 2256 total 2592 skew 0 clock 82.2= 7KHz v: height 1080 start 1083 end 1088 total 1129 clock 72.8= 7Hz [username@thisalinuxpc ~]$ xrandr --verbose --addmode HDMI-A-0 1920x1080_73= .00 [username@thisalinuxpc ~]$ xrandr --output HDMI-A-0 --mode 1920x1080_73.00 *******END TERMINAL EXAMPLE********* Doing the above commands, 72.9Hz then showed up in the "display" options (in panel menu) and selecting it works great with zero flicker. Now to make it stick after reboot/relog (if it works to your liking): Make a script file called "custom_refresh" (without quotes, no .sh)...put t= he following in it (change yours to fit your proper command outputs from above, accordingly): #!/bin/sh xrandr --newmode "1920x1080_73.00" 213.25 1920 2056 2256 2592 1080 1083 = 1088 1129 -hsync +vsync xrandr --verbose --addmode HDMI-A-0 1920x1080_73.00 xrandr --output HDMI-A-0 --mode 1920x1080_73.00 #[end of commands-don't include this line] Save this file to your /home/CHANGEMETOYOURUSERNAME/ dir (change CHANGEMETOYOURUSERNAME to your user name), quit, then make a new file called "trigger_custom_refresh.sh" (no quotes) and put this in it: #!/bin/sh cd /usr/bin/ xfce4-terminal -e 'bash -c "/home/CHANGEMETOYOURUSERNAME/custom_refresh"' #[end of commands-don't include this line] (or use whatever your favorite terminal emulator is instead, does not have = to be xfce4-terminal; don't forget to change the CHANGEMETOYOURUSERNAME to whatever your user name is, or whatever directory where you saved your custom_refresh script is properly reflected in the command) Save, quit. Cd to where this file is (I just stick both these files in my /home/ dir and run this command straight from a raw terminal) and in termin= al make it executable: $ chmod +x ./trigger_custom_refresh.sh To test it, reboot first (to clear the initial xrandr settings out and go b= ack to default), then use this command: $ ./trigger_custom_refresh.sh Your monitor should flicker as it restarts under the new refresh rate. If = it worked (you can check either by looking at the monitor display settings or = look at xfce4-display-settings or equivalent), you now have a functional script = to activate your custom refresh rate. Now to make this auto load with each reboot or relog: add the trigger_custom_refresh.sh file to startup applications if necessary so it auto-loads and triggers immediately after session-login. No sudo required, it'll load per user session or higher depending on what folder you run it o= ut of. **************************** LAST NOTE: I've found enabling "Tear Free" on my card, an RX590 to be necessary to remove tearing in Proton+Vulkan games and some other OpenGL ga= mes. TO ENABLE AMD's TEARFREE FEATURE: How to enable AMD's "Tear Free" option on their AMD Radeon RX 5xx (Polaris) cards: Time to mess around with xorg.conf. https://wiki.archlinux.org/index.php/AMDGPU#Xorg_configuration 25 Open a terminal and type the command: sudo mousepad /etc/X11/xorg.conf.d/20-amdgpu.conf (or substitute mousepad for whatever basic text editor you like) Then copy and paste the below text starting with "Section" and ending with "EndSection" into the text editor. Section "Device"=20 Identifier "AMD"=20 Driver "amdgpu"=20 Option "TearFree" "true"=20 EndSection Save and quit. This is all presumed that you're using the open source MESA driver. After that. Reboot your computer.=20 Enjoy TearFree --=20 You are receiving this mail because: You are the assignee for the bug.= --15555480335.72F687B2E.19374 Date: Thu, 18 Apr 2019 00:40:33 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Comme= nt # 82 on bug 10264= 6 from kyrottimus@= ;yahoo.com
My solution, well more of a workaround and since I had this pr=
oblem even with
default MESA that comes packaged with Kernel 5.05.XX, was to retune my moni=
tor
to my GPU instead of letting my GPU try to do it automatically the other way
around or waiting on updated kernel/drivers/firmware/microcode to address t=
his
problem for me.

TL:DR--using xrandr to tell my monitor to stay in step with my GPU.


This fixed it for me, your mileage may vary:

Below is an example of commands in the terminal to activate a new monitor
refresh rate in the "display" settings in Manjaro Linux to tune y=
our monitor to
a precise frequency: in the case of a Radeon (Polaris) RX580 or RX590 and a
75Hz (max) ASUS VG245H HDMI gaming monitor, my target was 73Hz (~-2Hz from
peak) to run with the GPU properly without any horizontal black/green line
flickering.

I chose 73Hz because I already tried tuning to my monitor's closest accurate
refresh rate (74.89Hz) manually off the reported 75Hz and it still flickere=
d,
and the next closest setting for my Monitor was ~73Hz.

Keep in mind, with the below example, your variables need to be pulled from
both the cvt command at the top (with your desired resolution/refresh rate
plugged in after the cvt command) and then plug that "Modeline" p=
art (after the
word Modeline) into the xrandr --newmode command.=20=20

YOUR COMMANDS WILL PROBABLY NEED DIFFERENT VARIABLES.

Then, using xrandr -q find your display type and ID (for me it was HDMI-A-0)
and plug that into your final command along with your desired
resolution/refresh info: example here of=20

$ xrandr --verbose --addmode HDMI-A-0 "1920x1080_73.00"

*******BEGIN TERMINAL EXAMPLE********

[username@thisalinuxpc ~]$ cvt 1920 1080 73
# 1920x1080 72.87 Hz (CVT) hsync: 82.27 kHz; pclk: 213.25 MHz
Modeline "1920x1080_73.00"  213.25  1920 2056 2256 2592  1080 108=
3 1088 1129
-hsync +vsync
[username@thisalinuxpc ~]$ xrandr --newmode "1920x1080_73.00"=
  213.25  1920
2056 2256 2592  1080 1083 1088 1129 -hsync +vsync
[username@thisalinuxpc ~]$ xrandr -q
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
DisplayPort-1 disconnected (normal left inverted right x axis y axis)
HDMI-A-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis)
531mm x 299mm
   1920x1080     60.00*+  74.99    50.00    59.94=20=20
   1600x1200     60.00=20=20
   1680x1050     59.88=20=20
   1280x1024     75.02    60.02=20=20
   1440x900      59.90=20=20
   1280x960      60.00=20=20
   1366x768      59.79=20=20
   1280x800      60.00=20=20
   1152x864      75.00=20=20
   1280x720      60.00    50.00    59.94=20=20
   1024x768      75.03    70.07    60.00=20=20
   832x624       74.55=20=20
   800x600       72.19    75.00    60.32    56.25=20=20
   720x576       50.00=20=20
   720x480       60.00    59.94=20=20
   640x480       75.00    72.81    66.67    60.00    59.94=20=20
   720x400       70.08=20=20
HDMI-A-1 disconnected (normal left inverted right x axis y axis)
DVI-D-0 disconnected (normal left inverted right x axis y axis)
  1920x1080_73.00 (0x6f2) 213.250MHz -HSync +VSync
        h: width  1920 start 2056 end 2256 total 2592 skew    0 clock  82.2=
7KHz
        v: height 1080 start 1083 end 1088 total 1129           clock  72.8=
7Hz
[username@thisalinuxpc ~]$ xrandr --verbose --addmode HDMI-A-0 1920x108=
0_73.00
[username@thisalinuxpc ~]$ xrandr --output HDMI-A-0 --mode 1920x1080_73=
.00

*******END TERMINAL EXAMPLE*********

Doing the above commands, 72.9Hz then showed up in the "display" =
options (in
panel menu) and selecting it works great with zero flicker.

Now to make it stick after reboot/relog (if it works to your liking):

Make a script file called "custom_refresh" (without quotes, no .s=
h)...put the
following in it (change yours to fit your proper command outputs from above,
accordingly):

#!/bin/sh
xrandr --newmode "1920x1080_73.00"  213.25  1920 2056 2256 2592  =
1080 1083 1088
1129 -hsync +vsync
xrandr --verbose --addmode HDMI-A-0 1920x1080_73.00
xrandr --output HDMI-A-0 --mode 1920x1080_73.00

#[end of commands-don't include this line]


Save this file to your /home/CHANGEMETOYOURUSERNAME/ dir (change
CHANGEMETOYOURUSERNAME to your user name), quit, then make a new file called
"trigger_custom_refresh.sh" (no quotes) and put this in it:

#!/bin/sh
cd /usr/bin/
xfce4-terminal -e 'bash -c "/home/CHANGEMETOYOURUSERNAME/custom_refres=
h"'


#[end of commands-don't include this line]

(or use whatever your favorite terminal emulator is instead, does not have =
to
be xfce4-terminal; don't forget to change the CHANGEMETOYOURUSERNAME to
whatever your user name is, or whatever directory where you saved your
custom_refresh script is properly reflected in the command)

Save, quit.  Cd to where this file is (I just stick both these files in my
/home/ dir and run this command straight from a raw terminal) and in termin=
al
make it executable:

$ chmod +x ./trigger_custom_refresh.sh


To test it, reboot first (to clear the initial xrandr settings out and go b=
ack
to default), then use this command:

$ ./trigger_custom_refresh.sh

Your monitor should flicker as it restarts under the new refresh rate.  If =
it
worked (you can check either by looking at the monitor display settings or =
look
at xfce4-display-settings or equivalent), you now have a functional script =
to
activate your custom refresh rate.

Now to make this auto load with each reboot or relog: add the
trigger_custom_refresh.sh file to startup applications if necessary so it
auto-loads and triggers immediately after session-login.  No sudo required,
it'll load per user session or higher depending on what folder you run it o=
ut
of.


****************************

LAST NOTE:  I've found enabling "Tear Free" on my card, an RX590 =
to be
necessary to remove tearing in Proton+Vulkan games and some other OpenGL ga=
mes.

TO ENABLE AMD's TEARFREE FEATURE:

How to enable AMD's "Tear Free" option on their AMD Radeon RX 5xx=
 (Polaris)
cards:

Time to mess around with xorg.conf.
=
https://wiki.archlinux.org/index.php/AMDGPU#Xorg_configuration 25

Open a terminal and type the command:

sudo mousepad /etc/X11/xorg.conf.d/20-amdgpu.conf

(or substitute mousepad for whatever basic text editor you like)

Then copy and paste the below text starting with "Section" and en=
ding with
"EndSection" into the text editor.

Section "Device"=20
Identifier "AMD"=20
Driver "amdgpu"=20
Option "TearFree" "true"=20
EndSection

Save and quit. This is all presumed that you're using the open source MESA
driver. After that. Reboot your computer.=20

Enjoy TearFree


You are receiving this mail because:
  • You are the assignee for the bug.
= --15555480335.72F687B2E.19374-- --===============0703197685== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0703197685==--