mirror of
https://github.com/torvalds/linux.git
synced 2026-04-25 18:12:26 -04:00
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 <matthew.brost@intel.com> Co-developed-by: Matthew Auld <matthew.auld@intel.com> Co-developed-by: Matt Roper <matthew.d.roper@intel.com> Co-developed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Co-developed-by: Francois Dugast <francois.dugast@intel.com> Co-developed-by: Lucas De Marchi <lucas.demarchi@intel.com> Co-developed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Co-developed-by: Philippe Lecluse <philippe.lecluse@intel.com> Co-developed-by: Nirmoy Das <nirmoy.das@intel.com> Co-developed-by: Jani Nikula <jani.nikula@intel.com> Co-developed-by: José Roberto de Souza <jose.souza@intel.com> Co-developed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Co-developed-by: Dave Airlie <airlied@redhat.com> Co-developed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Co-developed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Co-developed-by: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
This commit is contained in:
committed by
Rodrigo Vivi
parent
a60501d7c2
commit
dd08ebf6c3
66
drivers/gpu/drm/xe/tests/xe_test.h
Normal file
66
drivers/gpu/drm/xe/tests/xe_test.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 AND MIT */
|
||||
/*
|
||||
* Copyright © 2022 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef __XE_TEST_H__
|
||||
#define __XE_TEST_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
|
||||
#include <linux/sched.h>
|
||||
#include <kunit/test.h>
|
||||
|
||||
/*
|
||||
* Each test that provides a kunit private test structure, place a test id
|
||||
* here and point the kunit->priv to an embedded struct xe_test_priv.
|
||||
*/
|
||||
enum xe_test_priv_id {
|
||||
XE_TEST_LIVE_DMA_BUF,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct xe_test_priv - Base class for test private info
|
||||
* @id: enum xe_test_priv_id to identify the subclass.
|
||||
*/
|
||||
struct xe_test_priv {
|
||||
enum xe_test_priv_id id;
|
||||
};
|
||||
|
||||
#define XE_TEST_DECLARE(x) x
|
||||
#define XE_TEST_ONLY(x) unlikely(x)
|
||||
#define XE_TEST_EXPORT
|
||||
#define xe_cur_kunit() current->kunit_test
|
||||
|
||||
/**
|
||||
* xe_cur_kunit_priv - Obtain the struct xe_test_priv pointed to by
|
||||
* current->kunit->priv if it exists and is embedded in the expected subclass.
|
||||
* @id: Id of the expected subclass.
|
||||
*
|
||||
* Return: NULL if the process is not a kunit test, and NULL if the
|
||||
* current kunit->priv pointer is not pointing to an object of the expected
|
||||
* subclass. A pointer to the embedded struct xe_test_priv otherwise.
|
||||
*/
|
||||
static inline struct xe_test_priv *
|
||||
xe_cur_kunit_priv(enum xe_test_priv_id id)
|
||||
{
|
||||
struct xe_test_priv *priv;
|
||||
|
||||
if (!xe_cur_kunit())
|
||||
return NULL;
|
||||
|
||||
priv = xe_cur_kunit()->priv;
|
||||
return priv->id == id ? priv : NULL;
|
||||
}
|
||||
|
||||
#else /* if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST) */
|
||||
|
||||
#define XE_TEST_DECLARE(x)
|
||||
#define XE_TEST_ONLY(x) 0
|
||||
#define XE_TEST_EXPORT static
|
||||
#define xe_cur_kunit() NULL
|
||||
#define xe_cur_kunit_priv(_id) NULL
|
||||
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user