Bug 90079 - drmSetMaster and drmDropMaster need root privileges
Summary: drmSetMaster and drmDropMaster need root privileges
Status: NEW
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/other (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-17 21:11 UTC by g1938560
Modified: 2015-04-21 17:49 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description g1938560 2015-04-17 21:11:41 UTC
I run a small, user-space program that renders images in my virtual console with drmModeSetCRTC and family. I also support virtual terminal switching with ioctl() on stuff from linux/vt.h and some basic signal handling.

Switching back to X server, however, just renders... nothing.

Apparently I'm supposed to call drmDropMaster so that X server can pick up from there. I get -1 and errno is set to Permission Denied. When run as root, it works as expected.

Is there any reason why these functions require root privileges?
More importantly, is there any workaround for this so that my user space program can let X server draw its stuff once user switches back to X's virtual terminal?
Comment 1 Emil Velikov 2015-04-21 17:49:37 UTC
The root limitation when using the KMS API is deliberate. If your program only wants to render things then opening/using a render node is what you want.

Looking at the problem from another angle:
As of recently one could use X server without root access, although that involves using systemd-logind. Not 100% if that will do exactly what you want but having a quick look at the code and checking David's blog [1] on the topic won't hurt.

[1] https://dvdhrm.wordpress.com/


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.