Skip to content

Commit dd08ebf

Browse files
mbrost05rodrigovivi
authored andcommitted
drm/xe: Introduce a new DRM driver for Intel GPUs
Xe, is a new driver for Intel GPUs that supports both integrated and discrete platforms starting with Tiger Lake (first Intel Xe Architecture). The code is at a stage where it is already functional and has experimental support for multiple platforms starting from Tiger Lake, with initial support implemented in Mesa (for Iris and Anv, our OpenGL and Vulkan drivers), as well as in NEO (for OpenCL and Level0). The new Xe driver leverages a lot from i915. As for display, the intent is to share the display code with the i915 driver so that there is maximum reuse there. But it is not added in this patch. This initial work is a collaboration of many people and unfortunately the big squashed patch won't fully honor the proper credits. But let's get some git quick stats so we can at least try to preserve some of the credits: Co-developed-by: Matthew Brost <[email protected]> Co-developed-by: Matthew Auld <[email protected]> Co-developed-by: Matt Roper <[email protected]> Co-developed-by: Thomas Hellström <[email protected]> Co-developed-by: Francois Dugast <[email protected]> Co-developed-by: Lucas De Marchi <[email protected]> Co-developed-by: Maarten Lankhorst <[email protected]> Co-developed-by: Philippe Lecluse <[email protected]> Co-developed-by: Nirmoy Das <[email protected]> Co-developed-by: Jani Nikula <[email protected]> Co-developed-by: José Roberto de Souza <[email protected]> Co-developed-by: Rodrigo Vivi <[email protected]> Co-developed-by: Dave Airlie <[email protected]> Co-developed-by: Faith Ekstrand <[email protected]> Co-developed-by: Daniel Vetter <[email protected]> Co-developed-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> Signed-off-by: Matthew Brost <[email protected]>
1 parent a60501d commit dd08ebf

File tree

210 files changed

+40575
-0
lines changed

Some content is hidden

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

210 files changed

+40575
-0
lines changed

Documentation/gpu/drivers.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ GPU Driver Documentation
1818
vkms
1919
bridge/dw-hdmi
2020
xen-front
21+
xe/index
2122
afbc
2223
komeda-kms
2324
panfrost

Documentation/gpu/xe/index.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
3+
=======================
4+
drm/xe Intel GFX Driver
5+
=======================
6+
7+
The drm/xe driver supports some future GFX cards with rendering, display,
8+
compute and media. Support for currently available platforms like TGL, ADL,
9+
DG2, etc is provided to prototype the driver.
10+
11+
.. toctree::
12+
:titlesonly:
13+
14+
xe_mm
15+
xe_map
16+
xe_migrate
17+
xe_cs
18+
xe_pm
19+
xe_pcode
20+
xe_gt_mcr
21+
xe_wa
22+
xe_rtp
23+
xe_firmware

Documentation/gpu/xe/xe_cs.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
3+
==================
4+
Command submission
5+
==================
6+
7+
.. kernel-doc:: drivers/gpu/drm/xe/xe_exec.c
8+
:doc: Execbuf (User GPU command submission)

Documentation/gpu/xe/xe_firmware.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
3+
========
4+
Firmware
5+
========
6+
7+
Firmware Layout
8+
===============
9+
10+
.. kernel-doc:: drivers/gpu/drm/xe/xe_uc_fw_abi.h
11+
:doc: Firmware Layout
12+
13+
Write Once Protected Content Memory (WOPCM) Layout
14+
==================================================
15+
16+
.. kernel-doc:: drivers/gpu/drm/xe/xe_wopcm.c
17+
:doc: Write Once Protected Content Memory (WOPCM) Layout
18+
19+
GuC CTB Blob
20+
============
21+
22+
.. kernel-doc:: drivers/gpu/drm/xe/xe_guc_ct.c
23+
:doc: GuC CTB Blob
24+
25+
GuC Power Conservation (PC)
26+
===========================
27+
28+
.. kernel-doc:: drivers/gpu/drm/xe/xe_guc_pc.c
29+
:doc: GuC Power Conservation (PC)
30+
31+
Internal API
32+
============
33+
34+
TODO

Documentation/gpu/xe/xe_gt_mcr.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
3+
==============================================
4+
GT Multicast/Replicated (MCR) Register Support
5+
==============================================
6+
7+
.. kernel-doc:: drivers/gpu/drm/xe/xe_gt_mcr.c
8+
:doc: GT Multicast/Replicated (MCR) Register Support
9+
10+
Internal API
11+
============
12+
13+
TODO

Documentation/gpu/xe/xe_map.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
3+
=========
4+
Map Layer
5+
=========
6+
7+
.. kernel-doc:: drivers/gpu/drm/xe/xe_map.h
8+
:doc: Map layer

