Skip to content

Commit f363054

Browse files
committed
crocus: initial gallium driver for Intel gfx 4-7
This is a gallium driver for the Intel gfx 4-7 GPUs. It was initially cloned from the iris driver by Ilia Mirkin, then I ported over large reams of code from i965 until it worked. Acked-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11146>
1 parent 8da92b5 commit f363054

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+28508
-6
lines changed

meson.build

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ with_gallium_v3d = gallium_drivers.contains('v3d')
231231
with_gallium_panfrost = gallium_drivers.contains('panfrost')
232232
with_gallium_etnaviv = gallium_drivers.contains('etnaviv')
233233
with_gallium_tegra = gallium_drivers.contains('tegra')
234+
with_gallium_crocus = gallium_drivers.contains('crocus')
234235
with_gallium_iris = gallium_drivers.contains('iris')
235236
with_gallium_i915 = gallium_drivers.contains('i915')
236237
with_gallium_svga = gallium_drivers.contains('svga')
@@ -284,7 +285,7 @@ with_broadcom_vk = _vulkan_drivers.contains('broadcom')
284285
with_any_vk = _vulkan_drivers.length() != 0
285286

286287
with_any_broadcom = with_gallium_vc4 or with_gallium_v3d or with_broadcom_vk
287-
with_any_intel = with_dri_i965 or with_intel_vk or with_gallium_iris
288+
with_any_intel = with_dri_i965 or with_intel_vk or with_gallium_iris or with_gallium_crocus
288289

289290
if with_swrast_vk and not with_gallium_softpipe
290291
error('swrast vulkan requires gallium swrast')
@@ -795,7 +796,7 @@ if with_gallium_st_nine
795796
error('The nine state tracker requires gallium softpipe/llvmpipe.')
796797
elif not (with_gallium_radeonsi or with_gallium_nouveau or with_gallium_r600
797798
or with_gallium_r300 or with_gallium_svga or with_gallium_i915
798-
or with_gallium_iris)
799+
or with_gallium_iris or with_gallium_crocus)
799800
error('The nine state tracker requires at least one non-swrast gallium driver.')
800801
endif
801802
if not with_dri3

meson_options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ option(
6767
choices : [
6868
'auto', 'kmsro', 'radeonsi', 'r300', 'r600', 'nouveau', 'freedreno',
6969
'swrast', 'v3d', 'vc4', 'etnaviv', 'tegra', 'i915', 'svga', 'virgl',
70-
'swr', 'panfrost', 'iris', 'lima', 'zink', 'd3d12', 'asahi'
70+
'swr', 'panfrost', 'iris', 'lima', 'zink', 'd3d12', 'asahi', 'crocus'
7171
],
7272
description : 'List of gallium drivers to build. If this is set to auto all drivers applicable to the target OS/architecture will be built'
7373
)

src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ static const struct pipe_loader_ops pipe_loader_drm_ops;
7070
static const struct drm_driver_descriptor *driver_descriptors[] = {
7171
&i915_driver_descriptor,
7272
&iris_driver_descriptor,
73+
&crocus_driver_descriptor,
7374
&nouveau_driver_descriptor,
7475
&r300_driver_descriptor,
7576
&r600_driver_descriptor,

src/gallium/auxiliary/target-helpers/drm_helper.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,26 @@ DRM_DRIVER_DESCRIPTOR(iris, iris_driconf, ARRAY_SIZE(iris_driconf))
112112
DRM_DRIVER_DESCRIPTOR_STUB(iris)
113113
#endif
114114

115+
#ifdef GALLIUM_CROCUS
116+
#include "crocus/drm/crocus_drm_public.h"
117+
118+
static struct pipe_screen *
119+
pipe_crocus_create_screen(int fd, const struct pipe_screen_config *config)
120+
{
121+
struct pipe_screen *screen;
122+
123+
screen = crocus_drm_screen_create(fd, config);
124+
return screen ? debug_screen_wrap(screen) : NULL;
125+
}
126+
127+
const driOptionDescription crocus_driconf[] = {
128+
#include "crocus/driinfo_crocus.h"
129+
};
130+
DRM_DRIVER_DESCRIPTOR(crocus, crocus_driconf, ARRAY_SIZE(crocus_driconf))
131+
#else
132+
DRM_DRIVER_DESCRIPTOR_STUB(crocus)
133+
#endif
134+
115135
#ifdef GALLIUM_NOUVEAU
116136
#include "nouveau/drm/nouveau_drm_public.h"
117137

src/gallium/auxiliary/target-helpers/drm_helper_public.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ struct pipe_screen_config;
66

77
extern const struct drm_driver_descriptor i915_driver_descriptor;
88
extern const struct drm_driver_descriptor iris_driver_descriptor;
9+
extern const struct drm_driver_descriptor crocus_driver_descriptor;
910
extern const struct drm_driver_descriptor nouveau_driver_descriptor;
1011
extern const struct drm_driver_descriptor r300_driver_descriptor;
1112
extern const struct drm_driver_descriptor r600_driver_descriptor;

0 commit comments

Comments
 (0)