Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH v2 0/1] test/gem_create: exercise gem_create_ext_set_pat
@ 2023-05-02  5:19 fei.yang
  2023-05-02  5:19 ` [igt-dev] [PATCH v2 1/1] " fei.yang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: fei.yang @ 2023-05-02  5:19 UTC (permalink / raw)
  To: igt-dev; +Cc: Fei Yang

From: Fei Yang <fei.yang@intel.com>

This is the first draft of a new test case exercising the set_pat
extension for GEM_CREATE.

v2: make sure {get|set}_caching ioctls are disabled.

Fei Yang (1):
  test/gem_create: exercise gem_create_ext_set_pat

 include/drm-uapi/i915_drm.h | 33 ++++++++++++++++++++++++++++
 tests/i915/gem_create.c     | 44 +++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)

-- 
2.25.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [igt-dev] [PATCH v2 1/1] test/gem_create: exercise gem_create_ext_set_pat
  2023-05-02  5:19 [igt-dev] [PATCH v2 0/1] test/gem_create: exercise gem_create_ext_set_pat fei.yang
@ 2023-05-02  5:19 ` fei.yang
  2023-05-12 12:10   ` Kamil Konieczny
  2023-05-02  5:53 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2023-05-02  7:55 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 1 reply; 6+ messages in thread
From: fei.yang @ 2023-05-02  5:19 UTC (permalink / raw)
  To: igt-dev; +Cc: Fei Yang

From: Fei Yang <fei.yang@intel.com>

Gem_create uAPI has been extended with capability of setting PAT index.
Add a test case to exercise this new extension.

Signed-off-by: Fei Yang <fei.yang@intel.com>
---
 include/drm-uapi/i915_drm.h | 33 ++++++++++++++++++++++++++++
 tests/i915/gem_create.c     | 44 +++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)

diff --git a/include/drm-uapi/i915_drm.h b/include/drm-uapi/i915_drm.h
index a0876ee4..1fdaa372 100644
--- a/include/drm-uapi/i915_drm.h
+++ b/include/drm-uapi/i915_drm.h
@@ -3499,6 +3499,7 @@ struct drm_i915_gem_create_ext {
 	 */
 #define I915_GEM_CREATE_EXT_MEMORY_REGIONS 0
 #define I915_GEM_CREATE_EXT_PROTECTED_CONTENT 1
+#define I915_GEM_CREATE_EXT_SET_PAT 2
 	__u64 extensions;
 };
 
@@ -3616,6 +3617,38 @@ struct drm_i915_gem_create_ext_protected_content {
 /* ID of the protected content session managed by i915 when PXP is active */
 #define I915_PROTECTED_CONTENT_DEFAULT_SESSION 0xf
 
+/**
+ * struct drm_i915_gem_create_ext_set_pat - The
+ * I915_GEM_CREATE_EXT_SET_PAT extension.
+ *
+ * If this extension is provided, the specified caching policy (PAT index) is
+ * applied to the buffer object.
+ *
+ * Below is an example on how to create an object with specific caching policy:
+ *
+ * .. code-block:: C
+ *
+ *      struct drm_i915_gem_create_ext_set_pat set_pat_ext = {
+ *              .base = { .name = I915_GEM_CREATE_EXT_SET_PAT },
+ *              .pat_index = 0,
+ *      };
+ *      struct drm_i915_gem_create_ext create_ext = {
+ *              .size = PAGE_SIZE,
+ *              .extensions = (uintptr_t)&set_pat_ext,
+ *      };
+ *
+ *      int err = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create_ext);
+ *      if (err) ...
+ */
+struct drm_i915_gem_create_ext_set_pat {
+	/** @base: Extension link. See struct i915_user_extension. */
+	struct i915_user_extension base;
+	/** @pat_index: PAT index to be set */
+	__u32 pat_index;
+	/** @rsvd: reserved for future use */
+	__u32 rsvd;
+};
+
 #if defined(__cplusplus)
 }
 #endif
diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
index c719ab6c..20c71afb 100644
--- a/tests/i915/gem_create.c
+++ b/tests/i915/gem_create.c
@@ -537,6 +537,45 @@ static void create_ext_placement_each(int fd)
 	free(regions);
 }
 
+static void create_ext_set_pat(int fd)
+{
+	struct drm_i915_gem_create_ext_set_pat setparam_pat = {
+		.base = { .name = I915_GEM_CREATE_EXT_SET_PAT },
+		.pat_index = 0,
+	};
+	struct drm_i915_gem_create_ext_set_pat setparam_inv_pat = {
+		.base = { .name = I915_GEM_CREATE_EXT_SET_PAT },
+		.pat_index = 65,
+	};
+	struct drm_i915_gem_caching arg;
+	uint64_t size;
+	uint32_t handle;
+	int ret;
+
+	size = PAGE_SIZE;
+
+	ret = __gem_create_ext(fd, &size, 0, &handle, &setparam_pat.base);
+
+	/* Returning -EFAULT indicates set_pat extension is not supported */
+	if (ret == -EFAULT)
+		igt_info("I915_GEM_CREATE_EXT_SET_PAT is not supported\n");
+	igt_assert(ret == 0);
+
+	/* {set|get}_caching ioctl should fail for objects created with set_pat */
+	igt_assert(__gem_set_caching(fd, handle, 1) == -EOPNOTSUPP);
+
+	memset(&arg, 0, sizeof(arg));
+	arg.handle = handle;
+	igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_GET_CACHING, &arg) < 0 &&
+		   errno == EOPNOTSUPP);
+
+	/* gem_create should fail with -EINVAL if invalid pat index specified */
+	igt_assert_eq(__gem_create_ext(fd, &size, 0, &handle, &setparam_inv_pat.base),
+		      -EINVAL);
+
+	gem_close(fd, handle);
+}
+
 static bool supports_needs_cpu_access(int fd)
 {
 	struct drm_i915_gem_memory_class_instance regions[] = {
@@ -897,6 +936,11 @@ igt_main
 	igt_subtest("create-ext-placement-all")
 		create_ext_placement_all(fd);
 
+	igt_describe("Create objects with specific cache setting"
+		     " create-ext.");
+	igt_subtest("create-ext-set-pat")
+		    create_ext_set_pat(fd);
+
 	igt_describe("Verify the basic functionally and expected ABI contract around I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS");
 	igt_subtest("create-ext-cpu-access-sanity-check") {
 		igt_require(supports_needs_cpu_access(fd));
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for test/gem_create: exercise gem_create_ext_set_pat
  2023-05-02  5:19 [igt-dev] [PATCH v2 0/1] test/gem_create: exercise gem_create_ext_set_pat fei.yang
  2023-05-02  5:19 ` [igt-dev] [PATCH v2 1/1] " fei.yang