Documentation/gpu/xe/xe_migrate.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
3+
=============
4+
Migrate Layer
5+
=============
6+
7+
.. kernel-doc:: drivers/gpu/drm/xe/xe_migrate_doc.h
8+
:doc: Migrate Layer

Documentation/gpu/xe/xe_mm.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
3+
=================
4+
Memory Management
5+
=================
6+
7+
.. kernel-doc:: drivers/gpu/drm/xe/xe_bo_doc.h
8+
:doc: Buffer Objects (BO)
9+
10+
Pagetable building
11+
==================
12+
13+
.. kernel-doc:: drivers/gpu/drm/xe/xe_pt.c
14+
:doc: Pagetable building

Documentation/gpu/xe/xe_pcode.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
3+
=====
4+
Pcode
5+
=====
6+
7+
.. kernel-doc:: drivers/gpu/drm/xe/xe_pcode.c
8+
:doc: PCODE
9+
10+
Internal API
11+
============
12+
13+
.. kernel-doc:: drivers/gpu/drm/xe/xe_pcode.c
14+
:internal:

Documentation/gpu/xe/xe_pm.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
3+
========================
4+
Runtime Power Management
5+
========================
6+
7+
.. kernel-doc:: drivers/gpu/drm/xe/xe_pm.c
8+
:doc: Xe Power Management
9+
10+
Internal API
11+
============
12+
13+
.. kernel-doc:: drivers/gpu/drm/xe/xe_pm.c
14+
:internal:

Documentation/gpu/xe/xe_rtp.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
3+
=========================
4+
Register Table Processing
5+
=========================
6+
7+
.. kernel-doc:: drivers/gpu/drm/xe/xe_rtp.c
8+
:doc: Register Table Processing
9+
10+
Internal API
11+
============
12+
13+
.. kernel-doc:: drivers/gpu/drm/xe/xe_rtp_types.h
14+
:internal:
15+
16+
.. kernel-doc:: drivers/gpu/drm/xe/xe_rtp.h
17+
:internal:
18+
19+
.. kernel-doc:: drivers/gpu/drm/xe/xe_rtp.c
20+
:internal:

Documentation/gpu/xe/xe_wa.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
3+
====================
4+
Hardware workarounds
5+
====================
6+
7+
.. kernel-doc:: drivers/gpu/drm/xe/xe_wa.c
8+
:doc: Hardware workarounds
9+
10+
Internal API
11+
============
12+
13+
.. kernel-doc:: drivers/gpu/drm/xe/xe_wa.c
14+
:internal:

drivers/gpu/drm/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ source "drivers/gpu/drm/nouveau/Kconfig"
276276

277277
source "drivers/gpu/drm/i915/Kconfig"
278278

279+
source "drivers/gpu/drm/xe/Kconfig"
280+
279281
source "drivers/gpu/drm/kmb/Kconfig"
280282

281283
config DRM_VGEM

drivers/gpu/drm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ obj-$(CONFIG_DRM_RADEON)+= radeon/
134134
obj-$(CONFIG_DRM_AMDGPU)+= amd/amdgpu/
135135
obj-$(CONFIG_DRM_AMDGPU)+= amd/amdxcp/
136136
obj-$(CONFIG_DRM_I915) += i915/
137+
obj-$(CONFIG_DRM_XE) += xe/
137138
obj-$(CONFIG_DRM_KMB_DISPLAY) += kmb/
138139
obj-$(CONFIG_DRM_MGAG200) += mgag200/
139140
obj-$(CONFIG_DRM_V3D) += v3d/

drivers/gpu/drm/xe/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
*.hdrtest

