diff options
author | Alyssa Rosenzweig <alyssa@rosenzweig.io> | 2021-04-21 01:06:41 +0530 |
---|---|---|
committer | Alyssa Rosenzweig <none> | 2021-05-02 17:54:05 -0400 |
commit | 080b05e29e1f04f22a776057631f4061cf7c1824 (patch) | |
tree | 2aa756abb9bba2fa483f1ec81cea6a18d293961b /src/gallium/auxiliary | |
parent | 0ad6bacb730a36bd2234e4f4be44220f9e241d05 (diff) |
asahi: Add Gallium driver
Forked from noop, with some code from Panfrost.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10582>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/target-helpers/inline_sw_helper.h | 12 | ||||
-rw-r--r-- | src/gallium/auxiliary/target-helpers/sw_helper.h | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/target-helpers/inline_sw_helper.h b/src/gallium/auxiliary/target-helpers/inline_sw_helper.h index 76eda8467b8..8271df0cb0b 100644 --- a/src/gallium/auxiliary/target-helpers/inline_sw_helper.h +++ b/src/gallium/auxiliary/target-helpers/inline_sw_helper.h @@ -33,6 +33,10 @@ #include "d3d12/d3d12_public.h" #endif +#ifdef GALLIUM_ASAHI +#include "asahi/agx_public.h" +#endif + static inline struct pipe_screen * sw_screen_create_named(struct sw_winsys *winsys, const char *driver) { @@ -71,6 +75,11 @@ sw_screen_create_named(struct sw_winsys *winsys, const char *driver) screen = d3d12_create_dxcore_screen(winsys, NULL); #endif +#if defined(GALLIUM_ASAHI) + if (screen == NULL && strcmp(driver, "asahi") == 0) + screen = agx_screen_create(winsys); +#endif + return screen ? debug_screen_wrap(screen) : NULL; } @@ -84,6 +93,9 @@ sw_screen_create(struct sw_winsys *winsys) #if defined(GALLIUM_D3D12) only_sw ? "" : "d3d12", #endif +#if defined(GALLIUM_ASAHI) + only_sw ? "" : "asahi", +#endif #if defined(GALLIUM_LLVMPIPE) "llvmpipe", #endif diff --git a/src/gallium/auxiliary/target-helpers/sw_helper.h b/src/gallium/auxiliary/target-helpers/sw_helper.h index 88a5086d261..343c0410558 100644 --- a/src/gallium/auxiliary/target-helpers/sw_helper.h +++ b/src/gallium/auxiliary/target-helpers/sw_helper.h @@ -21,6 +21,10 @@ #include "d3d12/d3d12_public.h" #endif +#ifdef GALLIUM_ASAHI +#include "asahi/agx_public.h" +#endif + #ifdef GALLIUM_SOFTPIPE #include "softpipe/sp_public.h" #endif @@ -76,6 +80,11 @@ sw_screen_create_named(struct sw_winsys *winsys, const char *driver) screen = d3d12_create_dxcore_screen(winsys, NULL); #endif +#if defined(GALLIUM_ASAHI) + if (screen == NULL && strcmp(driver, "asahi") == 0) + screen = agx_screen_create(winsys); +#endif + return screen; } @@ -89,6 +98,9 @@ sw_screen_create(struct sw_winsys *winsys) #if defined(GALLIUM_D3D12) only_sw ? "" : "d3d12", #endif +#if defined(GALLIUM_ASAHI) + only_sw ? "" : "asahi", +#endif #if defined(GALLIUM_LLVMPIPE) "llvmpipe", #endif |