@@ -280,7 +280,16 @@ enum drm_i915_pmu_engine_sample {
280
280
#define I915_PMU_ENGINE_SEMA (class , instance ) \
281
281
__I915_PMU_ENGINE(class, instance, I915_SAMPLE_SEMA)
282
282
283
- #define __I915_PMU_OTHER (x ) (__I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x))
283
+ /*
284
+ * Top 4 bits of every non-engine counter are GT id.
285
+ */
286
+ #define __I915_PMU_GT_SHIFT (60)
287
+
288
+ #define ___I915_PMU_OTHER (gt , x ) \
289
+ (((__u64)__I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x)) | \
290
+ ((__u64)(gt) << __I915_PMU_GT_SHIFT))
291
+
292
+ #define __I915_PMU_OTHER (x ) ___I915_PMU_OTHER(0, x)
284
293
285
294
#define I915_PMU_ACTUAL_FREQUENCY __I915_PMU_OTHER(0)
286
295
#define I915_PMU_REQUESTED_FREQUENCY __I915_PMU_OTHER(1)
@@ -290,6 +299,12 @@ enum drm_i915_pmu_engine_sample {
290
299
291
300
#define I915_PMU_LAST /* Deprecated - do not use */ I915_PMU_RC6_RESIDENCY
292
301
302
+ #define __I915_PMU_ACTUAL_FREQUENCY (gt ) ___I915_PMU_OTHER(gt, 0)
303
+ #define __I915_PMU_REQUESTED_FREQUENCY (gt ) ___I915_PMU_OTHER(gt, 1)
304
+ #define __I915_PMU_INTERRUPTS (gt ) ___I915_PMU_OTHER(gt, 2)
305
+ #define __I915_PMU_RC6_RESIDENCY (gt ) ___I915_PMU_OTHER(gt, 3)
306
+ #define __I915_PMU_SOFTWARE_GT_AWAKE_TIME (gt ) ___I915_PMU_OTHER(gt, 4)
307
+
293
308
/* Each region is a minimum of 16k, and there are at most 255 of them.
294
309
*/
295
310
#define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use
@@ -659,7 +674,8 @@ typedef struct drm_i915_irq_wait {
659
674
* If the IOCTL is successful, the returned parameter will be set to one of the
660
675
* following values:
661
676
* * 0 if HuC firmware load is not complete,
662
- * * 1 if HuC firmware is authenticated and running.
677
+ * * 1 if HuC firmware is loaded and fully authenticated,
678
+ * * 2 if HuC firmware is loaded and authenticated for clear media only
663
679
*/
664
680
#define I915_PARAM_HUC_STATUS 42
665
681
@@ -771,6 +787,25 @@ typedef struct drm_i915_irq_wait {
771
787
*/
772
788
#define I915_PARAM_OA_TIMESTAMP_FREQUENCY 57
773
789
790
+ /*
791
+ * Query the status of PXP support in i915.
792
+ *
793
+ * The query can fail in the following scenarios with the listed error codes:
794
+ * -ENODEV = PXP support is not available on the GPU device or in the
795
+ * kernel due to missing component drivers or kernel configs.
796
+ *
797
+ * If the IOCTL is successful, the returned parameter will be set to one of
798
+ * the following values:
799
+ * 1 = PXP feature is supported and is ready for use.
800
+ * 2 = PXP feature is supported but should be ready soon (pending
801
+ * initialization of non-i915 system dependencies).
802
+ *
803
+ * NOTE: When param is supported (positive return values), user space should
804
+ * still refer to the GEM PXP context-creation UAPI header specs to be
805
+ * aware of possible failure due to system state machine at the time.
806
+ */
807
+ #define I915_PARAM_PXP_STATUS 58
808
+
774
809
/* Must be kept compact -- no holes and well documented */
775
810
776
811
/**
@@ -2096,6 +2131,21 @@ struct drm_i915_gem_context_param {
2096
2131
*
2097
2132
* -ENODEV: feature not available
2098
2133
* -EPERM: trying to mark a recoverable or not bannable context as protected
2134
+ * -ENXIO: A dependency such as a component driver or firmware is not yet
2135
+ * loaded so user space may need to attempt again. Depending on the
2136
+ * device, this error may be reported if protected context creation is
2137
+ * attempted very early after kernel start because the internal timeout
2138
+ * waiting for such dependencies is not guaranteed to be larger than
2139
+ * required (numbers differ depending on system and kernel config):
2140
+ * - ADL/RPL: dependencies may take up to 3 seconds from kernel start
2141
+ * while context creation internal timeout is 250 milisecs
2142
+ * - MTL: dependencies may take up to 8 seconds from kernel start
2143
+ * while context creation internal timeout is 250 milisecs
2144
+ * NOTE: such dependencies happen once, so a subsequent call to create a
2145
+ * protected context after a prior successful call will not experience
2146
+ * such timeouts and will not return -ENXIO (unless the driver is reloaded,
2147
+ * or, depending on the device, resumes from a suspended state).
2148
+ * -EIO: The firmware did not succeed in creating the protected context.
2099
2149
*/
2100
2150
#define I915_CONTEXT_PARAM_PROTECTED_CONTENT 0xd
2101
2151
/* Must be kept compact -- no holes and well documented */
@@ -3630,9 +3680,13 @@ struct drm_i915_gem_create_ext {
3630
3680
*
3631
3681
* For I915_GEM_CREATE_EXT_PROTECTED_CONTENT usage see
3632
3682
* struct drm_i915_gem_create_ext_protected_content.
3683
+ *
3684
+ * For I915_GEM_CREATE_EXT_SET_PAT usage see
3685
+ * struct drm_i915_gem_create_ext_set_pat.
3633
3686
*/
3634
3687
#define I915_GEM_CREATE_EXT_MEMORY_REGIONS 0
3635
3688
#define I915_GEM_CREATE_EXT_PROTECTED_CONTENT 1
3689
+ #define I915_GEM_CREATE_EXT_SET_PAT 2
3636
3690
__u64 extensions ;
3637
3691
};
3638
3692
@@ -3747,6 +3801,43 @@ struct drm_i915_gem_create_ext_protected_content {
3747
3801
__u32 flags ;
3748
3802
};
3749
3803
3804
+ /**
3805
+ * struct drm_i915_gem_create_ext_set_pat - The
3806
+ * I915_GEM_CREATE_EXT_SET_PAT extension.
3807
+ *
3808
+ * If this extension is provided, the specified caching policy (PAT index) is
3809
+ * applied to the buffer object.
3810
+ *
3811
+ * Below is an example on how to create an object with specific caching policy:
3812
+ *
3813
+ * .. code-block:: C
3814
+ *
3815
+ * struct drm_i915_gem_create_ext_set_pat set_pat_ext = {
3816
+ * .base = { .name = I915_GEM_CREATE_EXT_SET_PAT },
3817
+ * .pat_index = 0,
3818
+ * };
3819
+ * struct drm_i915_gem_create_ext create_ext = {
3820
+ * .size = PAGE_SIZE,
3821
+ * .extensions = (uintptr_t)&set_pat_ext,
3822
+ * };
3823
+ *
3824
+ * int err = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create_ext);
3825
+ * if (err) ...
3826
+ */
3827
+ struct drm_i915_gem_create_ext_set_pat {
3828
+ /** @base: Extension link. See struct i915_user_extension. */
3829
+ struct i915_user_extension base ;
3830
+ /**
3831
+ * @pat_index: PAT index to be set
3832
+ * PAT index is a bit field in Page Table Entry to control caching
3833
+ * behaviors for GPU accesses. The definition of PAT index is
3834
+ * platform dependent and can be found in hardware specifications,
3835
+ */
3836
+ __u32 pat_index ;
3837
+ /** @rsvd: reserved for future use */
3838
+ __u32 rsvd ;
3839
+ };
3840
+
3750
3841
/* ID of the protected content session managed by i915 when PXP is active */
3751
3842
#define I915_PROTECTED_CONTENT_DEFAULT_SESSION 0xf
3752
3843
0 commit comments