Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux: update to 5.15.y #5932

Merged
merged 3 commits into from Dec 14, 2021
Merged

linux: update to 5.15.y #5932

merged 3 commits into from Dec 14, 2021

Conversation

heitbaum
Copy link
Contributor

@heitbaum heitbaum commented Nov 30, 2021

https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.6
https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.7
https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.8

5.15.6 - 179 patches
5.15.7 - 207 patches
5.15.8 - 171 patches

issues / regressions

  • rtl8192e and r8188eu fixes in 5.15.6
  • Just waiting on https://github.com/lwfinger/rtl8192du for support of 5.15 in upstream.
    • DONE: RTL8192DU: update githash to support 5.15.x
  • torvalds/linux@b811a45
    • when you get to update the kernels again, whatch out for patch b811a451519036e54d1af10e695c9b2ff014fcc3 (remove IOVA cookie in rockchip iommu), that makes RKVDEC unstable - ** revert that **

log

5.15.8 Build tested on all of:

PROJECT=Allwinner ARCH=arm DEVICE=A64 s/build linux
PROJECT=Allwinner ARCH=arm DEVICE=H3 s/build linux
PROJECT=Allwinner ARCH=arm DEVICE=H5 s/build linux
PROJECT=Allwinner ARCH=arm DEVICE=H6 s/build linux
PROJECT=Rockchip ARCH=arm DEVICE=RK3288 s/build linux
PROJECT=Rockchip ARCH=arm DEVICE=RK3328 s/build linux
PROJECT=Rockchip ARCH=arm DEVICE=RK3399 s/build linux
PROJECT=NXP ARCH=arm DEVICE=iMX6 s/build linux
PROJECT=NXP ARCH=arm DEVICE=iMX8 s/build linux
PROJECT=Qualcomm ARCH=arm DEVICE=Dragonboard s/build linux
PROJECT=Samsung ARCH=arm DEVICE=Exynos s/build linux
PROJECT=Generic ARCH=x86_64 DEVICE=Generic s/build linux
PROJECT=Generic ARCH=x86_64 DEVICE=Generic-legacy s/build linux

5.15.y Run tested on all of:

  • Allwinner all - tested - 5.15.0 - jernejsk
  • Allwinner H6 (Tanix TX6) - 5.15.4 - heitbaum
  • Generic Generic (Intel TGL - NUC11) - 5.15.8 - heitbaum
  • NXP iMX6 (Cubox-i4Pro) - 5.15.0 - heitbaum
  • Rockchip RK3399pro (Rock Pi N10) - 5.15.4-rc1 - heitbaum
  • RK all - tested - 5.15.0 - knaerzche
  • Samsung Exynos (Hardkernel ODROID XU4) - 5.15.0 - heitbaum
  • Also tested on out of tree:
    • Allwinner D1 (NeZha) - 5.15.0 - heitbaum
    • Allwinner A20 (BananaPi) - 5.15.0 - heitbaum

@knaerzche
Copy link
Contributor

torvalds/linux@b811a45
when you get to update the kernels again, whatch out for patch b811a451519036e54d1af10e695c9b2ff014fcc3 (remove IOVA cookie in rockchip iommu), that makes RKVDEC unstable - ** revert that **

I don't think so: This commit was merged in 5.15-rc1 and I can't find any issues in current nightlites or when doing conformance tests. do you @heitbaum ?

@heitbaum
Copy link
Contributor Author

heitbaum commented Dec 4, 2021

torvalds/linux@b811a45
when you get to update the kernels again, whatch out for patch b811a451519036e54d1af10e695c9b2ff014fcc3 (remove IOVA cookie in rockchip iommu), that makes RKVDEC unstable - ** revert that **

I don't think so: This commit was merged in 5.15-rc1 and I can't find any issues in current nightlites or when doing conformance tests. do you @heitbaum ?

It has behaved for me. I’ll put strike-though through it.

@heitbaum heitbaum force-pushed the kernel11 branch 3 times, most recently from 09a7bd7 to 7c3bce8 Compare December 12, 2021 02:34
@MastaG
Copy link

MastaG commented Dec 13, 2021

@heitbaum
Is there going to be support for the Odroid XU4?
Because last we checked we couldn't get the MFC video decoder working in 5.10.

Also shouldn't there be a Kodi patch for switching on the v4l2-m2m decoder (as prime isn't working on the wayland driver).

@heitbaum
Copy link
Contributor Author

@heitbaum Is there going to be support for the Odroid XU4? Because last we checked we couldn't get the MFC video decoder working in 5.10.

Also shouldn't there be a Kodi patch for switching on the v4l2-m2m decoder (as prime isn't working on the wayland driver).

