qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Søren Sandmann Pedersen" <ssp@redhat.com>
To: qemu-devel@nongnu.org, spice-devel@lists.freedesktop.org
Cc: kraxel@redhat.com, "Søren Sandmann Pedersen" <ssp@redhat.com>
Subject: [Qemu-devel] [PATCH-v2 qemu] qxl: Add set_client_capabilities() interface to QXLInterface
Date: Sun,  2 Sep 2012 17:35:26 -0400	[thread overview]
Message-ID: <1346621726-11313-7-git-send-email-ssp@redhat.com> (raw)
In-Reply-To: <1346621726-11313-1-git-send-email-ssp@redhat.com>

This new interface lets spice server inform the guest whether

(a) a client is connected
(b) what capabilities the client has

There is a fixed number (464) of bits reserved for capabilities, and
when the capabilities bits change, the QXL_INTERRUPT_CLIENT interrupt
is generated.

Signed-off-by: Soren Sandmann <ssp@redhat.com>
---
 hw/qxl.c | 29 ++++++++++++++++++++++++++++-
 hw/qxl.h |  2 +-
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index c2dd3b4..1f62529 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -901,6 +901,26 @@ static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token)
     }
 }
 
+#if SPICE_SERVER_VERSION >= 0x000b04
+
+/* called from spice server thread context only */
+static void interface_set_client_capabilities(QXLInstance *sin,
+					      uint8_t client_present,
+					      uint8_t caps[58])
+{
+    PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
+
+    qxl->shadow_rom.client_present = client_present;
+    memcpy(qxl->shadow_rom.client_capabilities, caps, sizeof(caps));
+    qxl->rom->client_present = client_present;
+    memcpy(qxl->rom->client_capabilities, caps, sizeof(caps));
+    qxl_rom_set_dirty(qxl);
+
+    qxl_send_events(qxl, QXL_INTERRUPT_CLIENT);
+}
+
+#endif
+
 static const QXLInterface qxl_interface = {
     .base.type               = SPICE_INTERFACE_QXL,
     .base.description        = "qxl gpu",
@@ -922,6 +942,9 @@ static const QXLInterface qxl_interface = {
     .flush_resources         = interface_flush_resources,
     .async_complete          = interface_async_complete,
     .update_area_complete    = interface_update_area_complete,
+#if SPICE_SERVER_VERSION >= 0x000b04
+    .set_client_capabilities = interface_set_client_capabilities,
+#endif
 };
 
 static void qxl_enter_vga_mode(PCIQXLDevice *d)
@@ -1292,7 +1315,7 @@ static void qxl_set_mode(PCIQXLDevice *d, int modenr, int loadvm)
 
     d->mode = QXL_MODE_COMPAT;
     d->cmdflags = QXL_COMMAND_FLAG_COMPAT;
-#ifdef QXL_COMMAND_FLAG_COMPAT_16BPP /* new in spice 0.6.1 */
+#if QXL_COMMAND_FLAG_COMPAT_16BPP /* new in spice 0.6.1 */
     if (mode->bits == 16) {
         d->cmdflags |= QXL_COMMAND_FLAG_COMPAT_16BPP;
     }
@@ -1785,6 +1808,10 @@ static int qxl_init_common(PCIQXLDevice *qxl)
         io_size = 16;
         break;
     case 3: /* qxl-3 */
+	pci_device_rev = QXL_REVISION_STABLE_V10;
+	io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1);
+	break;
+    case 4:
     default:
         pci_device_rev = QXL_DEFAULT_REVISION;
         io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1);
diff --git a/hw/qxl.h b/hw/qxl.h
index 172baf6..98d5a64 100644
--- a/hw/qxl.h
+++ b/hw/qxl.h
@@ -128,7 +128,7 @@ typedef struct PCIQXLDevice {
         }                                                               \
     } while (0)
 
-#define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V10
+#define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V12
 
 /* qxl.c */
 void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id);
