AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Hellstrom <thellstrom-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
To: Emil Velikov
	<emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Dave Airlie <airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "Daniel Vetter" <daniel.vetter-/w4YWyX8dFk@public.gmane.org>,
	"Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>,
	dri-devel
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"VMware Graphics"
	<linux-graphics-maintainer-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>,
	"amd-gfx mailing list"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"Daniel Vetter" <daniel-/w4YWyX8dFk@public.gmane.org>
Subject: Re: [PATCH libdrm] libdrm: Allow dynamic drm majors on linux
Date: Wed, 5 Sep 2018 12:10:51 +0200	[thread overview]
Message-ID: <53ece2d8-e4ae-331d-16e9-8ad5d067844d@vmware.com> (raw)
In-Reply-To: <CACvgo50cfLHWDUEjeNet4H3F4i3okdhSsXfjNiPvH-YZbQsyEg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi, Emil,

On 09/05/2018 11:33 AM, Emil Velikov wrote:
> On 4 September 2018 at 23:33, Dave Airlie <airlied@gmail.com> wrote:
>> On Tue, 4 Sep 2018 at 03:00, Thomas Hellstrom <thellstrom@vmware.com> wrote:
>>> On 09/03/2018 06:33 PM, Daniel Vetter wrote:
>>>> On Mon, Sep 03, 2018 at 11:16:29AM +0200, Thomas Hellstrom wrote:
>>>>> On 08/31/2018 05:30 PM, Thomas Hellstrom wrote:
>>>>>> On 08/31/2018 05:27 PM, Emil Velikov wrote:
>>>>>>> On 31 August 2018 at 15:38, Michel Dänzer <michel@daenzer.net> wrote:
>>>>>>>> [ Adding the amd-gfx list ]
>>>>>>>>
>>>>>>>> On 2018-08-31 3:05 p.m., Thomas Hellstrom wrote:
>>>>>>>>> On 08/31/2018 02:30 PM, Emil Velikov wrote:
>>>>>>>>>> On 31 August 2018 at 12:54, Thomas Hellstrom <thellstrom@vmware.com>
>>>>>>>>>> wrote:
>>>>>>>>>>> To determine whether a device node is a drm device
>>>>>>>>>>> node or not, the code
>>>>>>>>>>> currently compares the node's major number to the static drm major
>>>>>>>>>>> device
>>>>>>>>>>> number.
>>>>>>>>>>>
>>>>>>>>>>> This breaks the standalone vmwgfx driver on XWayland dri clients,
>>>>>>>>>>>
>>>>>>>>>> Any particular reason why the code doesn't use a fixed node there?
>>>>>>>>>> It will make the diff vs the in-kernel driver a bit smaller.
>>>>>>>>> Because then it won't be able to interoperate with other in-tree
>>>>>>>>> drivers, like virtual drm drivers or passthrough usb drm drivers.
>>>>>>>>> There is no clean way to share the minor number allocation
>>>>>>>>> with in-tree
>>>>>>>>> drm, so standalone vmwgfx is using dynamic major allocation.
>>>>>>>> I wonder why I haven't heard of any of these issues with the standalone
>>>>>>>> version of amdgpu shipped in packaged AMD releases. Does that
>>>>>>>> also use a
>>>>>>>> different major number? If yes, maybe it's just that nobody has tried
>>>>>>>> Xwayland clients with that driver. If no, how does it avoid the other
>>>>>>>> issues described above?
>>>>>>>>
>>>>>>> AFAICT, the difference is that the standalone vmwgfx uses an internal
>>>>>>> copy of drm core.
>>>>>>> It doesn't reuse the in-kernel drm, hence it cannot know which minor
>>>>>>> it can use.
>>>>>>>
>>>>>>> -Emil
>>>>>> Actually, standalone vmwgfx could perhaps also try to allocate minors
>>>>>> from 63 and downwards. That might work, but needs some verification.
>>>>>>
>>>>> So unfortuntately this doesn't work since the in-tree drm's file operations
>>>>> are registered with the DRM_MAJOR.
>>>>> So I still think the patch is the way to go. If people are concerned that
>>>>> also fbdev file descriptors are allowed, perhaps there are other sysfs
>>>>> traits we can look at?
>>>> Somewhat out of curiosity, but why do you have to overwrite all of drm?
>>>> amdgpu seems to be able to pull their stunt off without ...
>>>> -Daniel
>>> At the time we launched the standalone vmwgfx, the DRM <-> driver
>>> interface was moving considerably more rapidly than the DRM <-> kernel
>>> interface. I think that's still the case. Hence less work for us. Also
>>> meant we can install the full driver stack with latest features on
>>> fairly old VMs without backported DRM functionality.
>>>
>> I think this should be fine for 99% of drm usage, there may be corner
>> cases in wierd places, but I can't point to any that really matter
>> (maybe strace?)
>>
> Having a closer look, I think this will break the Firefox/Chrome sandboxing :-\
> I cannot see the path /sys/dev/char/%d:%d/device/drm in the allowed
> list [1] [2].
Thanks for pointing this out.