Hi @MastaG - I picked up a XU4 so as to test the LE build. Mine does boot through to the Kodi screen - then it crashes. As I understand it - the last good kernel is 5.4 before the changes in the Samsung code in the kernel.

@MastaG
Copy link

MastaG commented Dec 13, 2021

Well I have Kodi running on both GBM and Wayland (using the same mali driver) on Linux 5.8.
A while ago it wouldn't run on 5.10 because the MFC didn't work.
But I'll try on 5.15 using your patch set and report back :)

The crashes have been fixed by AreaScout.

--- a/xbmc/windowing/gbm/GBMUtils.cpp
+++ b/xbmc/windowing/gbm/GBMUtils.cpp
@@ -74,24 +74,29 @@ CGBMUtils::CGBMDevice::CGBMSurface::CGBMSurface(gbm_surface* surface) : m_surfac
 {
 }
 
+#define MAX_SURFACE_BUFFERS 3
 CGBMUtils::CGBMDevice::CGBMSurface::CGBMSurfaceBuffer* CGBMUtils::CGBMDevice::CGBMSurface::
     LockFrontBuffer()
 {
-  m_buffers.emplace(std::make_unique<CGBMSurfaceBuffer>(m_surface));
 
-  if (!static_cast<bool>(gbm_surface_has_free_buffers(m_surface)))
+ /* Fix for ODROID XU4, gbm_surface_has_free_buffers doesn't seem to report if there
+  * are no buffers available instead GEM buffers are running out, so we manually empty
+  * the buffers here for a maximum of three
+  */
+  std::call_once(
+     flag, [this]() { CLog::Log(LOGDEBUG, "CGBMUtils - using {} buffers", MAX_SURFACE_BUFFERS); });
+
+  if (m_buffers.size() >= MAX_SURFACE_BUFFERS)
   {
-    /*
-     * We want to use call_once here because we want it to be logged the first time that
-     * we have to release buffers. This means that the maximum amount of buffers had been reached.
-     * For mesa this should be 4 buffers but it may vary accross other implementations.
-     */
-    std::call_once(
-        flag, [this]() { CLog::Log(LOGDEBUG, "CGBMUtils - using {} buffers", m_buffers.size()); });
-
-    m_buffers.pop();
+      while (!m_buffers.empty())
+      {
+        m_buffers.front();
+        m_buffers.pop();
+      }
   }
 
+  m_buffers.emplace(std::make_unique<CGBMSurfaceBuffer>(m_surface));
+
   return m_buffers.back().get();
 }

See the full patch for XU4:
odroid_xu4_matrix.zip

Some clarifications:

  • I disable GBM_BO_MAP/UNMAP because the mali driver doesn't support it
  • I disable the DMABUF support in RetroPlayer bacause the mali driver doesn't have it working, so only use the OpenGLES renderer for the moment
  • Fix crash for gbm_surface_has_free_buffers by AreaScout
  • DRM Prime doesn't work and is disabled by default
  • Use V4L2-m2m decoder for supported formats and properly display when it's being used (hardware decoding)
  • Fix FPS counter (and allow setting the refresh-rate to it) by AreaScout
  • Allow Kodi to use the cursor plane so it can render the GUI and player to separate planes by Memeka

With this patch, Kodi should work out of the box on XU4 on both GBM and Wayland, including RetroPlayer.

Now for your mali-midgard kernel driver, I wonder how you get it to build on recent kernels.
For example: https://github.com/LibreELEC/mali-midgard/blob/4d72a50cd76e2cdeef25fec113e3f6b3396f6e3c/driver/product/kernel/drivers/base/dma_buf_lock/src/dma_buf_lock.c#L32
It needs to be replaced with: #include <linux/dma-resv.h>

Just my 2 cents :)

@heitbaum
Copy link
Contributor Author

Now for your mali-midgard kernel driver, I wonder how you get it to build on recent kernels. For example: https://github.com/LibreELEC/mali-midgard/blob/4d72a50cd76e2cdeef25fec113e3f6b3396f6e3c/driver/product/kernel/drivers/base/dma_buf_lock/src/dma_buf_lock.c#L32 It needs to be replaced with: #include <linux/dma-resv.h>

Just my 2 cents :)

I haven’t looked into the above - yet, but tested he build just now completing the 5.15.8 test builds. Interested to have a go though. Might have some time in the next couple weeks. Quiet time at work. Here are my build logs from Mali-Midgard - http://ix.io/3ImR - which is 4d72a50cd76e2cdeef25fec113e3f6b3396f6e3c

If you would like to write the PR, I’d be happy to test.

@heitbaum heitbaum marked this pull request as ready for review December 14, 2021 13:43
@CvH CvH merged commit 216778f into LibreELEC:master Dec 14, 2021
@heitbaum heitbaum deleted the kernel11 branch December 15, 2021 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants