On Thu, Oct 22, 2015 at 7:28 PM, Christopher James Halse Rogers <christopher.halse.rog...@canonical.com> wrote: >> * Privilege to drmSetMaster() >> >> If there is only one drm device no setup is needed. > > > This is an incorrect understanding of what drmSetMaster() does. It is not > setting a primary device, it's the process claiming the DRM_MASTER > capability, which is required for things like modesetting and authorising > other drm clients' access to the device. > > Claiming DRM_MASTER requires root.
OK, thank you for pointing out. I'm not very familiar with DRM. >From my limited reading, if there is no drm master, which is the single-user scenario I have been considering, the first fd to open("/dev/dri/card0") automatically becomes the drm master and obtains DRM_MASTER capability. drmSetMaster() requires DRM_ROOT_ONLY capability, not DRM_MASTER capability. None of DRM_IOCTL_{GEM,MODE}_* ioctls require DRM_ROOT_ONLY capability. Once becoming drm master, the intel driver is smart enough to be aware and to "[not] let go" therefore does not call drmSetMaster() anymore. So the above statement should be amended as "If there is only one drm user, no setup is needed." I'm not sure what applications are "other drm clients". Based on my limited testing, xrandr resolution change and vt switching work correctly. Regards, Lingzhu