The function drmGetMinorNameForFD() already opens this path, so any 
user-space using that function would not work before either.

Also mozilla/firefox adds /sys/dev/char/226:* Which means that while it 
still won't work on standalone vmwgfx, there should at least be no 
regression.

For Chromium it seems they allow /sys/dev/char/ for AmdGpu, but only 
under ChromOS, so I'll ping those to be safe.

I also won't be doing an immediate release after pushing.

Thanks,
Thomas


> Thomas, can you please send a patch to the respective teams or give
> them a heads up?
>
> Thanks
> Emil
>

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-09-05 10:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180831115419.4922-1-thellstrom@vmware.com>
     [not found] ` <CACvgo50fT1JAfmCLeZT1STRe_nnPo9PQjgk9+S5VRk-o5P088w@mail.gmail.com>
     [not found]   ` <bbb94b6f-c9d5-27ab-9e6d-4b4c1d85db8e@vmware.com>
     [not found]     ` <bbb94b6f-c9d5-27ab-9e6d-4b4c1d85db8e-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2018-08-31 14:38       ` [PATCH libdrm] libdrm: Allow dynamic drm majors on linux Michel Dänzer
     [not found]         ` <33fb1ba6-cc44-f747-545b-9f877917933e-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-08-31 14:46           ` Thomas Hellstrom
     [not found]             ` <e656d26a-be98-cc9c-7962-fd74ad226c60-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2018-08-31 14:49               ` Michel Dänzer
     [not found]                 ` <6d78b948-55bc-3adf-f8c0-691aa80a8bb2-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-08-31 14:59                   ` Thomas Hellstrom
2018-08-31 15:27         ` Emil Velikov
     [not found]           ` <CACvgo53Wd1fq8=V_v7jjuFGimUfh7xD+ccCg-jOTjLSJdWUKeA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-08-31 15:30             ` Thomas Hellstrom
     [not found]               ` <c1dc7253-d505-dd16-480c-ee9a862d57ef-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2018-09-03  9:16                 ` Thomas Hellstrom
2018-09-03 16:33                   ` Daniel Vetter
     [not found]                     ` <20180903163310.GJ21634-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-09-03 17:00                       ` Thomas Hellstrom
     [not found]                         ` <91ad6140-4e56-afc1-2515-9ca973d0ea05-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2018-09-04 22:33                           ` Dave Airlie
     [not found]                             ` <CAPM=9tzScEQ-RWK55zKeT_yXiN6iAyx34DVX1eCgA3ZqC_SpuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-05  9:33                               ` Emil Velikov
     [not found]                                 ` <CACvgo50cfLHWDUEjeNet4H3F4i3okdhSsXfjNiPvH-YZbQsyEg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-05 10:10                                   ` Thomas Hellstrom [this message]
2018-09-05 13:07                                     ` Emil Velikov
     [not found]                                       ` <CACvgo53t4OSsdmxdHSqrfSWKZGYg4s+uXrSV3gWcignwNxfE8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-05 13:20                                         ` Thomas Hellstrom
2018-09-05 13:53                                           ` Emil Velikov
2018-09-30 17:31                                             ` Thomas Hellstrom
2018-10-02 19:55                                               ` Thomas Hellstrom
     [not found]                                               ` <a3af864a-8914-3bef-ff26-02c7672a9e50-4+hqylr40dJg9hUCZPvPmw@public.gmane.org>
2018-10-04 14:12                                                 ` Emil Velikov
     [not found]                                                   ` <CACvgo5289XdFe9S4r3uSUA20QP37Zy0iiYEW_nHMho4yc0Pi8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-10-04 16:43                                                     ` Thomas Hellstrom
2018-08-31 15:31             ` Christian König
     [not found]               ` <02acda47-d071-1c97-e151-fcb75d10c656-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-02 14:54                 ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53ece2d8-e4ae-331d-16e9-8ad5d067844d@vmware.com \
    --to=thellstrom-pghwnbhtmq7qt0dzr+alfa@public.gmane.org \
    --cc=airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=daniel-/w4YWyX8dFk@public.gmane.org \
    --cc=daniel.vetter-/w4YWyX8dFk@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-graphics-maintainer-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org \
    --cc=michel-otUistvHUpPR7s880joybQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox