Re: [PATCH v9 00/23] drm/rockchip: RK356x VOP2 support

Andy Yan
2022-03-31T12:13:36Z

Hi Piotr:

On 3/31/22 03:20, Sascha Hauer wrote:
> On Wed, Mar 30, 2022 at 04:52:22PM +0200, Piotr Oniszczuk wrote:
>>
>>> Wiadomość napisana przez Sascha Hauer <s.hauer@pengutronix.de> w dniu 30.03.2022, o godz. 12:20:
>>>
>>> Does it change anything if you do a "modetest -s 69@67:1920x1080" before
>>> starting the app? Or if you run "modetest -P 43@67:1920x1080@NV12"
>>> before starting the app? Or other combinations thereof?
>> So i tried following combinations
>>
>> -boot
>> -modetest -s 69@67:1920x1080 -> ok
>> -modetest -P 43@67:1920x1080@NV12 -> green screen
> I have no idea what is going on here. There same commands work for me.
> You could provide me your kernel config and upstream commitish you are
> working on, maybe that gets me closer to your setup.

It's a little strange, I can't reproduce this issue neither.

But I have problem with this two step command sequence.

step 1:  modetest -s 69@67:1920x1080 -> ok

step 2:  modetest -P 43@67:1920x1080@NV12,

I got the failed message:  "failed to enable plane: Permission denied"

Because the drm core will stop step2 by drm_ioctrl_permit as
DRM_IOCTL_SETPLANE need a master,

but the current master is the modetest run by step1.

static int drm_ioctl_permit(u32 flags, struct drm_file *file_priv)
{

/* ROOT_ONLY is only for CAP_SYS_ADMIN */
if (unlikely((flags & DRM_ROOT_ONLY) && !capable(CAP_SYS_ADMIN))) {
printk("DRM_ROOT_ONLY\n");
return -EACCES;
}

/* AUTH is only for authenticated or render client */
if (unlikely((flags & DRM_AUTH) &&
!drm_is_render_client(file_priv) &&
!file_priv->authenticated)) {
printk("DRM_AUTH\n");
return -EACCES;
}

/* MASTER is only for master or control clients */
if (unlikely((flags & DRM_MASTER) &&
!drm_is_current_master(file_priv))) {
printk("DRM_MASTER\n");
return -EACCES;
}

/* Render clients must be explicitly allowed */
if (unlikely(!(flags & DRM_RENDER_ALLOW) &&
drm_is_render_client(file_priv))) {
printk("DRM_RENDER_NOT_ALLOW\n");
return -EACCES;
}

return 0;
}

After bypass the permission check, I can run step 2 , but the display on
the screen will have a shift as the wrong dly configuration.

So how you two got step two run success?

Piotr:

What soc is on you board? rk3566 or rk3568?

I have a scripts[0]  use io[1] command to dump the VOP2 register you can
use it dump the register configuration when you meet a display failure,

then send the dump to me, maybe I can figure out something.

[0]https://github.com/andyshrk/buildroot/blob/2022/board/andyshrk/rootfs_overlay/usr/bin/vop2_dump.sh

[1] https://github.com/andyshrk/io

>
> Sascha