From 95785698731f88471d24fd523d04c72656c5fbcb Mon Sep 17 00:00:00 2001 From: Tianhao Ni Date: Tue, 23 Nov 2021 09:29:36 +0800 Subject: 1.Update spec file 2.Fix GLES31 eglSwapBuffers issue: - GLES31 CTS, TC will call eglSwapBuffers without any draw call, in this case tbm_surface will be NULL, but this should not be an error. Change-Id: I2eeda60f9581c40158ebec328024cb8f107dc646 Signed-off-by: Tianhao Ni --- packaging/mesa.spec | 68 ++++++++++++++++++++--------------- src/egl/drivers/dri2/platform_tizen.c | 18 ++++++---- 2 files changed, 52 insertions(+), 34 deletions(-) diff --git a/packaging/mesa.spec b/packaging/mesa.spec index d7d54f01b59..85c068ea608 100644 --- a/packaging/mesa.spec +++ b/packaging/mesa.spec @@ -1,5 +1,5 @@ Name: mesa -Version: 19.3.0 +Version: 21.2.3 Release: 0 License: MIT and Apache-2.0 and SGI Free Software License B v2.0 and BSD-3-Clause Summary: System for rendering interactive 3-D graphics @@ -39,10 +39,32 @@ BuildRequires: pkgconfig(libdrm_intel) >= 2.4.24 ExclusiveArch: %endif +%define USE_LLVM 0 +%define USE_GBM 0 %define USE_VULKAN 0 %define VULKAN_DRIVER broadcom -%define USE_GBM 0 +%define enable_driver() %{expand:%%{?!enable_%{1}: %%global enable_%{1} 1}} + +%ifarch %ix86 x86_64 +%define gallium_drivers "i915,swrast" +%define vulkan_drivers "" +%define dri_drivers "" +%else +%if %{USE_LLVM} == 1 +%enable_driver llvm +%endif +%if %{USE_GBM} == 1 +%enable_driver gbm +%endif +%if %{USE_VULKAN} == 1 +%enable_driver vulkan +%endif +%define gallium_drivers "vc4,v3d,kmsro%{?!enable_llvm:,swrast}" +%define vulkan_drivers "%{?enable_vulkan:%{VULKAN_DRIVER}}" +%define dri_drivers "auto" +%endif + %description Mesa is a 3-D graphics library with an API which is very similar to @@ -69,32 +91,22 @@ cp %{SOURCE1002} . mkdir build meson --prefix %{_hal_prefix} build/ \ - -Dc_link_args="-lttrace" \ - -Dcpp_link_args="-lttrace" \ - -Dlibdir=%{_hal_libdir} \ - -Dgallium-va=false \ - -Dgallium-vdpau=false \ - -Dgallium-xa=false \ - -Dgallium-xvmc=false \ - -Dglx=disabled \ - -Ddri3=false \ - -Dllvm=enabled \ -%if "%{USE_GBM}" == "1" - -Dgbm=true \ -%else - -Dgbm=false \ -%endif - -Dplatforms="tizen" \ -%ifarch %ix86 x86_64 - -Dgallium-drivers="i915,swrast" \ - -Ddri-drivers="" \ - -Dvulkan-drivers="" -%else -%if "%{USE_VULKAN}" == "1" - -Dvulkan-drivers="%{VULKAN_DRIVER}" \ -%endif - -Dgallium-drivers="vc4,v3d,kmsro,swrast" -%endif + -Dc_link_args="-lttrace" \ + -Dcpp_link_args="-lttrace" \ + -Dlibdir=%{_hal_libdir} \ + -Dgallium-va=false \ + -Dgallium-vdpau=false \ + -Dgallium-xa=false \ + -Dgallium-xvmc=false \ + -Dglx=disabled \ + -Ddri3=false \ + -Dllvm=%{?enable_llvm:enabled}%{?!enable_llvm:disabled} \ + -Dgbm=%{?enable_gbm:enabled}%{?!enable_gbm:disabled} \ + -Dplatforms="tizen" \ + -Dgallium-drivers=%{gallium_drivers} \ + -Ddri-drivers=%{dri_drivers} \ + -Dvulkan-drivers=%{vulkan_drivers} + ninja -C build/ diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c index 1b1ee618b87..83c3b426476 100755 --- a/src/egl/drivers/dri2/platform_tizen.c +++ b/src/egl/drivers/dri2/platform_tizen.c @@ -773,14 +773,20 @@ tizen_swap_buffers_with_damage(_EGLDisplay *disp, dri2_surf->color_buffers[i].age++; } - /* Make sure we have a back buffer in case we're swapping without - * ever rendering. */ - if (get_back_bo(dri2_surf, 0) < 0) { - _eglError(EGL_BAD_ALLOC, "dri2_swap_buffers"); - return EGL_FALSE; + /* In case that application didn't draw anything before swapbuffer, + * dri2_surf->tbm_surface will be NULL here, but this should not be + * an error */ + if (dri2_surf->tbm_surface) { + /* Make sure we have a back buffer in case we're swapping without + * ever rendering. */ + if (get_back_bo(dri2_surf, 0) < 0) { + _eglError(EGL_BAD_ALLOC, "dri2_swap_buffers"); + return EGL_FALSE; + } } - dri2_surf->back->age = 1; + if (dri2_surf->back) + dri2_surf->back->age = 1; TRACE_BEGIN("DRI2_SWAP_BUFERS"); /* The buffer to enqueue should be the buffer in which -- cgit v1.2.3