linux/drivers/gpu/drm/xe/xe_guc_relay.h
Michal Wajdeczko 811fe9f556 drm/xe/guc: Introduce Relay Communication for SR-IOV
There are scenarios where SR-IOV Virtual Function (VF) driver will
need to get additional data that is not available over VF MMIO BAR
nor could be queried from the GuC firmware and must be obtained
from the Physical Function (PF) driver.

To allow such communication between VF and PF drivers, GuC supports
set of H2G and G2H actions which allows relaying embedded messages,
that are otherwise opaque for the GuC.

To allow use of this communication mechanism, provide functions for
sending requests and handling replies and placeholder where we will
put handlers for incoming requests.

Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://lore.kernel.org/r/20240104222031.277-8-michal.wajdeczko@intel.com
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
2024-01-05 16:25:53 +01:00

38 lines
992 B
C

/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2023 Intel Corporation
*/
#ifndef _XE_GUC_RELAY_H_
#define _XE_GUC_RELAY_H_
#include <linux/types.h>
#include <linux/errno.h>
struct xe_guc_relay;
int xe_guc_relay_init(struct xe_guc_relay *relay);
int xe_guc_relay_send_to_pf(struct xe_guc_relay *relay,
const u32 *msg, u32 len, u32 *buf, u32 buf_size);
int xe_guc_relay_process_guc2vf(struct xe_guc_relay *relay, const u32 *msg, u32 len);
#ifdef CONFIG_PCI_IOV
int xe_guc_relay_send_to_vf(struct xe_guc_relay *relay, u32 target,
const u32 *msg, u32 len, u32 *buf, u32 buf_size);
int xe_guc_relay_process_guc2pf(struct xe_guc_relay *relay, const u32 *msg, u32 len);
#else
static inline int xe_guc_relay_send_to_vf(struct xe_guc_relay *relay, u32 target,
const u32 *msg, u32 len, u32 *buf, u32 buf_size)
{
return -ENODEV;
}
static inline int xe_guc_relay_process_guc2pf(struct xe_guc_relay *relay, const u32 *msg, u32 len)
{
return -ENODEV;
}
#endif
#endif