neutrinolabs / xorgxrdp

Xorg drivers for xrdp
Other
428 stars 108 forks source link

In rdpLRANDR.c why set refresh rate to 50Hz? #270

Open wqlxx opened 6 months ago

wqlxx commented 6 months ago

In rdpLRANDR.c I found the refresh rate is 50Hz. And I can get 50Hz from xrandr command.

Screen 0: minimum 64 x 64, current 1280 x 1024, maximum 8192 x 8192 rdp0 connected 1280x1024+0+0 0mm x 0mm 1280x1024 50.00*+

But when I test glxgears command with ___GL_SYNC_TOVBLANK=1 or _vblankmode=1. The frame rate is not 50Hz.

Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. 46715 frames in 5.0 seconds = 9342.961 FPS

metalefty commented 6 months ago

It is a pseudo refresh rate. I believe it doesn't affect actual behaviour. There's no answer why it is 50Hz but it can be set to whatever.

Nexarian commented 6 months ago

The real answer: I was playing with the value to see if it would help performance, I don't think it changed anything, and because it didn't matter it likely got merged into a commit long ago without much thought.

wqlxx commented 6 months ago

It is a pseudo refresh rate. I believe it doesn't affect actual behaviour. There's no answer why it is 50Hz but it can be set to whatever.

@metalefty Yes, I set it to 30Hz or 120Hz, nNo change at all.

wqlxx commented 6 months ago

The real answer: I was playing with the value to see if it would help performance, I don't think it changed anything, and because it didn't matter it likely got merged into a commit long ago without much thought.

@Nexarian Do you have any good advice? I hope to use vsync to control the frame ratre in glxgears or other APP with swapinterval.

metalefty commented 6 months ago

What is your purpose? As I said, It can be set whatever but it doesn't affect actual behaviour. It is a PSEUDO value, just ignore it.

metalefty commented 6 months ago

See also: https://github.com/neutrinolabs/xrdp/issues/2546#issuecomment-1427678036

wqlxx commented 6 months ago

What is your purpose? As I said, It can be set whatever but it doesn't affect actual behaviour. It is a PSEUDO value, just ignore it.

I hope to reduce GPU usage through control rdp0 (virtual monitor's name) refresh rate. In my test , I used windows mstsc to connect XRDP in ubuntu, and the glxgears or glmark2 run in high FPS, because the vsync/vblank seems to be invalid.

I found something about refresh rate in libxrandr, and xrdp can change refresh rate in xrandr. But it seems to do nothing to help glx/egl to use glxswapintervalEXT function in MESA.