linux/drivers/gpu/drm/xe/xe_pci.c

// SPDX-License-Identifier: MIT
/*
 * Copyright © 2021 Intel Corporation
 */

#include "xe_pci.h"

#include <kunit/static_stub.h>
#include <linux/device/driver.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/pm_runtime.h>

#include <drm/drm_color_mgmt.h>
#include <drm/drm_drv.h>
#include <drm/intel/xe_pciids.h>

#include "display/xe_display.h"
#include "regs/xe_gt_regs.h"
#include "xe_device.h"
#include "xe_drv.h"
#include "xe_gt.h"
#include "xe_gt_sriov_vf.h"
#include "xe_guc.h"
#include "xe_macros.h"
#include "xe_mmio.h"
#include "xe_module.h"
#include "xe_pci_sriov.h"
#include "xe_pci_types.h"
#include "xe_pm.h"
#include "xe_sriov.h"
#include "xe_step.h"
#include "xe_tile.h"

enum toggle_d3cold {};

struct xe_subplatform_desc {};

struct xe_device_desc {};

__diag_push();
__diag_ignore_all("-Woverride-init", "Allow field overrides in table");

#define PLATFORM

#define NOP(x)

static const struct xe_graphics_desc graphics_xelp =;

static const struct xe_graphics_desc graphics_xelpp =;

#define XE_HP_FEATURES

static const struct xe_graphics_desc graphics_xehpg =;

static const struct xe_graphics_desc graphics_xehpc =;

static const struct xe_graphics_desc graphics_xelpg =;

#define XE2_GFX_FEATURES

static const struct xe_graphics_desc graphics_xe2 =;

static const struct xe_media_desc media_xem =;

static const struct xe_media_desc media_xehpm =;

static const struct xe_media_desc media_xelpmp =;

static const struct xe_media_desc media_xe2 =;

static const struct xe_device_desc tgl_desc =;

static const struct xe_device_desc rkl_desc =;

static const u16 adls_rpls_ids[] =;

static const struct xe_device_desc adl_s_desc =;

static const u16 adlp_rplu_ids[] =;

static const struct xe_device_desc adl_p_desc =;

static const struct xe_device_desc adl_n_desc =;

#define DGFX_FEATURES

static const struct xe_device_desc dg1_desc =;

static const u16 dg2_g10_ids[] =;
static const u16 dg2_g11_ids[] =;
static const u16 dg2_g12_ids[] =;

#define DG2_FEATURES

static const struct xe_device_desc ats_m_desc =;

static const struct xe_device_desc dg2_desc =;

static const __maybe_unused struct xe_device_desc pvc_desc =;

static const struct xe_device_desc mtl_desc =;

static const struct xe_device_desc lnl_desc =;

static const struct xe_device_desc bmg_desc =;

#undef PLATFORM
__diag_pop();

/* Map of GMD_ID values to graphics IP */
static const struct gmdid_map graphics_ip_map[] =;

/* Map of GMD_ID values to media IP */
static const struct gmdid_map media_ip_map[] =;

#define INTEL_VGA_DEVICE

/*
 * Make sure any device matches here are from most specific to most
 * general.  For example, since the Quanta match is based on the subsystem
 * and subvendor IDs, we need it to come before the more general IVB
 * PCI ID matches, otherwise we'll use the wrong info struct above.
 */
static const struct pci_device_id pciidlist[] =;
MODULE_DEVICE_TABLE(pci, pciidlist);

#undef INTEL_VGA_DEVICE

/* is device_id present in comma separated list of ids */
static bool device_id_in_list(u16 device_id, const char *devices, bool negative)
{}

static bool id_forced(u16 device_id)
{}

static bool id_blocked(u16 device_id)
{}

static const struct xe_subplatform_desc *
find_subplatform(const struct xe_device *xe, const struct xe_device_desc *desc)
{}

enum xe_gmdid_type {};

static void read_gmdid(struct xe_device *xe, enum xe_gmdid_type type, u32 *ver, u32 *revid)
{}

/*
 * Pre-GMD_ID platform: device descriptor already points to the appropriate
 * graphics descriptor. Simply forward the description and calculate the version
 * appropriately. "graphics" should be present in all such platforms, while
 * media is optional.
 */
static void handle_pre_gmdid(struct xe_device *xe,
			     const struct xe_graphics_desc *graphics,
			     const struct xe_media_desc *media)
{}

/*
 * GMD_ID platform: read IP version from hardware and select graphics descriptor
 * based on the result.
 */
static void handle_gmdid(struct xe_device *xe,
			 const struct xe_graphics_desc **graphics,
			 const struct xe_media_desc **media,
			 u32 *graphics_revid,
			 u32 *media_revid)
{}

/*
 * Initialize device info content that only depends on static driver_data
 * passed to the driver at probe time from PCI ID table.
 */
static int xe_info_init_early(struct xe_device *xe,
			      const struct xe_device_desc *desc,
			      const struct xe_subplatform_desc *subplatform_desc)
{}

/*
 * Initialize device info content that does require knowledge about
 * graphics / media IP version.
 * Make sure that GT / tile structures allocated by the driver match the data
 * present in device info.
 */
static int xe_info_init(struct xe_device *xe,
			const struct xe_graphics_desc *graphics_desc,
			const struct xe_media_desc *media_desc)
{}

static void xe_pci_remove(struct pci_dev *pdev)
{}

static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{}

static void xe_pci_shutdown(struct pci_dev *pdev)
{}

#ifdef CONFIG_PM_SLEEP
static void d3cold_toggle(struct pci_dev *pdev, enum toggle_d3cold toggle)
{}

static int xe_pci_suspend(struct device *dev)
{}

static int xe_pci_resume(struct device *dev)
{}

static int xe_pci_runtime_suspend(struct device *dev)
{}

static int xe_pci_runtime_resume(struct device *dev)
{}

static int xe_pci_runtime_idle(struct device *dev)
{}

static const struct dev_pm_ops xe_pm_ops =;
#endif

static struct pci_driver xe_pci_driver =;

int xe_register_pci_driver(void)
{}

void xe_unregister_pci_driver(void)
{}

#if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
#include "tests/xe_pci.c"
#endif