Skip to content

Commit

Permalink
drm/xe: Introduce a new DRM driver for Intel GPUs
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mbrost05 authored and rodrigovivi committed Dec 12, 2023
1 parent a60501d commit dd08ebf
Show file tree
Hide file tree
Showing 210 changed files with 40,575 additions and 0 deletions.
1 change: 1 addition & 0 deletions Documentation/gpu/drivers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ GPU Driver Documentation
vkms
bridge/dw-hdmi
xen-front
xe/index
afbc
komeda-kms
panfrost
Expand Down
23 changes: 23 additions & 0 deletions Documentation/gpu/xe/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
=======================
drm/xe Intel GFX Driver
=======================

The drm/xe driver supports some future GFX cards with rendering, display,
compute and media. Support for currently available platforms like TGL, ADL,
DG2, etc is provided to prototype the driver.

.. toctree::
:titlesonly:

xe_mm
xe_map
xe_migrate
xe_cs
xe_pm
xe_pcode
xe_gt_mcr
xe_wa
xe_rtp
xe_firmware
8 changes: 8 additions & 0 deletions Documentation/gpu/xe/xe_cs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
==================
Command submission
==================

.. kernel-doc:: drivers/gpu/drm/xe/xe_exec.c
:doc: Execbuf (User GPU command submission)
34 changes: 34 additions & 0 deletions Documentation/gpu/xe/xe_firmware.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
========
Firmware
========

Firmware Layout
===============

.. kernel-doc:: drivers/gpu/drm/xe/xe_uc_fw_abi.h
:doc: Firmware Layout

Write Once Protected Content Memory (WOPCM) Layout
==================================================

.. kernel-doc:: drivers/gpu/drm/xe/xe_wopcm.c
:doc: Write Once Protected Content Memory (WOPCM) Layout

GuC CTB Blob
============

.. kernel-doc:: drivers/gpu/drm/xe/xe_guc_ct.c
:doc: GuC CTB Blob

GuC Power Conservation (PC)
===========================

.. kernel-doc:: drivers/gpu/drm/xe/xe_guc_pc.c
:doc: GuC Power Conservation (PC)

Internal API
============

TODO
13 changes: 13 additions & 0 deletions Documentation/gpu/xe/xe_gt_mcr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
==============================================
GT Multicast/Replicated (MCR) Register Support
==============================================

.. kernel-doc:: drivers/gpu/drm/xe/xe_gt_mcr.c
:doc: GT Multicast/Replicated (MCR) Register Support

Internal API
============

TODO
8 changes: 8 additions & 0 deletions Documentation/gpu/xe/xe_map.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
=========
Map Layer
=========

.. kernel-doc:: drivers/gpu/drm/xe/xe_map.h
:doc: Map layer
8 changes: 8 additions & 0 deletions Documentation/gpu/xe/xe_migrate.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
=============
Migrate Layer
=============

.. kernel-doc:: drivers/gpu/drm/xe/xe_migrate_doc.h
:doc: Migrate Layer
14 changes: 14 additions & 0 deletions Documentation/gpu/xe/xe_mm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
=================
Memory Management
=================

.. kernel-doc:: drivers/gpu/drm/xe/xe_bo_doc.h
:doc: Buffer Objects (BO)

Pagetable building
==================

.. kernel-doc:: drivers/gpu/drm/xe/xe_pt.c
:doc: Pagetable building
14 changes: 14 additions & 0 deletions Documentation/gpu/xe/xe_pcode.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
=====
Pcode
=====

.. kernel-doc:: drivers/gpu/drm/xe/xe_pcode.c
:doc: PCODE

Internal API
============

.. kernel-doc:: drivers/gpu/drm/xe/xe_pcode.c
:internal:
14 changes: 14 additions & 0 deletions Documentation/gpu/xe/xe_pm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
========================
Runtime Power Management
========================

.. kernel-doc:: drivers/gpu/drm/xe/xe_pm.c
:doc: Xe Power Management

Internal API
============

.. kernel-doc:: drivers/gpu/drm/xe/xe_pm.c
:internal:
20 changes: 20 additions & 0 deletions Documentation/gpu/xe/xe_rtp.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
=========================
Register Table Processing
=========================

.. kernel-doc:: drivers/gpu/drm/xe/xe_rtp.c
:doc: Register Table Processing

Internal API
============

.. kernel-doc:: drivers/gpu/drm/xe/xe_rtp_types.h
:internal:

.. kernel-doc:: drivers/gpu/drm/xe/xe_rtp.h
:internal:

.. kernel-doc:: drivers/gpu/drm/xe/xe_rtp.c
:internal:
14 changes: 14 additions & 0 deletions Documentation/gpu/xe/xe_wa.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
====================
Hardware workarounds
====================

.. kernel-doc:: drivers/gpu/drm/xe/xe_wa.c
:doc: Hardware workarounds

Internal API
============

.. kernel-doc:: drivers/gpu/drm/xe/xe_wa.c
:internal:
2 changes: 2 additions & 0 deletions drivers/gpu/drm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ source "drivers/gpu/drm/nouveau/Kconfig"

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

source "drivers/gpu/drm/xe/Kconfig"

source "drivers/gpu/drm/kmb/Kconfig"

