mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
mesa: add patch to fix YUV to RGB conversion
This adds a patch to mesa that fixes color space conversion for lima GPUs and allows to drop a kodi hack that was need to allow SW decoing on mali 4xx GPUs for Rockchip. For details see: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8549#note_785097
This commit is contained in:
parent
cdb1ffc1c0
commit
08307d58ff
@ -0,0 +1,36 @@
|
||||
From 9e361182db9ebca3514c055563f8ac459409ec7a Mon Sep 17 00:00:00 2001
|
||||
From: Erico Nunes <nunes.erico@gmail.com>
|
||||
Date: Mon, 1 Feb 2021 01:27:50 +0100
|
||||
Subject: [PATCH] lima: always set stride in texture descriptor
|
||||
|
||||
We can just always specify the stride parameter regardless of whether
|
||||
an alignment was forced or not. This fixes some issues where it is not
|
||||
straightforward to detect the need to specify stride by checking the
|
||||
buffer width (e.g. imported dmabuf to be used as texture).
|
||||
|
||||
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
|
||||
---
|
||||
src/gallium/drivers/lima/lima_texture.c | 7 ++-----
|
||||
1 file changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/gallium/drivers/lima/lima_texture.c b/src/gallium/drivers/lima/lima_texture.c
|
||||
index 4ac363178a9..7079865a3b5 100644
|
||||
--- a/src/gallium/drivers/lima/lima_texture.c
|
||||
+++ b/src/gallium/drivers/lima/lima_texture.c
|
||||
@@ -91,11 +91,8 @@ lima_texture_desc_set_res(struct lima_context *ctx, lima_tex_desc *desc,
|
||||
if (lima_res->tiled)
|
||||
layout = 3;
|
||||
else {
|
||||
- /* for padded linear texture */
|
||||
- if (lima_res->levels[first_level].width != width) {
|
||||
- desc->stride = lima_res->levels[first_level].stride;
|
||||
- desc->has_stride = 1;
|
||||
- }
|
||||
+ desc->stride = lima_res->levels[first_level].stride;
|
||||
+ desc->has_stride = 1;
|
||||
layout = 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 7479f183788ad47dc5ab74666808c29b7c272531 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Thu, 14 Jan 2021 23:51:20 +0100
|
||||
Subject: [PATCH] HACKOFF: DRMPRIMEGLES: avoid for lima due to broken
|
||||
YU12->XR24 conversion
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp | 2 +-
|
||||
.../VideoRenderers/HwDecRender/RendererDRMPRIMEGLES.cpp | 5 +++++
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp
|
||||
index 8c78f1beac..241a307351 100644
|
||||
--- a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp
|
||||
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp
|
||||
@@ -329,7 +329,7 @@ EShaderFormat CBaseRenderer::GetShaderFormat()
|
||||
{
|
||||
EShaderFormat ret = SHADER_NONE;
|
||||
|
||||
- if (m_format == AV_PIX_FMT_YUV420P)
|
||||
+ if (m_format == AV_PIX_FMT_YUV420P || m_format == AV_PIX_FMT_DRM_PRIME)
|
||||
ret = SHADER_YV12;
|
||||
else if (m_format == AV_PIX_FMT_YUV420P9)
|
||||
ret = SHADER_YV12_9;
|
||||
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIMEGLES.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIMEGLES.cpp
|
||||
index c1d69bf381..d33b58a321 100644
|
||||
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIMEGLES.cpp
|
||||
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIMEGLES.cpp
|
||||
@@ -59,6 +59,11 @@ CBaseRenderer* CRendererDRMPRIMEGLES::Create(CVideoBuffer* buffer)
|
||||
if (!winSystemEGL)
|
||||
return nullptr;
|
||||
|
||||
+ if (CServiceBroker::GetRenderSystem()->GetRenderVendor() == "lima")
|
||||
+ {
|
||||
+ CLog::LogF(LOGDEBUG, "Not using DRMPRIMEGLES due to broken mesa lima driver.");
|
||||
+ return nullptr;
|
||||
+ }
|
||||
CEGLImage image{winSystemEGL->GetEGLDisplay()};
|
||||
if (!image.SupportsFormatAndModifier(format, modifier))
|
||||
return nullptr;
|
||||
--
|
||||
2.25.1
|
||||
|
Loading…
x
Reference in New Issue
Block a user