@ 2023-05-02  5:53 ` Patchwork
  2023-05-02  7:55 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2023-05-02  5:53 UTC (permalink / raw)
  To: fei.yang; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 5492 bytes --]

== Series Details ==

Series: test/gem_create: exercise gem_create_ext_set_pat
URL   : https://patchwork.freedesktop.org/series/117185/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13078 -> IGTPW_8892
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/index.html

Participating hosts (38 -> 38)
------------------------------

  Additional (1): fi-kbl-soraka 
  Missing    (1): fi-snb-2520m 

Known issues
------------

  Here are the changes found in IGTPW_8892 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_huc_copy@huc-copy:
    - fi-kbl-soraka:      NOTRUN -> [SKIP][1] ([fdo#109271] / [i915#2190])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/fi-kbl-soraka/igt@gem_huc_copy@huc-copy.html

  * igt@gem_lmem_swapping@basic:
    - fi-kbl-soraka:      NOTRUN -> [SKIP][2] ([fdo#109271] / [i915#4613]) +3 similar issues
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/fi-kbl-soraka/igt@gem_lmem_swapping@basic.html

  * igt@i915_selftest@live@gt_heartbeat:
    - fi-apl-guc:         [PASS][3] -> [DMESG-FAIL][4] ([i915#5334])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html

  * igt@i915_selftest@live@gt_pm:
    - fi-kbl-soraka:      NOTRUN -> [DMESG-FAIL][5] ([i915#1886] / [i915#7913])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html

  * igt@i915_selftest@live@slpc:
    - bat-rpls-1:         [PASS][6] -> [DMESG-WARN][7] ([i915#6367])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/bat-rpls-1/igt@i915_selftest@live@slpc.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/bat-rpls-1/igt@i915_selftest@live@slpc.html

  * igt@kms_chamelium_frames@hdmi-crc-fast:
    - fi-kbl-soraka:      NOTRUN -> [SKIP][8] ([fdo#109271]) +16 similar issues
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/fi-kbl-soraka/igt@kms_chamelium_frames@hdmi-crc-fast.html

  * igt@kms_chamelium_hpd@common-hpd-after-suspend:
    - bat-rpls-1:         NOTRUN -> [SKIP][9] ([i915#7828])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/bat-rpls-1/igt@kms_chamelium_hpd@common-hpd-after-suspend.html

  * igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-1:
    - bat-dg2-8:          [PASS][10] -> [FAIL][11] ([i915#7932])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-1.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-1.html

  * igt@kms_pipe_crc_basic@suspend-read-crc:
    - bat-rpls-1:         NOTRUN -> [SKIP][12] ([i915#1845])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/bat-rpls-1/igt@kms_pipe_crc_basic@suspend-read-crc.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s3@smem:
    - bat-rpls-1:         [ABORT][13] ([i915#6687] / [i915#7978] / [i915#8407]) -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/bat-rpls-1/igt@gem_exec_suspend@basic-s3@smem.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/bat-rpls-1/igt@gem_exec_suspend@basic-s3@smem.html

  * igt@i915_selftest@live@migrate:
    - bat-atsm-1:         [DMESG-FAIL][15] ([i915#7699] / [i915#7913]) -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/bat-atsm-1/igt@i915_selftest@live@migrate.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/bat-atsm-1/igt@i915_selftest@live@migrate.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
  [i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
  [i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
  [i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699
  [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
  [i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
  [i915#7932]: https://gitlab.freedesktop.org/drm/intel/issues/7932
  [i915#7978]: https://gitlab.freedesktop.org/drm/intel/issues/7978
  [i915#8407]: https://gitlab.freedesktop.org/drm/intel/issues/8407


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7277 -> IGTPW_8892

  CI-20190529: 20190529
  CI_DRM_13078: 59c67d4cf8b737c0c25649091a1a22809d6a06f8 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_8892: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/index.html
  IGT_7277: 1cb3507f3ff28d11bd5cfabcde576fe78ddab571 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git


Testlist changes
----------------

+igt@gem_create@create-ext-set-pat

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/index.html

[-- Attachment #2: Type: text/html, Size: 6558 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for test/gem_create: exercise gem_create_ext_set_pat
  2023-05-02  5:19 [igt-dev] [PATCH v2 0/1] test/gem_create: exercise gem_create_ext_set_pat fei.yang
  2023-05-02  5:19 ` [igt-dev] [PATCH v2 1/1] " fei.yang
  2023-05-02  5:53 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2023-05-02  7:55 ` Patchwork
  2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2023-05-02  7:55 UTC (permalink / raw)
  To: fei.yang; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 17634 bytes --]

== Series Details ==

Series: test/gem_create: exercise gem_create_ext_set_pat
URL   : https://patchwork.freedesktop.org/series/117185/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13078_full -> IGTPW_8892_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/index.html

Participating hosts (8 -> 7)
------------------------------

  Missing    (1): shard-rkl0 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_8892_full:

### IGT changes ###

#### Possible regressions ####

  * {igt@gem_create@create-ext-set-pat} (NEW):
    - shard-glk:          NOTRUN -> [FAIL][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-glk3/igt@gem_create@create-ext-set-pat.html
    - {shard-rkl}:        NOTRUN -> [FAIL][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-rkl-7/igt@gem_create@create-ext-set-pat.html
    - shard-snb:          NOTRUN -> [FAIL][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-snb5/igt@gem_create@create-ext-set-pat.html
    - {shard-dg1}:        NOTRUN -> [FAIL][4]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-dg1-12/igt@gem_create@create-ext-set-pat.html
    - shard-apl:          NOTRUN -> [FAIL][5]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-apl2/igt@gem_create@create-ext-set-pat.html
    - {shard-tglu}:       NOTRUN -> [FAIL][6]
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-tglu-10/igt@gem_create@create-ext-set-pat.html

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@gem_mmap_offset@clear@smem0:
    - {shard-dg1}:        [PASS][7] -> [FAIL][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-dg1-18/igt@gem_mmap_offset@clear@smem0.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-dg1-14/igt@gem_mmap_offset@clear@smem0.html

  
New tests
---------

  New tests have been introduced between CI_DRM_13078_full and IGTPW_8892_full:

### New IGT tests (1) ###

  * igt@gem_create@create-ext-set-pat:
    - Statuses : 6 fail(s)
    - Exec time: [0.0] s

  

Known issues
------------

  Here are the changes found in IGTPW_8892_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-apl:          [PASS][9] -> [FAIL][10] ([i915#2842])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-apl3/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-apl4/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@gem_exec_fair@basic-pace@vcs0:
    - shard-glk:          [PASS][11] -> [FAIL][12] ([i915#2842]) +1 similar issue
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-glk7/igt@gem_exec_fair@basic-pace@vcs0.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-glk1/igt@gem_exec_fair@basic-pace@vcs0.html

  * igt@gen9_exec_parse@allowed-single:
    - shard-apl:          [PASS][13] -> [ABORT][14] ([i915#5566])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-apl2/igt@gen9_exec_parse@allowed-single.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-apl1/igt@gen9_exec_parse@allowed-single.html

  * igt@i915_selftest@live@sanitycheck:
    - shard-snb:          [PASS][15] -> [ABORT][16] ([i915#4528])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-snb4/igt@i915_selftest@live@sanitycheck.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-snb5/igt@i915_selftest@live@sanitycheck.html

  * igt@kms_content_protection@atomic:
    - shard-snb:          NOTRUN -> [SKIP][17] ([fdo#109271]) +85 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-snb6/igt@kms_content_protection@atomic.html

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
    - shard-apl:          [PASS][18] -> [FAIL][19] ([i915#2346])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-apl7/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-apl7/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
    - shard-glk:          [PASS][20] -> [FAIL][21] ([i915#2346])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-glk7/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-glk1/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html

  * igt@kms_flip@2x-plain-flip-ts-check@ac-hdmi-a1-hdmi-a2:
    - shard-glk:          [PASS][22] -> [FAIL][23] ([i915#2122])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-glk8/igt@kms_flip@2x-plain-flip-ts-check@ac-hdmi-a1-hdmi-a2.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-glk2/igt@kms_flip@2x-plain-flip-ts-check@ac-hdmi-a1-hdmi-a2.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a2:
    - shard-glk:          [PASS][24] -> [FAIL][25] ([i915#79])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-glk9/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a2.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-glk1/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a2.html

  
#### Possible fixes ####

  * igt@gem_barrier_race@remote-request@rcs0:
    - {shard-rkl}:        [ABORT][26] ([i915#7461] / [i915#8211]) -> [PASS][27]
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-rkl-7/igt@gem_barrier_race@remote-request@rcs0.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-rkl-3/igt@gem_barrier_race@remote-request@rcs0.html

  * igt@gem_ctx_exec@basic-nohangcheck:
    - {shard-rkl}:        [FAIL][28] ([i915#6268]) -> [PASS][29]
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-rkl-7/igt@gem_ctx_exec@basic-nohangcheck.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-rkl-7/igt@gem_ctx_exec@basic-nohangcheck.html

  * igt@gem_ctx_freq@sysfs:
    - {shard-dg1}:        [FAIL][30] -> [PASS][31]
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-dg1-12/igt@gem_ctx_freq@sysfs.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-dg1-14/igt@gem_ctx_freq@sysfs.html

  * igt@gem_eio@reset-stress:
    - {shard-dg1}:        [FAIL][32] ([i915#5784]) -> [PASS][33]
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-dg1-18/igt@gem_eio@reset-stress.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-dg1-15/igt@gem_eio@reset-stress.html

  * igt@gem_exec_fair@basic-deadline:
    - shard-glk:          [FAIL][34] ([i915#2846]) -> [PASS][35]
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-glk7/igt@gem_exec_fair@basic-deadline.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-glk4/igt@gem_exec_fair@basic-deadline.html

  * igt@gem_exec_fair@basic-none-solo@rcs0:
    - shard-apl:          [FAIL][36] ([i915#2842]) -> [PASS][37]
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-apl2/igt@gem_exec_fair@basic-none-solo@rcs0.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-apl2/igt@gem_exec_fair@basic-none-solo@rcs0.html

  * igt@gem_exec_fair@basic-none@vcs0:
    - {shard-rkl}:        [FAIL][38] ([i915#2842]) -> [PASS][39] +1 similar issue
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-rkl-4/igt@gem_exec_fair@basic-none@vcs0.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-rkl-6/igt@gem_exec_fair@basic-none@vcs0.html

  * igt@gem_spin_batch@engines@rcs0:
    - shard-apl:          [FAIL][40] ([i915#2898]) -> [PASS][41]
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-apl3/igt@gem_spin_batch@engines@rcs0.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-apl1/igt@gem_spin_batch@engines@rcs0.html

  * igt@i915_module_load@reload-no-display:
    - shard-snb:          [ABORT][42] ([i915#4528] / [i915#8393]) -> [PASS][43]
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-snb4/igt@i915_module_load@reload-no-display.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-snb1/igt@i915_module_load@reload-no-display.html

  * igt@i915_pm_rc6_residency@rc6-idle@vecs0:
    - {shard-dg1}:        [FAIL][44] ([i915#3591]) -> [PASS][45]
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-dg1-18/igt@i915_pm_rc6_residency@rc6-idle@vecs0.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-dg1-14/igt@i915_pm_rc6_residency@rc6-idle@vecs0.html

  * igt@i915_pm_rps@waitboost:
    - {shard-dg1}:        [FAIL][46] ([i915#8229]) -> [PASS][47]
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-dg1-18/igt@i915_pm_rps@waitboost.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-dg1-15/igt@i915_pm_rps@waitboost.html

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
    - shard-glk:          [FAIL][48] ([i915#2346]) -> [PASS][49]
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-glk9/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-glk8/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html

  * igt@kms_cursor_legacy@single-bo@pipe-b:
    - {shard-rkl}:        [INCOMPLETE][50] ([i915#8011]) -> [PASS][51]
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-rkl-7/igt@kms_cursor_legacy@single-bo@pipe-b.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-rkl-4/igt@kms_cursor_legacy@single-bo@pipe-b.html

  * {igt@kms_plane_scaling@intel-max-src-size@pipe-a-hdmi-a-2}:
    - {shard-rkl}:        [FAIL][52] -> [PASS][53]
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13078/shard-rkl-6/igt@kms_plane_scaling@intel-max-src-size@pipe-a-hdmi-a-2.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/shard-rkl-4/igt@kms_plane_scaling@intel-max-src-size@pipe-a-hdmi-a-2.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [fdo#109300]: https://bugs.freedesktop.org/show_bug.cgi?id=109300
  [fdo#109313]: https://bugs.freedesktop.org/show_bug.cgi?id=109313
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
  [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
  [fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
  [fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
  [i915#1937]: https://gitlab.freedesktop.org/drm/intel/issues/1937
  [i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
  [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
  [i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
  [i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
  [i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
  [i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
  [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
  [i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
  [i915#2898]: https://gitlab.freedesktop.org/drm/intel/issues/2898
  [i915#3023]: https://gitlab.freedesktop.org/drm/intel/issues/3023
  [i915#315]: https://gitlab.freedesktop.org/drm/intel/issues/315
  [i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
  [i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
  [i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
  [i915#3361]: https://gitlab.freedesktop.org/drm/intel/issues/3361
  [i915#3371]: https://gitlab.freedesktop.org/drm/intel/issues/3371
  [i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
  [i915#3469]: https://gitlab.freedesktop.org/drm/intel/issues/3469
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
  [i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
  [i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
  [i915#3743]: https://gitlab.freedesktop.org/drm/intel/issues/3743
  [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
  [i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
  [i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
  [i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
  [i915#4528]: https://gitlab.freedesktop.org/drm/intel/issues/4528
  [i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
  [i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
  [i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
  [i915#5122]: https://gitlab.freedesktop.org/drm/intel/issues/5122
  [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
  [i915#5234]: https://gitlab.freedesktop.org/drm/intel/issues/5234
  [i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
  [i915#5251]: https://gitlab.freedesktop.org/drm/intel/issues/5251
  [i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
  [i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
  [i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
  [i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
  [i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
  [i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
  [i915#6301]: https://gitlab.freedesktop.org/drm/intel/issues/6301
  [i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
  [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
  [i915#6755]: https://gitlab.freedesktop.org/drm/intel/issues/6755
  [i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
  [i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
  [i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
  [i915#7392]: https://gitlab.freedesktop.org/drm/intel/issues/7392
  [i915#7461]: https://gitlab.freedesktop.org/drm/intel/issues/7461
  [i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
  [i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742
  [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
  [i915#7975]: https://gitlab.freedesktop.org/drm/intel/issues/7975
  [i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011
  [i915#8211]: https://gitlab.freedesktop.org/drm/intel/issues/8211
  [i915#8213]: https://gitlab.freedesktop.org/drm/intel/issues/8213
  [i915#8229]: https://gitlab.freedesktop.org/drm/intel/issues/8229
  [i915#8381]: https://gitlab.freedesktop.org/drm/intel/issues/8381
  [i915#8393]: https://gitlab.freedesktop.org/drm/intel/issues/8393


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7277 -> IGTPW_8892
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_13078: 59c67d4cf8b737c0c25649091a1a22809d6a06f8 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_8892: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/index.html
  IGT_7277: 1cb3507f3ff28d11bd5cfabcde576fe78ddab571 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8892/index.html

[-- Attachment #2: Type: text/html, Size: 14244 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [igt-dev] [PATCH v2 1/1] test/gem_create: exercise gem_create_ext_set_pat
  2023-05-02  5:19 ` [igt-dev] [PATCH v2 1/1] " fei.yang
