Commit ff48e05d authored by Daniele Ceraolo Spurio's avatar Daniele Ceraolo Spurio
Browse files

drm/xe/pxp: Initialize PXP structure and KCR reg



As the first step towards adding PXP support, hook in the PXP init
function, allocate the PXP structure and initialize the KCR register to
allow PXP HWDRM sessions.

v2: remove unneeded includes, free PXP memory on error (John)

Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250129174140.948829-2-daniele.ceraolospurio@intel.com
parent ae5d9cde
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ xe-y += xe_bb.o \
	xe_preempt_fence.o \
	xe_pt.o \
	xe_pt_walk.o \
	xe_pxp.o \
	xe_query.o \
	xe_range_fence.o \
	xe_reg_sr.o \
+2 −2
Original line number Diff line number Diff line
@@ -10,9 +10,9 @@
#include <linux/types.h>

struct drm_gem_object;
struct intel_pxp;
struct xe_pxp;

static inline int intel_pxp_key_check(struct intel_pxp *pxp,
static inline int intel_pxp_key_check(struct xe_pxp *pxp,
				      struct drm_gem_object *obj,
				      bool assign)
{
+17 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: MIT */
/*
 * Copyright(c) 2024, Intel Corporation. All rights reserved.
 */

#ifndef __XE_PXP_REGS_H__
#define __XE_PXP_REGS_H__

#include "regs/xe_regs.h"

/* The following registers are only valid on platforms with a media GT */

/* KCR enable/disable control */
#define KCR_INIT				XE_REG(0x3860f0)
#define   KCR_INIT_ALLOW_DISPLAY_ME_WRITES	REG_BIT(14)

#endif /* __XE_PXP_REGS_H__ */
+6 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@
#include "xe_pcode.h"
#include "xe_pm.h"
#include "xe_pmu.h"
#include "xe_pxp.h"
#include "xe_query.h"
#include "xe_sriov.h"
#include "xe_survivability_mode.h"
@@ -861,6 +862,11 @@ int xe_device_probe(struct xe_device *xe)
	if (err)
		goto err_fini_oa;

	/* A PXP init failure is not fatal */
	err = xe_pxp_init(xe);
	if (err && err != -EOPNOTSUPP)
		drm_err(&xe->drm, "PXP initialization failed: %pe\n", ERR_PTR(err));

	err = drm_dev_register(&xe->drm, 0);
	if (err)
		goto err_fini_display;
+6 −2
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@

struct xe_ggtt;
struct xe_pat_ops;
struct xe_pxp;

#define XE_BO_INVALID_OFFSET	LONG_MAX

@@ -307,6 +308,8 @@ struct xe_device {
		u8 has_heci_gscfi:1;
		/** @info.has_llc: Device has a shared CPU+GPU last level cache */
		u8 has_llc:1;
		/** @info.has_pxp: Device has PXP support */
		u8 has_pxp:1;
		/** @info.has_range_tlb_invalidation: Has range based TLB invalidations */
		u8 has_range_tlb_invalidation:1;
		/** @info.has_sriov: Supports SR-IOV */
@@ -508,6 +511,9 @@ struct xe_device {
	/** @oa: oa observation subsystem */
	struct xe_oa oa;

	/** @pxp: Encapsulate Protected Xe Path support */
	struct xe_pxp *pxp;

	/** @needs_flr_on_fini: requests function-reset on fini */
	bool needs_flr_on_fini;

@@ -583,8 +589,6 @@ struct xe_device {
		unsigned int czclk_freq;
		unsigned int fsb_freq, mem_freq, is_ddr3;
	};

	void *pxp;
#endif
};

Loading