View previous topic :: View next topic |
Author |
Message |
motig n00b
Joined: 11 Oct 2016 Posts: 37
|
Posted: Thu Dec 28, 2017 11:19 am Post subject: Xorg intel refresh rate stuck at 40 Hz [WORKAROUND] |
|
|
Hello,
I have upgraded my kernel to gentoo-sources-4.14.8-r1 (used to be 4.9.34). I have noticed a sluggish performance in KDE and after some research it looks like the problem is my display refresh rate stuck at 40 Hz.
Code: |
$ xrandr
Screen 0: minimum 8 x 8, current 1600 x 900, maximum 32767 x 32767
eDP1 connected primary 1600x900+0+0 (normal left inverted right x axis y axis) 310mm x 170mm
1600x900 59.99*+ 40.00
1368x768 60.00
1280x720 60.00
1024x768 60.00
1024x576 60.00
960x540 60.00
800x600 60.32 56.25
864x486 60.00
800x450 60.00
640x480 59.94
720x405 60.00
640x360 60.00
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
$ glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
202 frames in 5.0 seconds = 40.235 FPS
|
I have tried changing it to 59.99 but it does not seem to work with neither KDE settings nor xrandr. If I switch resolution to 1368x768 it gets set to 60 but I definitely not want to run my desktop at that resolution.
Also according to the Xorg log it looks like it should be running at 60?
Code: |
[117952.263] (II) intel(0): switch to mode 1368x768@60.0 on eDP1 using pipe 0, position (0, 0), rotation normal, reflection none
[117953.500] (II) intel(0): resizing framebuffer to 1368x768
[117972.019] (II) intel(0): resizing framebuffer to 1600x900
[117972.052] (II) intel(0): switch to mode 1600x900@60.0 on eDP1 using pipe 0, position (0, 0), rotation normal, reflection none
|
Thanks for any suggestions!
gentoo-sources-4.14.8-r1
xf86-video-intel-2.99.917_p20170313
xorg-server-1.19.5
Last edited by motig on Thu Nov 29, 2018 10:48 am; edited 1 time in total |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Thu Dec 28, 2017 7:16 pm Post subject: |
|
|
What hardware are you using?
Chances are, you should be using the modesetting driver, and not even have xf86-video-intel installed by setting make.conf VIDEO_CARDS = "intel i965" . _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Thu Dec 28, 2017 7:40 pm Post subject: |
|
|
motig,
There are two refresh rates at play here.
One is how often the image on the screen is redrawn. That's 60Hz.
It might possibly be 30Hz if you are using interlaced video but that's unlikely.
Please put all of Xog.0.log onto a pastebin.
The other refresh rate is how fast the graphics engine can draw a new image in the pixel buffer.
That could be 40Hz but even an old Intel GPU can do better than that with glxgears if its set up properly.
What does Code: | glxinfo | grep -i direct | say about direct rendering: ?
For completeness, there are two pixel buffers. One is being displayed while the other is being drawn.
During the vertical blanking interval, the pixel buffers are swapped over.
In theory, this swap happens at 60Hz, which is the same rate as the display can cope with new images.
However, if the graphics engine has not completed drawing the new image, the swap will be delayed for another frame.
Framebuffer swaps do not happen during the active frame time. That produces ugly video artefacts known as 'tearing' _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
motig n00b
Joined: 11 Oct 2016 Posts: 37
|
Posted: Thu Dec 28, 2017 11:27 pm Post subject: |
|
|
I am using integrated graphics in an Intel Core i5-5200U
It used to work fine with the older kernel as mentioned in my original post.
Code: |
glxinfo | grep -i direct
direct rendering: Yes
GL_ARB_depth_clamp, GL_ARB_derivative_control, GL_ARB_direct_state_access,
GL_ARB_draw_elements_base_vertex, GL_ARB_draw_indirect,
GL_ARB_multi_draw_indirect, GL_ARB_occlusion_query2,
|
VIDEO_CARDS="intel vesa i915 i965"
I didn't have i915 and i965 originally but I enabled them, updated mesa and the behavior is still the same (after restarting the X server).
I have tried switching to 40 Hz explicitly and back to 60, it seems to do something but glxgears gives 40 FPS in both cases and KDE animation smoothness is the same.
Here's the Xorg log: https://paste.k3a.me/view/18bf80f3 |
|
Back to top |
|
|
The Main Man Veteran
Joined: 27 Nov 2014 Posts: 1166 Location: /run/user/1000
|
Posted: Fri Dec 29, 2017 12:43 pm Post subject: |
|
|
I had problems with kernel 4.14 and i915, wasn't this one though, was getting segfaults when trying to watch videos, tried to solve it but I couldn't.
Had to stay with older kernel, maybe it will be fixed in 4.15, I'm not sure what's going on. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Fri Dec 29, 2017 1:13 pm Post subject: |
|
|
motig,
That looks good.
Please pastebin your untire Xorg.0.log _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
motig n00b
Joined: 11 Oct 2016 Posts: 37
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Fri Dec 29, 2017 3:04 pm Post subject: |
|
|
motig,
Sorry I missed your full log post.
It looks perfectly normal.
-- edit --
Lets poke at it a little ...
man intel: | Option "SwapbuffersWait" "boolean"
This option controls the behavior of glXSwapBuffers and glXCopySubBufferMESA calls by GL applications. If enabled, the calls will avoid tearing by making sure the display scanline is outside of the area to be copied before the copy occurs. If disabled, no scanline synchronization is performed, meaning tearing will likely occur. Note that when enabled, this option can adversely affect the framerate of applications that render frames at less than refresh rate.
Default: enabled. |
Pass Xorg Code: | Option "SwapbuffersWait" "false" | It will be ugly and expect to see tearing but does it affect the framerate any? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Fri Dec 29, 2017 3:48 pm Post subject: |
|
|
Jaglover,
Thanks for making me look at this a bit harder.
Code: | [123241.894] (II) intel(0): Modeline "1600x900"x0.0 119.40 1600 1648 1680 2140 900 902 907 930 -hsync -vsync (55.8 kHz eP)
[123241.894] (II) intel(0): Modeline "1600x900"x0.0 79.61 1600 1648 1680 2140 900 902 907 930 -hsync -vsync (37.2 kHz e) |
That's 16.668ms per frame (60Hz) or 24.999ms per frame (40 Hz)
It looks like its using the wrong modeliine when it runs at 40Hz.
Maybe feed it a manual modeline and tell it to use it so it doesn't pick the wrong one. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Fri Dec 29, 2017 4:02 pm Post subject: |
|
|
Jaglover,
Code: | [123239.512] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Dec 28 15:29:19 2017
[123239.512] (==) Using config directory: "/etc/X11/xorg.conf.d"
[123239.512] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[123239.512] (==) No Layout section. Using the first Screen section.
[123239.512] (==) No screen section available. Using defaults. |
There should be more "No ... section available" entries than that,
We need to see Code: | cat /etc/X11/xorg.conf.d/* |
_________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
motig n00b
Joined: 11 Oct 2016 Posts: 37
|
Posted: Fri Dec 29, 2017 8:47 pm Post subject: |
|
|
Thanks for looking into it. I am starting to think it might be a rendering issue and not the refresh rate of the display itself.
When I manually switch refresh rate to 40, xrandr reflects that. I can switch back to 60 afterwards but glxgears behavior is the same. Unfortunately since this is a laptop LCD panel, I have no independent way to check the actual active settings.
Code: |
$ xrandr --rate 40
$ xrandr
Screen 0: minimum 8 x 8, current 1600 x 900, maximum 32767 x 32767
eDP1 connected primary 1600x900+0+0 (normal left inverted right x axis y axis) 310mm x 170mm
1600x900 59.99 + 40.00*
1368x768 60.00
1280x720 60.00
1024x768 60.00
1024x576 60.00
960x540 60.00
800x600 60.32 56.25
864x486 60.00
800x450 60.00
640x480 59.94
720x405 60.00
640x360 60.00
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
|
Also as requested, here are the contents of my xorg.conf.d:
Code: |
$ cat /etc/X11/xorg.conf.d/*
Section "Monitor"
Identifier "eDP1"
DisplaySize 310 174
EndSection
Section "Files"
EndSection
Section "InputClass"
Identifier "touchpad catchall"
Driver "synaptics"
MatchIsTouchpad "on"
Option "LeftEdge" "1661"
Option "RightEdge" "5367"
Option "TopEdge" "1412"
Option "BottomEdge" "4510"
Option "FingerLow" "25"
Option "FingerHigh" "30"
Option "MaxTapTime" "180"
Option "MaxTapMove" "246"
Option "MaxDoubleTapTime" "100"
Option "SingleTapTimeout" "180"
Option "ClickTime" "100"
Option "EmulateMidButtonTime" "75"
Option "EmulateTwoFingerMinZ" "282"
Option "EmulateTwoFingerMinW" "7"
Option "VertScrollDelta" "63"
Option "HorizScrollDelta" "60"
Option "VertEdgeScroll" "0"
Option "HorizEdgeScroll" "0"
Option "CornerCoasting" "0"
Option "VertTwoFingerScroll" "1"
Option "HorizTwoFingerScroll" "1"
Option "MinSpeed" "1"
Option "MaxSpeed" "1.75"
Option "AccelFactor" "0.0356189"
Option "TouchpadOff" "2"
Option "LockedDrags" "0"
Option "LockedDragTimeout" "5000"
Option "RTCornerButton" "0"
Option "RBCornerButton" "0"
Option "LTCornerButton" "0"
Option "LBCornerButton" "0"
Option "TapButton1" "0"
Option "TapButton2" "0"
Option "TapButton3" "2"
Option "ClickFinger1" "1"
Option "ClickFinger2" "1"
Option "ClickFinger3" "1"
Option "CircularScrolling" "0"
Option "CircScrollDelta" "0.100007"
Option "CircScrollTrigger" "0"
Option "CircularPad" "0"
Option "PalmDetect" "0"
Option "PalmMinWidth" "10"
Option "PalmMinZ" "200"
Option "CoastingSpeed" "0"
Option "CoastingFriction" "50"
Option "PressureMotionMinZ" "30"
Option "PressureMotionMaxZ" "160"
Option "PressureMotionMinFactor" "1"
Option "PressureMotionMaxFactor" "1"
Option "GrabEventDevice" "0"
Option "TapAndDragGesture" "1"
Option "AreaLeftEdge" "0"
Option "AreaRightEdge" "0"
Option "AreaTopEdge" "0"
Option "AreaBottomEdge" "0"
Option "HorizHysteresis" "28"
Option "VertHysteresis" "28"
Option "ClickPad" "0"
EndSection
|
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Fri Dec 29, 2017 9:15 pm Post subject: |
|
|
motig,
There is nothing there forcing 40 Hz.
Lets try forcing the 60Hz mode. Add Code: | ModeLine "1600x900 Force 60" 119.40 1600 1648 1680 2140 900 902 907 930 |
to your Section "Monitor" in /etc/X11/xorg.conf.d/
The timings are all from your Xorg.0.log, just with the name changed to "1600x900 Force 60"
When you make that change and restart Xory, it should show that "1600x900 Force 60" is in use.
If the modeline is not used, we can encourage it some more with a ServerLayout section.
This the the old fashioned way to configure Xorg, before that days of EDID. Its been relegated to the emergency manual override these days but it still works for most video drivers.
For completeness, Xorg can run at any arbitrary resolutions and timings you care to write a modeline for.
-- edit --
This only controls the rate at which the pixel buffer is transferred to the display surface.
If the GPU can't draw the new images that fast, the old image will be reused.
See what I said about the option that would allow tearing. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
motig n00b
Joined: 11 Oct 2016 Posts: 37
|
Posted: Fri Dec 29, 2017 11:59 pm Post subject: |
|
|
I have tried several things.
First, I rebooted to the old kernel, got the Xorg log and checked behavior.
Xorg log from kernel 4.9.34 is here: https://paste.k3a.me/view/0a46047e
Works normally with 60 FPS:
Code: |
$ xrandr
Screen 0: minimum 8 x 8, current 1600 x 900, maximum 32767 x 32767
eDP1 connected primary 1600x900+0+0 (normal left inverted right x axis y axis) 310mm x 170mm
1600x900 59.99*+ 40.00
1368x768 60.00
1280x720 60.00
1024x768 60.00
1024x576 60.00
960x540 60.00
800x600 60.32 56.25
864x486 60.00
800x450 60.00
640x480 59.94
720x405 60.00
640x360 60.00
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
$ glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
302 frames in 5.0 seconds = 60.369 FPS
|
Then I tried the new kernel 4.14.8-r1 with the new modeline. For some reason the X server picked the 40 Hz refresh rate but I switched to the new modeline manually. Unfortunately, the result was the same (40 FPS).
Code: |
$ xrandr
Screen 0: minimum 8 x 8, current 1600 x 900, maximum 32767 x 32767
eDP1 connected primary 1600x900+0+0 (normal left inverted right x axis y axis) 310mm x 170mm
1600x900 59.99 + 40.00*
1600x900 Force 60 59.99
1368x768 60.00
1280x720 60.00
1024x768 60.00
1024x576 60.00
960x540 60.00
800x600 60.32 56.25
864x486 60.00
800x450 60.00
640x480 59.94
720x405 60.00
640x360 60.00
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
$ xrandr --output "eDP1" --mode "1600x900 Force 60"
$ xrandr
Screen 0: minimum 8 x 8, current 1600 x 900, maximum 32767 x 32767
eDP1 connected primary 1600x900+0+0 (normal left inverted right x axis y axis) 310mm x 170mm
1600x900 59.99 + 59.99 40.00
1600x900 Force 60 59.99*
1368x768 60.00
1280x720 60.00
1024x768 60.00
1024x576 60.00
960x540 60.00
800x600 60.32 56.25
864x486 60.00
800x450 60.00
640x480 59.94
720x405 60.00
640x360 60.00
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
$ glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
203 frames in 5.0 seconds = 40.431 FPS
|
Finally, I tried to add the Option "SwapbuffersWait" "false". Now glxgears has framerate probably unrestricted by monitor refresh but it had no effect on KDE animation smoothness nor mouse cursor movement for example. I think it had a positive effect on content movement smoothness in web browser windows but it is hard to judge.
Code: |
$ glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
40250 frames in 5.0 seconds = 8049.875 FPS
|
|
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
motig n00b
Joined: 11 Oct 2016 Posts: 37
|
Posted: Tue Jan 09, 2018 10:39 am Post subject: |
|
|
I have just tried the modesetting driver with the same result - 40 FPS. The only difference I have noticed is that the screen DPI is incorrect even though xrandr reports correct display dimensions.
Code: |
# xrandr
Screen 0: minimum 320 x 200, current 1600 x 900, maximum 8192 x 8192
eDP-1 connected primary 1600x900+0+0 (normal left inverted right x axis y axis) 309mm x 174mm
1600x900 59.99*+ 40.00
1024x768 60.04 60.00
960x720 60.00
928x696 60.05
896x672 60.01
800x600 60.00 60.32 56.25
700x525 59.98
640x512 60.02
640x480 60.00 59.94
512x384 60.00
400x300 60.32 56.34
320x240 60.05
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)
|
Xorg log:
https://paste.k3a.me/view/359a4906
For the time being I went back to the 4.9 kernel branch, it seems like the 4.14 is keyword-masked again in portage? |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Thu Jan 11, 2018 6:27 am Post subject: |
|
|
Does disabling HDMI audio (using `xrandr`) fix the framerate? I know it's a laptop panel, but it may have the setting anyway. |
|
Back to top |
|
|
chithanh Developer
Joined: 05 Aug 2006 Posts: 2158 Location: Berlin, Germany
|
Posted: Thu Jan 11, 2018 12:52 pm Post subject: |
|
|
As the driver responsible for the modesetting is in the kernel nowadays, it may work forcing a mode through kernel parameters.
Try adding the following to the kernel command line
If that doesn't help, look up the kernel connector name (may be different from xrandr connector name) in /sys/class/drm/ and prepend that
Code: | video=DP-1:1600x900@60 |
(replace DP-1 with whatever your laptop display's connector name is)
For more information about the video=... kernel parameter syntax, read https://nouveau.freedesktop.org/wiki/KernelModeSetting/#forcingmodes (applies to other KMS drivers too, not only nouveau). |
|
Back to top |
|
|
motig n00b
Joined: 11 Oct 2016 Posts: 37
|
Posted: Thu Nov 29, 2018 10:48 am Post subject: |
|
|
So after almost a year, I have upgraded to a 4.14 kernel and guess what, the problem is still there.
However, I have found new information on the web, someone saying that if you create a modeline with a refresh rate higher than 60 Hz, it will set it to 60. So I tried it and it really works! In Arch Linux this bug was reported fixed a long time ago but the fix is probably not included in the mainline kernel.
Anyway if you suffer from this annoyance, try making a modeline with cvt for 72 Hz and add it via xrandr to test it, if successful add it to your config:
Code: |
$ cvt 1600 900 72
# 1600x900 71.87 Hz (CVT) hsync: 67.63 kHz; pclk: 145.00 MHz
Modeline "1600x900_72.00" 145.00 1600 1704 1872 2144 900 903 908 941 -hsync +vsync
$ xrandr --newmode "1600x900_72.00" 145.00 1600 1704 1872 2144 900 903 908 941 -hsync +vsync
$ xrandr --addmode "eDP-1" "1600x900_72.00"
$ xrandr --output "eDP-1" --mode "1600x900_72.00"
$ glxgears
378 frames in 5.0 seconds = 75.428 FPS
300 frames in 5.0 seconds = 59.996 FPS
|
/etc/X11/xorg.conf.d/10monitor.conf
Code: |
Section "Monitor"
Identifier "eDP-1"
DisplaySize 310 174
Modeline "1600x900_72" 145.00 1600 1704 1872 2144 900 903 908 941 -hsync +vsync
Option "PreferredMode" "1600x900_72"
EndSection
|
|
|
Back to top |
|
|
motig n00b
Joined: 11 Oct 2016 Posts: 37
|
Posted: Thu Jan 17, 2019 6:06 pm Post subject: |
|
|
As an additional note, I have replaced the 1600x900 TN panel in my laptop with a 1920x1080 VA today and the refresh rate problem is gone, I do not even need to use the custom modeline as a workaround. |
|
Back to top |
|
|
|