aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Events.c7
-rw-r--r--xorg-server/hw/xfree86/common/xf86platformBus.c20
-rw-r--r--xorg-server/hw/xfree86/drivers/modesetting/driver.c5
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Crtc.c53
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Crtc.h26
-rw-r--r--xorg-server/hw/xfree86/os-support/linux/systemd-logind.c17
6 files changed, 106 insertions, 22 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Events.c b/xorg-server/hw/xfree86/common/xf86Events.c
index c06aaaee1..97a1f97b2 100644
--- a/xorg-server/hw/xfree86/common/xf86Events.c
+++ b/xorg-server/hw/xfree86/common/xf86Events.c
@@ -583,10 +583,11 @@ xf86VTEnter(void)
/* Turn screen saver off when switching back */
dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
- /* If we use systemd-logind it will enable input devices for us */
- if (!systemd_logind_controls_session())
- for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next)
+ for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) {
+ /* Devices with server managed fds get enabled on logind resume */
+ if (!(pInfo->flags & XI86_SERVER_FD))
xf86EnableInputDeviceForVTSwitch(pInfo);
+ }
for (ih = InputHandlers; ih; ih = ih->next) {
if (ih->is_input)
diff --git a/xorg-server/hw/xfree86/common/xf86platformBus.c b/xorg-server/hw/xfree86/common/xf86platformBus.c
index 15988b8b1..c1aaba41a 100644
--- a/xorg-server/hw/xfree86/common/xf86platformBus.c
+++ b/xorg-server/hw/xfree86/common/xf86platformBus.c
@@ -153,8 +153,10 @@ xf86_check_platform_slot(const struct xf86_platform_device *pd)
for (i = 0; i < xf86NumEntities; i++) {
const EntityPtr u = xf86Entities[i];
- if (pd->pdev && u->bus.type == BUS_PCI)
- return !MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci);
+ if (pd->pdev && u->bus.type == BUS_PCI &&
+ MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci)) {
+ return FALSE;
+ }
if ((u->bus.type == BUS_PLATFORM) && (pd == u->bus.id.plat)) {
return FALSE;
}
@@ -426,6 +428,10 @@ xf86platformProbeDev(DriverPtr drvp)
/* find the main device or any device specificed in xorg.conf */
for (i = 0; i < numDevs; i++) {
+ /* skip inactive devices */
+ if (!devList[i]->active)
+ continue;
+
for (j = 0; j < xf86_num_platform_devices; j++) {
if (devList[i]->busID && *devList[i]->busID) {
if (xf86PlatformDeviceCheckBusID(&xf86_platform_devices[j], devList[i]->busID))
@@ -449,10 +455,14 @@ xf86platformProbeDev(DriverPtr drvp)
continue;
}
- /* if autoaddgpu devices is enabled then go find a few more and add them as GPU screens */
- if (xf86Info.autoAddGPU && numDevs) {
+ /* if autoaddgpu devices is enabled then go find any unclaimed platform
+ * devices and add them as GPU screens */
+ if (xf86Info.autoAddGPU) {
for (j = 0; j < xf86_num_platform_devices; j++) {
- probeSingleDevice(&xf86_platform_devices[j], drvp, devList[0], PLATFORM_PROBE_GPU_SCREEN);
+ if (probeSingleDevice(&xf86_platform_devices[j], drvp,
+ devList ? devList[0] : NULL,
+ PLATFORM_PROBE_GPU_SCREEN))
+ foundScreen = TRUE;
}
}
diff --git a/xorg-server/hw/xfree86/drivers/modesetting/driver.c b/xorg-server/hw/xfree86/drivers/modesetting/driver.c
index d52517d1a..e2f3846ca 100644
--- a/xorg-server/hw/xfree86/drivers/modesetting/driver.c
+++ b/xorg-server/hw/xfree86/drivers/modesetting/driver.c
@@ -1049,10 +1049,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
#ifdef GLAMOR
if (ms->drmmode.glamor) {
- if (!glamor_init(pScreen,
- GLAMOR_USE_EGL_SCREEN |
- GLAMOR_USE_SCREEN |
- GLAMOR_USE_PICTURE_SCREEN)) {
+ if (!glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to initialize glamor at ScreenInit() time.\n");
return FALSE;
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c
index 9d592a7eb..a1947241b 100644
--- a/xorg-server/hw/xfree86/modes/xf86Crtc.c
+++ b/xorg-server/hw/xfree86/modes/xf86Crtc.c
@@ -3026,6 +3026,27 @@ xf86OutputSetEDIDProperty(xf86OutputPtr output, void *data, int data_len)
}
}
+#define TILE_ATOM_NAME "TILE"
+/* changing this in the future could be tricky as people may hardcode 8 */
+#define TILE_PROP_NUM_ITEMS 8
+static void
+xf86OutputSetTileProperty(xf86OutputPtr output)
+{
+ Atom tile_atom = MakeAtom(TILE_ATOM_NAME, sizeof(TILE_ATOM_NAME) - 1, TRUE);
+
+ /* This may get called before the RandR resources have been created */
+ if (output->randr_output == NULL)
+ return;
+
+ if (output->tile_info.group_id != 0) {
+ RRChangeOutputProperty(output->randr_output, tile_atom, XA_INTEGER, 32,
+ PropModeReplace, TILE_PROP_NUM_ITEMS, (uint32_t *)&output->tile_info, FALSE, TRUE);
+ }
+ else {
+ RRDeleteOutputProperty(output->randr_output, tile_atom);
+ }
+}
+
#endif
/* Pull out a phyiscal size from a detailed timing if available. */
@@ -3071,6 +3092,38 @@ handle_detailed_physical_size(struct detailed_monitor_section
}
}
+Bool
+xf86OutputParseKMSTile(const char *tile_data, int tile_length,
+ struct xf86CrtcTileInfo *tile_info)
+{
+ int ret;
+
+ ret = sscanf(tile_data, "%d:%d:%d:%d:%d:%d:%d:%d",
+ &tile_info->group_id,
+ &tile_info->flags,
+ &tile_info->num_h_tile,
+ &tile_info->num_v_tile,
+ &tile_info->tile_h_loc,
+ &tile_info->tile_v_loc,
+ &tile_info->tile_h_size,
+ &tile_info->tile_v_size);
+ if (ret != 8)
+ return FALSE;
+ return TRUE;
+}
+
+void
+xf86OutputSetTile(xf86OutputPtr output, struct xf86CrtcTileInfo *tile_info)
+{
+ if (tile_info)
+ output->tile_info = *tile_info;
+ else
+ memset(&output->tile_info, 0, sizeof(output->tile_info));
+#ifdef RANDR_12_INTERFACE
+ xf86OutputSetTileProperty(output);
+#endif
+}
+
/**
* Set the EDID information for the specified output
*/
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.h b/xorg-server/hw/xfree86/modes/xf86Crtc.h
index 692bf40b9..3c5bbcfd5 100644
--- a/xorg-server/hw/xfree86/modes/xf86Crtc.h
+++ b/xorg-server/hw/xfree86/modes/xf86Crtc.h
@@ -70,6 +70,17 @@ typedef enum _xf86OutputStatus {
XF86OutputStatusUnknown
} xf86OutputStatus;
+struct xf86CrtcTileInfo {
+ uint32_t group_id;
+ uint32_t flags;
+ uint32_t num_h_tile;
+ uint32_t num_v_tile;
+ uint32_t tile_h_loc;
+ uint32_t tile_v_loc;
+ uint32_t tile_h_size;
+ uint32_t tile_v_size;
+};
+
typedef struct _xf86CrtcFuncs {
/**
* Turns the crtc on/off, or sets intermediate power levels if available.
@@ -226,7 +237,7 @@ typedef struct _xf86CrtcFuncs {
} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
-#define XF86_CRTC_VERSION 5
+#define XF86_CRTC_VERSION 6
struct _xf86Crtc {
/**
@@ -500,7 +511,7 @@ typedef struct _xf86OutputFuncs {
(*destroy) (xf86OutputPtr output);
} xf86OutputFuncsRec, *xf86OutputFuncsPtr;
-#define XF86_OUTPUT_VERSION 2
+#define XF86_OUTPUT_VERSION 3
struct _xf86Output {
/**
@@ -615,6 +626,8 @@ struct _xf86Output {
BoxRec initialTotalArea;
BoxRec initialTrackingArea;
INT16 initialBorder[4];
+
+ struct xf86CrtcTileInfo tile_info;
};
typedef struct _xf86ProviderFuncs {
@@ -881,6 +894,15 @@ extern _X_EXPORT void
xf86OutputSetEDID(xf86OutputPtr output, xf86MonPtr edid_mon);
/**
+ * Set the TILE information for the specified output
+ */
+extern _X_EXPORT void
+xf86OutputSetTile(xf86OutputPtr output, struct xf86CrtcTileInfo *tile_info);
+
+extern _X_EXPORT Bool
+xf86OutputParseKMSTile(const char *tile_data, int tile_length, struct xf86CrtcTileInfo *tile_info);
+
+/**
* Return the list of modes supported by the EDID information
* stored in 'output'
*/
diff --git a/xorg-server/hw/xfree86/os-support/linux/systemd-logind.c b/xorg-server/hw/xfree86/os-support/linux/systemd-logind.c
index 49758f465..4ad41a374 100644
--- a/xorg-server/hw/xfree86/os-support/linux/systemd-logind.c
+++ b/xorg-server/hw/xfree86/os-support/linux/systemd-logind.c
@@ -40,8 +40,6 @@
#include "systemd-logind.h"
-#define DBUS_TIMEOUT 500 /* Wait max 0.5 seconds */
-
struct systemd_logind_info {
DBusConnection *conn;
char *session;
@@ -130,7 +128,7 @@ systemd_logind_take_fd(int _major, int _minor, const char *path,
}
reply = dbus_connection_send_with_reply_and_block(info->conn, msg,
- DBUS_TIMEOUT, &error);
+ DBUS_TIMEOUT_USE_DEFAULT, &error);
if (!reply) {
LogMessage(X_ERROR, "systemd-logind: failed to take device %s: %s\n",
path, error.message);
@@ -207,7 +205,7 @@ systemd_logind_release_fd(int _major, int _minor, int fd)
}
reply = dbus_connection_send_with_reply_and_block(info->conn, msg,
- DBUS_TIMEOUT, &error);
+ DBUS_TIMEOUT_USE_DEFAULT, &error);
if (!reply)
LogMessage(X_ERROR, "systemd-logind: failed to release device: %s\n",
error.message);
@@ -289,7 +287,7 @@ systemd_logind_ack_pause(struct systemd_logind_info *info,
}
reply = dbus_connection_send_with_reply_and_block(info->conn, msg,
- DBUS_TIMEOUT, &error);
+ DBUS_TIMEOUT_USE_DEFAULT, &error);
if (!reply)
LogMessage(X_ERROR, "systemd-logind: failed to ack pause: %s\n",
error.message);
@@ -313,6 +311,9 @@ message_filter(DBusConnection * connection, DBusMessage * message, void *data)
dbus_int32_t major, minor;
char *pause_str;
+ if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_SIGNAL)
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
dbus_error_init(&error);
if (dbus_message_is_signal(message,
@@ -454,7 +455,7 @@ connect_hook(DBusConnection *connection, void *data)
}
reply = dbus_connection_send_with_reply_and_block(connection, msg,
- DBUS_TIMEOUT, &error);
+ DBUS_TIMEOUT_USE_DEFAULT, &error);
if (!reply) {
LogMessage(X_ERROR, "systemd-logind: failed to get session: %s\n",
error.message);
@@ -489,7 +490,7 @@ connect_hook(DBusConnection *connection, void *data)
}
reply = dbus_connection_send_with_reply_and_block(connection, msg,
- DBUS_TIMEOUT, &error);
+ DBUS_TIMEOUT_USE_DEFAULT, &error);
if (!reply) {
LogMessage(X_ERROR, "systemd-logind: TakeControl failed: %s\n",
error.message);
@@ -561,7 +562,7 @@ systemd_logind_release_control(struct systemd_logind_info *info)
}
reply = dbus_connection_send_with_reply_and_block(info->conn, msg,
- DBUS_TIMEOUT, &error);
+ DBUS_TIMEOUT_USE_DEFAULT, &error);
if (!reply) {
LogMessage(X_ERROR, "systemd-logind: ReleaseControl failed: %s\n",
error.message);