After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711216 - RFC xrandr: use "hotplug_mode_update" property
RFC xrandr: use "hotplug_mode_update" property
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2013-10-31 14:59 UTC by Marc-Andre Lureau
Modified: 2013-11-14 13:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
RFC xrandr: use "hotplug_mode_update" property (5.31 KB, patch)
2013-10-31 14:59 UTC, Marc-Andre Lureau
reviewed Details | Review
RFC xrandr: use "hotplug_mode_update" property (7.80 KB, patch)
2013-11-13 16:24 UTC, Marc-Andre Lureau
committed Details | Review

Description Marc-Andre Lureau 2013-10-31 14:59:10 UTC
Use the "hotplug_mode_update" connector property indicating that the
screen settings should be updated: get a new preferred mode on hotplug
events to handle dynamic guest resizing (where you resize the host
window and the guest resizes with it).
Comment 1 Marc-Andre Lureau 2013-10-31 14:59:13 UTC
Created attachment 258654 [details] [review]
RFC xrandr: use "hotplug_mode_update" property
Comment 2 Marc-Andre Lureau 2013-10-31 14:59:44 UTC
See also comment in https://bugzilla.gnome.org/show_bug.cgi?id=702804#c9
Comment 3 Marc-Andre Lureau 2013-11-07 18:40:23 UTC
btw, the kernel patch for the property is now in drm-next:
 http://cgit.freedesktop.org/~airlied/linux/log/?h=drm-next
Comment 4 Florian Müllner 2013-11-12 15:01:06 UTC
Review of attachment 258654 [details] [review]:

::: src/core/monitor-xrandr.c
@@ +321,3 @@
+  gboolean result = FALSE;
+
+  atom = XInternAtom (manager_xrandr->xdisplay, "hotplug_mode_update", FALSE);

Looks worth caching - can you add it to meta/atomnames.h?

@@ +328,3 @@
+
+  if (info) {
+      result = TRUE;

It's unlikely that drivers start to set the property to anything but TRUE, but something like
  result = info->values[0] == 1
or so still looks more correct to me.

@@ +1039,3 @@
   if (manager_xrandr->resources->timestamp >= manager_xrandr->resources->configTimestamp ||
+      (!hotplug_mode_update &&
+       meta_monitor_config_match_current (manager->config, manager)))

The comment above needs update.

Maybe it is clearer to write this as:

if (meta_monitor_manager_has_hotplug_mode_update (manager))
  {
    meta_monitor_config_make_default (manager->config, manager);
  }
else if (manager_xrandr->resources->timestamp >= ...)

?
Comment 5 Marc-Andre Lureau 2013-11-13 16:23:27 UTC
Review of attachment 258654 [details] [review]:

::: src/core/monitor-xrandr.c
@@ +321,3 @@
+  gboolean result = FALSE;
+
+  atom = XInternAtom (manager_xrandr->xdisplay, "hotplug_mode_update", FALSE);

done

@@ +328,3 @@
+
+  if (info) {
+      result = TRUE;

it's set to 0 in the patch, we could eventually ask Dave to change that quickly, but in general the idea is to use this property as a tag, its value shouldn't be meaningful.

http://cgit.freedesktop.org/~airlied/linux/commit/?h=drm-next&id=4695b03970df378dcb93fe3e7158381f1e980fa2

@@ +1039,3 @@
   if (manager_xrandr->resources->timestamp >= manager_xrandr->resources->configTimestamp ||
+      (!hotplug_mode_update &&
+       meta_monitor_config_match_current (manager->config, manager)))

well, we also want to allow re-configuration with manual xrandr usage or other tools, so the config timestamp check is still necessary. I updated the patch to make the 2 cases easier to read.
Comment 6 Marc-Andre Lureau 2013-11-13 16:24:29 UTC
Created attachment 259742 [details] [review]
RFC xrandr: use "hotplug_mode_update" property

Use the "hotplug_mode_update" connector property indicating that the
screen settings should be updated: get a new preferred mode on hotplug
events to handle dynamic guest resizing (where you resize the host
window and the guest resizes with it).
Comment 7 Florian Müllner 2013-11-14 13:27:08 UTC
Review of attachment 259742 [details] [review]:

OK.