> On 10 Aug 2018, at 12:56, Gerd Hoffmann <kra...@redhat.com> wrote:
>
> Hi,
>
>> + case SVGA_REG_DISPLAY_WIDTH:
>> + if ((s->display_id == 0) || (s->display_id == SVGA_ID_INVALID))
>> + ret = s->new_width ? s->new_width : surface_width(surface);
>> + else
>> + ret = 0;
>> + break;
>> + case SVGA_REG_DISPLAY_HEIGHT:
>> + if ((s->display_id == 0) || (s->display_id == SVGA_ID_INVALID))
>> + ret = s->new_height ? s->new_height : surface_height(surface);
>> + else
>> + ret = 0;
>> + break;
>
> What is the purpose of these registers? Hint for the guest about the
> host display size? If so you probably want wire up a callback for
> GraphicHwOps->ui_info. This will be called on display changes (i.e.
> user resizes qemu gtk window). See virtio_gpu_ui_info() for an example.
>
> cheers,
> Gerd
>
These registers are suppose to indicate to guest the display monitor size
(width & height).
When the QEMU console framework timer will run gui_update()->dpy_refresh()->VNC
dpy_refresh()->graphics_hw_update()->VMware-SVGA gfx_update()
Then vmsvga_update_display()->vmsvga_check_size() makes sure that host display
surface is set to have width/height as specified in vmsvga_state_s->{new_width,
new_height}.
Therefore, if new_width have been set, then host display will be changed to the
value set by the guest.
Thus, wiring up GraphicsHwOps->ui_info callback to return new info on
SVGA_REG_DISPLAY_{WIDTH, HEIGHT} registers may be useful only for case that we
want guest to respond to the fact that the host display have been resized.
However, I am not sure there is a mechanism to notify guest from vmware-svga
device that this even has occurred for guest to reread these registers. Both in
Linux vmware-svga driver code and VMware SVGA development kit, the
SVGA_IRQFLAG_* flags don’t indicate such an interrupt source. In addition, it
seems that Linux vmware-svga driver code only reads these registers at
vmw_kms_save_vga() which weirdly enough, seems to be unreachable code (not
called from anywhere…).
Therefore, I’m not sure it is important to do this change at this patch series.
But I am not 100% familiar with the entire QEMU graphics stack so maybe I’m
missing something trivial here.
Regards,
-Liran