Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new resolutions to Xdummy on the fly - dummy driver needs randr support added? #56

Closed
totaam opened this issue Dec 6, 2011 · 40 comments
Labels
display help wanted Extra attention is needed
Milestone

Comments

@totaam
Copy link
Collaborator

totaam commented Dec 6, 2011

Instead of finding the nearest match, we should just add the modeline, assign it to the output then select it.
This would allow us to match the client's screen size exactly.

(somewhat blocked by #10)

@totaam
Copy link
Collaborator Author

totaam commented Dec 6, 2011

2011-12-06 19:32:09: totaam uploaded file add-screen-size.patch (9.5 KiB)

this patch would add a new mode to Xdummy so we can use it... but does not work

@totaam
Copy link
Collaborator Author

totaam commented Dec 6, 2011

After asking xorg-devel, it would seem that the dummy driver does not support randr - or at least not fully.

The patch above attempts to replicate xrandr's command line functionality and even includes its own modeline calculator, so from xpra's side it is pretty much ready.

@totaam
Copy link
Collaborator Author

totaam commented May 4, 2012

Not heard back, and less critical now that the default config contains many of the typical resolutions found on desktops and even android devices.

@totaam
Copy link
Collaborator Author

totaam commented Sep 21, 2012

2012-09-21 05:20:43: onlyjob uploaded file _add-screen-size.patch (9.5 KiB)

refreshed patch to apply over 0.6.1

@totaam
Copy link
Collaborator Author

totaam commented Oct 7, 2012

Closed #186 (duplicate - some info there)

@totaam
Copy link
Collaborator Author

totaam commented Jan 22, 2014

@totaam
Copy link
Collaborator Author

totaam commented Apr 22, 2014

Forgot to update this ticket:

@totaam
Copy link
Collaborator Author

totaam commented Nov 21, 2014

NNicolas Boichat has just posted X11 patches to do exactly this!: PATCH dummy: Add support for custom resolutions (RandR 1.2)

Maybe this will fix #728
We'll just have to ensure this works with DPI (#163) - that we deal with #732 if possible, see also #349

@totaam
Copy link
Collaborator Author

totaam commented Jan 26, 2015

Looks like the discussion of what to do for randr 1.2 support is ongoing: Cleanups and RandR 1.2 support, with different implementations suggested.

And so this will have to wait until this gets merged in one form or another, and maybe we only have to package it then which would be great (assuming that the new code can be built against older servers that is...)

@totaam
Copy link
Collaborator Author

totaam commented May 18, 2015

Maybe this can help us: RandR 1.5 Brings Monitor Objects & Tile Support For X.Org

@totaam
Copy link
Collaborator Author

totaam commented Jun 9, 2015

Re-post: xvfb: add randr support (v2)

I think we should update the dummy driver with the same changes.

@totaam
Copy link
Collaborator Author

totaam commented Jun 18, 2015

In one of the responses to the patch above: [http://lists.x.org/archives/xorg-devel/2015-June/046666.html] links to: PATCH xf86-video-dummy 0/6: Cleanups and RandR 1.2 support - which is a better approach IMO.

@totaam
Copy link
Collaborator Author

totaam commented Sep 16, 2015

See also #969, in particular the ramdac fix in #969#comment:3

@totaam
Copy link
Collaborator Author

totaam commented Sep 16, 2015

2015-09-16 12:49:47: antoine uploaded file 1001-remove-pointless-functions.patch (2.9 KiB)

dummy randr 1.2: patch 1 Remove pointless empty functions

@totaam
Copy link
Collaborator Author

totaam commented Sep 16, 2015

2015-09-16 12:50:10: antoine uploaded file 1002-delete-xv-stuff.patch (1.9 KiB)

dummy randr 1.2: patch 2 Delete XV stuff

@totaam
Copy link
Collaborator Author

totaam commented Sep 16, 2015

2015-09-16 12:50:30: antoine uploaded file 1003-delete-screensaver.patch (1.0 KiB)

dummy randr 1.2: patch 3 Delete dPtr->screenSaver

@totaam
Copy link
Collaborator Author

totaam commented Sep 16, 2015

2015-09-16 12:50:47: antoine uploaded file 1004-remove-dga.patch (7.4 KiB)

dummy randr 1.2: patch 4 Remove DGA support

@totaam
Copy link
Collaborator Author

totaam commented Sep 16, 2015

2015-09-16 12:51:19: antoine uploaded file 1005-remove-fbbase.patch (2.5 KiB)

dummy randr 1.2: patch 5 Get rid of dPtr->FBBase

@totaam
Copy link
Collaborator Author

totaam commented Sep 16, 2015

2015-09-16 12:51:34: antoine uploaded file 1006-randr12.patch (7.8 KiB)

dummy randr 1.2: patch 6 Support RandR 1.2

@totaam
Copy link
Collaborator Author

totaam commented Sep 16, 2015

just tried the patch series above and hit a snag: my xorg-devel reply

@totaam
Copy link
Collaborator Author

totaam commented Oct 14, 2015

See also: MST monitors and the proposal for RandR 1.5 which would have the concept of "monitors" (without requiring us to have virtual CRTCs attached to them apparently)

@totaam
Copy link
Collaborator Author

totaam commented Dec 9, 2015

The randr v2 patch has been merged:
http://lists.x.org/archives/xorg-devel/2015-December/048228.html

Commit: 3d68d1f26709ecb5ce22a9baa0d3d8162574ed6a.

So either we figure out how to use the same code in Xdummy, or we switch back to Xvfb with newer versions?
Will have to test this new stuff: re-scheduling.

@totaam
Copy link
Collaborator Author

totaam commented Jun 15, 2016

We're not alone in needing this: xf86-video-dummy: resize to exact resolution from Chrome Remote Desktop developer Erik Jensen.

@totaam
Copy link
Collaborator Author

totaam commented Aug 10, 2016

I don't have time for this, new links:

@totaam
Copy link
Collaborator Author

totaam commented Sep 23, 2016

2016-09-23 06:59:00: antoine uploaded file dummy-remove-functions.patch (3.5 KiB)

for testing the latest upstream patches for dummy

@totaam
Copy link
Collaborator Author

totaam commented Sep 26, 2016

Recent discussion: remove dead code in dummy driver: In 2014 I had also modified the dummy driver while working with Teradici Corporation to support not only arbitrary pixel dimensions, but also multiple monitors. The latter feature might not make sense to some folks, but if you have a server-side Xserver mapped to a hardware thin client sitting across a network, which has multiple physical monitors attached, you want the Xserver to be configured in the exact same manner as the tin client. Even though there is just a virtual framebuffer in main memory, X applications need to know the number/size/location of monitors so that toolbars are placed properly, windows are fullscreen'ed properly, etc. And when the user moves from one hardware thin client to another, which may have a different monitor configuration, the Xserver session needs to change to that configuration.

@totaam
Copy link
Collaborator Author

totaam commented Jan 23, 2017

This will also make #1008 redundant.

@totaam
Copy link
Collaborator Author

totaam commented Jul 14, 2017

Raising again.

This is the commit that added randr to Xvfb: vfb: add randr support (v2)

@totaam
Copy link
Collaborator Author

totaam commented Sep 29, 2017

Done for Xvfb in r16994.
To use it, switch to Xvfb in /etc/xpra/conf.d/55_server_x11.conf.in
The server should then create new resolutions for every client, the "-d screen,randr" debug output looks like this (shown here for 1080p, but this works for any reasonable resolution):

dpi=120, dpi.x=120, dpi.y=120, double_click_time=400, double_click_distance=(-1, -1), \
    antialias={'hinting': True, 'enabled': True, 'orientation': 'NONE', 'contrast': 1000, 'hintstyle': 'hintslight'}, \
    cursor_size=24
Python/Gtk2 Linux Fedora 26 TwentySix x11 client version 2.2-[r16976](../commit/8504d272c71def04e162ca2d0a19c696db0057c7) 64-bit
 connected from 'desktop' as 'antoine' - 'Antoine Martin'
 mmap is enabled using 256MB area in /run/user/1000/xpra/xpra.7Ap0oy.mmap
 client root window size is 3840x2160 with 1 display:
  :1.0 (1016x572 mm - DPI: 96x95) workarea: 3840x2126 at 0x34
    monitor 1 (708x398 mm - DPI: 137x137)
maximum client resolution is 3840x2160 (current server resolution is 5760x2560)
set_screen_size(3840, 2160)
set_screen_size(3840, 2160) xdpi=120, ydpi=120
set_dpi(120, 120)
add_screen_size(3840, 2160)
Modeline 3840x2160 230 3840 4108 4492 5068 2160 2161 2164 2293
XRRCreateMode returned 0x275
screen_resources: crtcs=1, outputs=1, modes=2
adding mode 0x275 to output 0x3d
randr_added_sizes=[(3840, 2160)]
using XRRSetScreenConfigAndRate with 3840x2160
XRRSetScreenSize(0x555a8dbc8240, 0x25c, 3840, 2160, 813, 457)

Still TODO:

  • ideally, replace the synchronous sleep with an asynchronous handler: we have to wait for the X11 server to reconfigure its outputs, this makes the connection setup slower than it used to be...
  • maybe start removing old resolutions after we have added a few hundred, which can happen quite quickly
  • update the HTML5 client to remove the black borders

@totaam
Copy link
Collaborator Author

totaam commented Sep 30, 2017

r16996: improvements, client fixes (inc html5)

totaam added a commit that referenced this issue Apr 17, 2022
…erver

See #2834 for details.
As for Ubuntu, we can't enable Xdummy by default there because of the HWE conflict mess: #2190
@totaam
Copy link
Collaborator Author

totaam commented Apr 17, 2022

As of 90a20f9, we re-enable Xdummy by default on Debian - see #2834, but not on Ubuntu: #2190

totaam added a commit that referenced this issue Apr 17, 2022
this has been the case for a long time
totaam added a commit that referenced this issue Apr 17, 2022
@totaam totaam closed this as completed Apr 23, 2022
totaam added a commit that referenced this issue Jun 7, 2022
(this happens with multiple monitors of the same size)
totaam added a commit that referenced this issue Jun 7, 2022
totaam added a commit that referenced this issue Jun 7, 2022
totaam added a commit that referenced this issue Jun 18, 2022
totaam added a commit that referenced this issue Jun 22, 2022
* use a new capability rather than overloading the old one once more,
* change the monitor data format from #56 to match the GTK names more closely (easier),
* apply client desktop-scaling to monitor data
@totaam
Copy link
Collaborator Author

totaam commented Aug 15, 2023

FWIW: Don't remove an existing monitor from an output if another monitor is added changes how the dummy driver handles randr calls. It doesn't seem to have broken anything!

totaam added a commit that referenced this issue Aug 26, 2023
remove the bigger / smaller switch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant