From b575f5ed6c2a67aaa05e8175657e0a92ec7b14a4 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 9 Jun 2022 09:45:37 -0400 Subject: [PATCH] gallium: Only use Asahi's software path on macOS On macOS, we don't have DRM or any real WSI, so Asahi has to pretend to be a software rasterizer to load. On Linux, we do have DRM and proper WSI, so we don't want that. For faking Asahi devices on Linux, we should use drm-shim instead. This makes sure we don't accidentally load Asahi on non-M1 Linux. Signed-off-by: Alyssa Rosenzweig Acked-by: Eric Engestrom Part-of: --- src/gallium/auxiliary/target-helpers/inline_sw_helper.h | 6 +++--- src/gallium/auxiliary/target-helpers/sw_helper.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gallium/auxiliary/target-helpers/inline_sw_helper.h b/src/gallium/auxiliary/target-helpers/inline_sw_helper.h index 91056dc7bae..91321a81ef4 100644 --- a/src/gallium/auxiliary/target-helpers/inline_sw_helper.h +++ b/src/gallium/auxiliary/target-helpers/inline_sw_helper.h @@ -30,7 +30,7 @@ #include "d3d12/d3d12_public.h" #endif -#ifdef GALLIUM_ASAHI +#if defined(GALLIUM_ASAHI) && __APPLE__ #include "asahi/agx_public.h" #endif @@ -67,7 +67,7 @@ sw_screen_create_named(struct sw_winsys *winsys, const char *driver) screen = d3d12_create_dxcore_screen(winsys, NULL); #endif -#if defined(GALLIUM_ASAHI) +#if defined(GALLIUM_ASAHI) && __APPLE__ if (screen == NULL && strcmp(driver, "asahi") == 0) screen = agx_screen_create(0, NULL, winsys); #endif @@ -85,7 +85,7 @@ sw_screen_create_vk(struct sw_winsys *winsys, bool sw_vk) #if defined(GALLIUM_D3D12) (sw_vk || only_sw) ? "" : "d3d12", #endif -#if defined(GALLIUM_ASAHI) +#if defined(GALLIUM_ASAHI) && __APPLE__ (sw_vk || only_sw) ? "" : "asahi", #endif #if defined(GALLIUM_LLVMPIPE) diff --git a/src/gallium/auxiliary/target-helpers/sw_helper.h b/src/gallium/auxiliary/target-helpers/sw_helper.h index 29d65aecbea..3695a06dec8 100644 --- a/src/gallium/auxiliary/target-helpers/sw_helper.h +++ b/src/gallium/auxiliary/target-helpers/sw_helper.h @@ -21,7 +21,7 @@ #include "d3d12/d3d12_public.h" #endif -#ifdef GALLIUM_ASAHI +#if defined(GALLIUM_ASAHI) && __APPLE__ #include "asahi/agx_public.h" #endif @@ -71,7 +71,7 @@ sw_screen_create_named(struct sw_winsys *winsys, const struct pipe_screen_config screen = d3d12_create_dxcore_screen(winsys, NULL); #endif -#if defined(GALLIUM_ASAHI) +#if defined(GALLIUM_ASAHI) && __APPLE__ if (screen == NULL && strcmp(driver, "asahi") == 0) screen = agx_screen_create(0, NULL, winsys); #endif @@ -88,7 +88,7 @@ sw_screen_create_vk(struct sw_winsys *winsys, const struct pipe_screen_config *c #if defined(GALLIUM_D3D12) (sw_vk || only_sw) ? "" : "d3d12", #endif -#if defined(GALLIUM_ASAHI) +#if defined(GALLIUM_ASAHI) && __APPLE__ (sw_vk || only_sw) ? "" : "asahi", #endif #if defined(GALLIUM_LLVMPIPE)