summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-04-27 17:01:38 +0300
committerAlon Levy <alevy@redhat.com>2011-07-22 03:48:04 +0300
commitf3ca425f08275de670c963047a3d86e1fe481b2b (patch)
tree6d758274abee2169f7e3bf697a8d7d619890a571 /src
parent9e30b11be0134713922555a710b6be0e664b3af2 (diff)
xspice: stop using pci and vga
This ifdefs out all the parts in qxl_driver.c that are pci device specific and are not required by xspice. No functional change. The resulting spiceqxl_drv.so doesn't run.
Diffstat (limited to 'src')
-rw-r--r--src/qxl.h9
-rw-r--r--src/qxl_driver.c89
2 files changed, 88 insertions, 10 deletions
diff --git a/src/qxl.h b/src/qxl.h
index 6a5c63e..443871b 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -40,12 +40,15 @@
#include "xf86xv.h"
#include "shadow.h"
#include "micmap.h"
+#include "uxa/uxa.h"
+
+#ifndef XSPICE
#ifdef XSERVER_PCIACCESS
#include "pciaccess.h"
#endif
#include "fb.h"
-#include "uxa/uxa.h"
#include "vgaHW.h"
+#endif /* XSPICE */
#define hidden _X_HIDDEN
@@ -133,9 +136,10 @@ struct _qxl_screen_t
EntityInfoPtr entity;
+#ifndef XSPICE
void * io_pages;
void * io_pages_physical;
-
+
#ifdef XSERVER_LIBPCIACCESS
struct pci_device * pci;
#else
@@ -143,6 +147,7 @@ struct _qxl_screen_t
PCITAG pci_tag;
#endif
vgaRegRec vgaRegs;
+#endif /* XSPICE */
uxa_driver_t * uxa;
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index ffea383..275178c 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -204,6 +204,17 @@ qxl_blank_screen(ScreenPtr pScreen, int mode)
return TRUE;
}
+#ifdef XSPICE
+static void
+unmap_memory_helper(qxl_screen_t *qxl, int scrnIndex)
+{
+}
+
+static void
+map_memory_helper(qxl_screen_t *qxl, int scrnIndex)
+{
+}
+#else /* Default */
static void
unmap_memory_helper(qxl_screen_t *qxl, int scrnIndex)
{
@@ -265,6 +276,7 @@ map_memory_helper(qxl_screen_t *qxl, int scrnIndex)
qxl->io_base = qxl->pci->ioBase[3];
#endif
}
+#endif /* XSPICE */
static void
qxl_unmap_memory(qxl_screen_t *qxl, int scrnIndex)
@@ -308,6 +320,17 @@ qxl_map_memory(qxl_screen_t *qxl, int scrnIndex)
return TRUE;
}
+#ifdef XSPICE
+static void
+qxl_save_state(ScrnInfoPtr pScrn)
+{
+}
+
+static void
+qxl_restore_state(ScrnInfoPtr pScrn)
+{
+}
+#else /* QXL */
static void
qxl_save_state(ScrnInfoPtr pScrn)
{
@@ -323,6 +346,7 @@ qxl_restore_state(ScrnInfoPtr pScrn)
vgaHWRestoreFonts(pScrn, &qxl->vgaRegs);
}
+#endif /* XSPICE */
static Bool
qxl_close_screen(int scrnIndex, ScreenPtr pScreen)
@@ -916,8 +940,10 @@ qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
qxl_reset (qxl);
ErrorF ("done reset\n");
+#ifndef XSPICE
qxl->io_pages = (void *)((unsigned long)qxl->ram);
qxl->io_pages_physical = (void *)((unsigned long)qxl->ram_physical);
+#endif
qxl->command_ring = qxl_ring_create ((struct qxl_ring_header *)&(ram_header->cmd_ring),
sizeof (struct QXLCommand),
@@ -1055,6 +1081,7 @@ print_modes (qxl_screen_t *qxl, int scrnIndex)
}
}
+#ifndef XSPICE
static Bool
qxl_check_device(ScrnInfoPtr pScrn, qxl_screen_t *qxl)
{
@@ -1090,15 +1117,9 @@ qxl_check_device(ScrnInfoPtr pScrn, qxl_screen_t *qxl)
xf86DrvMsg(scrnIndex, X_INFO, "Correct RAM signature %x\n",
ram_header->magic);
-
- pScrn->videoRam = (rom->num_pages * 4096) / 1024;
-
- xf86DrvMsg(scrnIndex, X_INFO, "%d KB of video RAM\n", pScrn->videoRam);
-
- xf86DrvMsg(scrnIndex, X_INFO, "%d surfaces\n", rom->n_surfaces);
-
return TRUE;
}
+#endif /* !XSPICE */
static int
qxl_find_native_mode(ScrnInfoPtr pScrn, DisplayModePtr p)
@@ -1216,11 +1237,14 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
qxl = pScrn->driverPrivate;
qxl->entity = xf86GetEntityInfo(pScrn->entityList[0]);
+
+#ifndef XSPICE
qxl->pci = xf86GetPciInfoForEntity(qxl->entity->index);
#ifndef XSERVER_LIBPCIACCESS
qxl->pci_tag = pciTag(qxl->pci->bus, qxl->pci->device, qxl->pci->func);
#endif
-
+#endif /* XSPICE */
+
pScrn->monitor = pScrn->confScreen->monitor;
if (!qxl_color_setup(pScrn))
@@ -1234,8 +1258,13 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
if (!qxl_map_memory(qxl, scrnIndex))
goto out;
+#ifndef XSPICE
if (!qxl_check_device(pScrn, qxl))
goto out;
+#endif
+ pScrn->videoRam = (qxl->rom->num_pages * 4096) / 1024;
+ xf86DrvMsg(scrnIndex, X_INFO, "%d KB of video RAM\n", pScrn->videoRam);
+ xf86DrvMsg(scrnIndex, X_INFO, "%d surfaces\n", qxl->rom->n_surfaces);
/* ddc stuff here */
@@ -1317,9 +1346,11 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
print_modes (qxl, scrnIndex);
+#ifndef XSPICE
/* VGA hardware initialisation */
if (!vgaHWGetHWRec(pScrn))
return FALSE;
+#endif
/* hate */
qxl_unmap_memory(qxl, scrnIndex);
@@ -1341,6 +1372,7 @@ out:
return FALSE;
}
+#ifndef XSPICE
#ifdef XSERVER_LIBPCIACCESS
enum qxl_class
{
@@ -1374,11 +1406,14 @@ static PciChipsets qxlPciChips[] =
{ -1, -1, RES_UNDEFINED }
};
#endif
+#endif /* !XSPICE */
static void
qxl_identify(int flags)
{
+#ifndef XSPICE
xf86PrintChipsets("qxl", "Driver for QXL virtual graphics", qxlChips);
+#endif
}
static void
@@ -1394,6 +1429,37 @@ qxl_init_scrn(ScrnInfoPtr pScrn)
pScrn->LeaveVT = qxl_leave_vt;
}
+#ifdef XSPICE
+static Bool
+qxl_probe(struct _DriverRec *drv, int flags)
+{
+ ScrnInfoPtr pScrn;
+ int entityIndex;
+ EntityInfoPtr pEnt;
+ GDevPtr* device;
+
+ if (flags & PROBE_DETECT) {
+ return TRUE;
+ }
+
+ pScrn = xf86AllocateScreen(drv, flags);
+ qxl_init_scrn(pScrn);
+
+ xf86MatchDevice(QXL_DRIVER_NAME, &device);
+ entityIndex = xf86ClaimNoSlot(drv, 0, device[0], TRUE);
+ pEnt = xf86GetEntityInfo(entityIndex);
+ pEnt->driver = drv;
+
+ xf86AddEntityToScreen(pScrn, entityIndex);
+
+ return TRUE;
+}
+static Bool qxl_driver_func(ScrnInfoPtr screen_info_ptr, xorgDriverFuncOp xorg_driver_func_op, pointer hw_flags)
+{
+ *(xorgHWFlags*)hw_flags = (xorgHWFlags)HW_SKIP_CONSOLE;
+ return TRUE;
+}
+#else /* normal, not XSPICE */
#ifndef XSERVER_LIBPCIACCESS
static Bool
qxl_probe(DriverPtr drv, int flags)
@@ -1462,6 +1528,7 @@ qxl_pci_probe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t match)
#define qxl_probe NULL
#endif
+#endif /* XSPICE */
static DriverRec qxl_driver = {
0,
@@ -1471,11 +1538,17 @@ static DriverRec qxl_driver = {
NULL,
NULL,
0,
+#ifdef XSPICE
+ qxl_driver_func,
+ NULL,
+ NULL
+#else
NULL,
#ifdef XSERVER_LIBPCIACCESS
qxl_device_match,
qxl_pci_probe
#endif
+#endif /* XSPICE */
};
static pointer