xref: /linux/drivers/gpu/drm/xe/compat-i915-headers/pxp/intel_pxp.h (revision 4f9786035f9e519db41375818e1d0b5f20da2f10)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #ifndef __INTEL_PXP_H__
7 #define __INTEL_PXP_H__
8 
9 #include <linux/errno.h>
10 #include <linux/types.h>
11 
12 #include "xe_pxp.h"
13 
14 struct drm_gem_object;
15 
intel_pxp_key_check(struct drm_gem_object * obj,bool assign)16 static inline int intel_pxp_key_check(struct drm_gem_object *obj, bool assign)
17 {
18 	/*
19 	 * The assign variable is used in i915 to assign the key to the BO at
20 	 * first submission time. In Xe the key is instead assigned at BO
21 	 * creation time, so the assign variable must always be false.
22 	 */
23 	if (assign)
24 		return -EINVAL;
25 
26 	return xe_pxp_obj_key_check(obj);
27 }
28 
29 #endif
30