summaryrefslogtreecommitdiff
path: root/src/sna/sna_display.c
diff options
context:
space:
mode:
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);