[x86-64] GBM and RGB Colorspace on Intel Graphics

  • Hello,


    So I was running an ancient LE8 (Kodi 17) installation on Intel NUC and was running in full/full/full (Kodi/gfx driver/TV) RGB color space - cristal black colors and never had an issue with color space there.
    Btw the HW is a NUC7i5BNH with i5-7260U and Intel Graphics 640.

    Fast forward today, finally decided to upgrade to LE12 and noticed that my blacks are washed out. Of course, I double-checked that Kodi and TV are still set to full (0-255).
    Finally looked at the WM level (didn't try it with the kernel command) and noticed that the "Broadcast RGB" was set to automatic, and apparently the driver looks at HDMI info frames and decides it should use limited instead of full.
    This I verified with the following

    Code
    # modetest -M i915 -c
    (...)
            101 Broadcast RGB:
                    flags: enum
                    enums: Automatic=0 Full=1 Limited 16:235=2
                    value: 0
    (...)

    After forcing the Full mode with kmstest -c DP-1 -P "Broadcast RGB=1" < /dev/null (and restarting Kodi) things are back on track.

    I am now using a simple autostart.sh script

    Code
    # cat /storage/.config/autostart.sh
    
    #!/bin/sh
    # wait a moment for DRM to settle, then force Full RGB
    sleep 2
    kmstest -c DP-1 -P "Broadcast RGB=1" < /dev/null

    This forces the colors pace to full on boot and I am happy.

    My question is, can this be a feature request that this behavior can be setup through LE in the GUI as this is hardly intuitive for an average user?

  • In short, no, because it should be implemented in Kodi and not handled locally for LE. It's been half-investigated by Kwiboo in the past, see https://github.com/xbmc/xbmc/pull/14358, but that PR includes a pile of other things that were a little ahead of the kernel DRM framework maturing and it was closed.

    If you want to make a feature request, it should be done in the Kodi forum as this would be a Kodi feature.

  • Hm, I see.

    But from my limited understanding this is a setting that is beneath the application, it's something on the OS layer is it not?

    How can it be a feature request for an application devs that aren't responsible for the OS where the app is running on? The LE is a pre-built distribution that includes the app, but the choice of the WM, distribution, kernel and all is up to the LE team, and I believe this setting could be handled on that level and could be possibly a simple knob in the LE installer or configurator.
    At the very least, people could get some hints about this issue and how to solve it through a Wiki or in the installation guide.

    Thanks though, i will try to submit the feature request at Kodi then.

  • In the GBM/V4L2 world if you set rotation in the OS layer the DRM connector properties are changed. Kodi needs to be able to read that DRM property to understand that rotation is required, and then needs to render the UI rotated to match the orientation. Kodi does not do that currently, so if you physically rotate the screen and flag rotation in DRM, Kodi renders a "portrait" or "unflipped" version of the GUI instead of one rotated by 90/180/270 degrees. The reading DRM properties part is not that difficult to add, but shader changes are probably needed for the rendering bit and that's likely to need more effort.

    The old RPi method was more simple for users, but it only worked for RPi, and moving everything to the standard Linux DRM method means the feature can be coded in Kodi once and then it'll work the same with all Linux hardware that has drivers supporting DRM rotation (all the main drivers do).

    If it gets implemented I probably wouldn't complicate installers or the settings add-on with support for setting it as the numer of times we see enquiries about it is low. It would be documented in the wiki though.