linux/drivers/gpu/drm/i915/pxp/intel_pxp.c

// SPDX-License-Identifier: MIT
/*
 * Copyright(c) 2020 Intel Corporation.
 */
#include <linux/workqueue.h>

#include "gem/i915_gem_context.h"

#include "gt/intel_context.h"
#include "gt/intel_gt.h"

#include "i915_drv.h"

#include "intel_pxp.h"
#include "intel_pxp_gsccs.h"
#include "intel_pxp_irq.h"
#include "intel_pxp_regs.h"
#include "intel_pxp_session.h"
#include "intel_pxp_tee.h"
#include "intel_pxp_types.h"

/**
 * DOC: PXP
 *
 * PXP (Protected Xe Path) is a feature available in Gen12 and newer platforms.
 * It allows execution and flip to display of protected (i.e. encrypted)
 * objects. The SW support is enabled via the CONFIG_DRM_I915_PXP kconfig.
 *
 * Objects can opt-in to PXP encryption at creation time via the
 * I915_GEM_CREATE_EXT_PROTECTED_CONTENT create_ext flag. For objects to be
 * correctly protected they must be used in conjunction with a context created
 * with the I915_CONTEXT_PARAM_PROTECTED_CONTENT flag. See the documentation
 * of those two uapi flags for details and restrictions.
 *
 * Protected objects are tied to a pxp session; currently we only support one
 * session, which i915 manages and whose index is available in the uapi
 * (I915_PROTECTED_CONTENT_DEFAULT_SESSION) for use in instructions targeting
 * protected objects.
 * The session is invalidated by the HW when certain events occur (e.g.
 * suspend/resume). When this happens, all the objects that were used with the
 * session are marked as invalid and all contexts marked as using protected
 * content are banned. Any further attempt at using them in an execbuf call is
 * rejected, while flips are converted to black frames.
 *
 * Some of the PXP setup operations are performed by the Management Engine,
 * which is handled by the mei driver; communication between i915 and mei is
 * performed via the mei_pxp component module.
 */

bool intel_pxp_is_supported(const struct intel_pxp *pxp)
{}

bool intel_pxp_is_enabled(const struct intel_pxp *pxp)
{}

bool intel_pxp_is_active(const struct intel_pxp *pxp)
{}

static void kcr_pxp_set_status(const struct intel_pxp *pxp, bool enable)
{}

static void kcr_pxp_enable(const struct intel_pxp *pxp)
{}

static void kcr_pxp_disable(const struct intel_pxp *pxp)
{}

static int create_vcs_context(struct intel_pxp *pxp)
{}

static void destroy_vcs_context(struct intel_pxp *pxp)
{}

static void pxp_init_full(struct intel_pxp *pxp)
{}

static struct intel_gt *find_gt_for_required_teelink(struct drm_i915_private *i915)
{}

static struct intel_gt *find_gt_for_required_protected_content(struct drm_i915_private *i915)
{}

int intel_pxp_init(struct drm_i915_private *i915)
{}

void intel_pxp_fini(struct drm_i915_private *i915)
{}

void intel_pxp_mark_termination_in_progress(struct intel_pxp *pxp)
{}

static void pxp_queue_termination(struct intel_pxp *pxp)
{}

static bool pxp_component_bound(struct intel_pxp *pxp)
{}

int intel_pxp_get_backend_timeout_ms(struct intel_pxp *pxp)
{}

static int __pxp_global_teardown_final(struct intel_pxp *pxp)
{}

static int __pxp_global_teardown_restart(struct intel_pxp *pxp)
{}

void intel_pxp_end(struct intel_pxp *pxp)
{}

static bool pxp_required_fw_failed(struct intel_pxp *pxp)
{}

static bool pxp_fw_dependencies_completed(struct intel_pxp *pxp)
{}

/*
 * this helper is used by both intel_pxp_start and by
 * the GET_PARAM IOCTL that user space calls. Thus, the
 * return values here should match the UAPI spec.
 */
int intel_pxp_get_readiness_status(struct intel_pxp *pxp, int timeout_ms)
{}

/*
 * the arb session is restarted from the irq work when we receive the
 * termination completion interrupt
 */
#define PXP_READINESS_TIMEOUT

int intel_pxp_start(struct intel_pxp *pxp)
{}

void intel_pxp_init_hw(struct intel_pxp *pxp)
{}

void intel_pxp_fini_hw(struct intel_pxp *pxp)
{}

int intel_pxp_key_check(struct intel_pxp *pxp,
			struct drm_i915_gem_object *obj,
			bool assign)
{}

void intel_pxp_invalidate(struct intel_pxp *pxp)
{}