qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/9] Vga 20200929 patches
@ 2020-09-29  9:57 Gerd Hoffmann
  2020-09-29  9:57 ` [PULL 1/9] virtio-gpu-3d: fix abnormal display after a warm reboot Gerd Hoffmann
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Gerd Hoffmann @ 2020-09-29  9:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: David Gibson, qemu-ppc, Gerd Hoffmann, Michael S. Tsirkin

The following changes since commit 74504514b154ebebdff577d88e4bf5c13074e9ed:

  Merge remote-tracking branch 'remotes/alistair/tags/pull-register-20200927'=
 into staging (2020-09-28 16:49:10 +0100)

are available in the Git repository at:

  git://git.kraxel.org/qemu tags/vga-20200929-pull-request

for you to fetch changes up to 97a0530bb71fb96468f218b622cd840e2c667bf6:

  ppc/pseries: enable big-endian-framebuffer quirk for bochs-display and virt=
io-vga (2020-09-29 10:08:25 +0200)

----------------------------------------------------------------
virtio-vga: reset fix, bigendian fix.
virtio-vga+spice: set monitor dimension via edid.

----------------------------------------------------------------

Gerd Hoffmann (2):
  virtio-vga: implement big-endian-framebuffer property
  ppc/pseries: enable big-endian-framebuffer quirk for bochs-display and
    virtio-vga

Guoqing Zhang (1):
  virtio-gpu-3d: fix abnormal display after a warm reboot

Marc-Andr=C3=A9 Lureau (6):
  edid: fix physical display size computation
  edid: use physical dimensions if available
  ui: add getter for UIInfo
  spice: remove the single monitor config logic
  spice: get monitors physical dimension
  virtio-gpu: set physical dimensions for EDID

 include/hw/display/edid.h      |  5 ++++-
 include/hw/virtio/virtio-gpu.h |  1 +
 include/ui/console.h           |  4 ++++
 hw/display/edid-generate.c     | 36 +++++++++++++++++++++++-----------
 hw/display/virtio-gpu-3d.c     |  2 +-
 hw/display/virtio-gpu-base.c   |  2 ++
 hw/display/virtio-gpu.c        |  2 ++
 hw/display/virtio-vga.c        | 19 ++++++++++++++++++
 hw/ppc/spapr_pci.c             |  4 +++-
 qemu-edid.c                    | 11 +++++++++--
 ui/console.c                   |  7 +++++++
 ui/spice-display.c             | 33 +++++++++++--------------------
 12 files changed, 88 insertions(+), 38 deletions(-)

--=20
2.27.0




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PULL 1/9] virtio-gpu-3d: fix abnormal display after a warm reboot
  2020-09-29  9:57 [PULL 0/9] Vga 20200929 patches Gerd Hoffmann
@ 2020-09-29  9:57 ` Gerd Hoffmann
  2020-09-29  9:57 ` [PULL 2/9] edid: fix physical display size computation Gerd Hoffmann
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Gerd Hoffmann @ 2020-09-29  9:57 UTC (permalink / raw)
  To: qemu-devel
  Cc: Guoqing Zhang, Michael S. Tsirkin, qemu-ppc, Gerd Hoffmann,
	David Gibson, Qi Liu

From: Guoqing Zhang <zhangguoqing.kernel@bytedance.com>

When resetting virtio-gpu, virgl_renderer_reset() should be
called to ensure that the virglrenderer status is correct.

Signed-off-by: Guoqing Zhang <zhangguoqing.kernel@bytedance.com>
Reviewed-by: Qi Liu<liuqi.16@bytedance.com>
Message-id: 20200918111632.37354-1-zhangguoqing.kernel@bytedance.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/display/virtio-gpu-3d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
index 96621576c222..1bd33d7aedc6 100644
--- a/hw/display/virtio-gpu-3d.c
+++ b/hw/display/virtio-gpu-3d.c
@@ -595,7 +595,7 @@ void virtio_gpu_virgl_reset(VirtIOGPU *g)
 {
     int i;
 
-    /* virgl_renderer_reset() ??? */
+    virgl_renderer_reset();
     for (i = 0; i < g->parent_obj.conf.max_outputs; i++) {
         if (i != 0) {
             dpy_gfx_replace_surface(g->parent_obj.scanout[i].con, NULL);
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 2/9] edid: fix physical display size computation
  2020-09-29  9:57 [PULL 0/9] Vga 20200929 patches Gerd Hoffmann
  2020-09-29  9:57 ` [PULL 1/9] virtio-gpu-3d: fix abnormal display after a warm reboot Gerd Hoffmann
