150
150
ResolutionInfoX11Type *resInfoX = &resolutionInfoX11;
151
153
ASSERT(resolutionInfo.canSetResolution);
153
if (resInfoX->canUseVMwareCtrl && !resInfoX->canUseRandR12) {
155
XGrabServer(resInfoX->display);
156
if (resInfoX->canUseVMwareCtrl) {
155
158
* If so, use the VMWARE_CTRL extension to provide a custom resolution
156
159
* which we'll find as an exact match from XRRConfigSizes() (unless
159
162
* As such, we don't care if this succeeds or fails, we'll make a best
160
163
* effort attempt to change resolution anyway.
165
* On vmwgfx, this is routed through the X server down to the
166
* kernel modesetting system to provide a preferred mode with
167
* correcte width and height.
162
169
VMwareCtrl_SetRes(resInfoX->display, DefaultScreen(resInfoX->display),
166
return SelectResolution(width, height);
174
* Use legacy RandR (vmwlegacy) or RandR12 (vmwgfx) to select the
177
ret = SelectResolution(width, height);
178
XUngrabServer(resInfoX->display);
179
XFlush(resInfoX->display);
239
254
displays[i].y_org -= minY;
258
* Grab server to avoid potential races between setting GUI topology
259
* and setting FB topology.
261
XGrabServer(resInfoX->display);
264
* First, call vmwarectrl to update the connection info
265
* and resolution capabilities of connected monitors,
266
* according to the host GUI layout on vmwgfx. On vmwlegacy this
267
* sets the driver's exported Xinerama topology.
269
* For vmwgfx, this might be replaced with a direct kernel driver call
270
* in upcoming versions.
272
if (resInfoX->canUseVMwareCtrlTopologySet) {
273
if (!VMwareCtrl_SetTopology(resInfoX->display,
274
DefaultScreen(resInfoX->display),
275
displays, ndisplays)) {
276
g_debug("Failed to set topology in the driver.\n");
242
281
if (resInfoX->canUseRandR12) {
283
* For vmwgfx, use RandR12 to set the FB layout to a 1:1 mapping
284
* of the host GUI layout.
243
286
success = RandR12_SetTopology(resInfoX->display,
244
287
DefaultScreen(resInfoX->display),
245
288
resInfoX->rootWindow,
246
289
ndisplays, displays,
247
290
maxX - minX, maxY - minY);
248
291
} else if (resInfoX->canUseVMwareCtrlTopologySet) {
249
if (!VMwareCtrl_SetTopology(resInfoX->display, DefaultScreen(resInfoX->display),
250
displays, ndisplays)) {
251
g_debug("Failed to set topology in the driver.\n");
293
* For vmwlegacy, use legacy RandR to set the backing framebuffer
294
* size. We don't do this unless we were able to set a new
295
* topology using vmwarectrl.
255
297
if (!SelectResolution(maxX - minX, maxY - minY)) {
256
298
g_debug("Failed to set new resolution.\n");
459
504
resInfoX->canUseVMwareCtrlTopologySet = FALSE;
462
return resInfoX->canUseVMwareCtrlTopologySet || resInfoX->canUseRandR12;
507
return resInfoX->canUseVMwareCtrlTopologySet ||
508
(resInfoX->canUseRandR12 && resInfoX->canUseVMwareCtrl);