[Spice-devel] [spice-protocol PATCH 41/46] spiceqxl: remove implementation of qxl_set_mode, not needed for Xspice

Alon Levy alevy at redhat.com
Tue Apr 10 04:50:37 PDT 2012


---
 src/spiceqxl_io_port.c |   36 +-----------------------------------
 1 file changed, 1 insertion(+), 35 deletions(-)

diff --git a/src/spiceqxl_io_port.c b/src/spiceqxl_io_port.c
index 0b8acc8..db7d715 100644
--- a/src/spiceqxl_io_port.c
+++ b/src/spiceqxl_io_port.c
@@ -173,39 +173,6 @@ static void qxl_destroy_primary(qxl_screen_t *qxl)
     qxl->worker->destroy_primary_surface(qxl->worker, 0);
 }
 
-
-static void qxl_set_mode(qxl_screen_t *qxl, int modenr)
-{
-    struct QXLMode *mode = qxl->modes + modenr;
-    struct QXLRom *rom = qxlhw_pci_get_rom(qxl->hw);
-    uint64_t devmem = pointer_to_u64(qxlhw_pci_get_ram(qxl->hw));
-    QXLSurfaceCreate surface = {
-        .width      = mode->x_res,
-        .height     = mode->y_res,
-        .stride     = -mode->x_res * 4,
-        .format     = SPICE_SURFACE_FMT_32_xRGB,
-        .flags      = 0,
-        .mouse_mode = TRUE,
-        .mem        = devmem + qxl->shadow_rom.draw_area_offset,
-    };
-
-    dprint(1, "%s: mode %d  [ %d x %d @ %d bpp devmem 0x%lx ]\n", __FUNCTION__,
-           modenr, mode->x_res, mode->y_res, mode->bits, devmem);
-    qxl_hard_reset(qxl);
-
-    qxl->guest_primary.surface = surface;
-    qxl_create_guest_primary(qxl);
-
-    qxl->cmdflags = QXL_COMMAND_FLAG_COMPAT;
-#ifdef QXL_COMMAND_FLAG_COMPAT_16BPP /* new in spice 0.6.1 */
-    if (mode->bits == 16) {
-        qxl->cmdflags |= QXL_COMMAND_FLAG_COMPAT_16BPP;
-    }
-#endif
-    qxl->shadow_rom.mode = modenr;
-    rom->mode = modenr;
-}
-
 /* called from Xorg thread - not worker thread! */
 void xspice_ioport_write(qxl_screen_t *qxl, uint32_t io_port, uint32_t val)
 {
@@ -244,8 +211,7 @@ void xspice_ioport_write(qxl_screen_t *qxl, uint32_t io_port, uint32_t val)
         qxl->worker->oom(qxl->worker);
         break;
     case QXL_IO_SET_MODE:
-        dprint(1, "QXL_SET_MODE %d\n", val);
-        qxl_set_mode(qxl, val);
+        dprint(1, "QXL_SET_MODE %d - should not be calledd (this is Xspice)\n", val);
         break;
     case QXL_IO_LOG:
         fprintf(stderr, "qxl/guest: %s", header->log_buf);
-- 
1.7.9.3



More information about the Spice-devel mailing list