[Spice-devel] [spice-protocol PATCH 40/46] qxlhw: qxl_driver: use qxlhw_check_device
Alon Levy
alevy at redhat.com
Tue Apr 10 04:50:36 PDT 2012
---
src/qxl_driver.c | 46 ++--------------------------------------------
1 file changed, 2 insertions(+), 44 deletions(-)
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 972aa4a..14bac17 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -810,47 +810,6 @@ print_modes (qxl_screen_t *qxl, int scrnIndex)
}
}
-#ifndef XSPICE
-static Bool
-qxl_check_device(ScrnInfoPtr pScrn, qxl_screen_t *qxl)
-{
- int scrnIndex = pScrn->scrnIndex;
- struct QXLRom *rom = qxlhw_pci_get_rom(qxl->hw);
- struct QXLRam *ram_header = qxlhw_pci_get_ram_header(qxl->hw);
- void *ram = qxlhw_pci_get_ram(qxl->hw);
-
- CHECK_POINT();
-
- if (rom->magic != 0x4f525851) { /* "QXRO" little-endian */
- xf86DrvMsg(scrnIndex, X_ERROR, "Bad ROM signature %x\n", rom->magic);
- return FALSE;
- }
-
- xf86DrvMsg(scrnIndex, X_INFO, "Device version %d.%d\n",
- rom->id, rom->update_id);
-
- xf86DrvMsg(scrnIndex, X_INFO, "Compression level %d, log level %d\n",
- rom->compression_level,
- rom->log_level);
-
- xf86DrvMsg(scrnIndex, X_INFO, "%d io pages at 0x%lx\n",
- rom->num_pages, (unsigned long)ram);
-
- xf86DrvMsg(scrnIndex, X_INFO, "RAM header offset: 0x%x\n", rom->ram_header_offset);
-
- if (ram_header->magic != 0x41525851) { /* "QXRA" little-endian */
- xf86DrvMsg(scrnIndex, X_ERROR, "Bad RAM signature %x at %p\n",
- ram_header->magic,
- &ram_header->magic);
- return FALSE;
- }
-
- xf86DrvMsg(scrnIndex, X_INFO, "Correct RAM signature %x\n",
- ram_header->magic);
- return TRUE;
-}
-#endif /* !XSPICE */
-
static int
qxl_find_native_mode(ScrnInfoPtr pScrn, DisplayModePtr p)
{
@@ -1011,10 +970,9 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
goto out;
rom = qxlhw_pci_get_rom(qxl->hw);
-#ifndef XSPICE
- if (!qxl_check_device(pScrn, qxl))
+ if (!qxlhw_check_device(qxl->hw, pScrn))
goto out;
-#else
+#ifdef XSPICE
xspice_init_qxl_ram(qxl); /* initialize the rings */
#endif
pScrn->videoRam = (rom->num_pages * 4096) / 1024;
--
1.7.9.3
More information about the Spice-devel
mailing list