xserver: Branch 'master' - 2 commits
Keith Packard
keithp at kemper.freedesktop.org
Tue Oct 16 20:43:51 PDT 2007
configure.ac | 4 +--
hw/kdrive/fbdev/Makefile.am | 2 -
hw/xfree86/common/xf86str.h | 1
hw/xfree86/modes/xf86Crtc.c | 55 +++++++++++++++++++-------------------------
hw/xfree86/modes/xf86Crtc.h | 3 ++
5 files changed, 31 insertions(+), 34 deletions(-)
New commits:
commit feac0759522cbdc3e61ccfa373df735903c5cb27
Author: Keith Packard <keithp at koto.keithp.com>
Date: Wed Oct 17 11:42:28 2007 +0800
Make config file preferred mode override monitor preferred mode.
Add a new even-more-preferred bit to each mode which is used to make config
file preferences selected instead of the monitor preferred mode.
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 0365ddd..af98b4f 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -142,6 +142,7 @@ typedef enum {
# define M_T_DEFAULT 0x10 /* (VESA) default modes */
# define M_T_USERDEF 0x20 /* One of the modes from the config file */
# define M_T_DRIVER 0x40 /* Supplied by the driver (EDID, etc) */
+# define M_T_USERPREF 0x80 /* mode preferred by the user config */
/* Video mode */
typedef struct _DisplayModeRec {
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index f589b5a..0a48d5b 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -711,7 +711,8 @@ xf86DefaultMode (xf86OutputPtr output, int width, int height)
for (mode = output->probed_modes; mode; mode = mode->next)
{
int dpi;
- int preferred = (mode->type & M_T_PREFERRED) != 0;
+ int preferred = (((mode->type & M_T_PREFERRED) != 0) +
+ ((mode->type & M_T_USERPREF) != 0));
int diff;
if (xf86ModeWidth (mode, output->initial_rotation) > width ||
@@ -1415,7 +1416,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
mode->prev = NULL;
output->probed_modes = mode;
}
- mode->type |= M_T_PREFERRED;
+ mode->type |= (M_T_PREFERRED|M_T_USERPREF);
}
else
mode->type &= ~M_T_PREFERRED;
@@ -1532,6 +1533,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
int o, c;
DisplayModePtr target_mode = NULL;
+ int target_preferred = 0;
Rotation target_rotation = RR_Rotate_0;
xf86CrtcPtr *crtcs;
DisplayModePtr *modes;
@@ -1572,43 +1574,34 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
}
/*
- * Let outputs with preferred modes drive screen size
+ * User preferred > preferred > other modes
*/
for (o = 0; o < config->num_output; o++)
{
- xf86OutputPtr output = config->output[o];
+ xf86OutputPtr output = config->output[o];
+ DisplayModePtr default_mode;
+ int default_preferred;
- if (enabled[o] &&
- xf86OutputHasPreferredMode (output, width, height))
+ if (!enabled[o])
+ continue;
+ default_mode = xf86DefaultMode (output, width, height);
+ if (!default_mode)
+ continue;
+ default_preferred = (((default_mode->type & M_T_PREFERRED) != 0) +
+ ((default_mode->type & M_T_USERPREF) != 0));
+ if (default_preferred > target_preferred || !target_mode)
{
- target_mode = xf86DefaultMode (output, width, height);
+ target_mode = default_mode;
+ target_preferred = default_preferred;
target_rotation = output->initial_rotation;
- if (target_mode)
- {
- modes[o] = target_mode;
- config->compat_output = o;
- break;
- }
- }
- }
- if (!target_mode)
- {
- for (o = 0; o < config->num_output; o++)
- {
- xf86OutputPtr output = config->output[o];
- if (enabled[o])
- {
- target_mode = xf86DefaultMode (output, width, height);
- target_rotation = output->initial_rotation;
- if (target_mode)
- {
- modes[o] = target_mode;
- config->compat_output = o;
- break;
- }
- }
+ config->compat_output = o;
}
}
+ if (target_mode)
+ modes[config->compat_output] = target_mode;
+ /*
+ * Fill in other output modes
+ */
for (o = 0; o < config->num_output; o++)
{
xf86OutputPtr output = config->output[o];
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 9693e12..4c843cd 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -39,6 +39,9 @@
#ifndef M_T_DRIVER
#define M_T_DRIVER 0x40
#endif
+#ifndef M_T_USERPREF
+#define M_T_USERPREF 0x80
+#endif
#ifndef HARDWARE_CURSOR_ARGB
#define HARDWARE_CURSOR_ARGB 0x00004000
#endif
commit f2da10f7bc2ddb6ad2f18b793afc10d04b97c51c
Author: Keith Packard <keithp at koto.keithp.com>
Date: Wed Oct 17 10:50:22 2007 +0800
KDRIVE_LOCAL_LIBS includes some system libraries, not just internal x server libs
diff --git a/configure.ac b/configure.ac
index 59dcde7..fb88773 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1872,7 +1872,7 @@ if test "$KDRIVE" = yes; then
KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS $XV_CFLAGS"
- KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $XV_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB"
+ KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB"
KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.a'
case $host_os in
*linux*)
@@ -1884,7 +1884,7 @@ if test "$KDRIVE" = yes; then
KDRIVE_LOCAL_LIBS="$TSLIB_LIBS $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB $CONFIG_LIB"
KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS"
KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB $OS_LIB"
- KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVERLIBS_LIBS"
+ KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVERLIBS_LIBS $XV_LIBS"
# check if we can build Xephyr
PKG_CHECK_MODULES(XEPHYR, x11 xext xfont xau xdmcp, [xephyr="yes"], [xephyr="no"])
diff --git a/hw/kdrive/fbdev/Makefile.am b/hw/kdrive/fbdev/Makefile.am
index 1ce4833..420855b 100644
--- a/hw/kdrive/fbdev/Makefile.am
+++ b/hw/kdrive/fbdev/Makefile.am
@@ -20,7 +20,7 @@ Xfbdev_LDADD = \
Xfbdev_DEPENDENCIES = \
libfbdev.a \
- @KDRIVE_LOCAL_LIBS@
+ $(KDRIVE_PURE_LIBS)
relink:
rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS)
More information about the xorg-commit
mailing list