~ubuntu-branches/ubuntu/precise/xorg-server/precise

« back to all changes in this revision

Viewing changes to randr/rrscreen.c

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2011-01-31 19:45:19 UTC
  • mfrom: (1.1.38 upstream) (0.1.19 experimental)
  • Revision ID: james.westby@ubuntu.com-20110131194519-fx30d1zsg83invba
Tags: 2:1.9.99.901+git20110131.be3be758-0ubuntu1
* Merge from (unreleased) debian-experimental.  Remaining Ubuntu changes:
  - rules:
    + Disable SELinux, libaudit-dev is not in main yet. (LP: #406226)
    + Enable xcsecurity. (LP: #247537)
    + Add --with-extra-module-dir to support GL alternatives.
  - control: 
    + Xvfb depends on xauth, x11-xkb-utils. (LP: #500102)
    + Add breaks for incompatible drivers. (LP: #614993)
    + Drop libaudit-dev from build-deps.
  - local/xvfb-run*: Add correct docs about error codes. (LP #328205)
  - debian/patches:
    + 100_rethrow_signals.patch:
      When aborting, re-raise signals for apport
    + 109_fix-swcursor-crash.patch:
      Avoid dereferencing null pointer while reloading cursors during
      resume. (LP: #371405)
    + 111_armel-drv-fallbacks.patch:
      Add support for armel driver fallbacks.
    + 121_only_switch_vt_when_active.diff:
      Add a check to prevent the X server from changing the VT when killing
      GDM from the console.
    + 122_xext_fix_card32_overflow_in_xauth.patch:
      Fix server crash when “xauth generate” is called with large timeout.
    + 157_check_null_modes.patch, 162_null_crtc_in_rotation.patch,
      166_nullptr_xinerama_keyrepeat.patch, 167_nullptr_xisbread.patch
      169_mipointer_nullptr_checks.patch,
      172_cwgetbackingpicture_nullptr_check.patch:
      Fix various segfaults in xserver by checking pointers for NULL
      values before dereferencing them.
    + 165_man_xorg_conf_no_device_ident.patch
      Correct man page
    + 168_glibc_trace_to_stderr.patch:
      Report abort traces to stderr instead of terminal
    + 184_virtual_devices_autodetect.patch:
      Use vesa for qemu device, which is not supported by cirrus
    + 188_default_primary_to_first_busid.patch:
      Pick the first device and carry on (LP: #459512)
    + 190_cache-xkbcomp_output_for_fast_start_up.patch:
    + 191-Xorg-add-an-extra-module-path.patch:
      Add support for the alternatives module path.
    + 198_nohwaccess.patch:
      Adds a -nohwaccess argument to make X not access the hardware
      ports directly.
    + 200_randr-null.patch:
      Clarify a pointer initialization.
    + 206_intel_8xx_default_to_fbdev.patch:
      Makes 8xx class intel GPUs default to fbdev for stability. (LP: #633593)
* Refresh 121_only_switch_vt_when_active.diff for new upstream.
* Drop 187_edid_quirk_hp_nc8430.patch; upstream.
* Drop 189_xserver_1.5.0_bg_none_root.patch; functionality now upstream.
* Refresh 190_cache-xkbcomp_output_for_fast_start_up.patch for new upstream.
* Drop 197_xvfb-randr.patch:
  - miRandR, which this used, has been removed from the server. 
* Drop 204_fix-neg-sync-transition.patch; upstream.
* Drop 207_dga_master_device.patch; upstream.
* Drop 208_switch_on_release.diff; upstream.
* debian/patches/209_add_legacy_bgnone_option.patch:
  - Add "-nr" as a synonym for "-background none" to ease the transition from
    the old 189_xserver_1.5.0_bg_none_root.patch patch.  Can be dropped once
    all the ?DM have been updated to use the new option.
* debian/control:
  - Add Breaks: to xserver-xorg-video-8 and current fglrx.  These proprietary
    drivers don't yet have appropriate dependency information, so manually
    handle them here to prevent broken upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
168
168
RRScreenSizeSet (ScreenPtr  pScreen,
169
169
                 CARD16     width,
170
170
                 CARD16     height,
 
171
                 CARD16     pixWidth,
 
172
                 CARD16     pixHeight,
171
173
                 CARD32     mmWidth,
172
174
                 CARD32     mmHeight)
173
175
{
178
180
    {
179
181
        return (*pScrPriv->rrScreenSetSize) (pScreen,
180
182
                                             width, height,
 
183
                                             pixWidth, pixHeight,
181
184
                                             mmWidth, mmHeight);
182
185
    }
183
186
#endif
191
194
}
192
195
 
193
196
/*
 
197
 * Compute an RRScreenConfig from the current screen information
 
198
 */
 
199
void
 
200
RRScreenCurrentConfig(ScreenPtr screen,
 
201
                      RRScreenConfigPtr screen_config)
 
202
{
 
203
    PixmapPtr           screen_pixmap = screen->GetScreenPixmap(screen);
 
204
    WindowPtr           root = screen->root;
 
205
 
 
206
    screen_config->screen_pixmap_width = screen_pixmap->drawable.width;
 
207
    screen_config->screen_pixmap_height = screen_pixmap->drawable.height;
 
208
    screen_config->screen_width = root->drawable.width;
 
209
    screen_config->screen_height = root->drawable.height;
 
210
    screen_config->mm_width = screen->mmWidth;
 
211
    screen_config->mm_height = screen->mmHeight;
 
212
}
 
213
 
 
214
/*
194
215
 * Retrieve valid screen size range
195
216
 */
196
217
int
300
321
    }
301
322
    if (!RRScreenSizeSet (pScreen, 
302
323
                          stuff->width, stuff->height,
 
324
                          stuff->width, stuff->height,
303
325
                          stuff->widthInMillimeters,
304
326
                          stuff->heightInMillimeters))
305
327
    {
776
798
    }
777
799
    
778
800
    rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
779
 
    if (rc != Success)
 
801
    if (rc != Success) {
 
802
        client->errorValue = stuff->drawable;
780
803
        return rc;
 
804
    }
781
805
 
782
806
    pScreen = pDraw->pScreen;
783
807
 
915
939
        width = mode->mode.height;
916
940
        height = mode->mode.width;
917
941
    }
 
942
 
 
943
    if (width < pScrPriv->minWidth || pScrPriv->maxWidth < width) {
 
944
        client->errorValue = width;
 
945
        free(pData);
 
946
        return BadValue;
 
947
    }
 
948
    if (height < pScrPriv->minHeight || pScrPriv->maxHeight < height) {
 
949
        client->errorValue = height;
 
950
        free(pData);
 
951
        return BadValue;
 
952
    }
 
953
 
918
954
    if (width != pScreen->width || height != pScreen->height)
919
955
    {
920
956
        int     c;
922
958
        for (c = 0; c < pScrPriv->numCrtcs; c++)
923
959
        {
924
960
            if (!RRCrtcSet (pScrPriv->crtcs[c], NULL, 0, 0, RR_Rotate_0,
925
 
                            0, NULL))
 
961
                            0, NULL, NULL))
926
962
            {
927
963
                rep.status = RRSetConfigFailed;
928
964
                /* XXX recover from failure */
929
965
                goto sendReply;
930
966
            }
931
967
        }
932
 
        if (!RRScreenSizeSet (pScreen, width, height,
 
968
        if (!RRScreenSizeSet (pScreen, width, height, width, height,
933
969
                              pScreen->mmWidth, pScreen->mmHeight))
934
970
        {
935
971
            rep.status = RRSetConfigFailed;
938
974
        }
939
975
    }
940
976
 
941
 
    if (!RRCrtcSet (crtc, mode, 0, 0, stuff->rotation, 1, &output))
 
977
    if (!RRCrtcSet (crtc, mode, 0, 0, stuff->rotation, 1, &output, NULL))
942
978
        rep.status = RRSetConfigFailed;
943
979
    else {
944
980
        pScrPriv->lastSetTime = time;