-- 
1.7.11.4

  parent reply	other threads:[~2012-09-02 21:32 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-27 17:20 [Qemu-devel] Add ability to advertise client capabilities to QXL device Søren Sandmann Pedersen
2012-08-27 17:20 ` [Qemu-devel] [PATCH] Add new client_present and client capabilities fields to QXLRom Søren Sandmann Pedersen
2012-08-28  6:15   ` Gerd Hoffmann
2012-08-29  0:58     ` Søren Sandmann
2012-08-29  6:00       ` Gerd Hoffmann
2012-08-29 21:05         ` Søren Sandmann
2012-08-29 10:14       ` [Qemu-devel] [Spice-devel] " Alon Levy
2012-08-29 20:51         ` Søren Sandmann
2012-08-30  5:34           ` Gerd Hoffmann
2012-08-30 16:03             ` Søren Sandmann
2012-08-31  7:32               ` Gerd Hoffmann
2012-09-02 21:35                 ` [Qemu-devel] New patches to add capabilities to spice and qxl Søren Sandmann Pedersen
2012-09-02 21:35                   ` [Qemu-devel] [PATCH-v2 spice-protocol 1/2] Add A8 surface capability Søren Sandmann Pedersen
2012-09-02 21:35                   ` [Qemu-devel] [PATCH-v2 spice-protocol 2/2] Add new client_present and client capabilities fields to QXLRom Søren Sandmann Pedersen
2012-09-02 21:35                   ` [Qemu-devel] [PATCH-v2 spice-gtk] Advertise SPICE_DISPLAY_CAP_A8_SURFACE Søren Sandmann Pedersen
2012-09-02 21:35                   ` [Qemu-devel] [PATCH-v2 spice 1/2] Set a8 capability in the QXL device if supported by the client Søren Sandmann Pedersen
2012-09-03  7:34                     ` Alon Levy
2012-09-03 17:33                       ` Søren Sandmann
2012-09-03 17:49                         ` Søren Sandmann
2012-09-03 17:53                           ` [Qemu-devel] [PATCH 1/5] client: Advertise A8_SURFACE capability Søren Sandmann
2012-09-03 17:53                             ` [Qemu-devel] [PATCH 2/5] Add new set_client_capabilities() interface to QXLInstance Søren Sandmann
2012-09-03 17:53                             ` [Qemu-devel] [PATCH 3/5] Process outstanding commands in the ring after changing capability bits Søren Sandmann
2012-09-03 18:31                               ` [Qemu-devel] [Spice-devel] " Alon Levy
2012-09-03 17:53                             ` [Qemu-devel] [PATCH 4/5] Set a8 capability in the QXL device if supported by the client Søren Sandmann
2012-09-03 17:53                             ` [Qemu-devel] [PATCH 5/5] Bump spice.h version number to 0.11.4 Søren Sandmann
2012-09-02 21:35                   ` [Qemu-devel] [PATCH-v2 spice 2/2] " Søren Sandmann Pedersen
2012-09-02 21:35                   ` Søren Sandmann Pedersen [this message]
2012-09-03 17:36                     ` [Qemu-devel] [Spice-devel] [PATCH-v2 qemu] qxl: Add set_client_capabilities() interface to QXLInterface Søren Sandmann
2012-09-03 17:40                       ` [Qemu-devel] [PATCH] " Søren Sandmann
2012-09-03 18:21                         ` Alon Levy
2012-09-04 10:12                     ` [Qemu-devel] [PATCH-v2 qemu] " Gerd Hoffmann
2012-09-04 14:14                       ` [Qemu-devel] [PATCH 1/2] " Søren Sandmann
2012-09-04 14:14                         ` [Qemu-devel] [PATCH 2/2] Remove #ifdef QXL_COMMAND_FLAG_COMPAT_16BPP Søren Sandmann
2012-09-04 14:46                         ` [Qemu-devel] [PATCH 1/2] qxl: Add set_client_capabilities() interface to QXLInterface Gerd Hoffmann
2012-08-27 17:20 ` [Qemu-devel] [PATCH] Add new set_client_capabilities() interface to QXLInstance Søren Sandmann Pedersen
2012-08-27 17:20 ` [Qemu-devel] [PATCH] qxl: Add set_client_capabilities() interface to QXLInterface Søren Sandmann Pedersen
2012-08-28  6:19   ` Gerd Hoffmann
2012-08-27 17:20 ` [Qemu-devel] Add ability to advertise client capabilities to QXL device Søren Sandmann Pedersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1346621726-11313-7-git-send-email-ssp@redhat.com \
    --to=ssp@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=spice-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).