Merge lp:~kaihengfeng/unity-settings-daemon/lp1683445 into lp:unity-settings-daemon

Proposed by Kai-Heng Feng
Status: Merged
Merged at revision: 4182
Proposed branch: lp:~kaihengfeng/unity-settings-daemon/lp1683445
Merge into: lp:unity-settings-daemon
Diff against target: 53 lines (+35/-1)
1 file modified
plugins/power/gsd-backlight-linux.c (+35/-1)
To merge this branch: bzr merge lp:~kaihengfeng/unity-settings-daemon/lp1683445
Reviewer Review Type Date Requested Status
Robert Ancell Approve
Review via email: mp+323833@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Hi, this is still an issue for Unity users.
Can someone review this MP?

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Another gentle ping...

Revision history for this message
Robert Ancell (robert-ancell) wrote :

I'm not familiar with this code but the patch makes sense to me.

review: Approve
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Does this issue apply to gnome-settings-daemon i.e. for Ubuntu users in 18.04? The g-s-d code seems very different.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

It's already fixed in GSD, and the fix was already back ported for 16.04.

The code should be the same as the GSD one [1].

In addition to Bionic, Xenial and Artful also need this fix.

[1] https://gitlab.gnome.org/GNOME/gnome-settings-daemon/commit/ed7c2744aca1ad0bdd5adb62a8f2b5bdc1eb94b4

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/power/gsd-backlight-linux.c'
--- plugins/power/gsd-backlight-linux.c 2015-11-16 04:51:45 +0000
+++ plugins/power/gsd-backlight-linux.c 2017-05-10 08:46:43 +0000
@@ -41,6 +41,40 @@
41 }41 }
42 return NULL;42 return NULL;
43}43}
44
45/*
46 * Search for a raw backlight interface, raw backlight interfaces registered
47 * by the drm driver will have the drm-connector as their parent, check the
48 * drm-connector's enabled sysfs attribute so that we pick the right LCD-panel
49 * connector on laptops with hybrid-gfx. Fall back to just picking the first
50 * raw backlight interface if no enabled interface is found.
51 */
52static gchar *
53gsd_backlight_helper_get_raw (GList *devices)
54{
55 GUdevDevice *parent;
56 const gchar *attr;
57 GList *d;
58
59 for (d = devices; d != NULL; d = d->next) {
60 attr = g_udev_device_get_sysfs_attr (d->data, "type");
61 if (g_strcmp0 (attr, "raw") != 0)
62 continue;
63
64 parent = g_udev_device_get_parent (d->data);
65 if (!parent)
66 continue;
67
68 attr = g_udev_device_get_sysfs_attr (parent, "enabled");
69 if (!attr || g_strcmp0 (attr, "enabled") != 0)
70 continue;
71
72 return g_strdup (g_udev_device_get_sysfs_path (d->data));
73 }
74
75 return gsd_backlight_helper_get_type (devices, "raw");
76}
77
44#endif /* HAVE_GUDEV */78#endif /* HAVE_GUDEV */
4579
46char *80char *
@@ -70,7 +104,7 @@
70 *type = GSD_BACKLIGHT_TYPE_PLATFORM;104 *type = GSD_BACKLIGHT_TYPE_PLATFORM;
71 goto out;105 goto out;
72 }106 }
73 path = gsd_backlight_helper_get_type (devices, "raw");107 path = gsd_backlight_helper_get_raw (devices);
74 if (path != NULL) {108 if (path != NULL) {
75 if (type)109 if (type)
76 *type = GSD_BACKLIGHT_TYPE_RAW;110 *type = GSD_BACKLIGHT_TYPE_RAW;

Subscribers

People subscribed via source and target branches