genivi-ivi-layer-management@lists.genivi.org

development mailing list for GENIVI LayerManagement

View all threads

GPU DRM ioctl operation drm_setversion on /dev/dri/card0 returns -1 (EACCES)

IC
Ikshwaku Chauhan
Mon, Oct 8, 2018 10:30 AM

Dear All,

We are facing one issue related to drm and layer manager.
We are using below setup;

SOC:imx6 QUAD
BSP:Linux 3.1.17
Layer Manager : 1.1

Below components are using “/dev/dri/card0”
meucy17-t101-a0:~# lsof /dev/dri/card0

COMMAND        PID        USER  FD            TYPE DEVICE SIZE/OFF
NODE NAME
Xorg                    165        root  mem          CHR  226,0
1113    /dev/dri/card0
Xorg                    165        root  12u            CHR  226,0    0t0
1113 /dev/dri/card0
LayerMana          239        root  mem          CHR  226,0          1113
/dev/dri/card0
LayerMana          239        root    6u            CHR  226,0      0t0
1113  /dev/dri/card0

Below ioctl is failing when called from Layermanger, which will return as
permission denied(-EACCES);
DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion, DRM_MASTER),

I am getting these kind of system logs:
type=SYSCALL msg=audit(07/30/18 12:58:38.890:23) : arch=armeb syscall=ioctl
per=PER_LINUX_32BIT success=no exit=EACCES(Permission denied) a0=0x6
a1=0xc0106407 a2=0x768d9a28 a3=0x7 items=0 ppid=1 pid=1527 auid=unset
uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root
fsgid=root ses=unset tty=(none) comm=LayerManagerSer
exe=/usr/bin/LayerManagerService key=DAC

If I changed the flag from DRM_MASTER to DRM_AUTH in drm driver, no
errorlogs observed related to Layermanger.

--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -69,7 +69,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
DRM_IOCTL_DEF(DRM_IOCTL_GET_CLIENT, drm_getclient, DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_GET_STATS, drm_getstats, DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_GET_CAP, drm_getcap, DRM_UNLOCKED),

  •   DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion, DRM_MASTER),
    
  •   DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion, DRM_AUTH),
    

I have following queries:

  1. Is it ok to have the above changes?
  2. With failure logs, there is no problem in system behavior. Can we ignore
    these system logs?
  3. In logs we found that, Xorg setting the version, then why LayerManager
    again trying to change the version?

Thanks in advance.

Regards,
Ikshwaku

Dear All, We are facing one issue related to drm and layer manager. We are using below setup; SOC:imx6 QUAD BSP:Linux 3.1.17 Layer Manager : 1.1 Below components are using “/dev/dri/card0” meucy17-t101-a0:~# lsof /dev/dri/card0 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME Xorg 165 root mem CHR 226,0 1113 /dev/dri/card0 Xorg 165 root 12u CHR 226,0 0t0 1113 /dev/dri/card0 LayerMana 239 root mem CHR 226,0 1113 /dev/dri/card0 LayerMana 239 root 6u CHR 226,0 0t0 1113 /dev/dri/card0 Below ioctl is failing when called from Layermanger, which will return as permission denied(-EACCES); DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion, DRM_MASTER), I am getting these kind of system logs: type=SYSCALL msg=audit(07/30/18 12:58:38.890:23) : arch=armeb syscall=ioctl per=PER_LINUX_32BIT success=no exit=EACCES(Permission denied) a0=0x6 a1=0xc0106407 a2=0x768d9a28 a3=0x7 items=0 ppid=1 pid=1527 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root ses=unset tty=(none) comm=LayerManagerSer exe=/usr/bin/LayerManagerService key=DAC If I changed the flag from DRM_MASTER to DRM_AUTH in drm driver, no errorlogs observed related to Layermanger. --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -69,7 +69,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = { DRM_IOCTL_DEF(DRM_IOCTL_GET_CLIENT, drm_getclient, DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_IOCTL_GET_STATS, drm_getstats, DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_IOCTL_GET_CAP, drm_getcap, DRM_UNLOCKED), - DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion, DRM_MASTER), + DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion, DRM_AUTH), I have following queries: 1. Is it ok to have the above changes? 2. With failure logs, there is no problem in system behavior. Can we ignore these system logs? 3. In logs we found that, Xorg setting the version, then why LayerManager again trying to change the version? Thanks in advance. Regards, Ikshwaku
FE
Friedrich, Eugen (ADITG/ESB)
Mon, Oct 8, 2018 2:01 PM

