summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2016-10-18 16:10:19 +0200
committerAdam Jackson <ajax@redhat.com>2016-10-26 12:40:23 -0400
commit4aaeeda4774397dd6d80aa240ca623ae795ec5dc (patch)
tree054dae59896168544f311c6d89a79ebd09b598a4
parent7d91063aca4e4d326c294e246bc2dc36cb05318e (diff)
xfree86: Xorg.wrap: Do not require root rights for cards with 0 outputs
Prior to this commit the Xorg.wrap code to detect if root rights are necessary checked for DRM_IOCTL_MODE_GETRESOURCES succeeding *and* reporting more then 0 output connectors. DRM_IOCTL_MODE_GETRESOURCES succeeding alone is enough to differentiate between old drm only cards (which need ums and thus root) and kms capable cards. Some hybrid gfx laptops have 0 output connectors on one of their 2 GPUs, resulting in Xorg needlessly running as root. This commits removes the res.count_connectors > 0 check, fixing this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
-rw-r--r--hw/xfree86/xorg-wrapper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
index d93096294..a25e6ff5f 100644
--- a/hw/xfree86/xorg-wrapper.c
+++ b/hw/xfree86/xorg-wrapper.c
@@ -240,7 +240,7 @@ int main(int argc, char *argv[])
memset(&res, 0, sizeof(struct drm_mode_card_res));
r = ioctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res);
- if (r == 0 && res.count_connectors > 0)
+ if (r == 0)
kms_cards++;
close(fd);