config DRM_VGEM
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ obj-$(CONFIG_DRM_RADEON)+= radeon/
obj-$(CONFIG_DRM_AMDGPU)+= amd/amdgpu/
obj-$(CONFIG_DRM_AMDGPU)+= amd/amdxcp/
obj-$(CONFIG_DRM_I915) += i915/
obj-$(CONFIG_DRM_XE) += xe/
obj-$(CONFIG_DRM_KMB_DISPLAY) += kmb/
obj-$(CONFIG_DRM_MGAG200) += mgag200/
obj-$(CONFIG_DRM_V3D) += v3d/
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/xe/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SPDX-License-Identifier: GPL-2.0-only
*.hdrtest
63 changes: 63 additions & 0 deletions drivers/gpu/drm/xe/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# SPDX-License-Identifier: GPL-2.0-only
config DRM_XE
tristate "Intel Xe Graphics"
depends on DRM && PCI && MMU
select INTERVAL_TREE
# we need shmfs for the swappable backing store, and in particular
# the shmem_readpage() which depends upon tmpfs
select SHMEM
select TMPFS
select DRM_BUDDY
select DRM_KMS_HELPER
select DRM_PANEL
select DRM_SUBALLOC_HELPER
select RELAY
select IRQ_WORK
select SYNC_FILE
select IOSF_MBI
select CRC32
select SND_HDA_I915 if SND_HDA_CORE
select CEC_CORE if CEC_NOTIFIER
select VMAP_PFN
select DRM_TTM
select DRM_TTM_HELPER
select DRM_SCHED
select MMU_NOTIFIER
help
Experimental driver for Intel Xe series GPUs

If "M" is selected, the module will be called xe.

config DRM_XE_FORCE_PROBE
string "Force probe xe for selected Intel hardware IDs"
depends on DRM_XE
help
This is the default value for the xe.force_probe module
parameter. Using the module parameter overrides this option.

Force probe the xe for Intel graphics devices that are
recognized but not properly supported by this kernel version. It is
recommended to upgrade to a kernel version with proper support as soon
as it is available.

It can also be used to block the probe of recognized and fully
supported devices.

Use "" to disable force probe. If in doubt, use this.

Use "<pci-id>[,<pci-id>,...]" to force probe the xe for listed
devices. For example, "4500" or "4500,4571".

Use "*" to force probe the driver for all known devices.

Use "!" right before the ID to block the probe of the device. For
example, "4500,!4571" forces the probe of 4500 and blocks the probe of
4571.

Use "!*" to block the probe of the driver for all known devices.

menu "drm/Xe Debugging"
depends on DRM_XE
depends on EXPERT
source "drivers/gpu/drm/xe/Kconfig.debug"
endmenu
96 changes: 96 additions & 0 deletions drivers/gpu/drm/xe/Kconfig.debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# SPDX-License-Identifier: GPL-2.0-only
config DRM_XE_WERROR
bool "Force GCC to throw an error instead of a warning when compiling"
# As this may inadvertently break the build, only allow the user
# to shoot oneself in the foot iff they aim really hard
depends on EXPERT
# We use the dependency on !COMPILE_TEST to not be enabled in
# allmodconfig or allyesconfig configurations
depends on !COMPILE_TEST
default n
help
Add -Werror to the build flags for (and only for) xe.ko.
Do not enable this unless you are writing code for the xe.ko module.

Recommended for driver developers only.

If in doubt, say "N".

config DRM_XE_DEBUG
bool "Enable additional driver debugging"
depends on DRM_XE
depends on EXPERT
depends on !COMPILE_TEST
default n
help
Choose this option to turn on extra driver debugging that may affect
performance but will catch some internal issues.

Recommended for driver developers only.

If in doubt, say "N".

config DRM_XE_DEBUG_VM
bool "Enable extra VM debugging info"
default n
help
Enable extra VM debugging info

Recommended for driver developers only.

If in doubt, say "N".

config DRM_XE_DEBUG_MEM
bool "Enable passing SYS/LMEM addresses to user space"
default n
help
Pass object location trough uapi. Intended for extended
testing and development only.

Recommended for driver developers only.

If in doubt, say "N".

config DRM_XE_SIMPLE_ERROR_CAPTURE
bool "Enable simple error capture to dmesg on job timeout"
default n
help
Choose this option when debugging an unexpected job timeout

Recommended for driver developers only.

If in doubt, say "N".

config DRM_XE_KUNIT_TEST
tristate "KUnit tests for the drm xe driver" if !KUNIT_ALL_TESTS
depends on DRM_XE && KUNIT
default KUNIT_ALL_TESTS
select DRM_EXPORT_FOR_TESTS if m
help
Choose this option to allow the driver to perform selftests under
the kunit framework

Recommended for driver developers only.

If in doubt, say "N".

config DRM_XE_LARGE_GUC_BUFFER
bool "Enable larger guc log buffer"
default n
help
Choose this option when debugging guc issues.
Buffer should be large enough for complex issues.

Recommended for driver developers only.

If in doubt, say "N".

config DRM_XE_USERPTR_INVAL_INJECT
bool "Inject userptr invalidation -EINVAL errors"
default n
help
Choose this option when debugging error paths that
are hit during checks for userptr invalidations.

Recomended for driver developers only.
If in doubt, say "N".
Loading

0 comments on commit dd08ebf

Please sign in to comment.