summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-01 16:52:18 +0100
committerDave Airlie <airlied@redhat.com>2012-05-01 16:52:18 +0100
commit288d197f706804194ef9977baa50d566142e2acc (patch)
tree5c36c8fdeb9ce26b8a190c5bd59dcc0d3390377e
parent296d08ef590063fcc6f268778bc012df2d0243c4 (diff)
modesetting: move opening kernel device to before setting depth
due to interaction between option handling and set depth, we need to what fbdev does to get the device path early. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/driver.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/driver.c b/src/driver.c
index 827438a..fb4b410 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -437,6 +437,28 @@ PreInit(ScrnInfoPtr pScrn, int flags)
pScrn->progClock = TRUE;
pScrn->rgbBits = 8;
+ ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
+ if (ms->PciInfo) {
+ BusID = malloc(64);
+ sprintf(BusID, "PCI:%d:%d:%d",
+#if XSERVER_LIBPCIACCESS
+ ((ms->PciInfo->domain << 8) | ms->PciInfo->bus),
+ ms->PciInfo->dev, ms->PciInfo->func
+#else
+ ((pciConfigPtr) ms->PciInfo->thisCard)->busnum,
+ ((pciConfigPtr) ms->PciInfo->thisCard)->devnum,
+ ((pciConfigPtr) ms->PciInfo->thisCard)->funcnum
+#endif
+ );
+
+ ms->fd = drmOpen(NULL, BusID);
+ } else {
+ devicename = xf86FindOptionValue(ms->pEnt->device->options, "kmsdev");
+ ms->fd = open_hw(devicename);
+ }
+ if (ms->fd < 0)
+ return FALSE;
+
if (!xf86SetDepthBpp
(pScrn, 0, 0, 0,
PreferConvert24to32 | SupportConvert24to32 | Support32bppFb))
@@ -462,28 +484,6 @@ PreInit(ScrnInfoPtr pScrn, int flags)
memcpy(ms->Options, Options, sizeof(Options));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options);
- ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
- if (ms->PciInfo) {
- BusID = malloc(64);
- sprintf(BusID, "PCI:%d:%d:%d",
-#if XSERVER_LIBPCIACCESS
- ((ms->PciInfo->domain << 8) | ms->PciInfo->bus),
- ms->PciInfo->dev, ms->PciInfo->func
-#else
- ((pciConfigPtr) ms->PciInfo->thisCard)->busnum,
- ((pciConfigPtr) ms->PciInfo->thisCard)->devnum,
- ((pciConfigPtr) ms->PciInfo->thisCard)->funcnum
-#endif
- );
-
- ms->fd = drmOpen(NULL, BusID);
- } else {
- devicename = xf86GetOptValString(ms->Options, OPTION_DEVICE_PATH);
- ms->fd = open_hw(devicename);
- }
- if (ms->fd < 0)
- return FALSE;
-
if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight))
return FALSE;
if (!xf86SetDefaultVisual(pScrn, -1))