I'm using libdrm in effort to change gamma on my Chromebook. I find that when I call drmModeCrtcSetGamma, I get a "Permission denied" error, regardless of whether I run my program with sudo. See line 91 of my source code if you like:


So I insert a call to drmSetMaster(dat->fd) above drmModeCrtcSetGamma, and that results in an "Invalid argument" error. What is the correct approach, please? Documentation seems rather sparse, with the best I've seen being this:


(Sorry for the non-linking URLs. I don't have enough rep to post URLs.)