drivers/gpu/drm/xe/Kconfig

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
config DRM_XE
3+
tristate "Intel Xe Graphics"
4+
depends on DRM && PCI && MMU
5+
select INTERVAL_TREE
6+
# we need shmfs for the swappable backing store, and in particular
7+
# the shmem_readpage() which depends upon tmpfs
8+
select SHMEM
9+
select TMPFS
10+
select DRM_BUDDY
11+
select DRM_KMS_HELPER
12+
select DRM_PANEL
13+
select DRM_SUBALLOC_HELPER
14+
select RELAY
15+
select IRQ_WORK
16+
select SYNC_FILE
17+
select IOSF_MBI
18+
select CRC32
19+
select SND_HDA_I915 if SND_HDA_CORE
20+
select CEC_CORE if CEC_NOTIFIER
21+
select VMAP_PFN
22+
select DRM_TTM
23+
select DRM_TTM_HELPER
24+
select DRM_SCHED
25+
select MMU_NOTIFIER
26+
help
27+
Experimental driver for Intel Xe series GPUs
28+
29+
If "M" is selected, the module will be called xe.
30+
31+
config DRM_XE_FORCE_PROBE
32+
string "Force probe xe for selected Intel hardware IDs"
33+
depends on DRM_XE
34+
help
35+
This is the default value for the xe.force_probe module
36+
parameter. Using the module parameter overrides this option.
37+
38+
Force probe the xe for Intel graphics devices that are
39+
recognized but not properly supported by this kernel version. It is
40+
recommended to upgrade to a kernel version with proper support as soon
41+
as it is available.
42+
43+
It can also be used to block the probe of recognized and fully
44+
supported devices.
45+
46+
Use "" to disable force probe. If in doubt, use this.
47+
48+
Use "<pci-id>[,<pci-id>,...]" to force probe the xe for listed
49+
devices. For example, "4500" or "4500,4571".
50+
51+
Use "*" to force probe the driver for all known devices.
52+
53+
Use "!" right before the ID to block the probe of the device. For
54+
example, "4500,!4571" forces the probe of 4500 and blocks the probe of
55+
4571.
56+
57+
Use "!*" to block the probe of the driver for all known devices.
58+
59+
menu "drm/Xe Debugging"
60+
depends on DRM_XE
61+
depends on EXPERT
62+
source "drivers/gpu/drm/xe/Kconfig.debug"
63+
endmenu

drivers/gpu/drm/xe/Kconfig.debug

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
config DRM_XE_WERROR
3+
bool "Force GCC to throw an error instead of a warning when compiling"
4+
# As this may inadvertently break the build, only allow the user
5+
# to shoot oneself in the foot iff they aim really hard
6+
depends on EXPERT
7+
# We use the dependency on !COMPILE_TEST to not be enabled in
8+
# allmodconfig or allyesconfig configurations
9+
depends on !COMPILE_TEST
10+
default n
11+
help
12+
Add -Werror to the build flags for (and only for) xe.ko.
13+
Do not enable this unless you are writing code for the xe.ko module.
14+
15+
Recommended for driver developers only.
16+
17+
If in doubt, say "N".
18+
19+
config DRM_XE_DEBUG
20+
bool "Enable additional driver debugging"
21+
depends on DRM_XE
22+
depends on EXPERT
23+
depends on !COMPILE_TEST
24+
default n
25+
help
26+
Choose this option to turn on extra driver debugging that may affect
27+
performance but will catch some internal issues.
28+
29+
Recommended for driver developers only.
30+
31+
If in doubt, say "N".
32+
33+
config DRM_XE_DEBUG_VM
34+
bool "Enable extra VM debugging info"
35+
default n
36+
help
37+
Enable extra VM debugging info
38+
39+
Recommended for driver developers only.
40+
41+
If in doubt, say "N".
42+
43+
config DRM_XE_DEBUG_MEM
44+
bool "Enable passing SYS/LMEM addresses to user space"
45+
default n
46+
help
47+
Pass object location trough uapi. Intended for extended
48+
testing and development only.
49+
50+
Recommended for driver developers only.
51+
52+
If in doubt, say "N".
53+
54+
config DRM_XE_SIMPLE_ERROR_CAPTURE
55+
bool "Enable simple error capture to dmesg on job timeout"
56+
default n
57+
help
58+
Choose this option when debugging an unexpected job timeout
59+
60+
Recommended for driver developers only.
61+
62+
If in doubt, say "N".
63+
64+
config DRM_XE_KUNIT_TEST
65+
tristate "KUnit tests for the drm xe driver" if !KUNIT_ALL_TESTS
66+
depends on DRM_XE && KUNIT
67+
default KUNIT_ALL_TESTS
68+
select DRM_EXPORT_FOR_TESTS if m
69+
help
70+
Choose this option to allow the driver to perform selftests under
71+
the kunit framework
72+
73+
Recommended for driver developers only.
74+
75+
If in doubt, say "N".
76+
77+
config DRM_XE_LARGE_GUC_BUFFER
78+
bool "Enable larger guc log buffer"
79+
default n
80+
help
81+
Choose this option when debugging guc issues.
82+
Buffer should be large enough for complex issues.
83+
84+
Recommended for driver developers only.
85+
86+
If in doubt, say "N".
87+
88+
config DRM_XE_USERPTR_INVAL_INJECT
89+
bool "Inject userptr invalidation -EINVAL errors"
90+
default n
91+
help
92+
Choose this option when debugging error paths that
93+
are hit during checks for userptr invalidations.
94+
95+
Recomended for driver developers only.
96+
If in doubt, say "N".

0 commit comments

Comments
 (0)