summaryrefslogtreecommitdiff
path: root/src/sna/sna_display.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-10-03 15:35:54 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-10-03 16:13:38 +0100
commit6c157a925f258fd4c82cf0c3004e7d0056c1cd70 (patch)
tree44ef3ea4eea1cc67121e924ae8bebb93bd814f9b /src/sna/sna_display.c
parent4685e79d1163325b78722c84ce173c91c217ac02 (diff)
intel: Remove dependence upon having PciInfo
After some probing mechanisms, we may end up with a valid device without knowing its PCI address a priori. Having a valid device, we can just query it for the correct device id, and can safely abort any path that requires PCI information that we don't have. (Those paths are not valid under such hosting anyway - if it may be required, we could reconstruct the address.) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_display.c')
-rw-r--r--src/sna/sna_display.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 28ddce5f..13796051 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -476,12 +476,16 @@ has_device_backlight(xf86OutputPtr output, int *best_type)
{
struct sna_output *sna_output = output->driver_private;
struct sna *sna = to_sna(output->scrn);
- struct pci_device *pci = sna->PciInfo;
+ struct pci_device *pci;
char path[1024];
char *best_iface = NULL;
DIR *dir;
struct dirent *de;
+ pci = xf86GetPciInfoForEntity(sna->pEnt->index);
+ if (pci == NULL)
+ return NULL;
+
snprintf(path, sizeof(path),
"/sys/bus/pci/devices/%04x:%02x:%02x.%d/backlight",
pci->domain, pci->bus, pci->dev, pci->func);