~ubuntu-branches/ubuntu/quantal/xorg-server/quantal-proposed

« back to all changes in this revision

Viewing changes to debian/patches/201_report-real-dpi.patch

  • Committer: Package Import Robot
  • Author(s): Bryce Harrington, Maarten Lankhorst, Bryce Harrington
  • Date: 2012-06-04 19:12:23 UTC
  • mfrom: (0.11.40 sid)
  • Revision ID: package-import@ubuntu.com-20120604191223-7gt8pm5dtw7k340f
Tags: 2:1.12.1.902-1ubuntu1
[ Maarten Lankhorst ]
* Refresh patches to apply on x-server 1.12
  - patch-x-indent.sh from xorg-pkg-tools was used to redo coding style
* Deleted following patches because they have been committed upstream
  - 224_return_BadWindow_not_BadMatch.diff
  - 225_non-root_config_paths.patch
  - 505_query_pointer_touchscreen.patch
  - 506_touchscreen_pointer_emulation_checks.patch
  - 507_touchscreen_fixes.patch
* Non-trivial refresh of 500_pointer_barrier_thresholds.diff, based on 
  xorg-edgers
* Rest was refreshed with patch-x-indent.sh to survive coding style changes
* Add upstream patches for proper device disabling:
  - 510-dix-return-early-from-DisableDevice-if-the-device-is.patch
  - 511-dix-move-freeing-the-sprite-into-a-function.patch
  - 512-dix-free-the-sprite-when-disabling-the-device.patch
  - 513-dix-disable-non-sprite-owners-first-when-disabling-p.patch
  - 514-Xi-drop-forced-unpairing-when-changing-the-hierarchy.patch
  - 515-dix-disable-all-devices-before-shutdown.patch

[ Bryce Harrington ]
* Drop 209_add_legacy_bgnone_option.patch: lightdm and other *dm's have
  switched to the new standard -background option.  No need to continue
  providing the legacy -nr synonym.
* Drop 201_report-real-dpi.patch:  Commented out in series.
* Drop 198_nohwaccess.patch: Rootless-X no longer a development focus
  for us; the patch would need reworked anyway to provide proper
  support.
* Drop 166_nullptr_xinerama_keyrepeat.patch: Fixed differently upstream
  in commit 24e682d0, as verified by original reporter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Report physical DPI when EDID data exists.
2
 
 .
3
 
 This reverts git commit fff00df94d7ebd18a8e24537ec96073717375a3f, which 
4
 
 made X report 96DPI via the core protocol.
5
 
 .
6
 
 We want to make this policy decision higher up the stack than the X server,
7
 
 so revert this and make X report the physical DPI when the EDID contains
8
 
 physical size data.
9
 
Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
10
 
 
11
 
Index: xorg-server/hw/xfree86/modes/xf86RandR12.c
12
 
===================================================================
13
 
--- xorg-server.orig/hw/xfree86/modes/xf86RandR12.c     2010-08-03 15:59:57.750272356 +1000
14
 
+++ xorg-server/hw/xfree86/modes/xf86RandR12.c  2010-08-03 16:00:00.750380508 +1000
15
 
@@ -805,6 +805,7 @@
16
 
        else
17
 
        {
18
 
            xf86OutputPtr   output = xf86CompatOutput(pScrn);
19
 
+           rrScrPriv(pScreen);
20
 
 
21
 
            if (output &&
22
 
                output->conf_monitor &&
23
 
@@ -817,6 +818,23 @@
24
 
                mmWidth = output->conf_monitor->mon_width;
25
 
                mmHeight = output->conf_monitor->mon_height;
26
 
            }
27
 
+           else if (pScrPriv && pScrPriv->primaryOutput)
28
 
+           {
29
 
+               /* Calculate DPI based on primary display size, not the entire display size */
30
 
+               mmWidth = pScrPriv->primaryOutput->mmWidth * width / pScrPriv->primaryOutput->crtc->mode->mode.width;
31
 
+               mmHeight = pScrPriv->primaryOutput->mmHeight * height / pScrPriv->primaryOutput->crtc->mode->mode.height;
32
 
+           }
33
 
+           else if (output && output->crtc && output->crtc->mode.HDisplay &&
34
 
+                    output->mm_width && output->mm_height)
35
 
+           {
36
 
+               /*
37
 
+                * If the output has a mode and a declared size, use that
38
 
+                * to scale the screen size
39
 
+                */
40
 
+               DisplayModePtr  mode = &output->crtc->mode;
41
 
+               mmWidth = output->mm_width * width / mode->HDisplay;
42
 
+               mmHeight = output->mm_height * height / mode->VDisplay;
43
 
+           }
44
 
            else
45
 
            {
46
 
                /*