@ 2023-05-12 12:10   ` Kamil Konieczny
  2023-05-12 18:15     ` Yang, Fei
  0 siblings, 1 reply; 6+ messages in thread
From: Kamil Konieczny @ 2023-05-12 12:10 UTC (permalink / raw)
  To: igt-dev; +Cc: fei.yang

Hi Fei,

On 2023-05-01 at 22:19:21 -0700, fei.yang@intel.com wrote:
> From: Fei Yang <fei.yang@intel.com>
> 
> Gem_create uAPI has been extended with capability of setting PAT index.
> Add a test case to exercise this new extension.
> 
> Signed-off-by: Fei Yang <fei.yang@intel.com>
> ---
>  include/drm-uapi/i915_drm.h | 33 ++++++++++++++++++++++++++++

Please use lib/i915/i915_drm_local.h
until this land in drm-tip ./include/uapi/drm/i915_drm.h

After it will land there send separate patch to sync uapi.

Regards,
Kamil

>  tests/i915/gem_create.c     | 44 +++++++++++++++++++++++++++++++++++++
>  2 files changed, 77 insertions(+)
> 
> diff --git a/include/drm-uapi/i915_drm.h b/include/drm-uapi/i915_drm.h
> index a0876ee4..1fdaa372 100644
> --- a/include/drm-uapi/i915_drm.h
> +++ b/include/drm-uapi/i915_drm.h
> @@ -3499,6 +3499,7 @@ struct drm_i915_gem_create_ext {
>  	 */
>  #define I915_GEM_CREATE_EXT_MEMORY_REGIONS 0
>  #define I915_GEM_CREATE_EXT_PROTECTED_CONTENT 1
> +#define I915_GEM_CREATE_EXT_SET_PAT 2
>  	__u64 extensions;
>  };
>  
> @@ -3616,6 +3617,38 @@ struct drm_i915_gem_create_ext_protected_content {
>  /* ID of the protected content session managed by i915 when PXP is active */
>  #define I915_PROTECTED_CONTENT_DEFAULT_SESSION 0xf
>  
> +/**
> + * struct drm_i915_gem_create_ext_set_pat - The
> + * I915_GEM_CREATE_EXT_SET_PAT extension.
> + *
> + * If this extension is provided, the specified caching policy (PAT index) is
> + * applied to the buffer object.
> + *
> + * Below is an example on how to create an object with specific caching policy:
> + *
> + * .. code-block:: C
> + *
> + *      struct drm_i915_gem_create_ext_set_pat set_pat_ext = {
> + *              .base = { .name = I915_GEM_CREATE_EXT_SET_PAT },
> + *              .pat_index = 0,
> + *      };
> + *      struct drm_i915_gem_create_ext create_ext = {
> + *              .size = PAGE_SIZE,
> + *              .extensions = (uintptr_t)&set_pat_ext,
> + *      };
> + *
> + *      int err = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create_ext);
> + *      if (err) ...
> + */
> +struct drm_i915_gem_create_ext_set_pat {
> +	/** @base: Extension link. See struct i915_user_extension. */
> +	struct i915_user_extension base;
> +	/** @pat_index: PAT index to be set */
> +	__u32 pat_index;
> +	/** @rsvd: reserved for future use */
> +	__u32 rsvd;
> +};
> +
>  #if defined(__cplusplus)
>  }
>  #endif
> diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
> index c719ab6c..20c71afb 100644
> --- a/tests/i915/gem_create.c
> +++ b/tests/i915/gem_create.c
> @@ -537,6 +537,45 @@ static void create_ext_placement_each(int fd)
>  	free(regions);
>  }
>  
> +static void create_ext_set_pat(int fd)
> +{
> +	struct drm_i915_gem_create_ext_set_pat setparam_pat = {
> +		.base = { .name = I915_GEM_CREATE_EXT_SET_PAT },
> +		.pat_index = 0,
> +	};
> +	struct drm_i915_gem_create_ext_set_pat setparam_inv_pat = {
> +		.base = { .name = I915_GEM_CREATE_EXT_SET_PAT },
> +		.pat_index = 65,
> +	};
> +	struct drm_i915_gem_caching arg;
> +	uint64_t size;
> +	uint32_t handle;
> +	int ret;
> +
> +	size = PAGE_SIZE;
> +
> +	ret = __gem_create_ext(fd, &size, 0, &handle, &setparam_pat.base);
> +
> +	/* Returning -EFAULT indicates set_pat extension is not supported */
> +	if (ret == -EFAULT)
> +		igt_info("I915_GEM_CREATE_EXT_SET_PAT is not supported\n");
> +	igt_assert(ret == 0);
> +
> +	/* {set|get}_caching ioctl should fail for objects created with set_pat */
> +	igt_assert(__gem_set_caching(fd, handle, 1) == -EOPNOTSUPP);
> +
> +	memset(&arg, 0, sizeof(arg));
> +	arg.handle = handle;
> +	igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_GET_CACHING, &arg) < 0 &&
> +		   errno == EOPNOTSUPP);
> +
> +	/* gem_create should fail with -EINVAL if invalid pat index specified */
> +	igt_assert_eq(__gem_create_ext(fd, &size, 0, &handle, &setparam_inv_pat.base),
> +		      -EINVAL);
> +
> +	gem_close(fd, handle);
> +}
> +
>  static bool supports_needs_cpu_access(int fd)
>  {
>  	struct drm_i915_gem_memory_class_instance regions[] = {
> @@ -897,6 +936,11 @@ igt_main
>  	igt_subtest("create-ext-placement-all")
>  		create_ext_placement_all(fd);
>  
> +	igt_describe("Create objects with specific cache setting"
> +		     " create-ext.");
> +	igt_subtest("create-ext-set-pat")
> +		    create_ext_set_pat(fd);
> +
>  	igt_describe("Verify the basic functionally and expected ABI contract around I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS");
>  	igt_subtest("create-ext-cpu-access-sanity-check") {
>  		igt_require(supports_needs_cpu_access(fd));
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [igt-dev] [PATCH v2 1/1] test/gem_create: exercise gem_create_ext_set_pat
  2023-05-12 12:10   ` Kamil Konieczny
@ 2023-05-12 18:15     ` Yang, Fei
  0 siblings, 0 replies; 6+ messages in thread
From: Yang, Fei @ 2023-05-12 18:15 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev@lists.freedesktop.org

[-- Attachment #1: Type: text/plain, Size: 5173 bytes --]

> On 2023-05-01 at 22:19:21 -0700, fei.yang@intel.com wrote:
>> From: Fei Yang <fei.yang@intel.com>
>>
>> Gem_create uAPI has been extended with capability of setting PAT index.
>> Add a test case to exercise this new extension.
>>
>> Signed-off-by: Fei Yang <fei.yang@intel.com>
>> ---
>>  include/drm-uapi/i915_drm.h | 33 ++++++++++++++++++++++++++++
>
> Please use lib/i915/i915_drm_local.h

Updated in v3, https://patchwork.freedesktop.org/series/117695/

> until this land in drm-tip ./include/uapi/drm/i915_drm.h
>
> After it will land there send separate patch to sync uapi.

Will do.

> Regards,
> Kamil
>
>>  tests/i915/gem_create.c     | 44 +++++++++++++++++++++++++++++++++++++
>>  2 files changed, 77 insertions(+)
>>
>> diff --git a/include/drm-uapi/i915_drm.h b/include/drm-uapi/i915_drm.h
>> index a0876ee4..1fdaa372 100644
>> --- a/include/drm-uapi/i915_drm.h
>> +++ b/include/drm-uapi/i915_drm.h
>> @@ -3499,6 +3499,7 @@ struct drm_i915_gem_create_ext {
>>         */
>>  #define I915_GEM_CREATE_EXT_MEMORY_REGIONS 0
>>  #define I915_GEM_CREATE_EXT_PROTECTED_CONTENT 1
>> +#define I915_GEM_CREATE_EXT_SET_PAT 2
>>        __u64 extensions;
>>  };
>>
>> @@ -3616,6 +3617,38 @@ struct drm_i915_gem_create_ext_protected_content {
>>  /* ID of the protected content session managed by i915 when PXP is active */
>>  #define I915_PROTECTED_CONTENT_DEFAULT_SESSION 0xf
>>
>> +/**
>> + * struct drm_i915_gem_create_ext_set_pat - The
>> + * I915_GEM_CREATE_EXT_SET_PAT extension.
>> + *
>> + * If this extension is provided, the specified caching policy (PAT index) is
>> + * applied to the buffer object.
>> + *
>> + * Below is an example on how to create an object with specific caching policy:
>> + *
>> + * .. code-block:: C
>> + *
>> + *      struct drm_i915_gem_create_ext_set_pat set_pat_ext = {
>> + *              .base = { .name = I915_GEM_CREATE_EXT_SET_PAT },
>> + *              .pat_index = 0,
>> + *      };
>> + *      struct drm_i915_gem_create_ext create_ext = {
>> + *              .size = PAGE_SIZE,
>> + *              .extensions = (uintptr_t)&set_pat_ext,
>> + *      };
>> + *
>> + *      int err = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create_ext);
>> + *      if (err) ...
>> + */
>> +struct drm_i915_gem_create_ext_set_pat {
>> +     /** @base: Extension link. See struct i915_user_extension. */
>> +     struct i915_user_extension base;
>> +     /** @pat_index: PAT index to be set */
>> +     __u32 pat_index;
>> +     /** @rsvd: reserved for future use */
>> +     __u32 rsvd;
>> +};
>> +
>>  #if defined(__cplusplus)
>>  }
>>  #endif
>> diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
>> index c719ab6c..20c71afb 100644
>> --- a/tests/i915/gem_create.c
>> +++ b/tests/i915/gem_create.c
>> @@ -537,6 +537,45 @@ static void create_ext_placement_each(int fd)
>>        free(regions);
>>  }
>>
>> +static void create_ext_set_pat(int fd)
>> +{
>> +     struct drm_i915_gem_create_ext_set_pat setparam_pat = {
>> +             .base = { .name = I915_GEM_CREATE_EXT_SET_PAT },
>> +             .pat_index = 0,
>> +     };
>> +     struct drm_i915_gem_create_ext_set_pat setparam_inv_pat = {
>> +             .base = { .name = I915_GEM_CREATE_EXT_SET_PAT },
>> +             .pat_index = 65,
>> +     };
>> +     struct drm_i915_gem_caching arg;
>> +     uint64_t size;
>> +     uint32_t handle;
>> +     int ret;
>> +
>> +     size = PAGE_SIZE;
>> +
>> +     ret = __gem_create_ext(fd, &size, 0, &handle, &setparam_pat.base);
>> +
>> +     /* Returning -EFAULT indicates set_pat extension is not supported */
>> +     if (ret == -EFAULT)
>> +             igt_info("I915_GEM_CREATE_EXT_SET_PAT is not supported\n");
>> +     igt_assert(ret == 0);
>> +
>> +     /* {set|get}_caching ioctl should fail for objects created with set_pat */
>> +     igt_assert(__gem_set_caching(fd, handle, 1) == -EOPNOTSUPP);
>> +
>> +     memset(&arg, 0, sizeof(arg));
>> +     arg.handle = handle;
>> +     igt_assert(ioctl(fd, DRM_IOCTL_I915_GEM_GET_CACHING, &arg) < 0 &&
>> +                errno == EOPNOTSUPP);
>> +
>> +     /* gem_create should fail with -EINVAL if invalid pat index specified */
>> +     igt_assert_eq(__gem_create_ext(fd, &size, 0, &handle, &setparam_inv_pat.base),
>> +                   -EINVAL);
>> +
>> +     gem_close(fd, handle);
>> +}
>> +
>>  static bool supports_needs_cpu_access(int fd)
>>  {
>>        struct drm_i915_gem_memory_class_instance regions[] = {
>> @@ -897,6 +936,11 @@ igt_main
>>        igt_subtest("create-ext-placement-all")
>>                create_ext_placement_all(fd);
>>
>> +     igt_describe("Create objects with specific cache setting"
>> +                  " create-ext.");
>> +     igt_subtest("create-ext-set-pat")
>> +                 create_ext_set_pat(fd);
>> +
>>        igt_describe("Verify the basic functionally and expected ABI contract around I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS");
>>        igt_subtest("create-ext-cpu-access-sanity-check") {
>>                igt_require(supports_needs_cpu_access(fd));
>> --
>> 2.25.1


[-- Attachment #2: Type: text/html, Size: 12336 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-12 18:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-02  5:19 [igt-dev] [PATCH v2 0/1] test/gem_create: exercise gem_create_ext_set_pat fei.yang
2023-05-02  5:19 ` [igt-dev] [PATCH v2 1/1] " fei.yang
2023-05-12 12:10   ` Kamil Konieczny
2023-05-12 18:15     ` Yang, Fei
2023-05-02  5:53 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-05-02  7:55 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox