~n-muench/ubuntu/precise/open-vm-tools/open-vm-tools.raring-precise.backport

« back to all changes in this revision

Viewing changes to services/plugins/resolutionSet/resolutionX11.c

  • Committer: Package Import Robot
  • Author(s): Nate Muench
  • Date: 2012-01-23 16:09:45 UTC
  • mfrom: (1.4.6) (2.4.26 sid)
  • Revision ID: package-import@ubuntu.com-20120123160945-b6s0r1vkcovucpf3
Tags: 2011.12.20-562307-0ubuntu1
* Merge latest upstream git tag. Fixes building on Precise
  (LP: #898289, LP: #905612)

* Items merged from Debian unstable:
  - debian/control:
    + open-vm-tools recommends open-vm-dkms. (LP: #598933)
    + open-vm-tools now suggests open-vm-toolbox. (LP: #604998)
  (From 2011.08.21-471295-1 release)
  - Updating maintainer and uploaders fields.
  - Removing vcs fields.
  - Removing references to Daniel's old email address.
  - Updating years in copyright file.
  - Updating to standards version 3.9.2.
  - Updating to debhelper version 8.
  - Switching to source format 3.0 (quilt).
  - Removing manual chrpath setting.
  - Removing exclusion from plugins from debhelper shlibs.
  - Rediffing kvers.patch.
  (From 2011.09.23-491607-1 release)
  - Marking binary architecture-dependend packages as linux and kfreebsd
  only.
  - Removing liburiparser-dev from build-depends as upstream dropped
  unity support.
  - Building with libproc-dev on amd64 again.
  - Dropping disabling of dnet support.
  (From 2011.09.23-491607-2 release)
  - Adding doxygen to build-depends for api documentation.
  - Adding libcunit1-dev to build-depends for test suites.
  - Minimizing rules file.
  - Adding open-vm-tools-dev package, containing only the api
    documentation for now.
  (From 2011.09.23-491607-3 release)
  - Sorting overrides in rules alphabetically.
  - Compacting copyright file.
  - Adding udev rule to set timeout for vmware scsi devices
  (From 2011.12.20-562307-1 release)
  - Adding patch to correct typo in upstreams dkms configuration

* Remaining Changes:
  - Remove Stable part of version numbering.
  - debian folder:
    + Re-added open-vm-dkms.postinst & open-vm-dkms.prerm.
      * Allows dkms modules to compile upon installation.
  - debian/control:
    + Re-add open-vm-source and make into a transitional package
      for open-vm-toolbox.
    + Return dependancies that were moved to open-vm-tools back to
      open-vm-toolbox.
  - debian/rules and debian/open-vm-toolbox.lintian-overrides:
    + Make vmware-user-suid-wrapper suid-root
  - debian/rules:
    + Added CFLAGS field with -Wno-deprecated-declarations
      * Will suppress issues with glib 2.31 or later.
    + Add line to copy vmware-xdg-detect-de into place.
    + Install vmware-user.desktop through toolbox package.
  - debian/open-vm-tools.init:
    + Re-add 'modprobe [-r] vmblock'.
    + Add 'modprobe [-r] vmxnet'.
      * Incase it's not loaded during boot.
    + Remove and re-add pcnet32 module
      * Will be done before (remove) and after (readd) vmxnet module
        is added.
      * If vmxnet doesn't exist (aka modules fail to build), pcnet32 can be
        still used for network connectivity.
      * Workaround until a better fix can be done.
  - Re-add gnome-session to debian/local/xautostart.conf
  - Manpages removed (from debian/manpages):
    + vmmemctl.9
    + vmxnet3.9
    + Remove references to manpages that have been removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
                        uint32 height)
149
149
{
150
150
   ResolutionInfoX11Type *resInfoX = &resolutionInfoX11;
 
151
   Bool ret;
 
152
 
151
153
   ASSERT(resolutionInfo.canSetResolution);
152
154
 
153
 
   if (resInfoX->canUseVMwareCtrl && !resInfoX->canUseRandR12) {
 
155
   XGrabServer(resInfoX->display);
 
156
   if (resInfoX->canUseVMwareCtrl) {
154
157
      /*
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
158
161
       *
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.
 
164
       *
 
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.
161
168
       */
162
169
      VMwareCtrl_SetRes(resInfoX->display, DefaultScreen(resInfoX->display),
163
170
                        width, height);
164
171
   }
165
172
 
166
 
   return SelectResolution(width, height);
 
173
   /*
 
174
    * Use legacy RandR (vmwlegacy) or RandR12 (vmwgfx) to select the
 
175
    * desired mode.
 
176
    */
 
177
   ret = SelectResolution(width, height);
 
178
   XUngrabServer(resInfoX->display);
 
179
   XFlush(resInfoX->display);
 
180
 
 
181
   return ret;
167
182
}
168
183
 
169
184
 
239
254
      displays[i].y_org -= minY;
240
255
   }
241
256
 
 
257
   /*
 
258
    * Grab server to avoid potential races between setting GUI topology
 
259
    * and setting FB topology.
 
260
    */
 
261
   XGrabServer(resInfoX->display);
 
262
 
 
263
   /*
 
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.
 
268
    *
 
269
    * For vmwgfx, this might be replaced with a direct kernel driver call
 
270
    * in upcoming versions.
 
271
    */
 
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");
 
277
         goto out;
 
278
      }
 
279
   }
 
280
 
242
281
   if (resInfoX->canUseRandR12) {
 
282
       /*
 
283
        * For vmwgfx, use RandR12 to set the FB layout to a 1:1 mapping
 
284
        * of the host GUI layout.
 
285
        */
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");
252
 
         goto out;
253
 
      }
254
 
 
 
292
      /*
 
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.
 
296
       */
255
297
      if (!SelectResolution(maxX - minX, maxY - minY)) {
256
298
         g_debug("Failed to set new resolution.\n");
257
299
         goto out;
261
303
   }
262
304
 
263
305
out:
 
306
   XUngrabServer(resInfoX->display);
 
307
   XFlush(resInfoX->display);
 
308
 
264
309
   free(displays);
265
310
   return success;
266
311
#endif
459
504
      resInfoX->canUseVMwareCtrlTopologySet = FALSE;
460
505
   }
461
506
 
462
 
   return resInfoX->canUseVMwareCtrlTopologySet || resInfoX->canUseRandR12;
 
507
   return resInfoX->canUseVMwareCtrlTopologySet ||
 
508
      (resInfoX->canUseRandR12 && resInfoX->canUseVMwareCtrl);
463
509
#endif
464
510
}
465
511