From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher James Halse Rogers Subject: Re: [PATCH libdrm] xf86drm: Add drmIsMaster() Date: Tue, 22 Jan 2019 15:26:31 +1300 Message-ID: <518DE9C7-21B3-437C-AF20-6C8D3C3E7E9F@ubuntu.com> References: <20181120033652.29067-1-christopher.halse.rogers@canonical.com> <713C110C-3D7B-438D-B9D6-241507FF688C@cooperteam.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1649881802==" Return-path: Received: from mail.cooperteam.net (mail.cooperteam.net [45.248.50.188]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5983D89E1D for ; Tue, 22 Jan 2019 02:26:42 +0000 (UTC) In-Reply-To: <713C110C-3D7B-438D-B9D6-241507FF688C@cooperteam.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Emil Velikov , christopher.halse.rogers@canonical.com Cc: ML dri-devel List-Id: dri-devel@lists.freedesktop.org --===============1649881802== Content-Type: multipart/alternative; boundary="----94TMOTCXDC549IAK8LGLAYF0G5USU5" Content-Transfer-Encoding: 7bit ------94TMOTCXDC549IAK8LGLAYF0G5USU5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 18 December 2018 7:07:01 pm NZDT, Christopher James Halse Rogers wrote: >On 18 December 2018 4:35:37 am AEDT, Emil Velikov > wrote: >>Hi Christopher, >> >>On Tue, 20 Nov 2018 at 03:37, Christopher James Halse Rogers >> 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=2E >>> >>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=2E > >Certainly! > >The particular use-case I was hitting was testing my display server in >a container, where container-root is not real-root but the >implicit-master FD you get by opening the DRM node when there is no >current master would be sufficient=2E > >Just assuming the FD we get is master and failing later breaks the >platform probing; for example, when run under X11 if we don't check >master we'll load the KMS platform and then fail, rather than noticing >that KMS won't work and using our X11 backend=2E > >> >>> 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=2E >>> >>I'm wondering if we cannot extent DRM_IOCTL_GET_CLIENT or another >>IOCTL=2E >>What do you think? May I interest you in writing an RFC for the >>kernel-side? > >I think if I was going to do kernel-side changes if probably just make >it so that IOCTL_SET_MASTER just unconditionally succeeded on an fd >that was already master? >_______________________________________________ >dri-devel mailing list >dri-devel@lists=2Efreedesktop=2Eorg >https://lists=2Efreedesktop=2Eorg/mailman/listinfo/dri-devel Ping! Is there anything more you'd like to know about my use-case here? Are ther= e any objections to adding drmIsMaster()? ------94TMOTCXDC549IAK8LGLAYF0G5USU5 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On 18 December 2018 7:0= 7:01 pm NZDT, Christopher James Halse Rogers <chris@cooperteam=2Enet>= wrote:
On 18 December 2018 4:35:37 am AEDT, Emil Velikov &l=
t;emil=2El=2Evelikov@gmail=2Ecom> wrote:
Hi Christopher,

On Tue, 20 Nov 2018 at 03:37, C= hristopher James Halse Rogers
<christopher=2Ehalse=2Erogers@canonical= =2Ecom> wrote:
We c= an't use drmSetMaster to query whether or not a drm fd is master
becaus= e it requires CAP_SYS_ADMIN, even if the fd *is* a master fd=2E

Can you please mention the exact use case here? You mentioned it o= ver
IRC although it'll be nice to have it here for posterity=2E

Certainly!

The particular use-case I was hitting was tes= ting my display server in a container, where container-root is not real-roo= t but the implicit-master FD you get by opening the DRM node when there is = no current master would be sufficient=2E

Just assuming the FD we get= is master and failing later breaks the platform probing; for example, when= run under X11 if we don't check master we'll load the KMS platform and the= n fail, rather than noticing that KMS won't work and using our X11 backend= =2E

>
Pick DRM_IOCTL_MODE_ATTACHMODE a= s a long-deprecated ioctl that is
DRM_MASTER but not DRM_ROOT_ONLY as t= he probe by which we can detect
whether or not the fd is master=2E
<= br>
I'm wondering if we cannot extent DRM_IOCTL_GET_CLIENT or a= nother
IOCTL=2E
What do you think? May I interest you in writing an R= FC for the
kernel-side?

I think if I was going to do= kernel-side changes if probably just make it so that IOCTL_SET_MASTER just= unconditionally succeeded on an fd that was already master?
dri-devel m= ailing list
dri-devel@lists=2Efreedesktop=2Eorg
https://lists=2Efreedes= ktop=2Eorg/mailman/listinfo/dri-devel

Ping!

Is there anything more you'd like to know about m= y use-case here? Are there any objections to adding drmIsMaster()? ------94TMOTCXDC549IAK8LGLAYF0G5USU5-- --===============1649881802== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1649881802==--