Hello Ikshwaku,

Please find some answers below..

Best regards

Eugen Friedrich
Engineering Software Base (ADITG/ESB)

Tel. +49 5121 49 6921

-----Original Message-----
From: genivi-ivi-layer-management <genivi-ivi-layer-management-
bounces@lists.genivi.org> On Behalf Of Ikshwaku Chauhan
Sent: Montag, 8. Oktober 2018 12:31
To: genivi-ivi-layer-management@lists.genivi.org; dri-
devel@lists.freedesktop.org
Cc: suju.sks@gmail.com
Subject: GPU DRM ioctl operation drm_setversion on /dev/dri/card0 returns
-1 (EACCES)

Dear All,

We are facing one issue related to drm and layer manager.
We are using below setup;

SOC:imx6 QUAD
BSP:Linux 3.1.17
Layer Manager : 1.1

Below components are using “/dev/dri/card0”
meucy17-t101-a0:~# lsof /dev/dri/card0

COMMAND        PID        USER  FD            TYPE DEVICE SIZE/OFF
NODE NAME
Xorg                    165        root  mem          CHR  226,0
1113    /dev/dri/card0
Xorg                    165        root  12u            CHR  226,0    0t0
1113 /dev/dri/card0
LayerMana          239        root  mem          CHR  226,0          1113
/dev/dri/card0
LayerMana          239        root    6u            CHR  226,0      0t0
1113  /dev/dri/card0

Below ioctl is failing when called from Layermanger, which will return as
permission denied(-EACCES);
DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion,
DRM_MASTER),

I am getting these kind of system logs:
type=SYSCALL msg=audit(07/30/18 12:58:38.890:23) : arch=armeb
syscall=ioctl
per=PER_LINUX_32BIT success=no exit=EACCES(Permission denied) a0=0x6
a1=0xc0106407 a2=0x768d9a28 a3=0x7 items=0 ppid=1 pid=1527 auid=unset
uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root
fsgid=root ses=unset tty=(none) comm=LayerManagerSer
exe=/usr/bin/LayerManagerService key=DAC

If I changed the flag from DRM_MASTER to DRM_AUTH in drm driver, no
errorlogs observed related to Layermanger.

--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -69,7 +69,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
DRM_IOCTL_DEF(DRM_IOCTL_GET_CLIENT, drm_getclient,
DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_GET_STATS, drm_getstats,
DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_GET_CAP, drm_getcap, DRM_UNLOCKED),

  •   DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion,
    

DRM_MASTER),

  •   DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion,
    

DRM_AUTH),

I have following queries:

  1. Is it ok to have the above changes?

[EF] Generally NO, there is something not aligned in you system, the drm_setversion call will tell the kernel driver which version of drm is supported by the DRM_MASTER, and per definition there is only 1 DRM_MASTER at a time. DRM_MASTER is an userspace application which is allows to set the drm setting and provide new buffers for the display.
Default behavior is like this: the first how opens the /dev/dri/card0 will be the DRM_MASTER, all others can be only authenticated by the DRM_MASTER to be able to do some of the privileged commands, also the DRM_MASTER can drop the mastership then other userspace application can request it.
It looks like in your system the DRM_MASTER is the Xorg

  1. With failure logs, there is no problem in system behavior. Can we ignore
    these system logs?

[EF] This tells me that the setup is not completely correct and the drm_setversion call should not the called at all from LayerManagerService.
If you are happy with the system behavior this means that LayerManagerService also doesn't try to update the display buffers, which backend
Is used LayerManagerService and what it LayerManagerService is doying in you system?
Is it a client of Xorg server?

  1. In logs we found that, Xorg setting the version, then why LayerManager
    again trying to change the version?

[EF] Please describe how did you compiled the LayerManager and in which setup you going to use this: Graphical system: X11, wayland, framebuffer? Are you using NXP BSP or own linux kernel/platform?

Thanks in advance.

Regards,
Ikshwaku


genivi-ivi-layer-management mailing list
genivi-ivi-layer-management@lists.genivi.org
http://lists.genivi.org/mailman/listinfo/genivi-ivi-layer-
management_lists.genivi.org

