Mesa: cleanup old recipes (#13592)

* Delete mesa-23.1.9.recipe

* Delete mesa-24.1.4.recipe

* Delete mesa-23.1.9.patchset

* Delete mesa-24.1.4.patchset
This commit is contained in:
kenmays
2026-01-10 00:13:57 -08:00
committed by GitHub
parent 7cb8f104d7
commit e44b520baa
4 changed files with 0 additions and 657 deletions

View File

@@ -1,190 +0,0 @@
SUMMARY="Multi-platform GL implementation"
DESCRIPTION="Mesa is an open-source implementation of the OpenGL \
specification, which documents a system for rendering interactive \
3D graphics. Mesa fills the role of the Haiku OpenGL kit, \
providing 3D rendering to Haiku applications."
HOMEPAGE="https://www.mesa3d.org/"
COPYRIGHT="1999-2023 Brian Paul"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-${portVersion}.tar.xz"
CHECKSUM_SHA256="295ba27c28146ed09214e8ce79afa1659edf9d142decc3c91f804552d64f7510"
PATCHES="mesa-$portVersion.patchset"
ADDITIONAL_FILES="50_mesa.json"
ARCHITECTURES="?all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"
libVersion=1.0.0
libOSMesaVersion=8.0.0
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
libOSMesaVersionCompat="$libOSMesaVersion compat >= ${libOSMesaVersion%%.*}"
PROVIDES="
mesa$secondaryArchSuffix = $portVersion
lib:libOSMesa$secondaryArchSuffix = $libOSMesaVersionCompat
lib:libglapi$secondaryArchSuffix = 0.0.0
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libz$secondaryArchSuffix
lib:libLLVM_12$secondaryArchSuffix
lib:libexpat$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
"
PROVIDES_devel="
mesa${secondaryArchSuffix}_devel = $portVersion
devel:libOSMesa$secondaryArchSuffix = $libOSMesaVersionCompat
devel:libglapi$secondaryArchSuffix = 0.0.0
"
REQUIRES_devel="
mesa$secondaryArchSuffix == $portVersion base
devel:libGL$secondaryArchSuffix
"
SUMMARY_eglvnd="The Mesa glvnd rendering drivers for Haiku"
DESCRIPTION_eglvnd="This glvnd rendering driver package provides \
software pipe rendering (with LLVM-bosted performance)."
PROVIDES_eglvnd="
mesa${secondaryArchSuffix}_eglvnd = $portVersion
"
REQUIRES_eglvnd="
mesa$secondaryArchSuffix == $portVersion base
lib:libLLVM_12$secondaryArchSuffix
"
SUMMARY_lavapipe="Vulkan software rasteriser driver"
DESCRIPTION_lavapipe="Lavapipe is Mesa's software-based Vulkan 1.2 \
implementation akin to LLVMpipe for OpenGL."
PROVIDES_lavapipe="
mesa${secondaryArchSuffix}_lavapipe = $portVersion
"
REQUIRES_lavapipe="
lib:libLLVM_12$secondaryArchSuffix
"
# We require libglvnd_devel for now for clairity since there is no
# libglvnd.so and mesa 22.x provides our devel:libGL
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
libglvnd${secondaryArchSuffix}_devel
devel:libz$secondaryArchSuffix
devel:libLLVM_12$secondaryArchSuffix
devel:libexpat$secondaryArchSuffix
devel:libvulkan$secondaryArchSuffix
"
BUILD_PREREQUIRES="
python310$secondaryArchSuffix
mako_python310
cmd:ninja
cmd:bison
cmd:find
cmd:flex
cmd:meson
cmd:git
cmd:llvm_config >= 12
cmd:egrep
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:pkg_config$secondaryArchSuffix
cmd:which
"
defineDebugInfoPackage mesa$secondaryArchSuffix \
"${addOnsDir/mesa$secondaryArchSuffix/mesa${secondaryArchSuffix}_eglvnd}/opengl/egl_vendor.d/libEGL_mesa.so.0" \
"${addOnsDir/mesa$secondaryArchSuffix/mesa${secondaryArchSuffix}_lavapipe}/vulkan/icd.d/libvulkan_lvp.so" \
"$libDir"/libOSMesa.so.$libOSMesaVersion \
BUILD()
{
if [ -n "$secondaryArchSuffix" ]; then
export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture"
fi
mkdir -p build
# In the future, all we need to do is enable other gallium
# drivers so libEGL_mesa contains other drivers in addition
# to llvm swpipe.
meson build \
-Dosmesa=true -Degl=enabled -Dglvnd=true \
-Dgallium-drivers=swrast \
-Dvulkan-drivers=swrast \
-Dvulkan-icd-dir=$addOnsDir/vulkan/icd.d \
--buildtype=debugoptimized \
--prefix=$prefix \
--libdir=$libDir \
--includedir=$includeDir/os/opengl
ninja -C build $jobArgs
}
INSTALL()
{
ninja -C build install
# Do a little cleanup
rm -rf $prefix/share
# Mesa's EGL render driver
mkdir -p $addOnsDir/opengl/egl_vendor.d
mv $libDir/libEGL_mesa.so* "$addOnsDir/opengl/egl_vendor.d/"
# Vulkan lavapipe driver
mv $libDir/libvulkan_lvp.so \
"$addOnsDir/vulkan/icd.d"
# remove stock glvnd json
rm -rf $dataDir/glvnd
# remove dri stuff
rm -rf $dataDir/drirc.d
rm -rf $libDir/haiku
# Configure Mesa EGL Vendor Renderer
cp "$portDir/additional-files/50_mesa.json" "$addOnsDir/opengl/egl_vendor.d/"
# Configure vulkan lavapipe render (Fix path)
sed -i "s/\/packages\/mesa-.*\/.self\/lib\/libvulkan_lvp.so/.\/libvulkan_lvp.so/" $addOnsDir/vulkan/icd.d/lvp_icd.x86_64.json
# Set some nice version info
appVersion=${portVersion//\./ }
setversion "$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0.0.0" -app $appVersion -long \
"Mesa EGL rendering drivers"
setversion "$addOnsDir/vulkan/icd.d/libvulkan_lvp.so" -app $appVersion -long \
"Vulkan software rasteriser driver"
prepareInstalledDevelLibs \
libOSMesa
fixPkgconfig
sed -i 's/develop\/headers$/develop\/headers\/os\/opengl/' $installDestDir$developLibDir/pkgconfig/osmesa.pc
# devel package
packageEntries devel \
$developDir
# swpipe renderer package
packageEntries eglvnd \
"$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0.0.0" \
"$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0" \
"$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so" \
"$addOnsDir/opengl/egl_vendor.d/50_mesa.json"
# lavapipe renderer package
packageEntries lavapipe \
"$addOnsDir/vulkan/icd.d/libvulkan_lvp.so" \
"$addOnsDir/vulkan/icd.d/lvp_icd.x86_64.json"
# Remove empty directories from mesa package
rmdir "$addOnsDir/vulkan/icd.d"
rmdir "$addOnsDir/vulkan"
rmdir "$addOnsDir/opengl/egl_vendor.d"
rmdir "$addOnsDir/opengl"
}
TEST()
{
make check
}

View File

@@ -1,190 +0,0 @@
SUMMARY="Multi-platform GL implementation"
DESCRIPTION="Mesa is an open-source implementation of the OpenGL \
specification, which documents a system for rendering interactive \
3D graphics. Mesa fills the role of the Haiku OpenGL kit, \
providing 3D rendering to Haiku applications."
HOMEPAGE="https://www.mesa3d.org/"
COPYRIGHT="1999-2023 Brian Paul"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-${portVersion}.tar.xz"
CHECKSUM_SHA256="7cf7c6f665263ad0122889c1d4b076654c1eedea7a2f38c69c8c51579937ade1"
PATCHES="mesa-$portVersion.patchset"
ADDITIONAL_FILES="50_mesa.json"
ARCHITECTURES="?all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"
libVersion=1.0.0
libOSMesaVersion=8.0.0
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
libOSMesaVersionCompat="$libOSMesaVersion compat >= ${libOSMesaVersion%%.*}"
PROVIDES="
mesa$secondaryArchSuffix = $portVersion
lib:libOSMesa$secondaryArchSuffix = $libOSMesaVersionCompat
lib:libglapi$secondaryArchSuffix = 0.0.0
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libz$secondaryArchSuffix
lib:libLLVM_17$secondaryArchSuffix
lib:libexpat$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
"
PROVIDES_devel="
mesa${secondaryArchSuffix}_devel = $portVersion
devel:libOSMesa$secondaryArchSuffix = $libOSMesaVersionCompat
devel:libglapi$secondaryArchSuffix = 0.0.0
"
REQUIRES_devel="
mesa$secondaryArchSuffix == $portVersion base
devel:libGL$secondaryArchSuffix
"
SUMMARY_eglvnd="The Mesa glvnd rendering drivers for Haiku"
DESCRIPTION_eglvnd="This glvnd rendering driver package provides \
software pipe rendering (with LLVM-bosted performance)."
PROVIDES_eglvnd="
mesa${secondaryArchSuffix}_eglvnd = $portVersion
"
REQUIRES_eglvnd="
mesa$secondaryArchSuffix == $portVersion base
lib:libLLVM_17$secondaryArchSuffix
"
SUMMARY_lavapipe="Vulkan software rasteriser driver"
DESCRIPTION_lavapipe="Lavapipe is Mesa's software-based Vulkan 1.2 \
implementation akin to LLVMpipe for OpenGL."
PROVIDES_lavapipe="
mesa${secondaryArchSuffix}_lavapipe = $portVersion
"
REQUIRES_lavapipe="
lib:libLLVM_17$secondaryArchSuffix
"
# We require libglvnd_devel for now for clairity since there is no
# libglvnd.so and mesa 22.x provides our devel:libGL
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
libglvnd${secondaryArchSuffix}_devel
devel:libz$secondaryArchSuffix
devel:libLLVM_17$secondaryArchSuffix
devel:libexpat$secondaryArchSuffix
devel:libvulkan$secondaryArchSuffix
"
BUILD_PREREQUIRES="
python3.10$secondaryArchSuffix
mako_python310
cmd:ninja
cmd:bison
cmd:find
cmd:flex
cmd:meson
cmd:git
cmd:llvm_config >= 17
cmd:egrep
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:pkg_config$secondaryArchSuffix
cmd:which
"
defineDebugInfoPackage mesa$secondaryArchSuffix \
"${addOnsDir/mesa$secondaryArchSuffix/mesa${secondaryArchSuffix}_eglvnd}/opengl/egl_vendor.d/libEGL_mesa.so.0" \
"${addOnsDir/mesa$secondaryArchSuffix/mesa${secondaryArchSuffix}_lavapipe}/vulkan/icd.d/libvulkan_lvp.so" \
"$libDir"/libOSMesa.so.$libOSMesaVersion \
BUILD()
{
if [ -n "$secondaryArchSuffix" ]; then
export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture"
fi
mkdir -p build
# In the future, all we need to do is enable other gallium
# drivers so libEGL_mesa contains other drivers in addition
# to llvm swpipe.
meson build \
-Dosmesa=true -Degl=enabled -Dglvnd=enabled \
-Dgallium-drivers=swrast \
-Dvulkan-drivers=swrast \
-Dvulkan-icd-dir=$addOnsDir/vulkan/icd.d \
--buildtype=debugoptimized \
--prefix=$prefix \
--libdir=$libDir \
--includedir=$includeDir/os/opengl
ninja -C build $jobArgs
}
INSTALL()
{
ninja -C build install
# Do a little cleanup
rm -rf $prefix/share
# Mesa's EGL render driver
mkdir -p $addOnsDir/opengl/egl_vendor.d
mv $libDir/libEGL_mesa.so* "$addOnsDir/opengl/egl_vendor.d/"
# Vulkan lavapipe driver
mv $libDir/libvulkan_lvp.so \
"$addOnsDir/vulkan/icd.d"
# remove stock glvnd json
rm -rf $dataDir/glvnd
# remove dri stuff
rm -rf $dataDir/drirc.d
rm -rf $libDir/haiku
# Configure Mesa EGL Vendor Renderer
cp "$portDir/additional-files/50_mesa.json" "$addOnsDir/opengl/egl_vendor.d/"
# Configure vulkan lavapipe render (Fix path)
sed -i "s/\/packages\/mesa-.*\/.self\/lib\/libvulkan_lvp.so/.\/libvulkan_lvp.so/" $addOnsDir/vulkan/icd.d/lvp_icd.x86_64.json
# Set some nice version info
appVersion=${portVersion//\./ }
setversion "$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0.0.0" -app $appVersion -long \
"Mesa EGL rendering drivers"
setversion "$addOnsDir/vulkan/icd.d/libvulkan_lvp.so" -app $appVersion -long \
"Vulkan software rasteriser driver"
prepareInstalledDevelLibs \
libOSMesa
fixPkgconfig
sed -i 's/develop\/headers$/develop\/headers\/os\/opengl/' $installDestDir$developLibDir/pkgconfig/osmesa.pc
# devel package
packageEntries devel \
$developDir
# swpipe renderer package
packageEntries eglvnd \
"$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0.0.0" \
"$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0" \
"$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so" \
"$addOnsDir/opengl/egl_vendor.d/50_mesa.json"
# lavapipe renderer package
packageEntries lavapipe \
"$addOnsDir/vulkan/icd.d/libvulkan_lvp.so" \
"$addOnsDir/vulkan/icd.d/lvp_icd.x86_64.json"
# Remove empty directories from mesa package
rmdir "$addOnsDir/vulkan/icd.d"
rmdir "$addOnsDir/vulkan"
rmdir "$addOnsDir/opengl/egl_vendor.d"
rmdir "$addOnsDir/opengl"
}
TEST()
{
make check
}

View File

@@ -1,193 +0,0 @@
From a0c384a6165b7e5ad021cb974a6c9c9fe391b492 Mon Sep 17 00:00:00 2001
From: Alexander von Gluck IV <kallisti5@unixzen.com>
Date: Sat, 15 Apr 2023 08:08:43 -0500
Subject: [PATCH] hgl: Redefine visual options in hgl_context.h
* For now, move the visual mask flags into hgl_context.h
* This removes an un-needed dependency on GLView.h from glvnd
* Eventually, these need converted into normal EGL parameters
---
src/egl/drivers/haiku/egl_haiku.cpp | 21 +++------------------
src/gallium/frontends/hgl/hgl.c | 18 ++++++++----------
src/gallium/frontends/hgl/hgl_context.h | 16 ++++++++++++++++
3 files changed, 27 insertions(+), 28 deletions(-)
diff --git a/src/egl/drivers/haiku/egl_haiku.cpp b/src/egl/drivers/haiku/egl_haiku.cpp
index 3069c7edb42..94866e12315 100644
--- a/src/egl/drivers/haiku/egl_haiku.cpp
+++ b/src/egl/drivers/haiku/egl_haiku.cpp
@@ -53,21 +53,6 @@ extern "C" {
#include "target-helpers/inline_sw_helper.h"
}
-#define BGL_RGB 0
-#define BGL_INDEX 1
-#define BGL_SINGLE 0
-#define BGL_DOUBLE 2
-#define BGL_DIRECT 0
-#define BGL_INDIRECT 4
-#define BGL_ACCUM 8
-#define BGL_ALPHA 16
-#define BGL_DEPTH 32
-#define BGL_OVERLAY 64
-#define BGL_UNDERLAY 128
-#define BGL_STENCIL 512
-#define BGL_SHARE_CONTEXT 1024
-
-
#ifdef DEBUG
# define TRACE(x...) printf("egl_haiku: " x)
# define CALLED() TRACE("CALLED: %s\n", __PRETTY_FUNCTION__)
@@ -121,7 +106,7 @@ haiku_create_window_surface(_EGLDisplay *disp, _EGLConfig *conf, void *native_wi
}
struct st_visual visual;
- hgl_get_st_visual(&visual, BGL_DOUBLE|BGL_DEPTH);
+ hgl_get_st_visual(&visual, HGL_DOUBLE|HGL_DEPTH);
wgl_surf->fb = hgl_create_st_framebuffer(hgl_dpy->disp, &visual, native_window);
if (!wgl_surf->fb) {
@@ -158,7 +143,7 @@ haiku_create_pbuffer_surface(_EGLDisplay *disp, _EGLConfig *conf, const EGLint *
struct st_visual visual;
- hgl_get_st_visual(&visual, BGL_DOUBLE|BGL_DEPTH);
+ hgl_get_st_visual(&visual, HGL_DOUBLE|HGL_DEPTH);
wgl_surf->fb = hgl_create_st_framebuffer(hgl_dpy->disp, &visual, NULL);
if (!wgl_surf->fb) {
@@ -429,7 +414,7 @@ haiku_create_context(_EGLDisplay *disp, _EGLConfig *conf,
struct haiku_egl_display *hgl_dpy = haiku_egl_display(disp);
struct st_visual visual;
- hgl_get_st_visual(&visual, BGL_DOUBLE|BGL_DEPTH);
+ hgl_get_st_visual(&visual, HGL_DOUBLE|HGL_DEPTH);
struct haiku_egl_context* context = (struct haiku_egl_context*) calloc(1, sizeof (*context));
if (!context) {
diff --git a/src/gallium/frontends/hgl/hgl.c b/src/gallium/frontends/hgl/hgl.c
index 7fd5745d90f..8392f2ad2f7 100644
--- a/src/gallium/frontends/hgl/hgl.c
+++ b/src/gallium/frontends/hgl/hgl.c
@@ -18,8 +18,6 @@
#include "util/u_inlines.h"
#include "state_tracker/st_context.h"
-#include "GLView.h"
-
#ifdef DEBUG
# define TRACE(x...) printf("hgl:frontend: " x)
@@ -321,39 +319,39 @@ hgl_get_st_visual(struct st_visual* visual, ulong options)
assert(visual);
// Determine color format
- if ((options & BGL_INDEX) != 0) {
+ if ((options & HGL_INDEX) != 0) {
// Index color
visual->color_format = PIPE_FORMAT_B5G6R5_UNORM;
// TODO: Indexed color depth buffer?
visual->depth_stencil_format = PIPE_FORMAT_NONE;
} else {
// RGB color
- visual->color_format = (options & BGL_ALPHA)
+ visual->color_format = (options & HGL_ALPHA)
? PIPE_FORMAT_BGRA8888_UNORM : PIPE_FORMAT_BGRX8888_UNORM;
// TODO: Determine additional stencil formats
- visual->depth_stencil_format = (options & BGL_DEPTH)
+ visual->depth_stencil_format = (options & HGL_DEPTH)
? PIPE_FORMAT_Z24_UNORM_S8_UINT : PIPE_FORMAT_NONE;
}
- visual->accum_format = (options & BGL_ACCUM)
+ visual->accum_format = (options & HGL_ACCUM)
? PIPE_FORMAT_R16G16B16A16_SNORM : PIPE_FORMAT_NONE;
visual->buffer_mask |= ST_ATTACHMENT_FRONT_LEFT_MASK;
- if ((options & BGL_DOUBLE) != 0) {
+ if ((options & HGL_DOUBLE) != 0) {
TRACE("double buffer enabled\n");
visual->buffer_mask |= ST_ATTACHMENT_BACK_LEFT_MASK;
}
#if 0
- if ((options & BGL_STEREO) != 0) {
+ if ((options & HGL_STEREO) != 0) {
visual->buffer_mask |= ST_ATTACHMENT_FRONT_RIGHT_MASK;
- if ((options & BGL_DOUBLE) != 0)
+ if ((options & HGL_DOUBLE) != 0)
visual->buffer_mask |= ST_ATTACHMENT_BACK_RIGHT_MASK;
}
#endif
- if ((options & BGL_DEPTH) || (options & BGL_STENCIL))
+ if ((options & HGL_DEPTH) || (options & HGL_STENCIL))
visual->buffer_mask |= ST_ATTACHMENT_DEPTH_STENCIL_MASK;
TRACE("%s: Visual color format: %s\n", __func__,
diff --git a/src/gallium/frontends/hgl/hgl_context.h b/src/gallium/frontends/hgl/hgl_context.h
index 03e567af2de..6c36bf93474 100644
--- a/src/gallium/frontends/hgl/hgl_context.h
+++ b/src/gallium/frontends/hgl/hgl_context.h
@@ -17,6 +17,22 @@
#include "frontend/api.h"
+// visual options
+#define HGL_RGB 0
+#define HGL_INDEX 1
+#define HGL_SINGLE 0
+#define HGL_DOUBLE 2
+#define HGL_DIRECT 0
+#define HGL_INDIRECT 4
+#define HGL_ACCUM 8
+#define HGL_ALPHA 16
+#define HGL_DEPTH 32
+#define HGL_OVERLAY 64
+#define HGL_UNDERLAY 128
+#define HGL_STENCIL 512
+#define HGL_SHARE_CONTEXT 1024
+
+
#ifdef __cplusplus
extern "C" {
#endif
--
2.37.3
From 9f063a17d5149b963b7e6a25659373dac9f9c905 Mon Sep 17 00:00:00 2001
From: Alexander von Gluck IV <kallisti5@unixzen.com>
Date: Sat, 15 Apr 2023 10:06:37 -0500
Subject: [PATCH] egl/haiku: Drop some dead cleanup code
---
src/egl/drivers/haiku/egl_haiku.cpp | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/egl/drivers/haiku/egl_haiku.cpp b/src/egl/drivers/haiku/egl_haiku.cpp
index 94866e12315..c01be7b0f5e 100644
--- a/src/egl/drivers/haiku/egl_haiku.cpp
+++ b/src/egl/drivers/haiku/egl_haiku.cpp
@@ -314,7 +314,6 @@ static EGLBoolean
haiku_initialize_impl(_EGLDisplay *disp, void *platformDisplay)
{
struct haiku_egl_display *hgl_dpy;
- const char* err;
hgl_dpy = (struct haiku_egl_display*)calloc(1, sizeof(struct haiku_egl_display));
if (!hgl_dpy)
@@ -355,10 +354,6 @@ haiku_initialize_impl(_EGLDisplay *disp, void *platformDisplay)
haiku_add_configs_for_visuals(disp);
return EGL_TRUE;
-
-cleanup:
- haiku_display_destroy(disp);
- return _eglError(EGL_NOT_INITIALIZED, err);
}
--
2.37.3

View File

@@ -1,84 +0,0 @@
From 828c3cf002ba4901ef65cd0665149d14c30df1d8 Mon Sep 17 00:00:00 2001
From: X512 <danger_mail@list.ru>
Date: Fri, 26 Jul 2024 04:45:27 +0900
Subject: [PATCH 175/200] egl/haiku: fix synchronization problems, add missing
header
`st_context_invalidate_state` call is required when changing buffer attachments.
Including header with BBitmap class definition is required to properly
call C++ destructor.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30372>
---
src/egl/drivers/haiku/egl_haiku.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/egl/drivers/haiku/egl_haiku.cpp b/src/egl/drivers/haiku/egl_haiku.cpp
index 62d2fb5c3cd..6ca5241c815 100644
--- a/src/egl/drivers/haiku/egl_haiku.cpp
+++ b/src/egl/drivers/haiku/egl_haiku.cpp
@@ -49,6 +49,8 @@
#include "hgl/hgl_sw_winsys.h"
#include "hgl_context.h"
+#include <Bitmap.h>
+
extern "C" {
#include "target-helpers/inline_sw_helper.h"
}
@@ -239,6 +241,8 @@ haiku_swap_buffers(_EGLDisplay *disp, _EGLSurface *surf)
update_size(buffer);
+ st_context_invalidate_state(st, ST_INVALIDATE_FB_STATE);
+
return EGL_TRUE;
}
--
2.45.2
From 2e70757dc0b5adb854c2911081e670d753d6a524 Mon Sep 17 00:00:00 2001
From: X512 <danger_mail@list.ru>
Date: Thu, 25 Jul 2024 22:26:25 +0900
Subject: [PATCH 066/200] egl/haiku: fix double free of BBitmap
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30364>
---
src/egl/drivers/haiku/egl_haiku.cpp | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/egl/drivers/haiku/egl_haiku.cpp b/src/egl/drivers/haiku/egl_haiku.cpp
index 15417767406..62d2fb5c3cd 100644
--- a/src/egl/drivers/haiku/egl_haiku.cpp
+++ b/src/egl/drivers/haiku/egl_haiku.cpp
@@ -115,6 +115,9 @@ haiku_create_window_surface(_EGLDisplay *disp, _EGLConfig *conf,
return NULL;
}
+ // Unset and delete previously set bitmap if any.
+ delete ((BitmapHook *)native_window)->SetBitmap(NULL);
+
return &wgl_surf->base;
}
@@ -168,6 +171,13 @@ haiku_destroy_surface(_EGLDisplay *disp, _EGLSurface *surf)
struct haiku_egl_surface *hgl_surf = haiku_egl_surface(surf);
struct pipe_screen *screen = hgl_dpy->disp->fscreen->screen;
screen->fence_reference(screen, &hgl_surf->throttle_fence, NULL);
+
+ // Unset bitmap to release ownership. Bitmap will be deleted later
+ // when destroying framebuffer.
+ BitmapHook *bitmapHook = (BitmapHook*)hgl_surf->fb->winsysContext;
+ if (bitmapHook != NULL)
+ bitmapHook->SetBitmap(NULL);
+
hgl_destroy_st_framebuffer(hgl_surf->fb);
free(surf);
}
--
2.45.2