All of lore.kernel.org
 help / color / mirror / Atom feed
* Query regarding DRM mastership sharing between multiple process
@ 2021-03-04  4:13 Hardik Panchal
  2021-03-05 15:44 ` Pekka Paalanen
  0 siblings, 1 reply; 3+ messages in thread
From: Hardik Panchal @ 2021-03-04  4:13 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1722 bytes --]

Hello Sir/Madam,

I am trying to render some stuff using DRM with Qt GUI application and
decoded stream from Intel H/w decoder.

I have two applications one is for GUI content and another one is for
decoded video streams. While doing this I am facing an issue that only
singal process acquires DRM mastership while the other one is getting
error.

While wondering how to get the privilege to render stuff I came
across GET_MAGIC and AUTH_MAGIC.
Please refer to this text from the MAN page of DRM.

All DRM devices provide authentication mechanisms. Only a DRM-Master is
> allowed to perform mode-setting or modify core state and only one user can
> be DRM-Master at a time. See drmSetMaster
> <https://www.commandlinux.com/man-page/man3/drmSetMaster.3.html>(3) for
> information on how to become DRM-Master and what the limitations are. Other
> DRM users can be authenticated to the DRM-Master via drmAuthMagic
> <https://www.commandlinux.com/man-page/man3/drmAuthMagic.3.html>(3) so
> they can perform buffer allocations and rendering.
>

As per this the client which is authenticated using magic code should be
able to allocate buffer and rendering.
But while doing this I am not able to use drmModeSetPlane() for rendering
stuff on display from an authenticated client application. It is giving me
Permission Denied.

As per my understanding if the client is authenticated by using
GET/AUTH_MAGIC it should be able to set a plane and render stuff on the
display.

Is my understanding correct? Can we use this method to simultaneously
render from two applications?

Thank you in advance.

Having Addiction of Self-Dependence

*Hardik Panchal*
SDT - Satatya Devices
Contact No. : 9924472937
Email : hardik23398@gmail.com

[-- Attachment #1.2: Type: text/html, Size: 3939 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Query regarding DRM mastership sharing between multiple process
  2021-03-04  4:13 Query regarding DRM mastership sharing between multiple process Hardik Panchal
@ 2021-03-05 15:44 ` Pekka Paalanen
  2021-03-11 14:00   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Pekka Paalanen @ 2021-03-05 15:44 UTC (permalink / raw)
  To: Hardik Panchal; +Cc: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 2373 bytes --]

On Thu, 4 Mar 2021 09:43:22 +0530
Hardik Panchal <hardik.panchal@matrixcomsec.com> wrote:

> Hello Sir/Madam,
> 
> I am trying to render some stuff using DRM with Qt GUI application and
> decoded stream from Intel H/w decoder.
> 
> I have two applications one is for GUI content and another one is for
> decoded video streams. While doing this I am facing an issue that only
> singal process acquires DRM mastership while the other one is getting
> error.

Hi,

yes, this is deliberate and by design.

The idea of having two separate processes simultaneously controlling
KMS planes of the same CRTC is fundamentally forbidden. Even if it was
not forbidden, doing so would lead to other technical problems.

You have to change your architecture so that only one process controls
KMS. It you need other processes, they have to pass buffers or
rendering commands to the process that does control KMS. In other
words, you need a display server.

> While wondering how to get the privilege to render stuff I came
> across GET_MAGIC and AUTH_MAGIC.
> Please refer to this text from the MAN page of DRM.

Those will not help you with breaking the DRM master concept.

