tests/i915/gem_userptr_blits: Added XY_FAST_COPY_BLT Command for MTL
PATCH v4 1/1 tests/i915/gem_userptr_blits: Added XY_FAST_COPY_BLT Command for MTL
From: Arjun Melkaveri <[email protected]>
Test case uses legacy command which is not supported on MTL. Modified test to use XY_FAST_COPY_BLT.
--- tests/i915/gem_userptr_blits.c | 131 +++++++++++++++++++++------------ 1 file changed, 84 insertions(+), 47 deletions(-)
tests/i915/gem_userptr_blits.c +84 -47
@@ -99,8 +99,9 @@ static int copy(int fd, uint32_t dst, uint32_t src)struct drm_i915_gem_relocation_entry reloc[2 ];struct drm_i915_gem_exec_object2 obj[3 ];struct drm_i915_gem_execbuffer2 exec; +static uint32_t devid;uint32_t handle; -int ret, i=0 ; +int ret, i =0 ;uint64_t dst_offset, src_offset, bb_offset;bool has_relocs =gem_has_relocations (fd);
@@ -108,29 +109,44 @@ static int copy(int fd, uint32_t dst, uint32_t src) dst_offset = bb_offset +4096 ; src_offset = dst_offset +WIDTH *HEIGHT *sizeof (uint32_t ) * (src != dst); - batch[i++] =XY_SRC_COPY_BLT_CMD | -XY_SRC_COPY_BLT_WRITE_ALPHA | -XY_SRC_COPY_BLT_WRITE_RGB ; -if (intel_gen (intel_get_drm_devid (fd)) >=8 ) - batch[i -1 ] |=8 ; -else - batch[i -1 ] |=6 ; - - batch[i++] = (3 <<24 ) |/* 32 bits */ - (0xcc <<16 ) |/* copy ROP */ -WIDTH *4 ; - batch[i++] =0 ;/* dst x1,y1 */ - batch[i++] = (HEIGHT <<16 ) |WIDTH ;/* dst x2,y2 */ - batch[i++] = dst_offset;/* dst reloc */ -if (intel_gen (intel_get_drm_devid (fd)) >=8 ) - batch[i++] = dst_offset >>32 ; - batch[i++] =0 ;/* src x1,y1 */ - batch[i++] =WIDTH *4 ; - batch[i++] = src_offset;/* src reloc */ -if (intel_gen (intel_get_drm_devid (fd)) >=8 ) - batch[i++] = src_offset >>32 ; - batch[i++] =MI_BATCH_BUFFER_END ; - batch[i++] =MI_NOOP ; + devid =intel_get_drm_devid (fd); + +if (intel_graphics_ver (devid) >=IP_VER (12 ,60 )) { + batch[i++] =XY_FAST_COPY_BLT ; + batch[i++] =XY_FAST_COPY_COLOR_DEPTH_32 |WIDTH *4 ; + batch[i++] =0 ;/* dst x1,y1 */ + batch[i++] = (HEIGHT <<16 ) |WIDTH ;/* dst x2,y2 */ + batch[i++] = dst_offset;/* dst address */ + batch[i++] =0 ;/* src x1,y1 */ + batch[i++] =WIDTH *4 ;/* src pitch */ + batch[i++] = src_offset;/* src address */ + batch[i++] =MI_BATCH_BUFFER_END ; + batch[i++] =MI_NOOP ; + }else { + batch[i++] =XY_SRC_COPY_BLT_CMD | +XY_SRC_COPY_BLT_WRITE_ALPHA | +XY_SRC_COPY_BLT_WRITE_RGB ; +if (intel_gen (intel_get_drm_devid (fd)) >=8 ) + batch[i -1 ] |=8 ; +else + batch[i -1 ] |=6 ; + + batch[i++] = (3 <<24 ) |/* 32 bits */ + (0xcc <<16 ) |/* copy ROP */ +WIDTH *4 ; + batch[i++] =0 ;/* dst x1,y1 */ + batch[i++] = (HEIGHT <<16 ) |WIDTH ;/* dst x2,y2 */ + batch[i++] = dst_offset;/* dst reloc */ +if (intel_gen (intel_get_drm_devid (fd)) >=8 ) + batch[i++] = dst_offset >>32 ; + batch[i++] =0 ;/* src x1,y1 */ + batch[i++] =WIDTH *4 ; + batch[i++] = src_offset;/* src reloc */ +if (intel_gen (intel_get_drm_devid (fd)) >=8 ) + batch[i++] = src_offset >>32 ; + batch[i++] =MI_BATCH_BUFFER_END ; + batch[i++] =MI_NOOP ; + } handle =gem_create (fd,4096 );gem_write (fd, handle,0 , batch,sizeof (batch));
@@ -204,31 +220,52 @@ blit(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, int n_bo)struct drm_i915_gem_relocation_entry reloc[2 ];struct drm_i915_gem_exec_object2 *obj;struct drm_i915_gem_execbuffer2 exec; +static uint32_t devid;uint32_t handle; -int n, ret, i=0 ; +int n, ret, i =0 ; +uint64_t dst_offset, src_offset, bb_offset; - batch[i++] =XY_SRC_COPY_BLT_CMD | -XY_SRC_COPY_BLT_WRITE_ALPHA | -XY_SRC_COPY_BLT_WRITE_RGB ; -if (intel_gen (intel_get_drm_devid (fd)) >=8 ) - batch[i -1 ] |=8 ; -else - batch[i -1 ] |=6 ; - batch[i++] = (3 <<24 ) |/* 32 bits */ - (0xcc <<16 ) |/* copy ROP */ -WIDTH *4 ; - batch[i++] =0 ;/* dst x1,y1 */ - batch[i++] = (HEIGHT <<16 ) |WIDTH ;/* dst x2,y2 */ - batch[i++] =0 ;/* dst reloc */ -if (intel_gen (intel_get_drm_devid (fd)) >=8 ) - batch[i++] =0 ; - batch[i++] =0 ;/* src x1,y1 */ - batch[i++] =WIDTH *4 ; - batch[i++] =0 ;/* src reloc */ -if (intel_gen (intel_get_drm_devid (fd)) >=8 ) - batch[i++] =0 ; - batch[i++] =MI_BATCH_BUFFER_END ; - batch[i++] =MI_NOOP ; + bb_offset =16 <<20 ; + dst_offset = bb_offset +4096 ; + src_offset = dst_offset +WIDTH *HEIGHT *sizeof (uint32_t ) * (src != dst); + + devid =intel_get_drm_devid (fd); + +if (intel_graphics_ver (devid) >=IP_VER (12 ,60 )) { + batch[i++] =XY_FAST_COPY_BLT ; + batch[i++] =XY_FAST_COPY_COLOR_DEPTH_32 |WIDTH *4 ; + batch[i++] =0 ;/* dst x1,y1 */ + batch[i++] = (HEIGHT <<16 ) |WIDTH ;/* dst x2,y2 */ + batch[i++] = dst_offset;/* dst address */ + batch[i++] =0 ;/* src x1,y1 */ + batch[i++] =WIDTH *4 ;/* src pitch */ + batch[i++] = src_offset;//src address + batch[i++] =MI_BATCH_BUFFER_END ; + batch[i++] =MI_NOOP ; + }else { + batch[i++] =XY_SRC_COPY_BLT_CMD | +XY_SRC_COPY_BLT_WRITE_ALPHA | +XY_SRC_COPY_BLT_WRITE_RGB ; +if (intel_gen (intel_get_drm_devid (fd)) >=8 ) + batch[i -1 ] |=8 ; +else + batch[i -1 ] |=6 ; + batch[i++] = (3 <<24 ) |/* 32 bits */ + (0xcc <<16 ) |/* copy ROP */ +WIDTH *4 ; + batch[i++] =0 ;/* dst x1,y1 */ + batch[i++] = (HEIGHT <<16 ) |WIDTH ;/* dst x2,y2 */ + batch[i++] = dst_offset;/* dst reloc */ +if (intel_gen (intel_get_drm_devid (fd)) >=8 ) + batch[i++] =0 ; + batch[i++] =0 ;/* src x1,y1 */ + batch[i++] =WIDTH *4 ; + batch[i++] = src_offset;/* src reloc */ +if (intel_gen (intel_get_drm_devid (fd)) >=8 ) + batch[i++] =0 ; + batch[i++] =MI_BATCH_BUFFER_END ; + batch[i++] =MI_NOOP ; + } handle =gem_create (fd,4096 );gem_write (fd, handle,0 , batch,sizeof (batch));
Signature · 1 line
2.25.1
Patchwork
CI[igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/gem_userptr_blits: Added XY_FAST_COPY_BLT Command for MTL (rev4)
== Series Details ==
== Series Details ==
Series: tests/i915/gem_userptr_blits: Added XY_FAST_COPY_BLT Command for MTL (rev4)
URL : https://patchwork.freedesktop.org/series/111133/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_12413 -> IGTPW_8141
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_8141 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_8141, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8141/index.html
Participating hosts (36 -> 36)
------------------------------
No changes in participating hosts
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_8141:
### IGT changes ###
#### Possible regressions ####
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor@varying-size:
- fi-bsw-kefka: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12413/fi-bsw-kefka/igt@kms_cursor_legacy@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8141/fi-bsw-kefka/igt@kms_cursor_legacy@[email protected]
Known issues
------------
Here are the changes found in IGTPW_8141 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_gttfill@basic:
- fi-pnv-d510: [PASS][3] -> [SKIP][4] ([fdo#109271])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12413/fi-pnv-d510/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8141/fi-pnv-d510/igt@[email protected]
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-hsw-4770: NOTRUN -> [SKIP][5] ([fdo#109271] / [fdo#111827])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8141/fi-hsw-4770/igt@[email protected]
#### Possible fixes ####
* igt@i915_selftest@live@gt_heartbeat:
- fi-apl-guc: [DMESG-FAIL][6] ([i915#5334]) -> [PASS][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12413/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8141/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
* igt@i915_selftest@live@hangcheck:
- fi-hsw-4770: [INCOMPLETE][8] ([i915#4785]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12413/fi-hsw-4770/igt@i915_selftest@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8141/fi-hsw-4770/igt@i915_selftest@[email protected]
* igt@i915_selftest@live@workarounds:
- {bat-adln-1}: [INCOMPLETE][10] ([i915#4983] / [i915#7467]) -> [PASS][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12413/bat-adln-1/igt@i915_selftest@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8141/bat-adln-1/igt@i915_selftest@[email protected]
* igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-2:
- {bat-dg2-11}: [FAIL][12] ([i915#7336]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12413/bat-dg2-11/igt@kms_pipe_crc_basic@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8141/bat-dg2-11/igt@kms_pipe_crc_basic@[email protected]
{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#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#6257]: https://gitlab.freedesktop.org/drm/intel/issues/6257
[i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
[i915#7336]: https://gitlab.freedesktop.org/drm/intel/issues/7336
[i915#7467]: https://gitlab.freedesktop.org/drm/intel/issues/7467
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_7069 -> IGTPW_8141
CI-20190529: 20190529
CI_DRM_12413: 6d95d2370020769c71fa36b4bc1884ef62e14a14 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8141: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8141/index.html
IGT_7069: 40a2de5cc6a6b43af7da7905bfe1ede9d9a3200c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Testlist changes
----------------
+igt@kms_chamelium@common-hpd-after-hibernate
+igt@kms_chamelium@common-hpd-after-suspend
+igt@kms_chamelium@dp-hpd
+igt@kms_chamelium@dp-hpd-after-hibernate
+igt@kms_chamelium@dp-hpd-after-suspend
+igt@kms_chamelium@dp-hpd-enable-disable-mode
+igt@kms_chamelium@dp-hpd-fast
+igt@kms_chamelium@dp-hpd-for-each-pipe
+igt@kms_chamelium@dp-hpd-storm
+igt@kms_chamelium@dp-hpd-storm-disable
+igt@kms_chamelium@dp-hpd-with-enabled-mode
+igt@kms_chamelium@hdmi-hpd
+igt@kms_chamelium@hdmi-hpd-after-hibernate
+igt@kms_chamelium@hdmi-hpd-after-suspend
+igt@kms_chamelium@hdmi-hpd-enable-disable-mode
+igt@kms_chamelium@hdmi-hpd-fast
+igt@kms_chamelium@hdmi-hpd-for-each-pipe
+igt@kms_chamelium@hdmi-hpd-storm
+igt@kms_chamelium@hdmi-hpd-storm-disable
+igt@kms_chamelium@hdmi-hpd-with-enabled-mode
+igt@kms_chamelium@vga-hpd
+igt@kms_chamelium@vga-hpd-after-hibernate
+igt@kms_chamelium@vga-hpd-after-suspend
+igt@kms_chamelium@vga-hpd-enable-disable-mode
+igt@kms_chamelium@vga-hpd-fast
+igt@kms_chamelium@vga-hpd-for-each-pipe
+igt@kms_chamelium@vga-hpd-without-ddc
+igt@kms_chamelium@vga-hpd-with-enabled-mode
+igt@kms_color_chamelium@ctm-0-25
+igt@kms_color_chamelium@ctm-0-50
+igt@kms_color_chamelium@ctm-0-75
+igt@kms_color_chamelium@ctm-blue-to-red
+igt@kms_color_chamelium@ctm-green-to-red
+igt@kms_color_chamelium@ctm-limited-range
+igt@kms_color_chamelium@ctm-max
+igt@kms_color_chamelium@ctm-negative
+igt@kms_color_chamelium@ctm-red-to-blue
+igt@kms_color_chamelium@degamma
+igt@kms_color_chamelium@gamma
-igt@chamelium_color@ctm-0-25
-igt@chamelium_color@ctm-0-50
-igt@chamelium_color@ctm-0-75
-igt@chamelium_color@ctm-blue-to-red
-igt@chamelium_color@ctm-green-to-red
-igt@chamelium_color@ctm-limited-range
-igt@chamelium_color@ctm-max
-igt@chamelium_color@ctm-negative
-igt@chamelium_color@ctm-red-to-blue
-igt@chamelium_color@degamma
-igt@chamelium_color@gamma
-igt@chamelium_hpd@common-hpd-after-hibernate
-igt@chamelium_hpd@common-hpd-after-suspend
-igt@chamelium_hpd@dp-hpd
-igt@chamelium_hpd@dp-hpd-after-hibernate
-igt@chamelium_hpd@dp-hpd-after-suspend
-igt@chamelium_hpd@dp-hpd-enable-disable-mode
-igt@chamelium_hpd@dp-hpd-fast
-igt@chamelium_hpd@dp-hpd-for-each-pipe
-igt@chamelium_hpd@dp-hpd-storm
-igt@chamelium_hpd@dp-hpd-storm-disable
-igt@chamelium_hpd@dp-hpd-with-enabled-mode
-igt@chamelium_hpd@hdmi-hpd
-igt@chamelium_hpd@hdmi-hpd-after-hibernate
-igt@chamelium_hpd@hdmi-hpd-after-suspend
-igt@chamelium_hpd@hdmi-hpd-enable-disable-mode
-igt@chamelium_hpd@hdmi-hpd-fast
-igt@chamelium_hpd@hdmi-hpd-for-each-pipe
-igt@chamelium_hpd@hdmi-hpd-storm
-igt@chamelium_hpd@hdmi-hpd-storm-disable
-igt@chamelium_hpd@hdmi-hpd-with-enabled-mode
-igt@chamelium_hpd@vga-hpd
-igt@chamelium_hpd@vga-hpd-after-hibernate
-igt@chamelium_hpd@vga-hpd-after-suspend
-igt@chamelium_hpd@vga-hpd-enable-disable-mode
-igt@chamelium_hpd@vga-hpd-fast
-igt@chamelium_hpd@vga-hpd-for-each-pipe
-igt@chamelium_hpd@vga-hpd-without-ddc
-igt@chamelium_hpd@vga-hpd-with-enabled-mode
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8141/index.html
Hi Vikas,
Quoted 16 lines · Vikas Srivastava
From: Arjun Melkaveri <[email protected]>
Test case uses legacy command which is not supported on MTL. Modified test to use
XY_FAST_COPY_BLT.Signed-off-by Arjun Melkaveri <[email protected]>--- tests/i915/gem_userptr_blits.c | 131 +++++++++++++++++++++------------ 1 file changed, 84 insertions(+), 47 deletions(-)tests/i915/gem_userptr_blits.c +0
-0
tests/i915/gem_userptr_blits.c static int copy(int fd, uint32_t dst, uint32_t src) · line 102
Quoted 4 lines
tests/i915/gem_userptr_blits.c +1
-0@@ -99,8 +99,9 @@ static int copy(int fd, uint32_t dst, uint32_t src)struct drm_i915_gem_relocation_entry reloc[2 ];struct drm_i915_gem_exec_object2 obj[3 ];struct drm_i915_gem_execbuffer2 exec; +static uint32_t devid;
------- ^
Do not use static here.
Quoted 31 lines
tests/i915/gem_userptr_blits.c +1
-22uint32_t handle; -int ret, i=0 ; +int ret, i =0 ;uint64_t dst_offset, src_offset, bb_offset;bool has_relocs =gem_has_relocations (fd);@@ -108,29 +109,44 @@ static int copy(int fd, uint32_t dst, uint32_t src) dst_offset = bb_offset +4096 ; src_offset = dst_offset +WIDTH *HEIGHT *sizeof (uint32_t ) * (src != dst); - batch[i++] =XY_SRC_COPY_BLT_CMD | -XY_SRC_COPY_BLT_WRITE_ALPHA | -XY_SRC_COPY_BLT_WRITE_RGB ; -if (intel_gen (intel_get_drm_devid (fd)) >=8 ) - batch[i -1 ] |=8 ; -else - batch[i -1 ] |=6 ; - - batch[i++] = (3 <<24 ) |/* 32 bits */ - (0xcc <<16 ) |/* copy ROP */ -WIDTH *4 ; - batch[i++] =0 ;/* dst x1,y1 */ - batch[i++] = (HEIGHT <<16 ) |WIDTH ;/* dst x2,y2 */ - batch[i++] = dst_offset;/* dst reloc */ -if (intel_gen (intel_get_drm_devid (fd)) >=8 ) - batch[i++] = dst_offset >>32 ; - batch[i++] =0 ;/* src x1,y1 */ - batch[i++] =WIDTH *4 ; - batch[i++] = src_offset;/* src reloc */ -if (intel_gen (intel_get_drm_devid (fd)) >=8 ) - batch[i++] = src_offset >>32 ;
tests/i915/gem_userptr_blits.c static int copy(int fd, uint32_t dst, uint32_t src) · line 119
Quoted 10 lines
tests/i915/gem_userptr_blits.c +8
-2- batch[i++] =MI_BATCH_BUFFER_END ; - batch[i++] =MI_NOOP ; + devid =intel_get_drm_devid (fd); + +if (intel_graphics_ver (devid) >=IP_VER (12 ,60 )) { + batch[i++] =XY_FAST_COPY_BLT ; + batch[i++] =XY_FAST_COPY_COLOR_DEPTH_32 |WIDTH *4 ; + batch[i++] =0 ;/* dst x1,y1 */ + batch[i++] = (HEIGHT <<16 ) |WIDTH ;/* dst x2,y2 */ + batch[i++] = dst_offset;/* dst address */
---------------------------- ^
This is lower 32-bits, also use lower_32_bits:
batch[i++] = lower_32_bits(dst_offset);/* dst address */
and you need to follow-up with higer 32-bits, also use canonical macro, so add:
batch[i++] = higher_32_bits(CANONICAL(dst_offset));
tests/i915/gem_userptr_blits.c static int copy(int fd, uint32_t dst, uint32_t src) · line 122
Quoted 3 lines
tests/i915/gem_userptr_blits.c +3
-0+ batch[i++] =0 ;/* src x1,y1 */ + batch[i++] =WIDTH *4 ;/* src pitch */ + batch[i++] = src_offset;/* src address */
Same here, add higher bits.
tests/i915/gem_userptr_blits.c static int copy(int fd, uint32_t dst, uint32_t src) · line 135
Quoted 13 lines
tests/i915/gem_userptr_blits.c +13
-0+ batch[i++] =MI_BATCH_BUFFER_END ; + batch[i++] =MI_NOOP ; + }else { + batch[i++] =XY_SRC_COPY_BLT_CMD | +XY_SRC_COPY_BLT_WRITE_ALPHA | +XY_SRC_COPY_BLT_WRITE_RGB ; +if (intel_gen (intel_get_drm_devid (fd)) >=8 ) + batch[i -1 ] |=8 ; +else + batch[i -1 ] |=6 ; + + batch[i++] = (3 <<24 ) |/* 32 bits */ + (0xcc << 16) | /* copy ROP */
---------------------------- ^
tests/i915/gem_userptr_blits.c static int copy(int fd, uint32_t dst, uint32_t src) · line 136
Quoted 1 line
tests/i915/gem_userptr_blits.c +1
-0+WIDTH *4 ;
---------------------------- ^
Align.
Quoted 17 lines
tests/i915/gem_userptr_blits.c +13
-0+ batch[i++] =0 ;/* dst x1,y1 */ + batch[i++] = (HEIGHT <<16 ) |WIDTH ;/* dst x2,y2 */ + batch[i++] = dst_offset;/* dst reloc */ +if (intel_gen (intel_get_drm_devid (fd)) >=8 ) + batch[i++] = dst_offset >>32 ; + batch[i++] =0 ;/* src x1,y1 */ + batch[i++] =WIDTH *4 ; + batch[i++] = src_offset;/* src reloc */ +if (intel_gen (intel_get_drm_devid (fd)) >=8 ) + batch[i++] = src_offset >>32 ; + batch[i++] =MI_BATCH_BUFFER_END ; + batch[i++] =MI_NOOP ; + } handle =gem_create (fd,4096 );gem_write (fd, handle,0 , batch,sizeof (batch));
tests/i915/gem_userptr_blits.c blit(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, int n_bo) · line 223
Quoted 4 lines
tests/i915/gem_userptr_blits.c +1
-0@@ -204,31 +220,52 @@ blit(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, int n_bo)struct drm_i915_gem_relocation_entry reloc[2 ];struct drm_i915_gem_exec_object2 *obj;struct drm_i915_gem_execbuffer2 exec; +static uint32_t devid;
------- ^
Do not use static here.
Quoted 29 lines
tests/i915/gem_userptr_blits.c +4
-23uint32_t handle; -int n, ret, i=0 ; +int n, ret, i =0 ; +uint64_t dst_offset, src_offset, bb_offset; - batch[i++] =XY_SRC_COPY_BLT_CMD | -XY_SRC_COPY_BLT_WRITE_ALPHA | -XY_SRC_COPY_BLT_WRITE_RGB ; -if (intel_gen (intel_get_drm_devid (fd)) >=8 ) - batch[i -1 ] |=8 ; -else - batch[i -1 ] |=6 ; - batch[i++] = (3 <<24 ) |/* 32 bits */ - (0xcc <<16 ) |/* copy ROP */ -WIDTH *4 ; - batch[i++] =0 ;/* dst x1,y1 */ - batch[i++] = (HEIGHT <<16 ) |WIDTH ;/* dst x2,y2 */ - batch[i++] =0 ;/* dst reloc */ -if (intel_gen (intel_get_drm_devid (fd)) >=8 ) - batch[i++] =0 ; - batch[i++] =0 ;/* src x1,y1 */ - batch[i++] =WIDTH *4 ; - batch[i++] =0 ;/* src reloc */ -if (intel_gen (intel_get_drm_devid (fd)) >=8 ) - batch[i++] =0 ; - batch[i++] =MI_BATCH_BUFFER_END ; - batch[i++] =MI_NOOP ; + bb_offset =16 <<20 ; + dst_offset = bb_offset +4096 ;
tests/i915/gem_userptr_blits.c blit(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, int n_bo) · line 239
Quoted 10 lines
tests/i915/gem_userptr_blits.c +10
-0+ src_offset = dst_offset +WIDTH *HEIGHT *sizeof (uint32_t ) * (src != dst); + + devid =intel_get_drm_devid (fd); + +if (intel_graphics_ver (devid) >=IP_VER (12 ,60 )) { + batch[i++] =XY_FAST_COPY_BLT ; + batch[i++] =XY_FAST_COPY_COLOR_DEPTH_32 |WIDTH *4 ; + batch[i++] =0 ;/* dst x1,y1 */ + batch[i++] = (HEIGHT <<16 ) |WIDTH ;/* dst x2,y2 */ + batch[i++] = dst_offset;/* dst address */
Same here, add higher 32-bits.
tests/i915/gem_userptr_blits.c blit(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, int n_bo) · line 242
Quoted 3 lines
tests/i915/gem_userptr_blits.c +3
-0+ batch[i++] =0 ;/* src x1,y1 */ + batch[i++] =WIDTH *4 ;/* src pitch */ + batch[i++] = src_offset;//src address
Same here.
Regards,
Kamil
Quoted 32 lines
tests/i915/gem_userptr_blits.c +26
-0+ batch[i++] =MI_BATCH_BUFFER_END ; + batch[i++] =MI_NOOP ; + }else { + batch[i++] =XY_SRC_COPY_BLT_CMD | +XY_SRC_COPY_BLT_WRITE_ALPHA | +XY_SRC_COPY_BLT_WRITE_RGB ; +if (intel_gen (intel_get_drm_devid (fd)) >=8 ) + batch[i -1 ] |=8 ; +else + batch[i -1 ] |=6 ; + batch[i++] = (3 <<24 ) |/* 32 bits */ + (0xcc <<16 ) |/* copy ROP */ +WIDTH *4 ; + batch[i++] =0 ;/* dst x1,y1 */ + batch[i++] = (HEIGHT <<16 ) |WIDTH ;/* dst x2,y2 */ + batch[i++] = dst_offset;/* dst reloc */ +if (intel_gen (intel_get_drm_devid (fd)) >=8 ) + batch[i++] =0 ; + batch[i++] =0 ;/* src x1,y1 */ + batch[i++] =WIDTH *4 ; + batch[i++] = src_offset;/* src reloc */ +if (intel_gen (intel_get_drm_devid (fd)) >=8 ) + batch[i++] =0 ; + batch[i++] =MI_BATCH_BUFFER_END ; + batch[i++] =MI_NOOP ; + } handle =gem_create (fd,4096 );gem_write (fd, handle,0 , batch,sizeof (batch));Signature · 1 line
2.25.1