@ 2020-09-29  9:57 ` Gerd Hoffmann
  2020-09-29  9:57 ` [PULL 3/9] edid: use physical dimensions if available Gerd Hoffmann
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Gerd Hoffmann @ 2020-09-29  9:57 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, David Gibson, qemu-ppc, Gerd Hoffmann,
	Michael S. Tsirkin

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Divide the resolution by the DPI, and multiply to mm.

Note the computation done for edid[21/22] is correct (in cm).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20200927145751.365446-2-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/display/edid-generate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/display/edid-generate.c b/hw/display/edid-generate.c
index e58472fde501..618c74e1df39 100644
--- a/hw/display/edid-generate.c
+++ b/hw/display/edid-generate.c
@@ -208,8 +208,8 @@ static void edid_desc_timing(uint8_t *desc,
                              uint32_t dpi)
 {
     /* physical display size */
-    uint32_t xmm = xres * dpi / 254;
-    uint32_t ymm = yres * dpi / 254;
+    uint32_t xmm = xres * 254 / 10 / dpi;
+    uint32_t ymm = yres * 254 / 10 / dpi;
 
     /* pull some realistic looking timings out of thin air */
     uint32_t xfront = xres * 25 / 100;
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 3/9] edid: use physical dimensions if available
  2020-09-29  9:57 [PULL 0/9] Vga 20200929 patches Gerd Hoffmann
  2020-09-29  9:57 ` [PULL 1/9] virtio-gpu-3d: fix abnormal display after a warm reboot Gerd Hoffmann
  2020-09-29  9:57 ` [PULL 2/9] edid: fix physical display size computation Gerd Hoffmann
@ 2020-09-29  9:57 ` Gerd Hoffmann
  2020-09-29  9:57 ` [PULL 4/9] ui: add getter for UIInfo Gerd Hoffmann
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Gerd Hoffmann @ 2020-09-29  9:57 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, David Gibson, qemu-ppc, Gerd Hoffmann,
	Michael S. Tsirkin

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Replace dpi with width_mm/height_mm in qemu_edid_info.

Use it when set (non-zero) to compute the DPI and generate the EDID.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20200927145751.365446-3-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/hw/display/edid.h  |  5 ++++-
 hw/display/edid-generate.c | 36 +++++++++++++++++++++++++-----------
 qemu-edid.c                | 11 +++++++++--
 3 files changed, 38 insertions(+), 14 deletions(-)

