aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-08-30 13:41:12 +0200
committermarha <marha@users.sourceforge.net>2014-08-30 13:43:25 +0200
commite21655632e3fd40b7f6a5cc3c7f3c379d54557c4 (patch)
tree46054f4b20f70afd1c7743e54aa48471e2ded483 /xorg-server/hw
parent6c0c95d6045d2d2b4e6a3a2f11457850031c57bc (diff)
downloadvcxsrv-e21655632e3fd40b7f6a5cc3c7f3c379d54557c4.tar.gz
vcxsrv-e21655632e3fd40b7f6a5cc3c7f3c379d54557c4.tar.bz2
vcxsrv-e21655632e3fd40b7f6a5cc3c7f3c379d54557c4.zip
xserver libxtrans libxcb xcb-proto libX11 mesa git update 30 Aug 2014
xserver commit 3a51418b2db353519a1779cf3cebbcc9afba2520 libxcb commit b0e6c2de09c7474868dd7185674fa113a5c2e0aa libxcb/xcb-proto commit dc0c544fe044ddeb4917bba0c2fed66c70e6db43 libX11 commit 6101b967b641355dd863fd1ce52c6a7d58bcbe68 libxtrans commit 17491de45c352c833442cccf17a9bd65909889db mesa commit 932b0ef1ceecf873213447a8778e5cbe1b3b6be7
Diffstat (limited to 'xorg-server/hw')
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyr.c8
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyr.h3
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrinit.c31
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.c156
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.h10
-rw-r--r--xorg-server/hw/kdrive/src/kdrive.c23
-rw-r--r--xorg-server/hw/kdrive/src/kdrive.h2
-rw-r--r--xorg-server/hw/xfree86/common/xf86Bus.c3
-rw-r--r--xorg-server/hw/xfree86/common/xf86Xinput.h5
-rw-r--r--xorg-server/hw/xfree86/common/xf86platformBus.c22
-rw-r--r--xorg-server/hw/xfree86/common/xf86platformBus.h1
-rw-r--r--xorg-server/hw/xfree86/os-support/bsd/ppc_video.c2
-rw-r--r--xorg-server/hw/xquartz/xpr/xprScreen.c23
13 files changed, 262 insertions, 27 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.c b/xorg-server/hw/kdrive/ephyr/ephyr.c
index d57e9f33c..85d419376 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyr.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyr.c
@@ -111,13 +111,16 @@ Bool
ephyrScreenInitialize(KdScreenInfo *screen)
{
EphyrScrPriv *scrpriv = screen->driver;
+ int x = 0, y = 0;
int width = 640, height = 480;
CARD32 redMask, greenMask, blueMask;
- if (hostx_want_screen_size(screen, &width, &height)
+ if (hostx_want_screen_geometry(screen, &width, &height, &x, &y)
|| !screen->width || !screen->height) {
screen->width = width;
screen->height = height;
+ screen->x = x;
+ screen->y = y;
}
if (EphyrWantGrayScale)
@@ -242,7 +245,8 @@ ephyrMapFramebuffer(KdScreenInfo * screen)
buffer_height = ephyrBufferHeight(screen);
priv->base =
- hostx_screen_init(screen, screen->width, screen->height, buffer_height,
+ hostx_screen_init(screen, screen->x, screen->y,
+ screen->width, screen->height, buffer_height,
&priv->bytes_per_line, &screen->fb.bitsPerPixel);
if ((scrpriv->randr & RR_Rotate_0) && !(scrpriv->randr & RR_Reflect_All)) {
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.h b/xorg-server/hw/kdrive/ephyr/ephyr.h
index dfd93c9bc..4e753f158 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyr.h
+++ b/xorg-server/hw/kdrive/ephyr/ephyr.h
@@ -73,8 +73,11 @@ typedef struct _ephyrScrPriv {
xcb_window_t win_pre_existing; /* Set via -parent option like xnest */
xcb_window_t peer_win; /* Used for GL; should be at most one */
xcb_image_t *ximg;
+ Bool win_explicit_position;
+ int win_x, win_y;
int win_width, win_height;
int server_depth;
+ const char *output; /* Set via -output option */
unsigned char *fb_data; /* only used when host bpp != server bpp */
xcb_shm_segment_info_t shminfo;
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrinit.c b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
index fc0001012..38acc52a6 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrinit.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
@@ -47,6 +47,8 @@ extern KdPointerDriver LinuxEvdevMouseDriver;
extern KdKeyboardDriver LinuxEvdevKeyboardDriver;
#endif
+void processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id);
+void processOutputArg(const char *output, char *parent_id);
void processScreenArg(const char *screen_size, char *parent_id);
void
@@ -134,6 +136,7 @@ ddxUseMsg(void)
ErrorF("-parent <XID> Use existing window as Xephyr root win\n");
ErrorF("-sw-cursor Render cursors in software in Xephyr\n");
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
+ ErrorF("-output <NAME> Attempt to run Xephyr fullscreen (restricted to given output geometry)\n");
ErrorF("-grayscale Simulate 8bit grayscale\n");
ErrorF("-resizeable Make Xephyr windows resizeable\n");
#ifdef GLAMOR
@@ -154,7 +157,7 @@ ddxUseMsg(void)
}
void
-processScreenArg(const char *screen_size, char *parent_id)
+processScreenOrOutputArg(const char *screen_size, const char *output, char *parent_id)
{
KdCardInfo *card;
@@ -164,6 +167,7 @@ processScreenArg(const char *screen_size, char *parent_id)
if (card) {
KdScreenInfo *screen;
unsigned long p_id = 0;
+ Bool use_geometry;
screen = KdScreenInfoAdd(card);
KdParseScreen(screen, screen_size);
@@ -174,14 +178,28 @@ processScreenArg(const char *screen_size, char *parent_id)
if (parent_id) {
p_id = strtol(parent_id, NULL, 0);
}
+
+ use_geometry = (strchr(screen_size, '+') != NULL);
EPHYR_DBG("screen number:%d\n", screen->mynum);
- hostx_add_screen(screen, p_id, screen->mynum);
+ hostx_add_screen(screen, p_id, screen->mynum, use_geometry, output);
}
else {
ErrorF("No matching card found!\n");
}
}
+void
+processScreenArg(const char *screen_size, char *parent_id)
+{
+ processScreenOrOutputArg(screen_size, NULL, parent_id);
+}
+
+void
+processOutputArg(const char *output, char *parent_id)
+{
+ processScreenOrOutputArg("100x100+0+0", output, parent_id);
+}
+
int
ddxProcessArgument(int argc, char **argv, int i)
{
@@ -223,6 +241,15 @@ ddxProcessArgument(int argc, char **argv, int i)
UseMsg();
exit(1);
}
+ else if (!strcmp(argv[i], "-output")) {
+ if (i + 1 < argc) {
+ processOutputArg(argv[i + 1], NULL);
+ return 2;
+ }
+
+ UseMsg();
+ exit(1);
+ }
else if (!strcmp(argv[i], "-sw-cursor")) {
hostx_use_sw_cursor();
return 1;
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c
index 1c759743d..2161ad550 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.c
+++ b/xorg-server/hw/kdrive/ephyr/hostx.c
@@ -51,6 +51,7 @@
#include <xcb/xcb_image.h>
#include <xcb/shape.h>
#include <xcb/xcb_keysyms.h>
+#include <xcb/randr.h>
#ifdef XF86DRI
#include <xcb/xf86dri.h>
#include <xcb/glx.h>
@@ -104,12 +105,15 @@ static void
#define host_depth_matches_server(_vars) (HostX.depth == (_vars)->server_depth)
int
-hostx_want_screen_size(KdScreenInfo *screen, int *width, int *height)
+hostx_want_screen_geometry(KdScreenInfo *screen, int *width, int *height, int *x, int *y)
{
EphyrScrPriv *scrpriv = screen->driver;
if (scrpriv && (scrpriv->win_pre_existing != None ||
+ scrpriv->output != NULL ||
HostX.use_fullscreen == TRUE)) {
+ *x = scrpriv->win_x;
+ *y = scrpriv->win_y;
*width = scrpriv->win_width;
*height = scrpriv->win_height;
return 1;
@@ -119,7 +123,7 @@ hostx_want_screen_size(KdScreenInfo *screen, int *width, int *height)
}
void
-hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num)
+hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num, Bool use_geometry, const char *output)
{
EphyrScrPriv *scrpriv = screen->driver;
int index = HostX.n_screens;
@@ -131,6 +135,8 @@ hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num)
scrpriv->screen = screen;
scrpriv->win_pre_existing = win_id;
+ scrpriv->win_explicit_position = use_geometry;
+ scrpriv->output = output;
}
void
@@ -210,6 +216,119 @@ hostx_want_preexisting_window(KdScreenInfo *screen)
}
void
+hostx_get_output_geometry(const char *output,
+ int *x, int *y,
+ int *width, int *height)
+{
+ int i, name_len = 0, output_found = FALSE;
+ char *name = NULL;
+ xcb_generic_error_t *error;
+ xcb_randr_query_version_cookie_t version_c;
+ xcb_randr_query_version_reply_t *version_r;
+ xcb_randr_get_screen_resources_cookie_t screen_resources_c;
+ xcb_randr_get_screen_resources_reply_t *screen_resources_r;
+ xcb_randr_output_t *randr_outputs;
+ xcb_randr_get_output_info_cookie_t output_info_c;
+ xcb_randr_get_output_info_reply_t *output_info_r;
+ xcb_randr_get_crtc_info_cookie_t crtc_info_c;
+ xcb_randr_get_crtc_info_reply_t *crtc_info_r;
+
+ /* First of all, check for extension */
+ if (!xcb_get_extension_data(HostX.conn, &xcb_randr_id)->present)
+ {
+ fprintf(stderr, "\nHost X server does not support RANDR extension (or it's disabled).\n");
+ exit(1);
+ }
+
+ /* Check RandR version */
+ version_c = xcb_randr_query_version(HostX.conn, 1, 2);
+ version_r = xcb_randr_query_version_reply(HostX.conn,
+ version_c,
+ &error);
+
+ if (error != NULL || version_r == NULL)
+ {
+ fprintf(stderr, "\nFailed to get RandR version supported by host X server.\n");
+ exit(1);
+ }
+ else if (version_r->major_version < 1 || version_r->minor_version < 2)
+ {
+ free(version_r);
+ fprintf(stderr, "\nHost X server doesn't support RandR 1.2, needed for -output usage.\n");
+ exit(1);
+ }
+
+ free(version_r);
+
+ /* Get list of outputs from screen resources */
+ screen_resources_c = xcb_randr_get_screen_resources(HostX.conn,
+ HostX.winroot);
+ screen_resources_r = xcb_randr_get_screen_resources_reply(HostX.conn,
+ screen_resources_c,
+ NULL);
+ randr_outputs = xcb_randr_get_screen_resources_outputs(screen_resources_r);
+
+ for (i = 0; !output_found && i < screen_resources_r->num_outputs; i++)
+ {
+ /* Get info on the output */
+ output_info_c = xcb_randr_get_output_info(HostX.conn,
+ randr_outputs[i],
+ XCB_CURRENT_TIME);
+ output_info_r = xcb_randr_get_output_info_reply(HostX.conn,
+ output_info_c,
+ NULL);
+
+ /* Get output name */
+ name_len = xcb_randr_get_output_info_name_length(output_info_r);
+ name = malloc(name_len + 1);
+ strncpy(name, (char*)xcb_randr_get_output_info_name(output_info_r), name_len);
+ name[name_len] = '\0';
+
+ if (!strcmp(name, output))
+ {
+ output_found = TRUE;
+
+ /* Check if output is connected */
+ if (output_info_r->crtc == XCB_NONE)
+ {
+ free(name);
+ free(output_info_r);
+ free(screen_resources_r);
+ fprintf(stderr, "\nOutput %s is currently disabled (or not connected).\n", output);
+ exit(1);
+ }
+
+ /* Get CRTC from output info */
+ crtc_info_c = xcb_randr_get_crtc_info(HostX.conn,
+ output_info_r->crtc,
+ XCB_CURRENT_TIME);
+ crtc_info_r = xcb_randr_get_crtc_info_reply(HostX.conn,
+ crtc_info_c,
+ NULL);
+
+ /* Get CRTC geometry */
+ *x = crtc_info_r->x;
+ *y = crtc_info_r->y;
+ *width = crtc_info_r->width;
+ *height = crtc_info_r->height;
+
+ free(crtc_info_r);
+ }
+
+ free(name);
+ free(output_info_r);
+ }
+
+ free(screen_resources_r);
+
+ if (!output_found)
+ {
+ fprintf(stderr, "\nOutput %s not available in host X server.\n", output);
+ exit(1);
+ }
+}
+
+void
hostx_use_fullscreen(void)
{
HostX.use_fullscreen = TRUE;
@@ -358,6 +477,8 @@ hostx_init(void)
scrpriv->win = xcb_generate_id(HostX.conn);
scrpriv->server_depth = HostX.depth;
scrpriv->ximg = NULL;
+ scrpriv->win_x = 0;
+ scrpriv->win_y = 0;
if (scrpriv->win_pre_existing != XCB_WINDOW_NONE) {
xcb_get_geometry_reply_t *prewin_geom;
@@ -415,6 +536,17 @@ hostx_init(void)
hostx_set_fullscreen_hint();
}
+ else if (scrpriv->output) {
+ hostx_get_output_geometry(scrpriv->output,
+ &scrpriv->win_x,
+ &scrpriv->win_y,
+ &scrpriv->win_width,
+ &scrpriv->win_height);
+
+ HostX.use_fullscreen = TRUE;
+ hostx_set_fullscreen_hint();
+ }
+
tmpstr = getenv("RESOURCE_NAME");
if (tmpstr && (!ephyrResNameFromCmd))
@@ -637,6 +769,7 @@ hostx_set_cmap_entry(unsigned char idx,
*/
void *
hostx_screen_init(KdScreenInfo *screen,
+ int x, int y,
int width, int height, int buffer_height,
int *bytes_per_line, int *bits_per_pixel)
{
@@ -648,8 +781,8 @@ hostx_screen_init(KdScreenInfo *screen,
exit(1);
}
- EPHYR_DBG("host_screen=%p wxh=%dx%d, buffer_height=%d",
- host_screen, width, height, buffer_height);
+ EPHYR_DBG("host_screen=%p x=%d, y=%d, wxh=%dx%d, buffer_height=%d",
+ host_screen, x, y, width, height, buffer_height);
if (scrpriv->ximg != NULL) {
/* Free up the image data if previously used
@@ -740,10 +873,25 @@ hostx_screen_init(KdScreenInfo *screen,
xcb_map_window(HostX.conn, scrpriv->win);
+ /* Set explicit window position if it was informed in
+ * -screen option (WxH+X or WxH+X+Y). Otherwise, accept the
+ * position set by WM.
+ * The trick here is putting this code after xcb_map_window() call,
+ * so these values won't be overriden by WM. */
+ if (scrpriv->win_explicit_position)
+ {
+ uint32_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y;
+ uint32_t values[2] = {x, y};
+ xcb_configure_window(HostX.conn, scrpriv->win, mask, values);
+ }
+
+
xcb_aux_sync(HostX.conn);
scrpriv->win_width = width;
scrpriv->win_height = height;
+ scrpriv->win_x = x;
+ scrpriv->win_y = y;
#ifdef GLAMOR
if (ephyr_glamor) {
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.h b/xorg-server/hw/kdrive/ephyr/hostx.h
index e83323a0c..80894c8c0 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.h
+++ b/xorg-server/hw/kdrive/ephyr/hostx.h
@@ -74,7 +74,7 @@ typedef struct {
} EphyrRect;
int
-hostx_want_screen_size(KdScreenInfo *screen, int *width, int *height);
+hostx_want_screen_geometry(KdScreenInfo *screen, int *width, int *height, int *x, int *y);
int
hostx_want_host_cursor(void);
@@ -83,6 +83,11 @@ void
hostx_use_sw_cursor(void);
void
+ hostx_get_output_geometry(const char *output,
+ int *x, int *y,
+ int *width, int *height);
+
+void
hostx_use_fullscreen(void);
int
@@ -107,7 +112,7 @@ int
hostx_init(void);
void
-hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num);
+hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num, Bool use_geometry, const char *output);
void
hostx_set_display_name(char *name);
@@ -136,6 +141,7 @@ hostx_set_cmap_entry(unsigned char idx,
unsigned char r, unsigned char g, unsigned char b);
void *hostx_screen_init(KdScreenInfo *screen,
+ int x, int y,
int width, int height, int buffer_height,
int *bytes_per_line, int *bits_per_pixel);
diff --git a/xorg-server/hw/kdrive/src/kdrive.c b/xorg-server/hw/kdrive/src/kdrive.c
index b5b91c0dd..5dbff3fce 100644
--- a/xorg-server/hw/kdrive/src/kdrive.c
+++ b/xorg-server/hw/kdrive/src/kdrive.c
@@ -300,6 +300,8 @@ KdParseScreen(KdScreenInfo * screen, const char *arg)
screen->softCursor = kdSoftCursor;
screen->origin = kdOrigin;
screen->randr = RR_Rotate_0;
+ screen->x = 0;
+ screen->y = 0;
screen->width = 0;
screen->height = 0;
screen->width_mm = 0;
@@ -313,7 +315,7 @@ KdParseScreen(KdScreenInfo * screen, const char *arg)
return;
for (i = 0; i < 2; i++) {
- arg = KdParseFindNext(arg, "x/@XY", save, &delim);
+ arg = KdParseFindNext(arg, "x/+@XY", save, &delim);
if (!save[0])
return;
@@ -321,7 +323,7 @@ KdParseScreen(KdScreenInfo * screen, const char *arg)
mm = 0;
if (delim == '/') {
- arg = KdParseFindNext(arg, "x@XY", save, &delim);
+ arg = KdParseFindNext(arg, "x+@XY", save, &delim);
if (!save[0])
return;
mm = atoi(save);
@@ -335,7 +337,8 @@ KdParseScreen(KdScreenInfo * screen, const char *arg)
screen->height = pixels;
screen->height_mm = mm;
}
- if (delim != 'x' && delim != '@' && delim != 'X' && delim != 'Y' &&
+ if (delim != 'x' && delim != '+' && delim != '@' &&
+ delim != 'X' && delim != 'Y' &&
(delim != '\0' || i == 0))
return;
}
@@ -346,6 +349,18 @@ KdParseScreen(KdScreenInfo * screen, const char *arg)
kdSoftCursor = FALSE;
kdSubpixelOrder = SubPixelUnknown;
+ if (delim == '+') {
+ arg = KdParseFindNext(arg, "+@xXY", save, &delim);
+ if (save[0])
+ screen->x = atoi(save);
+ }
+
+ if (delim == '+') {
+ arg = KdParseFindNext(arg, "@xXY", save, &delim);
+ if (save[0])
+ screen->y = atoi(save);
+ }
+
if (delim == '@') {
arg = KdParseFindNext(arg, "xXY", save, &delim);
if (save[0]) {
@@ -425,7 +440,7 @@ KdUseMsg(void)
{
ErrorF("\nTinyX Device Dependent Usage:\n");
ErrorF
- ("-screen WIDTH[/WIDTHMM]xHEIGHT[/HEIGHTMM][@ROTATION][X][Y][xDEPTH/BPP[xFREQ]] Specify screen characteristics\n");
+ ("-screen WIDTH[/WIDTHMM]xHEIGHT[/HEIGHTMM][+[-]XOFFSET][+[-]YOFFSET][@ROTATION][X][Y][xDEPTH/BPP[xFREQ]] Specify screen characteristics\n");
ErrorF
("-rgba rgb/bgr/vrgb/vbgr/none Specify subpixel ordering for LCD panels\n");
ErrorF
diff --git a/xorg-server/hw/kdrive/src/kdrive.h b/xorg-server/hw/kdrive/src/kdrive.h
index 08b1681ce..066a13419 100644
--- a/xorg-server/hw/kdrive/src/kdrive.h
+++ b/xorg-server/hw/kdrive/src/kdrive.h
@@ -89,6 +89,8 @@ typedef struct _KdScreenInfo {
ScreenPtr pScreen;
void *driver;
Rotation randr; /* rotation and reflection */
+ int x;
+ int y;
int width;
int height;
int rate;
diff --git a/xorg-server/hw/xfree86/common/xf86Bus.c b/xorg-server/hw/xfree86/common/xf86Bus.c
index b3b3f8cc5..bd3e4e37b 100644
--- a/xorg-server/hw/xfree86/common/xf86Bus.c
+++ b/xorg-server/hw/xfree86/common/xf86Bus.c
@@ -210,6 +210,9 @@ xf86BusProbe(void)
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
xf86SbusProbe();
#endif
+#ifdef XSERVER_PLATFORM_BUS
+ xf86platformPrimary();
+#endif
}
/*
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.h b/xorg-server/hw/xfree86/common/xf86Xinput.h
index 9fe8c87b6..66a64fb48 100644
--- a/xorg-server/hw/xfree86/common/xf86Xinput.h
+++ b/xorg-server/hw/xfree86/common/xf86Xinput.h
@@ -51,6 +51,7 @@
#ifndef _xf86Xinput_h
#define _xf86Xinput_h
+#include "xf86.h"
#include "xf86str.h"
#include "inputstr.h"
#include <X11/extensions/XI.h>
@@ -85,7 +86,7 @@ typedef struct _InputDriverRec {
/* This is to input devices what the ScrnInfoRec is to screens. */
-typedef struct _InputInfoRec {
+struct _InputInfoRec {
struct _InputInfoRec *next;
char *name;
char *driver;
@@ -110,7 +111,7 @@ typedef struct _InputInfoRec {
void *module;
XF86OptionPtr options;
InputAttributes *attrs;
-} *InputInfoPtr;
+};
/* xf86Globals.c */
extern InputInfoPtr xf86InputDevs;
diff --git a/xorg-server/hw/xfree86/common/xf86platformBus.c b/xorg-server/hw/xfree86/common/xf86platformBus.c
index 946039940..5ad9b7080 100644
--- a/xorg-server/hw/xfree86/common/xf86platformBus.c
+++ b/xorg-server/hw/xfree86/common/xf86platformBus.c
@@ -435,10 +435,9 @@ xf86platformProbeDev(DriverPtr drvp)
/* for non-seat0 servers assume first device is the master */
if (ServerIsNotSeat0())
break;
- if (xf86_platform_devices[j].pdev) {
- if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
- break;
- }
+
+ if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
+ break;
}
}
@@ -594,4 +593,19 @@ void xf86platformVTProbe(void)
xf86PlatformReprobeDevice(i, xf86_platform_devices[i].attribs);
}
}
+
+void xf86platformPrimary(void)
+{
+ /* use the first platform device as a fallback */
+ if (primaryBus.type == BUS_NONE) {
+ xf86Msg(X_INFO, "no primary bus or device found\n");
+
+ if (xf86_num_platform_devices > 0) {
+ primaryBus.id.plat = &xf86_platform_devices[0];
+ primaryBus.type = BUS_PLATFORM;
+
+ xf86Msg(X_NONE, "\tfalling back to %s\n", primaryBus.id.plat->attribs->syspath);
+ }
+ }
+}
#endif
diff --git a/xorg-server/hw/xfree86/common/xf86platformBus.h b/xorg-server/hw/xfree86/common/xf86platformBus.h
index 317dd24d5..a7335b9da 100644
--- a/xorg-server/hw/xfree86/common/xf86platformBus.h
+++ b/xorg-server/hw/xfree86/common/xf86platformBus.h
@@ -155,6 +155,7 @@ extern _X_EXPORT int
xf86PlatformMatchDriver(char *matches[], int nmatches);
extern void xf86platformVTProbe(void);
+extern void xf86platformPrimary(void);
#endif
#endif
diff --git a/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c b/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c
index 947a68678..3fd28c3b5 100644
--- a/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c
+++ b/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c
@@ -76,7 +76,7 @@ ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
(flags & VIDMEM_READONLY) ?
PROT_READ : (PROT_READ | PROT_WRITE), MAP_SHARED, fd, Base);
if (base == MAP_FAILED)
- FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)",
+ FatalError("%s: could not mmap screen [s=%lx,a=%lx] (%s)",
"xf86MapVidMem", Size, Base, strerror(errno));
return base;
diff --git a/xorg-server/hw/xquartz/xpr/xprScreen.c b/xorg-server/hw/xquartz/xpr/xprScreen.c
index 7aa1ae1df..d0a525ff4 100644
--- a/xorg-server/hw/xquartz/xpr/xprScreen.c
+++ b/xorg-server/hw/xquartz/xpr/xprScreen.c
@@ -169,14 +169,25 @@ displayScreenBounds(CGDirectDisplayID id)
(int)frame.size.width, (int)frame.size.height,
(int)frame.origin.x, (int)frame.origin.y);
- /* Remove menubar to help standard X11 window managers.
- * On Mavericks and later, the menu bar is on all displays.
- */
- if (XQuartzIsRootless
+ Boolean spacePerDisplay = false;
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
- && (NSAppKitVersionNumber >= 1265 || (frame.origin.x == 0 && frame.origin.y == 0))
+ if (NSAppKitVersionNumber >= 1265)
#endif
- ) {
+ {
+ Boolean ok;
+ (void)CFPreferencesAppSynchronize(CFSTR("com.apple.spaces"));
+ spacePerDisplay = ! CFPreferencesGetAppBooleanValue(CFSTR("spans-displays"),
+ CFSTR("com.apple.spaces"),
+ &ok);
+ if (!ok)
+ spacePerDisplay = true;
+ }
+
+ /* Remove menubar to help standard X11 window managers.
+ * On Mavericks and later, the menu bar is on all displays when spans-displays is false or unset.
+ */
+ if (XQuartzIsRootless &&
+ (spacePerDisplay || (frame.origin.x == 0 && frame.origin.y == 0))) {
frame.origin.y += aquaMenuBarHeight;
frame.size.height -= aquaMenuBarHeight;
}