[Bug 102646] Screen flickering under amdgpu-experimental [buggy auto power profile]

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Apr 18 00:40:32 UTC 2019


https://bugs.freedesktop.org/show_bug.cgi?id=102646

--- Comment #82 from kyrottimus at yahoo.com ---
My solution, well more of a workaround and since I had this problem even with
default MESA that comes packaged with Kernel 5.05.XX, was to retune my monitor
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 this
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 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 flickered,
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.  

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 

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

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

[username at 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 at thisalinuxpc ~]$ xrandr --newmode "1920x1080_73.00"  213.25  1920
2056 2256 2592  1080 1083 1088 1129 -hsync +vsync
[username at 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  
   1600x1200     60.00  
   1680x1050     59.88  
   1280x1024     75.02    60.02  
   1440x900      59.90  
   1280x960      60.00  
   1366x768      59.79  
   1280x800      60.00  
   1152x864      75.00  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94  
   720x400       70.08  
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.27KHz
        v: height 1080 start 1083 end 1088 total 1129           clock  72.87Hz
[username at thisalinuxpc ~]$ xrandr --verbose --addmode HDMI-A-0 1920x1080_73.00
[username at 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 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_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 terminal
make it executable:

$ chmod +x ./trigger_custom_refresh.sh


To test it, reboot first (to clear the initial xrandr settings out and go back
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 out
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 games.

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" 
Identifier "AMD" 
Driver "amdgpu" 
Option "TearFree" "true" 
EndSection

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

Enjoy TearFree

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20190418/b72d290d/attachment.html>


More information about the dri-devel mailing list