diff --git a/spec_files/mesa/Mesa-MLAA-License-Clarification-Email.txt b/spec_files/mesa/38/Mesa-MLAA-License-Clarification-Email.txt similarity index 100% rename from spec_files/mesa/Mesa-MLAA-License-Clarification-Email.txt rename to spec_files/mesa/38/Mesa-MLAA-License-Clarification-Email.txt diff --git a/spec_files/mesa/gamescope.patch b/spec_files/mesa/38/gamescope.patch similarity index 100% rename from spec_files/mesa/gamescope.patch rename to spec_files/mesa/38/gamescope.patch diff --git a/spec_files/mesa/mesa.spec b/spec_files/mesa/38/mesa.spec similarity index 100% rename from spec_files/mesa/mesa.spec rename to spec_files/mesa/38/mesa.spec diff --git a/spec_files/mesa/valve_config.patch b/spec_files/mesa/38/valve_config.patch similarity index 100% rename from spec_files/mesa/valve_config.patch rename to spec_files/mesa/38/valve_config.patch diff --git a/spec_files/mesa/39/Mesa-MLAA-License-Clarification-Email.txt b/spec_files/mesa/39/Mesa-MLAA-License-Clarification-Email.txt new file mode 100644 index 00000000..30bdf2e9 --- /dev/null +++ b/spec_files/mesa/39/Mesa-MLAA-License-Clarification-Email.txt @@ -0,0 +1,117 @@ + +Subject: RE: Question about Mesa MLAA license +From: Jorge Jimenez +Date: 01/08/2013 12:50 PM +To: Tom Callaway +CC: "jorge@iryoku.com" + +Yes to both questions. + +Thanks, +Jorge + +From: Tom Callaway +Sent: January 8, 2013 6:49 PM +To: Jorge Jimenez +CC: jorge@iryoku.com +Subject: Re: Question about Mesa MLAA license + +On 01/08/2013 12:39 PM, Jorge Jimenez wrote: +> Hi Tom, +> +> What we meant with that is that we made an exception for clause 2. +> Instead of clause 2, in the case of the Mesa project, you have to name +> the technique Jimenez's MLAA in the config options of Mesa. We did that +> just to allow them to solve license issues. This exception should be for +> the Mesa project, and any project using Mesa, like Fedora. +> +> We want to widespread usage of our MLAA, so we want to avoid any kind of +> license complications. Hope current one is good for Fedora, if not +> please tell, and we'll see what we can do! + +Okay, a few more questions: + +* If Fedora decides to simply reproduce the quoted statement: +"Uses Jimenez's MLAA. Copyright (C) 2010 by Jorge Jimenez, Belen Masia, +Jose I. Echevarria, Fernando Navarro and Diego Gutierrez." + +Specifically, if this is done as part of documentation included with +Mesa, is that sufficient to meet clause 2 even if the Mesa config option +is not set as described in your exception? + +* Currently, the Mesa config option for MLAA says: "Morphological +anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default +quality". Is this in compliance with your exception? + +Thanks again, + +~tom + +== +Fedora Project + +Subject: RE: Question about Mesa MLAA license +From: Jorge Jimenez +Date: 01/08/2013 12:39 PM +To: "jorge@iryoku.com" , Tom Callaway + +Hi Tom, + +What we meant with that is that we made an exception for clause 2. +Instead of clause 2, in the case of the Mesa project, you have to name +the technique Jimenez's MLAA in the config options of Mesa. We did that +just to allow them to solve license issues. This exception should be for +the Mesa project, and any project using Mesa, like Fedora. + +We want to widespread usage of our MLAA, so we want to avoid any kind of +license complications. Hope current one is good for Fedora, if not +please tell, and we'll see what we can do! + +Cheers, +Jorge + +From: Tom Callaway +Sent: January 8, 2013 6:30 PM +To: jorge@iryoku.com +Subject: Question about Mesa MLAA license + +Jorge, + +Thanks for all of your fantastic graphics work! I have been auditing +Fedora (a popular distribution of Linux) for license compliance and I +came across your MLAA code in Mesa. + +The license says: + + * 2. Redistributions in binary form must reproduce the following +statement: + * + * "Uses Jimenez's MLAA. Copyright (C) 2010 by Jorge Jimenez, Belen Masia, + * Jose I. Echevarria, Fernando Navarro and Diego Gutierrez." + * + * Only for use in the Mesa project, this point 2 is filled by naming the + * technique Jimenez's MLAA in the Mesa config options. + +That wording is unclear. When you say "Only for use in the Mesa +project...", it seems like you could either be saying: + +- This code may only be used as part of Mesa. + +OR + +- In Mesa, you can comply with clause 2 by simply selecting "Jimenez's +MLAA" in the Mesa config options. + +***** + +If the first item is true, then we may have to remove the MLAA code from +Fedora's copy of Mesa. However, looking at the license on your SMAA +code, I do not believe it to be the case. Please let me know either way! + +Thanks in advance, + +Tom Callaway +Fedora Legal + +== +Fedora Project diff --git a/spec_files/mesa/39/gamescope.patch b/spec_files/mesa/39/gamescope.patch new file mode 100644 index 00000000..e45db7d0 --- /dev/null +++ b/spec_files/mesa/39/gamescope.patch @@ -0,0 +1,243 @@ +diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c +index 11bf647..ffa3a02 100644 +--- a/src/loader/loader_dri3_helper.c ++++ b/src/loader/loader_dri3_helper.c +@@ -37,13 +37,14 @@ + #include "loader_dri_helper.h" + #include "loader_dri3_helper.h" + #include "util/macros.h" ++#include "util/simple_mtx.h" + #include "drm-uapi/drm_fourcc.h" + + /** + * A cached blit context. + */ + struct loader_dri3_blit_context { +- mtx_t mtx; ++ simple_mtx_t mtx; + __DRIcontext *ctx; + __DRIscreen *cur_screen; + const __DRIcoreExtension *core; +@@ -51,7 +52,7 @@ struct loader_dri3_blit_context { + + /* For simplicity we maintain the cache only for a single screen at a time */ + static struct loader_dri3_blit_context blit_context = { +- _MTX_INITIALIZER_NP, NULL ++ SIMPLE_MTX_INITIALIZER, NULL + }; + + static void +@@ -162,7 +163,7 @@ static bool loader_dri3_have_image_blit(const struct loader_dri3_drawable *draw) + static __DRIcontext * + loader_dri3_blit_context_get(struct loader_dri3_drawable *draw) + { +- mtx_lock(&blit_context.mtx); ++ simple_mtx_lock(&blit_context.mtx); + + if (blit_context.ctx && blit_context.cur_screen != draw->dri_screen_render_gpu) { + blit_context.core->destroyContext(blit_context.ctx); +@@ -186,7 +187,7 @@ loader_dri3_blit_context_get(struct loader_dri3_drawable *draw) + static void + loader_dri3_blit_context_put(void) + { +- mtx_unlock(&blit_context.mtx); ++ simple_mtx_unlock(&blit_context.mtx); + } + + /** +@@ -288,6 +289,30 @@ dri3_update_max_num_back(struct loader_dri3_drawable *draw) + } + } + ++static unsigned ++gamescope_swapchain_override() ++{ ++ const char *path = getenv("GAMESCOPE_LIMITER_FILE"); ++ if (!path) ++ return 0; ++ ++ static simple_mtx_t mtx = SIMPLE_MTX_INITIALIZER; ++ static int fd = -1; ++ ++ simple_mtx_lock(&mtx); ++ if (fd < 0) { ++ fd = open(path, O_RDONLY); ++ } ++ simple_mtx_unlock(&mtx); ++ ++ if (fd < 0) ++ return 0; ++ ++ uint32_t override_value = 0; ++ pread(fd, &override_value, sizeof(override_value), 0); ++ return override_value; ++} ++ + void + loader_dri3_set_swap_interval(struct loader_dri3_drawable *draw, int interval) + { +@@ -302,10 +327,12 @@ loader_dri3_set_swap_interval(struct loader_dri3_drawable *draw, int interval) + * PS. changing from value A to B and A < B won't cause swap out of order but + * may still gets wrong target_msc value at the beginning. + */ +- if (draw->swap_interval != interval) ++ if (draw->orig_swap_interval != interval) + loader_dri3_swapbuffer_barrier(draw); + +- draw->swap_interval = interval; ++ draw->orig_swap_interval = interval; ++ if (gamescope_swapchain_override() != 1) ++ draw->swap_interval = interval; + } + + static void +@@ -434,6 +461,12 @@ loader_dri3_drawable_init(xcb_connection_t *conn, + if (!draw->adaptive_sync) + set_adaptive_sync_property(conn, draw->drawable, false); + ++ draw->orig_swap_interval = draw->swap_interval; ++ ++ unsigned gamescope_override = gamescope_swapchain_override(); ++ if (gamescope_override == 1) ++ draw->swap_interval = 1; ++ + draw->swap_interval = dri_get_initial_swap_interval(draw->dri_screen_render_gpu, + draw->ext->config); + +@@ -1091,6 +1124,12 @@ loader_dri3_swap_buffers_msc(struct loader_dri3_drawable *draw, + if (draw->type == LOADER_DRI3_DRAWABLE_WINDOW) { + dri3_fence_reset(draw->conn, back); + ++ unsigned gamescope_override = gamescope_swapchain_override(); ++ if (gamescope_override == 1) ++ draw->swap_interval = 1; ++ else ++ draw->swap_interval = draw->orig_swap_interval; ++ + /* Compute when we want the frame shown by taking the last known + * successful MSC and adding in a swap interval for each outstanding swap + * request. target_msc=divisor=remainder=0 means "Use glXSwapBuffers() +@@ -2357,12 +2396,12 @@ loader_dri3_swapbuffer_barrier(struct loader_dri3_drawable *draw) + void + loader_dri3_close_screen(__DRIscreen *dri_screen) + { +- mtx_lock(&blit_context.mtx); ++ simple_mtx_lock(&blit_context.mtx); + if (blit_context.ctx && blit_context.cur_screen == dri_screen) { + blit_context.core->destroyContext(blit_context.ctx); + blit_context.ctx = NULL; + } +- mtx_unlock(&blit_context.mtx); ++ simple_mtx_unlock(&blit_context.mtx); + } + + /** +diff --git a/src/loader/loader_dri3_helper.h b/src/loader/loader_dri3_helper.h +index 1fd340b..b8f5eaa 100644 +--- a/src/loader/loader_dri3_helper.h ++++ b/src/loader/loader_dri3_helper.h +@@ -178,6 +178,7 @@ struct loader_dri3_drawable { + bool block_on_depleted_buffers; + bool queries_buffer_age; + int swap_interval; ++ int orig_swap_interval; + + struct loader_dri3_extensions *ext; + const struct loader_dri3_vtable *vtable; +diff --git a/src/loader/meson.build b/src/loader/meson.build +index 81779a3..18c9fd9 100644 +--- a/src/loader/meson.build ++++ b/src/loader/meson.build +@@ -28,7 +28,7 @@ if with_platform_x11 and with_dri3 + include_directories : [inc_include, inc_src], + dependencies : [ + dep_libdrm, dep_xcb_dri3, dep_xcb_present, dep_xcb_sync, dep_xshmfence, +- dep_xcb_xfixes, ++ dep_xcb_xfixes, dep_xcb_xrandr, idep_mesautil + ], + build_by_default : false, + ) +diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c +index a423559..5ed89cb 100644 +--- a/src/vulkan/wsi/wsi_common_x11.c ++++ b/src/vulkan/wsi/wsi_common_x11.c +@@ -42,6 +42,7 @@ + #include "util/hash_table.h" + #include "util/os_file.h" + #include "util/os_time.h" ++#include "util/simple_mtx.h" + #include "util/u_debug.h" + #include "util/u_thread.h" + #include "util/xmlconfig.h" +@@ -198,6 +199,30 @@ wsi_x11_detect_xwayland(xcb_connection_t *conn, + return is_xwayland; + } + ++static unsigned ++gamescope_swapchain_override() ++{ ++ const char *path = getenv("GAMESCOPE_LIMITER_FILE"); ++ if (!path) ++ return 0; ++ ++ static simple_mtx_t mtx = SIMPLE_MTX_INITIALIZER; ++ static int fd = -1; ++ ++ simple_mtx_lock(&mtx); ++ if (fd < 0) { ++ fd = open(path, O_RDONLY); ++ } ++ simple_mtx_unlock(&mtx); ++ ++ if (fd < 0) ++ return 0; ++ ++ uint32_t override_value = 0; ++ pread(fd, &override_value, sizeof(override_value), 0); ++ return override_value; ++} ++ + static struct wsi_x11_connection * + wsi_x11_connection_create(struct wsi_device *wsi_dev, + xcb_connection_t *conn) +@@ -1074,6 +1099,8 @@ struct x11_swapchain { + /* Total number of images returned to application in AcquireNextImage. */ + uint64_t present_poll_acquire_count; + ++ VkPresentModeKHR orig_present_mode; ++ + struct x11_image images[0]; + }; + VK_DEFINE_NONDISP_HANDLE_CASTS(x11_swapchain, base.base, VkSwapchainKHR, +@@ -1802,6 +1829,12 @@ x11_queue_present(struct wsi_swapchain *anv_chain, + if (chain->status < 0) + return chain->status; + ++ unsigned gamescope_override = gamescope_swapchain_override(); ++ if ((gamescope_override == 1 && chain->base.present_mode != VK_PRESENT_MODE_FIFO_KHR) || ++ (gamescope_override != 1 && chain->base.present_mode != chain->orig_present_mode)) { ++ return x11_swapchain_result(chain, VK_ERROR_OUT_OF_DATE_KHR); ++ } ++ + if (damage && damage->pRectangles && damage->rectangleCount > 0 && + damage->rectangleCount <= MAX_DAMAGE_RECTS) { + xcb_rectangle_t rects[MAX_DAMAGE_RECTS]; +@@ -2554,6 +2587,10 @@ x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, + xcb_void_cookie_t cookie; + VkResult result; + VkPresentModeKHR present_mode = wsi_swapchain_get_present_mode(wsi_device, pCreateInfo); ++ VkPresentModeKHR orig_present_mode = present_mode; ++ ++ if (gamescope_swapchain_override() == 1) ++ present_mode = VK_PRESENT_MODE_FIFO_KHR; + + assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR); + +@@ -2666,6 +2703,7 @@ x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, + chain->base.wait_for_present = x11_wait_for_present; + chain->base.release_images = x11_release_images; + chain->base.present_mode = present_mode; ++ chain->orig_present_mode = orig_present_mode; + chain->base.image_count = num_images; + chain->conn = conn; + chain->window = window; diff --git a/spec_files/mesa/39/mesa.spec b/spec_files/mesa/39/mesa.spec new file mode 100644 index 00000000..98468d5f --- /dev/null +++ b/spec_files/mesa/39/mesa.spec @@ -0,0 +1,657 @@ +%ifnarch s390x +%global with_hardware 1 +%global with_vulkan_hw 1 +%global with_vdpau 1 +%global with_va 1 +%if !0%{?rhel} +%global with_nine 1 +%global with_omx 1 +%global with_opencl 1 +%endif +%global base_vulkan ,amd +%endif + +%ifarch %{ix86} x86_64 +%global with_crocus 1 +%global with_i915 1 +%if !0%{?rhel} +%global with_intel_clc 1 +%endif +%global with_iris 1 +%global with_xa 1 +%global platform_vulkan ,intel,intel_hasvk +%endif + +%ifarch aarch64 +%if !0%{?rhel} +%global with_etnaviv 1 +%global with_lima 1 +%global with_vc4 1 +%global with_v3d 1 +%endif +%global with_freedreno 1 +%global with_kmsro 1 +%global with_panfrost 1 +%global with_tegra 1 +%global with_xa 1 +%global platform_vulkan ,broadcom,freedreno,panfrost +%endif + +%ifnarch s390x +%if !0%{?rhel} +%global with_r300 1 +%global with_r600 1 +%endif +%global with_radeonsi 1 +%global with_vmware 1 +%endif + +%ifarch %{valgrind_arches} +%bcond_without valgrind +%else +%bcond_with valgrind +%endif + +%global vulkan_drivers swrast%{?base_vulkan}%{?platform_vulkan} + +Name: mesa +Summary: Mesa graphics libraries +%global ver 23.1.8 +Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)} +Release: %autorelease.bazzite.{{{ git_dir_version }}} +License: MIT +URL: http://www.mesa3d.org + +Source0: https://archive.mesa3d.org/mesa-%{ver}.tar.xz +# src/gallium/auxiliary/postprocess/pp_mlaa* have an ... interestingly worded license. +# Source1 contains email correspondence clarifying the license terms. +# Fedora opts to ignore the optional part of clause 2 and treat that code as 2 clause BSD. +Source1: Mesa-MLAA-License-Clarification-Email.txt + +Patch0: valve_config.patch +Patch1: gamescope.patch + +BuildRequires: meson >= 1.0.0 +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: gettext +%if 0%{?with_hardware} +BuildRequires: kernel-headers +%endif +# We only check for the minimum version of pkgconfig(libdrm) needed so that the +# SRPMs for each arch still have the same build dependencies. See: +# https://bugzilla.redhat.com/show_bug.cgi?id=1859515 +BuildRequires: pkgconfig(libdrm) >= 2.4.97 +BuildRequires: pkgconfig(libunwind) +BuildRequires: pkgconfig(expat) +BuildRequires: pkgconfig(zlib) >= 1.2.3 +BuildRequires: pkgconfig(libzstd) +BuildRequires: pkgconfig(libselinux) +BuildRequires: pkgconfig(wayland-scanner) +BuildRequires: pkgconfig(wayland-protocols) >= 1.8 +BuildRequires: pkgconfig(wayland-client) >= 1.11 +BuildRequires: pkgconfig(wayland-server) >= 1.11 +BuildRequires: pkgconfig(wayland-egl-backend) >= 3 +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(xext) +BuildRequires: pkgconfig(xdamage) >= 1.1 +BuildRequires: pkgconfig(xfixes) +BuildRequires: pkgconfig(xcb-glx) >= 1.8.1 +BuildRequires: pkgconfig(xxf86vm) +BuildRequires: pkgconfig(xcb) +BuildRequires: pkgconfig(x11-xcb) +BuildRequires: pkgconfig(xcb-dri2) >= 1.8 +BuildRequires: pkgconfig(xcb-dri3) +BuildRequires: pkgconfig(xcb-present) +BuildRequires: pkgconfig(xcb-sync) +BuildRequires: pkgconfig(xshmfence) >= 1.1 +BuildRequires: pkgconfig(dri2proto) >= 2.8 +BuildRequires: pkgconfig(glproto) >= 1.4.14 +BuildRequires: pkgconfig(xcb-xfixes) +BuildRequires: pkgconfig(xcb-randr) +BuildRequires: pkgconfig(xrandr) >= 1.3 +BuildRequires: bison +BuildRequires: flex +BuildRequires: lm_sensors-devel +%if 0%{?with_vdpau} +BuildRequires: pkgconfig(vdpau) >= 1.1 +%endif +%if 0%{?with_va} +BuildRequires: pkgconfig(libva) >= 0.38.0 +%endif +%if 0%{?with_omx} +BuildRequires: pkgconfig(libomxil-bellagio) +%endif +BuildRequires: pkgconfig(libelf) +BuildRequires: pkgconfig(libglvnd) >= 1.3.2 +BuildRequires: llvm-devel >= 7.0.0 +%if 0%{?with_opencl} +BuildRequires: clang-devel +BuildRequires: bindgen +BuildRequires: rust-packaging +BuildRequires: pkgconfig(libclc) +BuildRequires: pkgconfig(SPIRV-Tools) +BuildRequires: pkgconfig(LLVMSPIRVLib) +%endif +%if %{with valgrind} +BuildRequires: pkgconfig(valgrind) +%endif +BuildRequires: python3-devel +BuildRequires: python3-mako +%if 0%{?with_intel_clc} +BuildRequires: python3-ply +%endif +BuildRequires: vulkan-headers +BuildRequires: glslang +%if 0%{?with_vulkan_hw} +BuildRequires: pkgconfig(vulkan) +%endif + +%description +%{summary}. + +%package filesystem +Summary: Mesa driver filesystem +Provides: mesa-dri-filesystem = %{?epoch:%{epoch}:}%{version}-%{release} + +%description filesystem +%{summary}. + +%package libGL +Summary: Mesa libGL runtime libraries +Requires: %{name}-libglapi%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: libglvnd-glx%{?_isa} >= 1:1.3.2 +Recommends: %{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description libGL +%{summary}. + +%package libGL-devel +Summary: Mesa libGL development package +Requires: %{name}-libGL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: libglvnd-devel%{?_isa} >= 1:1.3.2 +Provides: libGL-devel +Provides: libGL-devel%{?_isa} +Recommends: gl-manpages + +%description libGL-devel +%{summary}. + +%package libEGL +Summary: Mesa libEGL runtime libraries +Requires: libglvnd-egl%{?_isa} >= 1:1.3.2 +Requires: %{name}-libgbm%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: %{name}-libglapi%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Recommends: %{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description libEGL +%{summary}. + +%package libEGL-devel +Summary: Mesa libEGL development package +Requires: %{name}-libEGL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: libglvnd-devel%{?_isa} >= 1:1.3.2 +Requires: %{name}-khr-devel%{?_isa} +Provides: libEGL-devel +Provides: libEGL-devel%{?_isa} + +%description libEGL-devel +%{summary}. + +%package dri-drivers +Summary: Mesa-based DRI drivers +Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: %{name}-libglapi%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +%if 0%{?with_va} +Recommends: %{name}-va-drivers%{?_isa} +%endif +# If mesa-libEGL is installed, it must match in version. This is here to prevent using +# mesa-libEGL < 23.0.3-1 (frozen in the 'fedora' repo) which didn't have strong enough +# inter-dependencies. See https://bugzilla.redhat.com/show_bug.cgi?id=2193135 . +Requires: (%{name}-libEGL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} if %{name}-libEGL%{?_isa}) + +%description dri-drivers +%{summary}. + +%if 0%{?with_omx} +%package omx-drivers +Summary: Mesa-based OMX drivers +Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description omx-drivers +%{summary}. +%endif + +%if 0%{?with_va} +%package va-drivers +Summary: Mesa-based VA-API video acceleration drivers +Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Obsoletes: %{name}-vaapi-drivers < 22.2.0-5 + +%description va-drivers +%{summary}. +%endif + +%if 0%{?with_vdpau} +%package vdpau-drivers +Summary: Mesa-based VDPAU drivers +Requires: %{name}-filesystem%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description vdpau-drivers +%{summary}. +%endif + +%package libOSMesa +Summary: Mesa offscreen rendering libraries +Requires: %{name}-libglapi%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Provides: libOSMesa +Provides: libOSMesa%{?_isa} + +%description libOSMesa +%{summary}. + +%package libOSMesa-devel +Summary: Mesa offscreen rendering development package +Requires: %{name}-libOSMesa%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description libOSMesa-devel +%{summary}. + +%package libgbm +Summary: Mesa gbm runtime library +Provides: libgbm +Provides: libgbm%{?_isa} +Recommends: %{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +# If mesa-dri-drivers are installed, they must match in version. This is here to prevent using +# older mesa-dri-drivers together with a newer mesa-libgbm and its dependants. +# See https://bugzilla.redhat.com/show_bug.cgi?id=2193135 . +Requires: (%{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} if %{name}-dri-drivers%{?_isa}) + +%description libgbm +%{summary}. + +%package libgbm-devel +Summary: Mesa libgbm development package +Requires: %{name}-libgbm%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Provides: libgbm-devel +Provides: libgbm-devel%{?_isa} + +%description libgbm-devel +%{summary}. + +%if 0%{?with_xa} +%package libxatracker +Summary: Mesa XA state tracker +Provides: libxatracker +Provides: libxatracker%{?_isa} + +%description libxatracker +%{summary}. + +%package libxatracker-devel +Summary: Mesa XA state tracker development package +Requires: %{name}-libxatracker%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Provides: libxatracker-devel +Provides: libxatracker-devel%{?_isa} + +%description libxatracker-devel +%{summary}. +%endif + +%package libglapi +Summary: Mesa shared glapi +Provides: libglapi +Provides: libglapi%{?_isa} +# If mesa-dri-drivers are installed, they must match in version. This is here to prevent using +# older mesa-dri-drivers together with a newer mesa-libglapi or its dependants. +# See https://bugzilla.redhat.com/show_bug.cgi?id=2193135 . +Requires: (%{name}-dri-drivers%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} if %{name}-dri-drivers%{?_isa}) + +%description libglapi +%{summary}. + +%if 0%{?with_opencl} +%package libOpenCL +Summary: Mesa OpenCL runtime library +Requires: ocl-icd%{?_isa} +Requires: libclc%{?_isa} +Requires: %{name}-libgbm%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: opencl-filesystem + +%description libOpenCL +%{summary}. + +%package libOpenCL-devel +Summary: Mesa OpenCL development package +Requires: %{name}-libOpenCL%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description libOpenCL-devel +%{summary}. +%endif + +%if 0%{?with_nine} +%package libd3d +Summary: Mesa Direct3D9 state tracker + +%description libd3d +%{summary}. + +%package libd3d-devel +Summary: Mesa Direct3D9 state tracker development package +Requires: %{name}-libd3d%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description libd3d-devel +%{summary}. +%endif + +%package vulkan-drivers +Summary: Mesa Vulkan drivers +Requires: vulkan%{_isa} +Obsoletes: mesa-vulkan-devel < %{?epoch:%{epoch}:}%{version}-%{release} + +%description vulkan-drivers +The drivers with support for the Vulkan API. + +%prep +%autosetup -n %{name}-%{ver} -p1 +cp %{SOURCE1} docs/ + +%build +# ensure standard Rust compiler flags are set +export RUSTFLAGS="%build_rustflags" + +# We've gotten a report that enabling LTO for mesa breaks some games. See +# https://bugzilla.redhat.com/show_bug.cgi?id=1862771 for details. +# Disable LTO for now +%define _lto_cflags %{nil} + +%meson \ + -Dplatforms=x11,wayland \ + -Ddri3=enabled \ + -Dosmesa=true \ +%if 0%{?with_hardware} + -Dgallium-drivers=swrast,virgl,nouveau%{?with_r300:,r300}%{?with_crocus:,crocus}%{?with_i915:,i915}%{?with_iris:,iris}%{?with_vmware:,svga}%{?with_radeonsi:,radeonsi}%{?with_r600:,r600}%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_v3d:,v3d}%{?with_kmsro:,kmsro}%{?with_lima:,lima}%{?with_panfrost:,panfrost}%{?with_vulkan_hw:,zink} \ +%else + -Dgallium-drivers=swrast,virgl \ +%endif + -Dgallium-vdpau=%{?with_vdpau:enabled}%{!?with_vdpau:disabled} \ + -Dgallium-omx=%{?with_omx:bellagio}%{!?with_omx:disabled} \ + -Dgallium-va=%{?with_va:enabled}%{!?with_va:disabled} \ + -Dgallium-xa=%{?with_xa:enabled}%{!?with_xa:disabled} \ + -Dgallium-nine=%{?with_nine:true}%{!?with_nine:false} \ + -Dgallium-opencl=%{?with_opencl:icd}%{!?with_opencl:disabled} \ +%if 0%{?with_opencl} + -Dgallium-rusticl=true \ +%endif + -Dvulkan-drivers=%{?vulkan_drivers} \ + -Dvulkan-layers=device-select \ + -Dshared-glapi=enabled \ + -Dgles1=disabled \ + -Dgles2=enabled \ + -Dopengl=true \ + -Dgbm=enabled \ + -Dglx=dri \ + -Degl=enabled \ + -Dglvnd=true \ +%if 0%{?with_intel_clc} + -Dintel-clc=enabled \ +%endif + -Dmicrosoft-clc=disabled \ + -Dllvm=enabled \ + -Dshared-llvm=enabled \ + -Dvalgrind=%{?with_valgrind:enabled}%{!?with_valgrind:disabled} \ + -Dbuild-tests=false \ + -Dselinux=true \ + -Dandroid-libbacktrace=disabled \ + %{nil} +%meson_build + +%install +%meson_install + +# libvdpau opens the versioned name, don't bother including the unversioned +rm -vf %{buildroot}%{_libdir}/vdpau/*.so +# likewise glvnd +rm -vf %{buildroot}%{_libdir}/libGLX_mesa.so +rm -vf %{buildroot}%{_libdir}/libEGL_mesa.so +# XXX can we just not build this +rm -vf %{buildroot}%{_libdir}/libGLES* + +# glvnd needs a default provider for indirect rendering where it cannot +# determine the vendor +ln -s %{_libdir}/libGLX_mesa.so.0 %{buildroot}%{_libdir}/libGLX_system.so.0 + +# this keeps breaking, check it early. note that the exit from eu-ftr is odd. +pushd %{buildroot}%{_libdir} +for i in libOSMesa*.so libGL.so ; do + eu-findtextrel $i && exit 1 +done +popd + +%files filesystem +%doc docs/Mesa-MLAA-License-Clarification-Email.txt +%dir %{_libdir}/dri +%if 0%{?with_hardware} +%if 0%{?with_vdpau} +%dir %{_libdir}/vdpau +%endif +%endif + +%files libGL +%{_libdir}/libGLX_mesa.so.0* +%{_libdir}/libGLX_system.so.0* +%files libGL-devel +%dir %{_includedir}/GL/internal +%{_includedir}/GL/internal/dri_interface.h +%{_libdir}/pkgconfig/dri.pc +%{_libdir}/libglapi.so + +%files libEGL +%{_datadir}/glvnd/egl_vendor.d/50_mesa.json +%{_libdir}/libEGL_mesa.so.0* +%files libEGL-devel +%dir %{_includedir}/EGL +%{_includedir}/EGL/eglext_angle.h +%{_includedir}/EGL/eglmesaext.h + +%files libglapi +%{_libdir}/libglapi.so.0 +%{_libdir}/libglapi.so.0.* + +%files libOSMesa +%{_libdir}/libOSMesa.so.8* +%files libOSMesa-devel +%dir %{_includedir}/GL +%{_includedir}/GL/osmesa.h +%{_libdir}/libOSMesa.so +%{_libdir}/pkgconfig/osmesa.pc + +%files libgbm +%{_libdir}/libgbm.so.1 +%{_libdir}/libgbm.so.1.* +%files libgbm-devel +%{_libdir}/libgbm.so +%{_includedir}/gbm.h +%{_libdir}/pkgconfig/gbm.pc + +%if 0%{?with_xa} +%files libxatracker +%if 0%{?with_hardware} +%{_libdir}/libxatracker.so.2 +%{_libdir}/libxatracker.so.2.* +%endif + +%files libxatracker-devel +%if 0%{?with_hardware} +%{_libdir}/libxatracker.so +%{_includedir}/xa_tracker.h +%{_includedir}/xa_composite.h +%{_includedir}/xa_context.h +%{_libdir}/pkgconfig/xatracker.pc +%endif +%endif + +%if 0%{?with_opencl} +%files libOpenCL +%{_libdir}/libMesaOpenCL.so.* +%{_libdir}/libRusticlOpenCL.so.* +%{_sysconfdir}/OpenCL/vendors/mesa.icd +%{_sysconfdir}/OpenCL/vendors/rusticl.icd +%files libOpenCL-devel +%{_libdir}/libMesaOpenCL.so +%{_libdir}/libRusticlOpenCL.so +%endif + +%if 0%{?with_nine} +%files libd3d +%dir %{_libdir}/d3d/ +%{_libdir}/d3d/*.so.* + +%files libd3d-devel +%{_libdir}/pkgconfig/d3d.pc +%{_includedir}/d3dadapter/ +%{_libdir}/d3d/*.so +%endif + +%files dri-drivers +%dir %{_datadir}/drirc.d +%{_datadir}/drirc.d/00-mesa-defaults.conf +%{_libdir}/dri/kms_swrast_dri.so +%{_libdir}/dri/swrast_dri.so +%{_libdir}/dri/virtio_gpu_dri.so + +%if 0%{?with_hardware} +%if 0%{?with_r300} +%{_libdir}/dri/r300_dri.so +%endif +%if 0%{?with_radeonsi} +%if 0%{?with_r600} +%{_libdir}/dri/r600_dri.so +%endif +%{_libdir}/dri/radeonsi_dri.so +%endif +%ifarch %{ix86} x86_64 +%{_libdir}/dri/crocus_dri.so +%{_libdir}/dri/i915_dri.so +%{_libdir}/dri/iris_dri.so +%endif +%ifarch aarch64 +%{_libdir}/dri/ingenic-drm_dri.so +%{_libdir}/dri/imx-drm_dri.so +%{_libdir}/dri/imx-lcdif_dri.so +%{_libdir}/dri/kirin_dri.so +%{_libdir}/dri/komeda_dri.so +%{_libdir}/dri/mali-dp_dri.so +%{_libdir}/dri/mcde_dri.so +%{_libdir}/dri/mxsfb-drm_dri.so +%{_libdir}/dri/rcar-du_dri.so +%{_libdir}/dri/stm_dri.so +%endif +%if 0%{?with_vc4} +%{_libdir}/dri/vc4_dri.so +%endif +%if 0%{?with_v3d} +%{_libdir}/dri/v3d_dri.so +%endif +%if 0%{?with_freedreno} +%{_libdir}/dri/kgsl_dri.so +%{_libdir}/dri/msm_dri.so +%endif +%if 0%{?with_etnaviv} +%{_libdir}/dri/etnaviv_dri.so +%endif +%if 0%{?with_tegra} +%{_libdir}/dri/tegra_dri.so +%endif +%if 0%{?with_lima} +%{_libdir}/dri/lima_dri.so +%endif +%if 0%{?with_panfrost} +%{_libdir}/dri/panfrost_dri.so +%endif +%{_libdir}/dri/nouveau_dri.so +%if 0%{?with_vmware} +%{_libdir}/dri/vmwgfx_dri.so +%endif +%endif +%if 0%{?with_opencl} +%dir %{_libdir}/gallium-pipe +%{_libdir}/gallium-pipe/*.so +%endif +%if 0%{?with_kmsro} +%{_libdir}/dri/armada-drm_dri.so +%{_libdir}/dri/exynos_dri.so +%{_libdir}/dri/hx8357d_dri.so +%{_libdir}/dri/ili9225_dri.so +%{_libdir}/dri/ili9341_dri.so +%{_libdir}/dri/imx-dcss_dri.so +%{_libdir}/dri/mediatek_dri.so +%{_libdir}/dri/meson_dri.so +%{_libdir}/dri/mi0283qt_dri.so +%{_libdir}/dri/pl111_dri.so +%{_libdir}/dri/repaper_dri.so +%{_libdir}/dri/rockchip_dri.so +%{_libdir}/dri/st7586_dri.so +%{_libdir}/dri/st7735r_dri.so +%{_libdir}/dri/sun4i-drm_dri.so +%endif +%if 0%{?with_vulkan_hw} +%{_libdir}/dri/zink_dri.so +%endif + +%if 0%{?with_omx} +%files omx-drivers +%{_libdir}/bellagio/libomx_mesa.so +%endif + +%if 0%{?with_va} +%files va-drivers +%{_libdir}/dri/nouveau_drv_video.so +%if 0%{?with_r600} +%{_libdir}/dri/r600_drv_video.so +%endif +%if 0%{?with_radeonsi} +%{_libdir}/dri/radeonsi_drv_video.so +%endif +%{_libdir}/dri/virtio_gpu_drv_video.so +%endif + +%if 0%{?with_vdpau} +%files vdpau-drivers +%{_libdir}/vdpau/libvdpau_nouveau.so.1* +%if 0%{?with_r600} +%{_libdir}/vdpau/libvdpau_r600.so.1* +%endif +%if 0%{?with_radeonsi} +%{_libdir}/vdpau/libvdpau_radeonsi.so.1* +%endif +%{_libdir}/vdpau/libvdpau_virtio_gpu.so.1* +%endif + +%files vulkan-drivers +%{_libdir}/libvulkan_lvp.so +%{_datadir}/vulkan/icd.d/lvp_icd.*.json +%{_libdir}/libVkLayer_MESA_device_select.so +%{_datadir}/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json +%if 0%{?with_vulkan_hw} +%{_libdir}/libvulkan_radeon.so +%{_datadir}/drirc.d/00-radv-defaults.conf +%{_datadir}/vulkan/icd.d/radeon_icd.*.json +%ifarch %{ix86} x86_64 +%{_libdir}/libvulkan_intel.so +%{_datadir}/vulkan/icd.d/intel_icd.*.json +%{_libdir}/libvulkan_intel_hasvk.so +%{_datadir}/vulkan/icd.d/intel_hasvk_icd.*.json +%endif +%ifarch aarch64 +%{_libdir}/libvulkan_broadcom.so +%{_datadir}/vulkan/icd.d/broadcom_icd.*.json +%{_libdir}/libvulkan_freedreno.so +%{_datadir}/vulkan/icd.d/freedreno_icd.*.json +%{_libdir}/libvulkan_panfrost.so +%{_datadir}/vulkan/icd.d/panfrost_icd.*.json +%endif +%endif + +%changelog +%autochangelog diff --git a/spec_files/mesa/39/valve_config.patch b/spec_files/mesa/39/valve_config.patch new file mode 100644 index 00000000..f3f09fcb --- /dev/null +++ b/spec_files/mesa/39/valve_config.patch @@ -0,0 +1,178 @@ +diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf +index 2b45eda..0cf8099 100644 +--- a/src/util/00-mesa-defaults.conf ++++ b/src/util/00-mesa-defaults.conf +@@ -166,6 +166,12 @@ TODO: document the other workarounds. +