ewanr-bbc
Posts: 35
Joined: Mon Sep 09, 2019 3:18 pm
Location: London, UK

Chromium/minigbm: DRM_IOCTL_VC4_CREATE_BO failed in kernel 5.4

Thu Jul 23, 2020 4:05 pm

I'm creating a separate post for the issue I mentioned in a post about a different issue.

When trying to run Chromium Ozone-GBM on Raspbian with kernel 5.4, I get an error from minigbm:

Code: Select all

[minigbm:vc4.c(76)] DRM_IOCTL_VC4_GEM_CREATE failed (size=8294400)

Having looked more closely, this should actually be "DRM_IOCTL_VC4_CREATE_BO failed", not DRM_IOCTL_VC4_GEM_CREATE. Looking in GDB, I can see we are using /dev/dri/card1, and the resulting error is ENODEV (19).

Having compared the source for vc4_create_bo_ioctl in the 5.4 and 4.19 kernels, I can see there is a call made to a new function called vc4_grab_bin_bo. This returns an ENODEV if (!vc4->v3d).

What's the reason for this statement? Are we checking that the VC4 device is in fact a V3D device? Why do we need this check, when everything seemed to work fine for minigbm in kernel 4.19?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9069
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Chromium/minigbm: DRM_IOCTL_VC4_CREATE_BO failed in kernel 5.4

Thu Jul 23, 2020 8:20 pm

Ooh, that sounds like mainline have been a tad over eager - https://github.com/raspberrypi/linux/co ... f4c19c8d9d

I don't know enough about exactly how binner buffer objects are allocated, but I think you are right about vc4_create_bo_ioctl not being only called for binner BOs, and could be called for generic objects.
Whether those need to be allocated against card1 (which is generally the render card) or card0 (V3D on Pi4) is an interesting question.

I can see the gain in not fragmenting the CMA heap due to lots of allocs, but I think this change may be ignoring other valid uses. I'll have to follow it up via those who know (probably Igalia).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

ewanr-bbc
Posts: 35
Joined: Mon Sep 09, 2019 3:18 pm
Location: London, UK

Re: Chromium/minigbm: DRM_IOCTL_VC4_CREATE_BO failed in kernel 5.4

Fri Jul 24, 2020 9:09 am

Okay, I'll remove it from my kernel for now. Let me know if you find anything out.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9069
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Chromium/minigbm: DRM_IOCTL_VC4_CREATE_BO failed in kernel 5.4

Fri Jul 24, 2020 10:12 am

I think you may want to revert that whole commit. It has no purpose on pi4, and I think it is making huge assumptions over the use of that ioctl.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

ewanr-bbc
Posts: 35
Joined: Mon Sep 09, 2019 3:18 pm
Location: London, UK

Re: Chromium/minigbm: DRM_IOCTL_VC4_CREATE_BO failed in kernel 5.4

Fri Jul 24, 2020 10:16 am

Will do, shall I create a pull request to raspberrypi/linux?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9069
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Chromium/minigbm: DRM_IOCTL_VC4_CREATE_BO failed in kernel 5.4

Fri Jul 24, 2020 11:15 am

Not yet. I need to understand the logic before it would be accepted anyway.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

ewanr-bbc
Posts: 35
Joined: Mon Sep 09, 2019 3:18 pm
Location: London, UK

Re: Chromium/minigbm: DRM_IOCTL_VC4_CREATE_BO failed in kernel 5.4

Fri Jul 24, 2020 11:23 am

Makes sense! I accidentally created a pull request to raspberrypi/linux instead of bbc/linux (d'oh!). Feel free to close if you want.

Return to “Graphics programming”