All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Kasireddy, Vivek" <vivek.kasireddy@intel.com>
Cc: "Markus Armbruster" <armbru@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Kim, Dongwon" <dongwon.kim@intel.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Daniel P.Berrangé" <berrange@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH v1 3/3] ui/gtk: Add a new parameter to assign connectors/monitors to GFX VCs
Date: Thu, 22 Sep 2022 06:52:11 +0200	[thread overview]
Message-ID: <875yhg6mf8.fsf@pond.sub.org> (raw)
In-Reply-To: <IA0PR11MB7185C537C33111FCBD2C6F71F84F9@IA0PR11MB7185.namprd11.prod.outlook.com> (Vivek Kasireddy's message of "Wed, 21 Sep 2022 22:21:33 +0000")

"Kasireddy, Vivek" <vivek.kasireddy@intel.com> writes:

> Hi Markus,
>
> Thank you for the review.
>
>> Vivek Kasireddy <vivek.kasireddy@intel.com> writes:
>> 
>> > The new parameter named "connector" can be used to assign physical
>> > monitors/connectors to individual GFX VCs such that when the monitor
>> > is connected or hotplugged, the associated GTK window would be
>> > fullscreened on it. If the monitor is disconnected or unplugged,
>> > the associated GTK window would be destroyed and a relevant
>> > disconnect event would be sent to the Guest.
>> >
>> > Usage: -device virtio-gpu-pci,max_outputs=2,blob=true,xres=1920,yres=1080...
>> >        -display gtk,gl=on,connector.0=eDP-1,connector.1=DP-1.....
>> >
>> > Cc: Dongwon Kim <dongwon.kim@intel.com>
>> > Cc: Gerd Hoffmann <kraxel@redhat.com>
>> > Cc: Daniel P. Berrangé <berrange@redhat.com>
>> > Cc: Markus Armbruster <armbru@redhat.com>
>> > Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> > Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
>> > Cc: Thomas Huth <thuth@redhat.com>
>> > Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
>> > ---
>> >  qapi/ui.json    |   9 ++-
>> >  qemu-options.hx |   1 +
>> >  ui/gtk.c        | 168 ++++++++++++++++++++++++++++++++++++++++++++++++
>> >  3 files changed, 177 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/qapi/ui.json b/qapi/ui.json
>> > index 286c5731d1..86787a4c95 100644
>> > --- a/qapi/ui.json
>> > +++ b/qapi/ui.json
>> > @@ -1199,13 +1199,20 @@
>> >  #               interfaces (e.g. VGA and virtual console character devices)
>> >  #               by default.
>> >  #               Since 7.1
>> > +# @connector:   List of physical monitor/connector names where the GTK windows
>> > +#               containing the respective graphics virtual consoles (VCs) are
>> > +#               to be placed. If a mapping exists for a VC, it will be
>> > +#               fullscreened on that specific monitor or else it would not be
>> > +#               displayed anywhere and would appear disconnected to the guest.
>> 
>> Let's see whether I understand this...  We have VCs numbered 0, 1, ...
>> VC #i is mapped to the i-th element of @connector, counting from zero.
>> Correct?
>
> [Kasireddy, Vivek] Yes, correct.
>
>> Ignorant question: what's a "physical monitor/connector name"?
>
> [Kasireddy, Vivek] IIUC, while the HDMI/DP protocols refer to a receiver (RX)
> as a "sink", the DRM Graphics subsystem in the kernel uses the term "connector"
> and the GTK library prefers the term "monitor".

Awesome.

>                                                 All of these terms can be
> used interchangeably but I chose the term connector for the new parameter
> after debating between connector, monitor, output, etc. 

Okay.

> The connector name (e.g. DP-1, HDMI-A-2, etc) uniquely identifies a connector
> or a monitor on any given system:
> https://elixir.bootlin.com/linux/v6.0-rc6/source/include/drm/drm_connector.h#L1328
> If you are on Intel hardware, you can find more info related to connectors by doing:
> cat /sys/kernel/debug/dri/0/i915_display_info

Thanks!

>> Would you mind breaking the lines a bit earlier, between column 70 and
>> 75?
>
> [Kasireddy, Vivek] Np, will do that.
>
>> 
>> > +#               Since 7.2
>> >  #
>> >  # Since: 2.12
>> >  ##
>> >  { 'struct'  : 'DisplayGTK',
>> >    'data'    : { '*grab-on-hover' : 'bool',
>> >                  '*zoom-to-fit'   : 'bool',
>> > -                '*show-tabs'     : 'bool'  } }
>> > +                '*show-tabs'     : 'bool',
>> > +                '*connector'     : ['str']  } }
>> >
>> >  ##
>> >  # @DisplayEGLHeadless:

Elsewhere in ui.json, names of list-valued members use plural: channels,
clients, keys, addresses.  Let's name this one connectors for
consistency.

With that, QAPI schema
Acked-by: Markus Armbruster <armbru@redhat.com>

>> > diff --git a/qemu-options.hx b/qemu-options.hx
>> > index 31c04f7eea..576b65ef9f 100644
>> > --- a/qemu-options.hx
>> > +++ b/qemu-options.hx
>> > @@ -1945,6 +1945,7 @@ DEF("display", HAS_ARG, QEMU_OPTION_display,
>> >  #if defined(CONFIG_GTK)
>> >      "-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n"
>> >      "            [,show-tabs=on|off][,show-cursor=on|off][,window-close=on|off]\n"
>> > +    "            [,connector.<id of VC>=<connector name>]\n"
>> 
>> Is "<id of VC>" a VC number?
>
> [Kasireddy, Vivek] Yes.

An "id" is commonly a name.  Suggest connector.<index>.


>> >  #endif
>> >  #if defined(CONFIG_VNC)
>> >      "-display vnc=<display>[,<optargs>]\n"

A bit of documentation is missing:

              ``show-cursor=on|off`` :  Force showing the mouse cursor

              ``window-close=on|off`` : Allow to quit qemu with window close button
     +        ``connector.<index>`` : <explanation>

          ``curses[,charset=<encoding>]``

>> 
>> Remainder of my review is on style only.  Style suggestions are not
>> demands :)
>
> [Kasireddy, Vivek] No problem; most of your suggestions are sensible
> and I'll include them all in v2. 

Thanks!



  reply	other threads:[~2022-09-22  4:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17  0:07 [PATCH v1 0/3] ui/gtk: Add a new parameter to assign connectors/monitors to Guests' windows Vivek Kasireddy
2022-09-17  0:07 ` [PATCH v1 1/3] ui/gtk: Disable the scanout when a detached tab is closed Vivek Kasireddy
2022-09-17  0:07 ` [PATCH v1 2/3] ui/gtk: Factor out tab window creation into a separate function Vivek Kasireddy
2022-09-17  0:07 ` [PATCH v1 3/3] ui/gtk: Add a new parameter to assign connectors/monitors to GFX VCs Vivek Kasireddy
2022-09-21 14:27   ` Markus Armbruster
2022-09-21 22:21     ` Kasireddy, Vivek
2022-09-22  4:52       ` Markus Armbruster [this message]
2022-09-20 15:04 ` [PATCH v1 0/3] ui/gtk: Add a new parameter to assign connectors/monitors to Guests' windows Markus Armbruster
2022-09-20 20:48   ` Kasireddy, Vivek
2022-09-21  6:06     ` Markus Armbruster
2022-09-28 23:29       ` Kim, Dongwon
2022-09-29  5:00         ` Markus Armbruster

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=875yhg6mf8.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dongwon.kim@intel.com \
    --cc=f4bug@amsat.org \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=vivek.kasireddy@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.