Re: [PATCH v3] ui/cocoa: Take refresh rate into account
On Fri, 1 Jul 2022 at 11:11, Gerd Hoffmann wrote: > > On Tue, Jun 21, 2022 at 09:51:38AM +0100, Peter Maydell wrote: > > On Mon, 20 Jun 2022 at 21:29, Akihiko Odaki wrote: > > > > > > Retreieve the refresh rate of the display and reflect it with > > > dpy_set_ui_info() and update_displaychangelistener(), allowing the > > > guest and DisplayChangeListener to consume the information. > > > > But why? What goes wrong if we don't bother to do this? > > Nothing goes wrong. This provides a hint to the guest how often the > display is updated, so the guest has the chance to adapt to that. > When we run 30 Hz display updates on the host side it is pointless for > the guest to update the screen at 60Hz frequency, the guest can spare > some cpu cycles instead. > > [ this should be better explained in the commit message ] Thanks for the explanation. -- PMM
Re: [PATCH v3] ui/cocoa: Take refresh rate into account
On Tue, Jun 21, 2022 at 09:51:38AM +0100, Peter Maydell wrote: > On Mon, 20 Jun 2022 at 21:29, Akihiko Odaki wrote: > > > > Retreieve the refresh rate of the display and reflect it with > > dpy_set_ui_info() and update_displaychangelistener(), allowing the > > guest and DisplayChangeListener to consume the information. > > But why? What goes wrong if we don't bother to do this? Nothing goes wrong. This provides a hint to the guest how often the display is updated, so the guest has the chance to adapt to that. When we run 30 Hz display updates on the host side it is pointless for the guest to update the screen at 60Hz frequency, the guest can spare some cpu cycles instead. [ this should be better explained in the commit message ] take care, Gerd
Re: [PATCH v3] ui/cocoa: Take refresh rate into account
On 2022/06/21 17:51, Peter Maydell wrote: On Mon, 20 Jun 2022 at 21:29, Akihiko Odaki wrote: Retreieve the refresh rate of the display and reflect it with dpy_set_ui_info() and update_displaychangelistener(), allowing the guest and DisplayChangeListener to consume the information. But why? What goes wrong if we don't bother to do this? thanks -- PMM Regarding dpy_set_ui_info(), it depends on the guest. update_displaychangelistener() would change the frequency of the calls of the DisplayChangeListener. I think it is obvious that delivering the refresh rate with dpy_set_ui_info() and update_displaychangelistener() makes sense, considering that those functions actually exist. They shouldn't exist at first place if we don't have to bother to do this. Regards, Akihiko Odaki
Re: [PATCH v3] ui/cocoa: Take refresh rate into account
On Mon, 20 Jun 2022 at 21:29, Akihiko Odaki wrote: > > Retreieve the refresh rate of the display and reflect it with > dpy_set_ui_info() and update_displaychangelistener(), allowing the > guest and DisplayChangeListener to consume the information. But why? What goes wrong if we don't bother to do this? thanks -- PMM