Bug 282659 - multimedia/kodi: fix run in GBM mode
Summary: multimedia/kodi: fix run in GBM mode
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-10 00:38 UTC by Ivan Rozhuk
Modified: 2024-11-21 23:09 UTC (History)
2 users (show)

See Also:
yzrh: maintainer-feedback+
yzrh: merge-quarterly?


Attachments
patch (22.76 KB, patch)
2024-11-10 00:38 UTC, Ivan Rozhuk
no flags Details | Diff
Disable DRM_MODE_ATOMIC_NONBLOCK (740 bytes, patch)
2024-11-10 10:54 UTC, yzrh
no flags Details | Diff
patch (1.65 KB, patch)
2024-11-15 14:49 UTC, Ivan Rozhuk
rozhuk.im: maintainer-approval?
Details | Diff
Remove IN_FENCE_FD from property (1.28 KB, patch)
2024-11-21 22:34 UTC, yzrh
yzrh: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2024-11-10 00:38:55 UTC
Created attachment 255062 [details]
patch

A bit more details in: https://github.com/xbmc/xbmc/issues/25259
This patch only revert 1 commit.
Comment 1 yzrh 2024-11-10 10:54:46 UTC
Created attachment 255067 [details]
Disable DRM_MODE_ATOMIC_NONBLOCK

DRM_MODE_ATOMIC_NONBLOCK is from linux drm,
could you please test the patch to see if
drm-kmod is missing something to support it?
Comment 2 Ivan Rozhuk 2024-11-15 14:49:40 UTC
Created attachment 255194 [details]
patch
Comment 3 Ivan Rozhuk 2024-11-15 14:51:03 UTC
(In reply to yzrh from comment #1)

This patch does not work, but I make another minimal patch that work.
Comment 4 yzrh 2024-11-17 13:59:08 UTC
GPU fencing does not work properly?  Could you
provide output of `glxinfo -B' please?

Does output of `dmesg' contain anything about `fence driver'?
Comment 5 yzrh 2024-11-17 14:14:43 UTC
If you happen to have a nvidia GPU,
the support was only added for 560 driver series (550 in ports).
See https://github.com/NVIDIA/open-gpu-kernel-modules/issues/622.
Comment 6 Ivan Rozhuk 2024-11-17 16:08:14 UTC
(In reply to yzrh from comment #4)

> Could you provide output of `glxinfo -B' please?

Yes and no.
I run kodi on dedicated ssd/FBSD where is no other extra software and goal of GBM is not to have xorg or wayland.
H/W is: amd ryzen 5750G.

Output from my system (h/w a bit differ, I did not try to run kodi at GBM mode on my system):
 glxinfo -B
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: AMD (0x1002)
    Device: AMD Radeon RX 5600 XT (radeonsi, navi10, LLVM 15.0.7, DRM 3.49, 14.2-STABLE) (0x731f)
    Version: 24.1.7
    Accelerated: yes
    Video memory: 6144MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 5253 MB, largest block: 5253 MB
    VBO free aux. memory - total: 65347 MB, largest block: 65347 MB
    Texture free memory - total: 5253 MB, largest block: 5253 MB
    Texture free aux. memory - total: 65347 MB, largest block: 65347 MB
    Renderbuffer free memory - total: 5253 MB, largest block: 5253 MB
    Renderbuffer free aux. memory - total: 65347 MB, largest block: 65347 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 6144 MB
    Total available memory: 71625 MB
    Currently available dedicated video memory: 5253 MB
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon RX 5600 XT (radeonsi, navi10, LLVM 15.0.7, DRM 3.49, 14.2-STABLE)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 24.1.7
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.1.7
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 24.1.7
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20


> Does output of `dmesg' contain anything about `fence driver'?

dmesg contain multiple messages: [5652] drm_gem_plane_helper_prepare_fb: explicit fence not handled


> If you happen to have a nvidia GPU, the support was only added for 560 driver series (550 in ports).

I have seen their change log. I am on amdgpu only.
And I do not see any fence autodetect code.
Comment 7 yzrh 2024-11-17 16:46:15 UTC
I found the problem, kernel message is from
https://github.com/freebsd/drm-kmod/blob/master/drivers/gpu/drm/drm_gem_atomic_helper.c

drm-kmod simply does not have an implementation of drm_gem_plane_helper_prepare_fb().
I think it is fair to disable explicit fencing on FreeBSD for now.

For reference:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/gpu/drm/drm_gem_atomic_helper.c?h=v6.1.118
Comment 8 yzrh 2024-11-17 16:58:53 UTC
Well, it seems that Bugzilla wants Requestee filled.
I can't change the flag.
Comment 9 Ivan Rozhuk 2024-11-19 17:54:52 UTC
(In reply to yzrh from comment #8)

Anything that I can do?
Comment 10 yzrh 2024-11-21 22:14:41 UTC
It could be that `Requestee' for flag `maintainer-approval' is blank.
Hopefully someone will commit the patch :)
Thanks again for the help.
Comment 11 yzrh 2024-11-21 22:34:12 UTC
Created attachment 255368 [details]
Remove IN_FENCE_FD from property