From ac80633ce275edddaa3e4fa2ae0c048ed00f7d74 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 22 Mar 2010 10:29:25 +0000 Subject: svn merge -c505 ^/branches/released . --- xorg-server/hw/xfree86/modes/Makefile.in | 3 +++ xorg-server/hw/xfree86/modes/xf86Crtc.c | 22 ++++++++++++++-------- xorg-server/hw/xfree86/modes/xf86Crtc.h | 26 ++++++++++++++++++++++++++ xorg-server/hw/xfree86/modes/xf86Cursors.c | 4 ++-- xorg-server/hw/xfree86/modes/xf86RandR12.c | 14 +++++++++----- 5 files changed, 54 insertions(+), 15 deletions(-) (limited to 'xorg-server/hw/xfree86/modes') diff --git a/xorg-server/hw/xfree86/modes/Makefile.in b/xorg-server/hw/xfree86/modes/Makefile.in index 62ce86e1c..ad64acf56 100644 --- a/xorg-server/hw/xfree86/modes/Makefile.in +++ b/xorg-server/hw/xfree86/modes/Makefile.in @@ -156,6 +156,7 @@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ +DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ DEFS = @DEFS@ @@ -287,6 +288,8 @@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHA1_CFLAGS = @SHA1_CFLAGS@ diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c index 9b1ff280b..860e520ad 100644 --- a/xorg-server/hw/xfree86/modes/xf86Crtc.c +++ b/xorg-server/hw/xfree86/modes/xf86Crtc.c @@ -1495,12 +1495,16 @@ GuessRangeFromModes(MonPtr mon, DisplayModePtr mode) mon->vrefresh[0].lo = 58.0; } +enum det_monrec_source { + sync_config, sync_edid, sync_default +}; + struct det_monrec_parameter { MonRec *mon_rec; int *max_clock; Bool set_hsync; Bool set_vrefresh; - enum { sync_config, sync_edid, sync_default } *sync_source; + enum det_monrec_source *sync_source; }; static void handle_detailed_monrec(struct detailed_monitor_section *det_mon, @@ -1563,7 +1567,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) Bool add_default_modes = TRUE; Bool debug_modes = config->debug_modes || xf86Initialising; - enum { sync_config, sync_edid, sync_default } sync_source = sync_default; + enum det_monrec_source sync_source = sync_default; while (output->probed_modes != NULL) xf86DeleteMode(&output->probed_modes, output->probed_modes); @@ -2591,8 +2595,8 @@ xf86SetDesiredModes (ScrnInfoPtr scrn) if (!crtc->enabled) continue; - if (config->output[config->compat_output]->crtc == crtc) - output = config->output[config->compat_output]; + if (xf86CompatOutput(scrn) && xf86CompatCrtc(scrn) == crtc) + output = xf86CompatOutput(scrn); else { for (o = 0; o < config->num_output; o++) @@ -2712,14 +2716,16 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); Bool ok = TRUE; - xf86OutputPtr compat_output = config->output[config->compat_output]; - DisplayModePtr compat_mode; + xf86OutputPtr compat_output; + DisplayModePtr compat_mode = NULL; int c; /* * Let the compat output drive the final mode selection */ - compat_mode = xf86OutputFindClosestMode (compat_output, desired); + compat_output = xf86CompatOutput(pScrn); + if (compat_output) + compat_mode = xf86OutputFindClosestMode (compat_output, desired); if (compat_mode) desired = compat_mode; @@ -2943,7 +2949,7 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) } /* Set the DDC properties for the 'compat' output */ - if (output == config->output[config->compat_output]) + if (output == xf86CompatOutput(scrn)) xf86SetDDCproperties(scrn, edid_mon); #ifdef RANDR_12_INTERFACE diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.h b/xorg-server/hw/xfree86/modes/xf86Crtc.h index 9baa956a3..68a968cc2 100644 --- a/xorg-server/hw/xfree86/modes/xf86Crtc.h +++ b/xorg-server/hw/xfree86/modes/xf86Crtc.h @@ -689,6 +689,32 @@ extern _X_EXPORT int xf86CrtcConfigPrivateIndex; #define XF86_CRTC_CONFIG_PTR(p) ((xf86CrtcConfigPtr) ((p)->privates[xf86CrtcConfigPrivateIndex].ptr)) +static _X_INLINE xf86OutputPtr +xf86CompatOutput(ScrnInfoPtr pScrn) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + return config->output[config->compat_output]; +} + +static _X_INLINE xf86CrtcPtr +xf86CompatCrtc(ScrnInfoPtr pScrn) +{ + xf86OutputPtr compat_output = xf86CompatOutput(pScrn); + if (!compat_output) + return NULL; + return compat_output->crtc; +} + +static _X_INLINE RRCrtcPtr +xf86CompatRRCrtc(ScrnInfoPtr pScrn) +{ + xf86CrtcPtr compat_crtc = xf86CompatCrtc(pScrn); + if (!compat_crtc) + return NULL; + return compat_crtc->randr_crtc; +} + + /* * Initialize xf86CrtcConfig structure */ diff --git a/xorg-server/hw/xfree86/modes/xf86Cursors.c b/xorg-server/hw/xfree86/modes/xf86Cursors.c index 385848b7a..e2e174e59 100644 --- a/xorg-server/hw/xfree86/modes/xf86Cursors.c +++ b/xorg-server/hw/xfree86/modes/xf86Cursors.c @@ -461,11 +461,11 @@ xf86_use_hw_cursor (ScreenPtr screen, CursorPtr cursor) xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; + ++cursor->refcnt; if (xf86_config->cursor) FreeCursor (xf86_config->cursor, None); xf86_config->cursor = cursor; - ++cursor->refcnt; - + if (cursor->bits->width > cursor_info->MaxWidth || cursor->bits->height> cursor_info->MaxHeight) return FALSE; diff --git a/xorg-server/hw/xfree86/modes/xf86RandR12.c b/xorg-server/hw/xfree86/modes/xf86RandR12.c index 1fc63c4dc..7ba09b6fe 100644 --- a/xorg-server/hw/xfree86/modes/xf86RandR12.c +++ b/xorg-server/hw/xfree86/modes/xf86RandR12.c @@ -805,9 +805,10 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) } else { - xf86OutputPtr output = config->output[config->compat_output]; + xf86OutputPtr output = xf86CompatOutput(pScrn); - if (output->conf_monitor && + if (output && + output->conf_monitor && (output->conf_monitor->mon_width > 0 && output->conf_monitor->mon_height > 0)) { @@ -1719,10 +1720,13 @@ xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma) { CARD16 *points, *red, *green, *blue; ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); - RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc; - int size = max(0, crtc->gammaSize); + RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); + int size; + if (!crtc) + return Success; + + size = max(0, crtc->gammaSize); if (!size) return Success; -- cgit v1.2.3