linux/drivers/gpu/drm/xe/xe_device.h

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

#ifndef _XE_DEVICE_H_
#define _XE_DEVICE_H_

#include <drm/drm_util.h>

#include "xe_device_types.h"

static inline struct xe_device *to_xe_device(const struct drm_device *dev)
{}

static inline struct xe_device *pdev_to_xe_device(struct pci_dev *pdev)
{}

static inline struct xe_device *ttm_to_xe_device(struct ttm_device *ttm)
{}

struct xe_device *xe_device_create(struct pci_dev *pdev,
				   const struct pci_device_id *ent);
int xe_device_probe_early(struct xe_device *xe);
int xe_device_probe(struct xe_device *xe);
void xe_device_remove(struct xe_device *xe);
void xe_device_shutdown(struct xe_device *xe);

void xe_device_wmb(struct xe_device *xe);

static inline struct xe_file *to_xe_file(const struct drm_file *file)
{}

static inline struct xe_tile *xe_device_get_root_tile(struct xe_device *xe)
{}

#define XE_MAX_GT_PER_TILE

static inline struct xe_gt *xe_tile_get_gt(struct xe_tile *tile, u8 gt_id)
{}

static inline struct xe_gt *xe_device_get_gt(struct xe_device *xe, u8 gt_id)
{}

/*
 * Provide a GT structure suitable for performing non-GT MMIO operations against
 * the primary tile.  Primarily intended for early tile initialization, display
 * handling, top-most interrupt enable/disable, etc.  Since anything using the
 * MMIO handle returned by this function doesn't need GSI offset translation,
 * we'll return the primary GT from the root tile.
 *
 * FIXME: Fix the driver design so that 'gt' isn't the target of all MMIO
 * operations.
 *
 * Returns the primary gt of the root tile.
 */
static inline struct xe_gt *xe_root_mmio_gt(struct xe_device *xe)
{}

static inline bool xe_device_uc_enabled(struct xe_device *xe)
{}

#define for_each_tile(tile__, xe__, id__)

#define for_each_remote_tile(tile__, xe__, id__)

/*
 * FIXME: This only works for now since multi-tile and standalone media
 * happen to be mutually exclusive.  Future platforms may change this...
 */
#define for_each_gt(gt__, xe__, id__)

static inline struct xe_force_wake *gt_to_fw(struct xe_gt *gt)
{}

void xe_device_assert_mem_access(struct xe_device *xe);

static inline bool xe_device_in_fault_mode(struct xe_device *xe)
{}

static inline bool xe_device_in_non_fault_mode(struct xe_device *xe)
{}

static inline bool xe_device_has_flat_ccs(struct xe_device *xe)
{}

static inline bool xe_device_has_sriov(struct xe_device *xe)
{}

static inline bool xe_device_has_memirq(struct xe_device *xe)
{}

u32 xe_device_ccs_bytes(struct xe_device *xe, u64 size);

void xe_device_snapshot_print(struct xe_device *xe, struct drm_printer *p);

u64 xe_device_canonicalize_addr(struct xe_device *xe, u64 address);
u64 xe_device_uncanonicalize_addr(struct xe_device *xe, u64 address);

void xe_device_td_flush(struct xe_device *xe);

static inline bool xe_device_wedged(struct xe_device *xe)
{}

void xe_device_declare_wedged(struct xe_device *xe);

#endif