summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/intel_device.c21
-rw-r--r--src/intel_driver.h6
-rw-r--r--src/intel_module.c3
3 files changed, 25 insertions, 5 deletions
diff --git a/src/intel_device.c b/src/intel_device.c
index 92472c54..8ab7ad79 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -48,6 +48,10 @@
#include <xf86_OSproc.h>
#include <i915_drm.h>
+#ifdef XSERVER_PLATFORM_BUS
+#include <xf86platformBus.h>
+#endif
+
#include "intel_driver.h"
struct intel_device {
@@ -216,9 +220,22 @@ static char *find_render_node(int fd)
return NULL;
}
+#ifdef XSERVER_PLATFORM_BUS
+static char *get_path(struct xf86_platform_device *dev)
+{
+ const char *path = xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_PATH);
+ return path ? strdup(path) : NULL;
+}
+#else
+static char *get_path(struct xf86_platform_device *dev)
+{
+ return NULL;
+}
+#endif
+
int intel_open_device(int entity_num,
const struct pci_device *pci,
- const char *path)
+ struct xf86_platform_device *platform)
{
struct intel_device *dev;
char *local_path;
@@ -233,7 +250,7 @@ int intel_open_device(int entity_num,
if (dev)
return dev->fd;
- local_path = path ? strdup(path) : NULL;
+ local_path = get_path(platform);
fd = __intel_open_device(pci, &local_path);
if (fd == -1)
diff --git a/src/intel_driver.h b/src/intel_driver.h
index e54054fe..9f4c4e50 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -1,6 +1,8 @@
#ifndef INTEL_DRIVER_H
#define INTEL_DRIVER_H
+struct xf86_platform_device;
+
#define INTEL_VERSION 4000
#define INTEL_NAME "intel"
#define INTEL_DRIVER_NAME "intel"
@@ -120,7 +122,9 @@ void intel_detect_chipset(ScrnInfoPtr scrn,
EntityInfoPtr ent,
struct pci_device *pci);
-int intel_open_device(int entity_num, const struct pci_device *pci, const char *path);
+int intel_open_device(int entity_num,
+ const struct pci_device *pci,
+ struct xf86_platform_device *dev);
int intel_get_device(ScrnInfoPtr scrn);
const char *intel_get_client_name(ScrnInfoPtr scrn);
int intel_get_master(ScrnInfoPtr scrn);
diff --git a/src/intel_module.c b/src/intel_module.c
index ca8eacd7..6728d160 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -525,8 +525,7 @@ intel_platform_probe(DriverPtr driver,
if (!dev->pdev)
return FALSE;
- if (intel_open_device(entity_num, dev->pdev,
- xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_PATH)) == -1)
+ if (intel_open_device(entity_num, dev->pdev, dev))
return FALSE;
/* Allow ourselves to act as a slaved output if not primary */