Hello Ikshwaku, Please find some answers below.. Best regards Eugen Friedrich Engineering Software Base (ADITG/ESB) Tel. +49 5121 49 6921 > -----Original Message----- > From: genivi-ivi-layer-management <genivi-ivi-layer-management- > bounces@lists.genivi.org> On Behalf Of Ikshwaku Chauhan > Sent: Montag, 8. Oktober 2018 12:31 > To: genivi-ivi-layer-management@lists.genivi.org; dri- > devel@lists.freedesktop.org > Cc: suju.sks@gmail.com > Subject: GPU DRM ioctl operation drm_setversion on /dev/dri/card0 returns > -1 (EACCES) > > Dear All, > > We are facing one issue related to drm and layer manager. > We are using below setup; > > SOC:imx6 QUAD > BSP:Linux 3.1.17 > Layer Manager : 1.1 > > Below components are using “/dev/dri/card0” > meucy17-t101-a0:~# lsof /dev/dri/card0 > > COMMAND PID USER FD TYPE DEVICE SIZE/OFF > NODE NAME > Xorg 165 root mem CHR 226,0 > 1113 /dev/dri/card0 > Xorg 165 root 12u CHR 226,0 0t0 > 1113 /dev/dri/card0 > LayerMana 239 root mem CHR 226,0 1113 > /dev/dri/card0 > LayerMana 239 root 6u CHR 226,0 0t0 > 1113 /dev/dri/card0 > > > Below ioctl is failing when called from Layermanger, which will return as > permission denied(-EACCES); > DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion, > DRM_MASTER), > > I am getting these kind of system logs: > type=SYSCALL msg=audit(07/30/18 12:58:38.890:23) : arch=armeb > syscall=ioctl > per=PER_LINUX_32BIT success=no exit=EACCES(Permission denied) a0=0x6 > a1=0xc0106407 a2=0x768d9a28 a3=0x7 items=0 ppid=1 pid=1527 auid=unset > uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root > fsgid=root ses=unset tty=(none) comm=LayerManagerSer > exe=/usr/bin/LayerManagerService key=DAC > > > If I changed the flag from DRM_MASTER to DRM_AUTH in drm driver, no > errorlogs observed related to Layermanger. > > --- a/drivers/gpu/drm/drm_drv.c > +++ b/drivers/gpu/drm/drm_drv.c > @@ -69,7 +69,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = { > DRM_IOCTL_DEF(DRM_IOCTL_GET_CLIENT, drm_getclient, > DRM_UNLOCKED), > DRM_IOCTL_DEF(DRM_IOCTL_GET_STATS, drm_getstats, > DRM_UNLOCKED), > DRM_IOCTL_DEF(DRM_IOCTL_GET_CAP, drm_getcap, DRM_UNLOCKED), > - DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion, > DRM_MASTER), > + DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion, > DRM_AUTH), > > I have following queries: > > 1. Is it ok to have the above changes? [EF] Generally NO, there is something not aligned in you system, the drm_setversion call will tell the kernel driver which version of drm is supported by the DRM_MASTER, and per definition there is only 1 DRM_MASTER at a time. DRM_MASTER is an userspace application which is allows to set the drm setting and provide new buffers for the display. Default behavior is like this: the first how opens the /dev/dri/card0 will be the DRM_MASTER, all others can be only authenticated by the DRM_MASTER to be able to do some of the privileged commands, also the DRM_MASTER can drop the mastership then other userspace application can request it. It looks like in your system the DRM_MASTER is the Xorg > 2. With failure logs, there is no problem in system behavior. Can we ignore > these system logs? [EF] This tells me that the setup is not completely correct and the drm_setversion call should not the called at all from LayerManagerService. If you are happy with the system behavior this means that LayerManagerService also doesn't try to update the display buffers, which backend Is used LayerManagerService and what it LayerManagerService is doying in you system? Is it a client of Xorg server? > 3. In logs we found that, Xorg setting the version, then why LayerManager > again trying to change the version? [EF] Please describe how did you compiled the LayerManager and in which setup you going to use this: Graphical system: X11, wayland, framebuffer? Are you using NXP BSP or own linux kernel/platform? > > Thanks in advance. > > Regards, > Ikshwaku > _______________________________________________ > genivi-ivi-layer-management mailing list > genivi-ivi-layer-management@lists.genivi.org > http://lists.genivi.org/mailman/listinfo/genivi-ivi-layer- > management_lists.genivi.org