> > All DRM devices provide authentication mechanisms. Only a DRM-Master is
> > allowed to perform mode-setting or modify core state and only one user can
> > be DRM-Master at a time. See drmSetMaster
> > <https://www.commandlinux.com/man-page/man3/drmSetMaster.3.html>(3) for
> > information on how to become DRM-Master and what the limitations are. Other
> > DRM users can be authenticated to the DRM-Master via drmAuthMagic
> > <https://www.commandlinux.com/man-page/man3/drmAuthMagic.3.html>(3) so
> > they can perform buffer allocations and rendering.
> >  
> 
> As per this the client which is authenticated using magic code should be
> able to allocate buffer and rendering.
> But while doing this I am not able to use drmModeSetPlane() for rendering
> stuff on display from an authenticated client application. It is giving me
> Permission Denied.
> 
> As per my understanding if the client is authenticated by using
> GET/AUTH_MAGIC it should be able to set a plane and render stuff on the
> display.

No. Authentication gives access to buffer allocation and submitting
rendering commands to the GPU. It does not give access to KMS.


Sorry,
pq

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Query regarding DRM mastership sharing between multiple process
  2021-03-05 15:44 ` Pekka Paalanen
@ 2021-03-11 14:00   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2021-03-11 14:00 UTC (permalink / raw)
  To: Pekka Paalanen; +Cc: Hardik Panchal, dri-devel

On Fri, Mar 05, 2021 at 05:44:04PM +0200, Pekka Paalanen wrote:
> On Thu, 4 Mar 2021 09:43:22 +0530
> Hardik Panchal <hardik.panchal@matrixcomsec.com> wrote:
> 
> > Hello Sir/Madam,
> > 
> > I am trying to render some stuff using DRM with Qt GUI application and
> > decoded stream from Intel H/w decoder.
> > 
> > I have two applications one is for GUI content and another one is for
> > decoded video streams. While doing this I am facing an issue that only
> > singal process acquires DRM mastership while the other one is getting
> > error.
> 
> Hi,
> 
> yes, this is deliberate and by design.
> 
> The idea of having two separate processes simultaneously controlling
> KMS planes of the same CRTC is fundamentally forbidden. Even if it was
> not forbidden, doing so would lead to other technical problems.
> 
> You have to change your architecture so that only one process controls
> KMS. It you need other processes, they have to pass buffers or
> rendering commands to the process that does control KMS. In other
> words, you need a display server.

One option is kms leases, where the main compositor with exclusive control
over the display can pass a select set of resources to another process.
But it's a clear lessor/lessee relationship, and the main compositor can
always revoke the lease if needed.
-Daniel

> 
> > While wondering how to get the privilege to render stuff I came
> > across GET_MAGIC and AUTH_MAGIC.
> > Please refer to this text from the MAN page of DRM.
> 
> Those will not help you with breaking the DRM master concept.
> 
> > > All DRM devices provide authentication mechanisms. Only a DRM-Master is
> > > allowed to perform mode-setting or modify core state and only one user can
> > > be DRM-Master at a time. See drmSetMaster
> > > <https://www.commandlinux.com/man-page/man3/drmSetMaster.3.html>(3) for
> > > information on how to become DRM-Master and what the limitations are. Other
> > > DRM users can be authenticated to the DRM-Master via drmAuthMagic
> > > <https://www.commandlinux.com/man-page/man3/drmAuthMagic.3.html>(3) so
> > > they can perform buffer allocations and rendering.
> > >  
> > 
> > As per this the client which is authenticated using magic code should be
> > able to allocate buffer and rendering.
> > But while doing this I am not able to use drmModeSetPlane() for rendering
> > stuff on display from an authenticated client application. It is giving me
> > Permission Denied.
> > 
> > As per my understanding if the client is authenticated by using
> > GET/AUTH_MAGIC it should be able to set a plane and render stuff on the
> > display.
> 
> No. Authentication gives access to buffer allocation and submitting
> rendering commands to the GPU. It does not give access to KMS.
> 
> 
> Sorry,
> pq



> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-11 14:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04  4:13 Query regarding DRM mastership sharing between multiple process Hardik Panchal
2021-03-05 15:44 ` Pekka Paalanen
2021-03-11 14:00   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.