Bug 347360

Summary: nvidia is reporting 50Hz - again (at least through xcb?)
Product: [Plasma] kwin Reporter: Nikola Schnelle <n.schnelle>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: cam, chrno-sphered, kaankasim88
Priority: NOR Flags: thomas.luebking: NVIDIA+
thomas.luebking: ReviewRequest+
Version First Reported In: 5.3.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
URL: https://git.reviewboard.kde.org/r/123693/
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Nikola Schnelle 2015-05-07 05:21:59 UTC
Scrolling in firefox is not smooth as in kde4 on the same hardware. And generally effects seems less smooth then butter smooth kde4/kwin4 experience.

Problem is fixed if I change Tearing prevention from "automatic" to "never". But then I get tearing of course. 
Switching to xrender also fixes the problem.

Nvidia card with latest stable drivers with "export __GL_YIELD="USLEEP"" workaround for preventing tearing (using in kde4 also without any problems).

Reproducible: Always
Comment 1 Thomas Lübking 2015-05-07 07:31:34 UTC
You're likely running into the 50Hz issue.
Add

[Compositing]
RefreshRate=60

to ~/.config/kwinrc and "kwin_x11 --replace &"
Comment 2 Nikola Schnelle 2015-05-07 07:52:33 UTC
(In reply to Thomas Lübking from comment #1)
> You're likely running into the 50Hz issue.
> Add
> 
> [Compositing]
> RefreshRate=60
> 
> to ~/.config/kwinrc and "kwin_x11 --replace &"

Yeah that fixes it. Thank you.
Comment 3 Thomas Lübking 2015-05-07 22:58:42 UTC
*** Bug 347397 has been marked as a duplicate of this bug. ***
Comment 4 Thomas Lübking 2015-05-13 14:51:53 UTC
*** Bug 347658 has been marked as a duplicate of this bug. ***
Comment 5 Thomas Lübking 2015-05-15 22:17:23 UTC
Git commit c08038e0a63f51202762fa72943d5cd3884a82f8 by Thomas Lübking.
Committed on 15/05/2015 at 20:02.
Pushed by luebking into branch 'Plasma/5.3'.

prefer query Screens::refreshRate()

ScreenInfo::rate is reporting 50Hz (on at least nvidia)
... AGAIN! * sigh*

In addition we check for __GL_SYNC_DISPLAY_DEVICE to pick
the rate of the screen that the driver will actually sync to
(hopefully...)

The patch is limited to nvidia systems for 5.3, applied everywhere
in master (ie. will be in 5.4 unless there's some problem)
REVIEW: 123693

M  +28   -4    options.cpp

http://commits.kde.org/kwin/c08038e0a63f51202762fa72943d5cd3884a82f8
Comment 6 Thomas Lübking 2015-05-15 22:46:38 UTC
Git commit 3158e987fa241f95a984be1b6a0dba344d2c0c95 by Thomas Lübking.
Committed on 15/05/2015 at 21:55.
Pushed by luebking into branch 'master'.

prefer query Screens::refreshRate()

ScreenInfo::rate is reporting 50Hz (on at least nvidia)
... AGAIN! * sigh*

In addition we check for __GL_SYNC_DISPLAY_DEVICE to pick
the rate of the screen that the driver will actually sync to
(hopefully...)

The patch is limited to nvidia systems for 5.3, applied everywhere
in master (ie. will be in 5.4 unless there's some problem)
REVIEW: 123693

M  +28   -4    options.cpp

http://commits.kde.org/kwin/3158e987fa241f95a984be1b6a0dba344d2c0c95
Comment 7 Cameron 2015-05-17 23:09:24 UTC
I also have the same issue with 5.3. 

However, I tried RefreshRate=144 (which is the refresh rate of my monitor) and I got 72 fps. I tried setting it much higher, and I'd get 60-something fps. Maybe there's something being truncated here?

Remembering something, I finally tried RefreshRate=100  and now I get 100 fps. From past experience I've found that kwin appears to have framerate/refresh cap at 100 fps/hz. If your monitor has a refresh rate above 100, then the best you can for this issue is set RefreshRate=100.

This will not affect other applications, windowed and fullscreen games will be able to run at over 100 fps with vsync.

Hope this helps someone else until we have a release with the fix!
Comment 8 Thomas Lübking 2015-05-18 09:20:14 UTC
a) the fps counter effect display is capped at 100 fps (and unreliable. don't focus on it - we need some statistics module)

b) set
MaxFPS=144 # defaults to 60 - this is NOT affected by the fix of this bug!
RefreshRate=144