Commit 4aaeeda4 authored by Hans de Goede's avatar Hans de Goede Committed by Adam Jackson

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: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@imgtec.com>
parent 7d91063a
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment