From 6204783c642c92e3d59d0cbea494df59d5958cd7 Mon Sep 17 00:00:00 2001 From: Valentin Jec Date: Fri, 26 Jul 2024 18:25:22 +0300 Subject: mesa-demos: Add patch for egl clear backgrounds black color mesa: Add patches for video showing wrong frame and fix virgl driver assert issue Signed-off-by: Valentin Jec --- .../0001-egl-clear-backgrounds-black.patch | 30 ++++++++++++++ recipes-graphics/mesa/mesa-demos_%.bbappend | 3 +- ...GS-7599-cso-fix-virgl-driver-assert-issue.patch | 47 ++++++++++++++++++++++ ...73-egl-dri2-fix-video-showing-wrong-frame.patch | 33 +++++++++++++++ recipes-graphics/mesa/mesa_%.bbappend | 3 ++ 5 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 recipes-graphics/mesa/mesa-demos/0001-egl-clear-backgrounds-black.patch create mode 100644 recipes-graphics/mesa/mesa/0001-MGS-7599-cso-fix-virgl-driver-assert-issue.patch create mode 100644 recipes-graphics/mesa/mesa/0001-MGS-7673-egl-dri2-fix-video-showing-wrong-frame.patch diff --git a/recipes-graphics/mesa/mesa-demos/0001-egl-clear-backgrounds-black.patch b/recipes-graphics/mesa/mesa-demos/0001-egl-clear-backgrounds-black.patch new file mode 100644 index 000000000..fa46823f1 --- /dev/null +++ b/recipes-graphics/mesa/mesa-demos/0001-egl-clear-backgrounds-black.patch @@ -0,0 +1,30 @@ +From cad7eb0f0487aea64c4460bd6ad95b5c9537d35a Mon Sep 17 00:00:00 2001 +From: Jiyu Yang +Date: Thu, 11 Apr 2024 16:30:50 +0800 +Subject: [PATCH] egl: clear backgrounds black + +if 50% translucency used, the application render result can vary +depending on the format chosen, such as R10G10B10A2 or RGB24. + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/demos/-/merge_requests/174] +Signed-off-by: Jiyu Yang +--- + src/egl/opengles2/es2gears.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/egl/opengles2/es2gears.c b/src/egl/opengles2/es2gears.c +index db67f3a9..4e81afe7 100644 +--- a/src/egl/opengles2/es2gears.c ++++ b/src/egl/opengles2/es2gears.c +@@ -515,7 +515,7 @@ gears_draw(void) + GLfloat transform[16]; + identity(transform); + +- glClearColor(0.0, 0.0, 0.0, 0.0); ++ glClearColor(0.0, 0.0, 0.0, 1.0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + /* Translate and rotate the view */ +-- +2.34.1 + diff --git a/recipes-graphics/mesa/mesa-demos_%.bbappend b/recipes-graphics/mesa/mesa-demos_%.bbappend index ff5d71ae1..1c5dd3daf 100644 --- a/recipes-graphics/mesa/mesa-demos_%.bbappend +++ b/recipes-graphics/mesa/mesa-demos_%.bbappend @@ -2,7 +2,8 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" SRC_URI:append:imxgpu = " \ file://Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch \ - file://fix-clear-build-break.patch" + file://fix-clear-build-break.patch \ + file://0001-egl-clear-backgrounds-black.patch" REQUIRED_DISTRO_FEATURES:remove:imxgpu = "x11" diff --git a/recipes-graphics/mesa/mesa/0001-MGS-7599-cso-fix-virgl-driver-assert-issue.patch b/recipes-graphics/mesa/mesa/0001-MGS-7599-cso-fix-virgl-driver-assert-issue.patch new file mode 100644 index 000000000..3dc8db099 --- /dev/null +++ b/recipes-graphics/mesa/mesa/0001-MGS-7599-cso-fix-virgl-driver-assert-issue.patch @@ -0,0 +1,47 @@ +From 612c3dc98d5d050b9cfee16ec77ca3c8358caa0d Mon Sep 17 00:00:00 2001 +From: Wujian Sun +Date: Mon, 29 Apr 2024 17:29:16 +0800 +Subject: [PATCH] MGS-7599 cso: fix virgl driver assert issue + +A workaround that remove PIPE_MAX_SAMPLERS and +PIPE_MAX_CONSTANT_BUFFERS assert. + +Upstream-Status: Inappropriate [i.MX-specific] + +Signed-off-by: Wujian Sun +--- + src/gallium/auxiliary/cso_cache/cso_context.c | 2 -- + src/gallium/drivers/virgl/virgl_screen.c | 2 +- + 2 files changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c +index 3e86def31c5..ffc6d22da9c 100644 +--- a/src/gallium/auxiliary/cso_cache/cso_context.c ++++ b/src/gallium/auxiliary/cso_cache/cso_context.c +@@ -403,10 +403,8 @@ cso_unbind_context(struct cso_context *ctx) + PIPE_SHADER_CAP_MAX_CONST_BUFFERS); + int maximg = scr->get_shader_param(scr, sh, + PIPE_SHADER_CAP_MAX_SHADER_IMAGES); +- assert(maxsam <= PIPE_MAX_SAMPLERS); + assert(maxview <= PIPE_MAX_SHADER_SAMPLER_VIEWS); + assert(maxssbo <= PIPE_MAX_SHADER_BUFFERS); +- assert(maxcb <= PIPE_MAX_CONSTANT_BUFFERS); + assert(maximg <= PIPE_MAX_SHADER_IMAGES); + if (maxsam > 0) { + ctx->base.pipe->bind_sampler_states(ctx->base.pipe, sh, 0, maxsam, zeros); +diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c +index 389a1935cc3..7c7f8ba576b 100644 +--- a/src/gallium/drivers/virgl/virgl_screen.c ++++ b/src/gallium/drivers/virgl/virgl_screen.c +@@ -435,7 +435,7 @@ virgl_get_shader_param(struct pipe_screen *screen, + return 1; + case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: + return MIN2(vscreen->caps.caps.v2.max_shader_sampler_views, +- PIPE_MAX_SHADER_SAMPLER_VIEWS); ++ PIPE_MAX_SAMPLERS); + case PIPE_SHADER_CAP_INTEGERS: + return vscreen->caps.caps.v1.glsl_level >= 130; + case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH: +-- +2.17.1 + diff --git a/recipes-graphics/mesa/mesa/0001-MGS-7673-egl-dri2-fix-video-showing-wrong-frame.patch b/recipes-graphics/mesa/mesa/0001-MGS-7673-egl-dri2-fix-video-showing-wrong-frame.patch new file mode 100644 index 000000000..0cdcbfca6 --- /dev/null +++ b/recipes-graphics/mesa/mesa/0001-MGS-7673-egl-dri2-fix-video-showing-wrong-frame.patch @@ -0,0 +1,33 @@ +From 188d7b01037e5a0249e63c2600cf15a288a9ff3f Mon Sep 17 00:00:00 2001 +From: Wujian Sun +Date: Fri, 19 Apr 2024 18:38:17 +0800 +Subject: [PATCH] MGS-7673 egl/dri2: fix video showing wrong frame + +Softpipe driver doesn't support EGL_EXT_image_dma_buf_import_modifiers +extension. +Should not report the extension. + +Upstream-Status: Pending + +Signed-off-by: Wujian Sun +--- + src/egl/drivers/dri2/egl_dri2.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c +index 992f0e3d46d..6ee209d4b47 100644 +--- a/src/egl/drivers/dri2/egl_dri2.c ++++ b/src/egl/drivers/dri2/egl_dri2.c +@@ -942,7 +942,8 @@ dri2_setup_screen(_EGLDisplay *disp) + + #ifdef HAVE_LIBDRM + if (dri2_dpy->image->base.version >= 8 && +- dri2_dpy->image->createImageFromDmaBufs) { ++ dri2_dpy->image->createImageFromDmaBufs && ++ strcmp("softpipe", pscreen->get_name(pscreen))) { + disp->Extensions.EXT_image_dma_buf_import = EGL_TRUE; + disp->Extensions.EXT_image_dma_buf_import_modifiers = EGL_TRUE; + } +-- +2.17.1 + diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa_%.bbappend index acddfbc66..f2375a55c 100644 --- a/recipes-graphics/mesa/mesa_%.bbappend +++ b/recipes-graphics/mesa/mesa_%.bbappend @@ -1,6 +1,9 @@ PROVIDES:remove:imxgpu = "virtual/egl" PROVIDES:remove:imxgpu3d = "virtual/libgl virtual/libgles1 virtual/libgles2" +SRC_URI:append:mx93-nxp-bsp = " file://0001-MGS-7673-egl-dri2-fix-video-showing-wrong-frame.patch" +SRC_URI:append:imx-nxp-bsp = " file://0001-MGS-7599-cso-fix-virgl-driver-assert-issue.patch" + PACKAGECONFIG:remove:imxgpu = "egl gbm" PACKAGECONFIG:remove:imxgpu3d = "gles" -- cgit v1.2.3-54-g00ecf