diff options
author | Matthew Garrett <mjg@redhat.com> | 2010-09-09 18:19:10 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2010-09-09 18:19:10 -0400 |
commit | 29273d4838e8fe19703b1988fbf5e550bd0d3a8f (patch) | |
tree | 6419ac64b49f057c033e7368943e915c19d6faaf | |
parent | 0cdba834f5049ff3c827815a2c2e9fac40675151 (diff) |
Require gpu-level backlight control for external displays.
This may change in future if we work out how to tie ACPI to DRM and
see any examples of external backlight control via ACPI. I kind of
doubt it, though.
-rw-r--r-- | libbacklight.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/libbacklight.c b/libbacklight.c index e6715b1..767005c 100644 --- a/libbacklight.c +++ b/libbacklight.c @@ -3,25 +3,29 @@ #include <libbacklight.h> #include <stdio.h> #include <sys/types.h> +#include <linux/types.h> #include <dirent.h> #include <sys/stat.h> +#include <drm/drm_mode.h> #include <fcntl.h> #include <malloc.h> #include <string.h> -static const char *output_names[] = { "None", +static const char *output_names[] = { "Unknown", "VGA", - "DVI", - "DVI", - "DVI", + "DVI-I", + "DVI-D", + "DVI-A", "Composite", - "TV", + "SVIDEO", "LVDS", - "CTV", - "DIN", - "DP", - "HDMI", - "HDMI", + "Component", + "9-pin DIN", + "DisplayPort" + "HDMI Type A", + "HDMI Type B", + "TV", + "Embedded DisplayPort" }; static long backlight_get(struct backlight *backlight, char *node) @@ -178,6 +182,15 @@ struct backlight *backlight_init(struct pci_device *dev, int card, goto out; free (path); + + if (connector_type != DRM_MODE_CONNECTOR_LVDS && + connector_type != DRM_MODE_CONNECTOR_eDP) { + /* External displays are assumed to require + gpu control at the moment */ + if (entry_type != BACKLIGHT_RAW) + continue; + } + asprintf(&path, "%s/%s", backlight_path, "device"); ret = readlink(path, buffer, sizeof(buffer)); |