On Mon, Dec 17, 2018 at 6:38 PM Emil Velikov <emil.l.velikov@xxxxxxxxx> wrote: > > Hi Christopher, > > On Tue, 20 Nov 2018 at 03:37, Christopher James Halse Rogers > <christopher.halse.rogers@xxxxxxxxxxxxx> wrote: > > > > We can't use drmSetMaster to query whether or not a drm fd is master > > because it requires CAP_SYS_ADMIN, even if the fd *is* a master fd. > > > Can you please mention the exact use case here? You mentioned it over > IRC although it'll be nice to have it here for posterity. > > > Pick DRM_IOCTL_MODE_ATTACHMODE as a long-deprecated ioctl that is > > DRM_MASTER but not DRM_ROOT_ONLY as the probe by which we can detect > > whether or not the fd is master. > > > I'm wondering if we cannot extent DRM_IOCTL_GET_CLIENT or another IOCTL. > What do you think? May I interest you in writing an RFC for the kernel-side? > > IMHO checking with the kernel devs for a cleaner solution is a worthy > goal. If they're unhappy we can use this workaround. I think an invalid request through authmagic would be cleaner. That should give you EINVAL (you're master) or EACCESS (you're not master). It's also directly related to the master status, so less of a mindbinder. Note that we allocate magic numbers through the idr starting at 1, 0 is considered an invalid magic number and rejected. -Daniel > > Thanks > Emil > _______________________________________________ > dri-devel mailing list > dri-devel@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel