diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2012-07-06 21:38:09 -0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2012-07-06 21:38:09 -0400 |
commit | 5f87032943ab982662ddc466911bae7602b4afb2 (patch) | |
tree | a32971abe7b4a39c6a1492c376e54247a9cc9087 /src | |
parent | 5906fa15bb68c4fd6253b49cea51a3b92f89c6d6 (diff) | |
download | vd_agent-5f87032943ab982662ddc466911bae7602b4afb2.tar.gz vd_agent-5f87032943ab982662ddc466911bae7602b4afb2.tar.xz vd_agent-5f87032943ab982662ddc466911bae7602b4afb2.zip |
Do not set crtc config to 0
I presume the reason to disable Crtc was to pass some XRandr check
that all crtc can fit in the screen. However, it is not a requirement
if the driver handles it.
Diffstat (limited to 'src')
-rw-r--r-- | src/vdagent-x11-randr.c | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/src/vdagent-x11-randr.c b/src/vdagent-x11-randr.c index 61b5418..ff1aa19 100644 --- a/src/vdagent-x11-randr.c +++ b/src/vdagent-x11-randr.c @@ -656,30 +656,7 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11, if (x11->verbose) { dump_monitors_config(x11, mon_config, "after zeroing"); } - /* - * Set screen size once now. If the screen size is reduced it may (will - * probably) invalidate a currently set crtc mode, so disable crtcs first. - */ - if (x11->width > primary_w || x11->height > primary_h) { - for (i = 0 ; i < x11->randr.res->ncrtc; ++i) { - /* This can fail if we are not in vt, xserver/RRCrtcSet checks - * vtSema */ - s = XRRSetCrtcConfig(x11->display, x11->randr.res, - x11->randr.res->crtcs[i], - CurrentTime, 0, 0, None, RR_Rotate_0, - NULL, 0); - if (s != RRSetConfigSuccess) { - goto exit; - } - } - } - if (primary_w != x11->width || primary_h != x11->height) { - arm_error_handler(x11); - XRRSetScreenSize(x11->display, x11->root_window, primary_w, primary_h, - DisplayWidthMM(x11->display, x11->screen), - DisplayHeightMM(x11->display, x11->screen)); - check_error_handler(x11); - } + for (i = 0; i < mon_config->num_of_monitors; ++i) { /* Try to create the requested resolution */ width = mon_config->monitors[i].width; @@ -691,6 +668,15 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11, set_screen_to_best_size(x11, width, height, &width, &height); } } + + if (primary_w != x11->width || primary_h != x11->height) { + arm_error_handler(x11); + XRRSetScreenSize(x11->display, x11->root_window, primary_w, primary_h, + DisplayWidthMM(x11->display, x11->screen), + DisplayHeightMM(x11->display, x11->screen)); + check_error_handler(x11); + } + if (!update_randr_res(x11)) { fprintf(x11->errfile, "get screen info failed\n"); } |