diff --git a/include/hw/display/edid.h b/include/hw/display/edid.h
index 5b1de57f24f9..1f8fc9b37500 100644
--- a/include/hw/display/edid.h
+++ b/include/hw/display/edid.h
@@ -5,7 +5,8 @@ typedef struct qemu_edid_info {
     const char *vendor; /* http://www.uefi.org/pnp_id_list */
     const char *name;
     const char *serial;
-    uint32_t    dpi;
+    uint16_t    width_mm;
+    uint16_t    height_mm;
     uint32_t    prefx;
     uint32_t    prefy;
     uint32_t    maxx;
@@ -18,6 +19,8 @@ size_t qemu_edid_size(uint8_t *edid);
 void qemu_edid_region_io(MemoryRegion *region, Object *owner,
                          uint8_t *edid, size_t size);
 
+uint32_t qemu_edid_dpi_to_mm(uint32_t dpi, uint32_t res);
+
 #define DEFINE_EDID_PROPERTIES(_state, _edid_info)              \
     DEFINE_PROP_UINT32("xres", _state, _edid_info.prefx, 0),    \
     DEFINE_PROP_UINT32("yres", _state, _edid_info.prefy, 0),    \
diff --git a/hw/display/edid-generate.c b/hw/display/edid-generate.c
index 618c74e1df39..1665b7cbb29a 100644
--- a/hw/display/edid-generate.c
+++ b/hw/display/edid-generate.c
@@ -205,12 +205,8 @@ static void edid_desc_dummy(uint8_t *desc)
 
 static void edid_desc_timing(uint8_t *desc,
                              uint32_t xres, uint32_t yres,
-                             uint32_t dpi)
+                             uint32_t xmm, uint32_t ymm)
 {
-    /* physical display size */
-    uint32_t xmm = xres * 254 / 10 / dpi;
-    uint32_t ymm = yres * 254 / 10 / dpi;
-
     /* pull some realistic looking timings out of thin air */
     uint32_t xfront = xres * 25 / 100;
     uint32_t xsync  = xres *  3 / 100;
@@ -290,12 +286,24 @@ static void edid_colorspace(uint8_t *edid,
     edid[34] = white_y >> 2;
 }
 
+static uint32_t qemu_edid_dpi_from_mm(uint32_t mm, uint32_t res)
+{
+    return res * 254 / 10 / mm;
+}
+
+uint32_t qemu_edid_dpi_to_mm(uint32_t dpi, uint32_t res)
+{
+    return res * 254 / 10 / dpi;
+}
+
 void qemu_edid_generate(uint8_t *edid, size_t size,
                         qemu_edid_info *info)
 {
     uint32_t desc = 54;
     uint8_t *xtra3 = NULL;
     uint8_t *dta = NULL;
+    uint32_t width_mm, height_mm;
+    uint32_t dpi = 100; /* if no width_mm/height_mm */
 
     /* =============== set defaults  =============== */
 
@@ -305,15 +313,20 @@ void qemu_edid_generate(uint8_t *edid, size_t size,
     if (!info->name) {
         info->name = "QEMU Monitor";
     }
-    if (!info->dpi) {
-        info->dpi = 100;
-    }
     if (!info->prefx) {
         info->prefx = 1024;
     }
     if (!info->prefy) {
         info->prefy = 768;
     }
+    if (info->width_mm && info->height_mm) {
+        width_mm = info->width_mm;
+        height_mm = info->height_mm;
+        dpi = qemu_edid_dpi_from_mm(width_mm, info->prefx);
+    } else {
+        width_mm = qemu_edid_dpi_to_mm(dpi, info->prefx);
+        height_mm = qemu_edid_dpi_to_mm(dpi, info->prefy);
+    }
 
     /* =============== extensions  =============== */
 
@@ -360,8 +373,8 @@ void qemu_edid_generate(uint8_t *edid, size_t size,
     edid[20] = 0xa5;
 
     /* screen size: undefined */
-    edid[21] = info->prefx * 254 / 100 / info->dpi;
-    edid[22] = info->prefy * 254 / 100 / info->dpi;
+    edid[21] = width_mm / 10;
+    edid[22] = height_mm / 10;
 
     /* display gamma: 2.2 */
     edid[23] = 220 - 100;
@@ -387,7 +400,8 @@ void qemu_edid_generate(uint8_t *edid, size_t size,
 
     /* =============== descriptor blocks =============== */
 
-    edid_desc_timing(edid + desc, info->prefx, info->prefy, info->dpi);
+    edid_desc_timing(edid + desc, info->prefx, info->prefy,
+                     width_mm, height_mm);
     desc += 18;
 
     edid_desc_ranges(edid + desc);
diff --git a/qemu-edid.c b/qemu-edid.c
index 46eef7049803..1db3372b982c 100644
--- a/qemu-edid.c
+++ b/qemu-edid.c
@@ -9,7 +9,10 @@
 #include "qemu/cutils.h"
 #include "hw/display/edid.h"
 
-static qemu_edid_info info;
+static qemu_edid_info info = (qemu_edid_info) {
+    .prefx = 1024,
+    .prefy = 768,
+};
 
 static void usage(FILE *out)
 {
@@ -39,6 +42,7 @@ int main(int argc, char *argv[])
 {
     FILE *outfile = NULL;
     uint8_t blob[256];
+    uint32_t dpi = 100;
     int rc;
 
     for (;;) {
@@ -83,7 +87,7 @@ int main(int argc, char *argv[])
             }
             break;
         case 'd':
-            if (qemu_strtoui(optarg, NULL, 10, &info.dpi) < 0) {
+            if (qemu_strtoui(optarg, NULL, 10, &dpi) < 0) {
                 fprintf(stderr, "not a number: %s\n", optarg);
                 exit(1);
             }
@@ -110,6 +114,9 @@ int main(int argc, char *argv[])
         outfile = stdout;
     }
 
+    info.width_mm = qemu_edid_dpi_to_mm(dpi, info.prefx);
+    info.height_mm = qemu_edid_dpi_to_mm(dpi, info.prefy);
+
     memset(blob, 0, sizeof(blob));
     qemu_edid_generate(blob, sizeof(blob), &info);
     fwrite(blob, sizeof(blob), 1, outfile);
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 4/9] ui: add getter for UIInfo
  2020-09-29  9:57 [PULL 0/9] Vga 20200929 patches Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2020-09-29  9:57 ` [PULL 3/9] edid: use physical dimensions if available Gerd Hoffmann
@ 2020-09-29  9:57 ` Gerd Hoffmann
  2020-09-29  9:57 ` [PULL 5/9] spice: remove the single monitor config logic Gerd Hoffmann
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Gerd Hoffmann @ 2020-09-29  9:57 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, David Gibson, qemu-ppc, Gerd Hoffmann,
	Michael S. Tsirkin

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The following patch is going to introduce extra fields / details to
UIInfo. Add a getter and keep the current values, instead of memset(0)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20200927145751.365446-4-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/ui/console.h | 1 +
 ui/console.c         | 7 +++++++
 ui/spice-display.c   | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index 79e301f946c7..353d2e49a1b2 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -264,6 +264,7 @@ void update_displaychangelistener(DisplayChangeListener *dcl,
 void unregister_displaychangelistener(DisplayChangeListener *dcl);
 
 bool dpy_ui_info_supported(QemuConsole *con);
+const QemuUIInfo *dpy_get_ui_info(const QemuConsole *con);
 int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info);
 
 void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h);
diff --git a/ui/console.c b/ui/console.c
index 7592c3c324ff..54a74c0b16c9 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1516,6 +1516,13 @@ bool dpy_ui_info_supported(QemuConsole *con)
     return con->hw_ops->ui_info != NULL;
 }
 
+const QemuUIInfo *dpy_get_ui_info(const QemuConsole *con)
+{
+    assert(con != NULL);
+
+    return &con->ui_info;
+}
+
 int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info)
 {
     assert(con != NULL);
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 19632fdf6c16..625d9232b95a 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -672,7 +672,7 @@ static int interface_client_monitors_config(QXLInstance *sin,
         return 1;
     }
 
-    memset(&info, 0, sizeof(info));
+    info = *dpy_get_ui_info(ssd->dcl.con);
 
     if (mc->num_of_monitors == 1) {
         /*
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 5/9] spice: remove the single monitor config logic
  2020-09-29  9:57 [PULL 0/9] Vga 20200929 patches Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2020-09-29  9:57 ` [PULL 4/9] ui: add getter for UIInfo Gerd Hoffmann
@ 2020-09-29  9:57 ` Gerd Hoffmann
  2020-09-29  9:57 ` [PULL 6/9] spice: get monitors physical dimension Gerd Hoffmann
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Gerd Hoffmann @ 2020-09-29  9:57 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, David Gibson, qemu-ppc, Gerd Hoffmann,
	Michael S. Tsirkin

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Introduced in commit 9c956e646178fee8c14ce7dfae5a9d7cb901876c ("spice:
prepare for upcoming spice-server change"), the new logic never
materialized in the spice server source tree. Let's remove it for now,
until it actually changes in Spice.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20200927145751.365446-5-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-display.c | 26 ++++----------------------
 1 file changed, 4 insertions(+), 22 deletions(-)

diff --git a/ui/spice-display.c b/ui/spice-display.c
index 625d9232b95a..b304c13149a8 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -674,28 +674,10 @@ static int interface_client_monitors_config(QXLInstance *sin,
 
     info = *dpy_get_ui_info(ssd->dcl.con);
 
-    if (mc->num_of_monitors == 1) {
-        /*
-         * New spice-server version which filters the list of monitors
-         * to only include those that belong to our display channel.
-         *
-         * single-head configuration (where filtering doesn't matter)
-         * takes this code path too.
-         */
-        info.width  = mc->monitors[0].width;
-        info.height = mc->monitors[0].height;
-    } else {
-        /*
-         * Old spice-server which gives us all monitors, so we have to
-         * figure ourself which entry we need.  Array index is the
-         * channel_id, which is the qemu console index, see
-         * qemu_spice_add_display_interface().
-         */
-        head = qemu_console_get_index(ssd->dcl.con);
-        if (mc->num_of_monitors > head) {
-            info.width  = mc->monitors[head].width;
-            info.height = mc->monitors[head].height;
-        }
+    head = qemu_console_get_index(ssd->dcl.con);
+    if (mc->num_of_monitors > head) {
+        info.width  = mc->monitors[head].width;
+        info.height = mc->monitors[head].height;
     }
 
     trace_qemu_spice_ui_info(ssd->qxl.id, info.width, info.height);
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 6/9] spice: get monitors physical dimension
  2020-09-29  9:57 [PULL 0/9] Vga 20200929 patches Gerd Hoffmann
                   ` (4 preceding siblings ...)
  2020-09-29  9:57 ` [PULL 5/9] spice: remove the single monitor config logic Gerd Hoffmann
@ 2020-09-29  9:57 ` Gerd Hoffmann
  2020-09-29  9:57 ` [PULL 7/9] virtio-gpu: set physical dimensions for EDID Gerd Hoffmann
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Gerd Hoffmann @ 2020-09-29  9:57 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, David Gibson, qemu-ppc, Gerd Hoffmann,
	Michael S. Tsirkin

From: Marc-André Lureau <marcandre.lureau@redhat.com>

With upcoming Spice server version 0.14.4, the monitor configuration can
contain additional fields for the monitor physical dimensions.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20200927145751.365446-6-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/ui/console.h | 3 +++
 ui/spice-display.c   | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/include/ui/console.h b/include/ui/console.h
index 353d2e49a1b2..e7303d8b98a8 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -119,6 +119,9 @@ typedef struct DisplaySurface {
 } DisplaySurface;
 
 typedef struct QemuUIInfo {
+    /* physical dimension */
+    uint16_t width_mm;
+    uint16_t height_mm;
     /* geometry */
     int       xoff;
     int       yoff;
diff --git a/ui/spice-display.c b/ui/spice-display.c
index b304c13149a8..0178d5766d2c 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -678,6 +678,13 @@ static int interface_client_monitors_config(QXLInstance *sin,
     if (mc->num_of_monitors > head) {
         info.width  = mc->monitors[head].width;
         info.height = mc->monitors[head].height;
+#if SPICE_SERVER_VERSION >= 0x000e04 /* release 0.14.4 */
+        if (mc->flags & VD_AGENT_CONFIG_MONITORS_FLAG_PHYSICAL_SIZE) {
+            VDAgentMonitorMM *mm = (void *)&mc->monitors[mc->num_of_monitors];
+            info.width_mm = mm[head].width;
+            info.height_mm = mm[head].height;
+        }
+#endif
     }
 
     trace_qemu_spice_ui_info(ssd->qxl.id, info.width, info.height);
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 7/9] virtio-gpu: set physical dimensions for EDID
  2020-09-29  9:57 [PULL 0/9] Vga 20200929 patches Gerd Hoffmann
                   ` (5 preceding siblings ...)
  2020-09-29  9:57 ` [PULL 6/9] spice: get monitors physical dimension Gerd Hoffmann
@ 2020-09-29  9:57 ` Gerd Hoffmann
  2020-09-29  9:57 ` [PULL 8/9] virtio-vga: implement big-endian-framebuffer property Gerd Hoffmann
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Gerd Hoffmann @ 2020-09-29  9:57 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, David Gibson, qemu-ppc, Gerd Hoffmann,
	Michael S. Tsirkin

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20200927145751.365446-7-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/hw/virtio/virtio-gpu.h | 1 +
 hw/display/virtio-gpu-base.c   | 2 ++
 hw/display/virtio-gpu.c        | 2 ++
 3 files changed, 5 insertions(+)

diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h
index 455e0a743350..1aed7275c824 100644
--- a/include/hw/virtio/virtio-gpu.h
+++ b/include/hw/virtio/virtio-gpu.h
@@ -62,6 +62,7 @@ struct virtio_gpu_scanout {
 };
 
 struct virtio_gpu_requested_state {
+    uint16_t width_mm, height_mm;
     uint32_t width, height;
     int x, y;
 };
diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c
index aeb87235420a..40ccd00f9421 100644
--- a/hw/display/virtio-gpu-base.c
+++ b/hw/display/virtio-gpu-base.c
@@ -82,6 +82,8 @@ static int virtio_gpu_ui_info(void *opaque, uint32_t idx, QemuUIInfo *info)
     g->req_state[idx].y = info->yoff;
     g->req_state[idx].width = info->width;
     g->req_state[idx].height = info->height;
+    g->req_state[idx].width_mm = info->width_mm;
+    g->req_state[idx].height_mm = info->height_mm;
 
     if (info->width && info->height) {
         g->enabled_output_bitmask |= (1 << idx);
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 90be4e3ed719..f3b71fa9c7c3 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -212,6 +212,8 @@ virtio_gpu_generate_edid(VirtIOGPU *g, int scanout,
 {
     VirtIOGPUBase *b = VIRTIO_GPU_BASE(g);
     qemu_edid_info info = {
+        .width_mm = b->req_state[scanout].width_mm,
+        .height_mm = b->req_state[scanout].height_mm,
         .prefx = b->req_state[scanout].width,
         .prefy = b->req_state[scanout].height,
     };
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 8/9] virtio-vga: implement big-endian-framebuffer property
  2020-09-29  9:57 [PULL 0/9] Vga 20200929 patches Gerd Hoffmann
                   ` (6 preceding siblings ...)
  2020-09-29  9:57 ` [PULL 7/9] virtio-gpu: set physical dimensions for EDID Gerd Hoffmann
@ 2020-09-29  9:57 ` Gerd Hoffmann
  2020-09-29  9:57 ` [PULL 9/9] ppc/pseries: enable big-endian-framebuffer quirk for bochs-display and virtio-vga Gerd Hoffmann
  2020-09-29 12:18 ` [PULL 0/9] Vga 20200929 patches Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Gerd Hoffmann @ 2020-09-29  9:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: David Gibson, qemu-ppc, Gerd Hoffmann, Michael S. Tsirkin

Allows to switch the (vga mode) framebuffer into bigendian mode
by setting the property, simliar to stdvga.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20200928085335.21961-2-kraxel@redhat.com
---
 hw/display/virtio-vga.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index f9410a0c2e61..81f776ee36e7 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -168,6 +168,20 @@ static void virtio_vga_base_reset(DeviceState *dev)
     vga_dirty_log_start(&vvga->vga);
 }
 
+static bool virtio_vga_get_big_endian_fb(Object *obj, Error **errp)
+{
+    VirtIOVGABase *d = VIRTIO_VGA_BASE(obj);
+
+    return d->vga.big_endian_fb;
+}
+
+static void virtio_vga_set_big_endian_fb(Object *obj, bool value, Error **errp)
+{
+    VirtIOVGABase *d = VIRTIO_VGA_BASE(obj);
+
+    d->vga.big_endian_fb = value;
+}
+
 static Property virtio_vga_base_properties[] = {
     DEFINE_VIRTIO_GPU_PCI_PROPERTIES(VirtIOPCIProxy),
     DEFINE_PROP_END_OF_LIST(),
@@ -190,6 +204,11 @@ static void virtio_vga_base_class_init(ObjectClass *klass, void *data)
     k->realize = virtio_vga_base_realize;
     pcidev_k->romfile = "vgabios-virtio.bin";
     pcidev_k->class_id = PCI_CLASS_DISPLAY_VGA;
+
+    /* Expose framebuffer byteorder via QOM */
+    object_class_property_add_bool(klass, "big-endian-framebuffer",
+                                   virtio_vga_get_big_endian_fb,
+                                   virtio_vga_set_big_endian_fb);
 }
 
 static TypeInfo virtio_vga_base_info = {
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 9/9] ppc/pseries: enable big-endian-framebuffer quirk for bochs-display and virtio-vga
  2020-09-29  9:57 [PULL 0/9] Vga 20200929 patches Gerd Hoffmann
                   ` (7 preceding siblings ...)
  2020-09-29  9:57 ` [PULL 8/9] virtio-vga: implement big-endian-framebuffer property Gerd Hoffmann
@ 2020-09-29  9:57 ` Gerd Hoffmann
  2020-09-29 12:18 ` [PULL 0/9] Vga 20200929 patches Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Gerd Hoffmann @ 2020-09-29  9:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: David Gibson, qemu-ppc, Gerd Hoffmann, Michael S. Tsirkin

Already done for stdvga and secondary-vga, bochs-display and virtio-vga
support the big-endian-framebuffer property too.  Fixes blue console
background at boot (offb firmware console).

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1881912
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20200928085335.21961-3-kraxel@redhat.com
---
 hw/ppc/spapr_pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 4d97ff6c70f2..5db912b48c41 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -2464,7 +2464,9 @@ static int spapr_switch_one_vga(DeviceState *dev, void *opaque)
     bool be = *(bool *)opaque;
 
     if (object_dynamic_cast(OBJECT(dev), "VGA")
-        || object_dynamic_cast(OBJECT(dev), "secondary-vga")) {
+        || object_dynamic_cast(OBJECT(dev), "secondary-vga")
+        || object_dynamic_cast(OBJECT(dev), "bochs-display")
+        || object_dynamic_cast(OBJECT(dev), "virtio-vga")) {
         object_property_set_bool(OBJECT(dev), "big-endian-framebuffer", be,
                                  &error_abort);
     }
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PULL 0/9] Vga 20200929 patches
  2020-09-29  9:57 [PULL 0/9] Vga 20200929 patches Gerd Hoffmann
                   ` (8 preceding siblings ...)
  2020-09-29  9:57 ` [PULL 9/9] ppc/pseries: enable big-endian-framebuffer quirk for bochs-display and virtio-vga Gerd Hoffmann
@ 2020-09-29 12:18 ` Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2020-09-29 12:18 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Michael S. Tsirkin, qemu-ppc, QEMU Developers, David Gibson

On Tue, 29 Sep 2020 at 10:59, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> The following changes since commit 74504514b154ebebdff577d88e4bf5c13074e9ed:
>
>   Merge remote-tracking branch 'remotes/alistair/tags/pull-register-20200927'=
>  into staging (2020-09-28 16:49:10 +0100)
>
> are available in the Git repository at:
>
>   git://git.kraxel.org/qemu tags/vga-20200929-pull-request
>
> for you to fetch changes up to 97a0530bb71fb96468f218b622cd840e2c667bf6:
>
>   ppc/pseries: enable big-endian-framebuffer quirk for bochs-display and virt=
> io-vga (2020-09-29 10:08:25 +0200)
>
> ----------------------------------------------------------------
> virtio-vga: reset fix, bigendian fix.
> virtio-vga+spice: set monitor dimension via edid.
>


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.2
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-09-29 12:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-29  9:57 [PULL 0/9] Vga 20200929 patches Gerd Hoffmann
2020-09-29  9:57 ` [PULL 1/9] virtio-gpu-3d: fix abnormal display after a warm reboot Gerd Hoffmann
2020-09-29  9:57 ` [PULL 2/9] edid: fix physical display size computation Gerd Hoffmann
2020-09-29  9:57 ` [PULL 3/9] edid: use physical dimensions if available Gerd Hoffmann
2020-09-29  9:57 ` [PULL 4/9] ui: add getter for UIInfo Gerd Hoffmann
2020-09-29  9:57 ` [PULL 5/9] spice: remove the single monitor config logic Gerd Hoffmann
2020-09-29  9:57 ` [PULL 6/9] spice: get monitors physical dimension Gerd Hoffmann
2020-09-29  9:57 ` [PULL 7/9] virtio-gpu: set physical dimensions for EDID Gerd Hoffmann
2020-09-29  9:57 ` [PULL 8/9] virtio-vga: implement big-endian-framebuffer property Gerd Hoffmann
2020-09-29  9:57 ` [PULL 9/9] ppc/pseries: enable big-endian-framebuffer quirk for bochs-display and virtio-vga Gerd Hoffmann
2020-09-29 12:18 ` [PULL 0/9] Vga 20200929 patches Peter Maydell

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).