lib/rendercopy: Assert that buffer dimensions/stride are acceptable
PATCH 1/1 lib/rendercopy: Assert that buffer dimensions/stride are acceptable
From: Ville Syrjälä <[email protected]>
Sprinkle some asserts into rendercopy to make sure we don't try to exceed the render engine surface size/stride limitations.
--- lib/rendercopy_gen4.c | 4 ++++ lib/rendercopy_gen6.c | 4 ++++ lib/rendercopy_gen7.c | 4 ++++ lib/rendercopy_gen8.c | 4 ++++ lib/rendercopy_gen9.c | 4 ++++ lib/rendercopy_i830.c | 8 ++++++++ lib/rendercopy_i915.c | 9 +++++++++ 7 files changed, 37 insertions(+)
lib/rendercopy_gen4.c +4 -0
@@ -142,6 +142,10 @@ gen4_bind_buf(struct intel_batchbuffer *batch,uint32_t write_domain, read_domain;int ret; +igt_assert_lte (buf->stride,128 *1024 ); +igt_assert_lte (igt_buf_width (buf),8192 ); +igt_assert_lte (igt_buf_height (buf),8192 ); +if (is_dst) { write_domain = read_domain =I915_GEM_DOMAIN_RENDER ; }else {
lib/rendercopy_gen6.c +4 -0
@@ -79,6 +79,10 @@ gen6_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf,uint32_t write_domain, read_domain;int ret; +igt_assert_lte (buf->stride,128 *1024 ); +igt_assert_lte (igt_buf_width (buf),8192 ); +igt_assert_lte (igt_buf_height (buf),8192 ); +if (is_dst) { write_domain = read_domain =I915_GEM_DOMAIN_RENDER ; }else {
lib/rendercopy_gen7.c +4 -0
@@ -65,6 +65,10 @@ gen7_bind_buf(struct intel_batchbuffer *batch,uint32_t write_domain, read_domain;int ret; +igt_assert_lte (buf->stride,256 *1024 ); +igt_assert_lte (igt_buf_width (buf),16384 ); +igt_assert_lte (igt_buf_height (buf),16384 ); +switch (buf->bpp) {case 8 : format =SURFACEFORMAT_R8_UNORM ;break ;case 16 : format =SURFACEFORMAT_R8G8_UNORM ;break ;
lib/rendercopy_gen8.c +4 -0
@@ -150,6 +150,10 @@ gen8_bind_buf(struct intel_batchbuffer *batch,uint32_t write_domain, read_domain, offset;int ret; +igt_assert_lte (buf->stride,256 *1024 ); +igt_assert_lte (igt_buf_width (buf),16384 ); +igt_assert_lte (igt_buf_height (buf),16384 ); +if (is_dst) { write_domain = read_domain =I915_GEM_DOMAIN_RENDER ; }else {
lib/rendercopy_gen9.c +4 -0
@@ -180,6 +180,10 @@ gen8_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf,uint32_t write_domain, read_domain, offset;int ret; +igt_assert_lte (buf->stride,256 *1024 ); +igt_assert_lte (igt_buf_width (buf),16384 ); +igt_assert_lte (igt_buf_height (buf),16384 ); +if (is_dst) { write_domain = read_domain =I915_GEM_DOMAIN_RENDER ; }else {
lib/rendercopy_i830.c +8 -0
@@ -138,6 +138,10 @@ static void gen2_emit_target(struct intel_batchbuffer *batch,uint32_t tiling;uint32_t format; +igt_assert_lte (dst->stride,8192 ); +igt_assert_lte (igt_buf_width (dst),2048 ); +igt_assert_lte (igt_buf_height (dst),2048 ); +switch (dst->bpp) {case 8 : format =COLR_BUF_8BIT ;break ;case 16 : format =COLR_BUF_RGB565 ;break ;
@@ -175,6 +179,10 @@ static void gen2_emit_texture(struct intel_batchbuffer *batch,uint32_t tiling;uint32_t format; +igt_assert_lte (src->stride,8192 ); +igt_assert_lte (igt_buf_width (src),2048 ); +igt_assert_lte (igt_buf_height (src),2048 ); +switch (src->bpp) {case 8 : format =MAPSURF_8BIT |MT_8BIT_L8 ;break ;case 16 : format =MAPSURF_16BIT |MT_16BIT_RGB565 ;break ;
lib/rendercopy_i915.c +9 -0
@@ -87,6 +87,11 @@ void gen3_render_copyfunc(struct intel_batchbuffer *batch, {#define TEX_COUNT 1uint32_t format_bits, tiling_bits =0 ; + +igt_assert_lte (src->stride,8192 ); +igt_assert_lte (igt_buf_width (src),2048 ); +igt_assert_lte (igt_buf_height (src),2048 ); +if (src->tiling !=I915_TILING_NONE ) tiling_bits =MS3_TILED_SURFACE ;if (src->tiling ==I915_TILING_Y )
@@ -123,6 +128,10 @@ void gen3_render_copyfunc(struct intel_batchbuffer *batch,uint32_t tiling_bits =0 ;uint32_t format_bits; +igt_assert_lte (dst->stride,8192 ); +igt_assert_lte (igt_buf_width (dst),2048 ); +igt_assert_lte (igt_buf_height (dst),2048 ); +switch (dst->bpp) {case 8 : format_bits =COLR_BUF_8BIT ;break ;case 16 : format_bits =COLR_BUF_RGB565 ;break ;
Signature · 6 lines
2.19.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for lib/rendercopy: Assert that buffer dimensions/stride are acceptable
== Series Details ==
== Series Details ==
Series: lib/rendercopy: Assert that buffer dimensions/stride are acceptable
URL : https://patchwork.freedesktop.org/series/58953/
State : success
== Summary ==
CI Bug Log - changes from IGT_4925 -> IGTPW_2778
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/58953/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2778 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_cs_nop@fork-compute0:
- fi-icl-y: NOTRUN -> SKIP [fdo#109315] +17
* igt@gem_ctx_create@basic-files:
- fi-gdg-551: NOTRUN -> SKIP [fdo#109271] +106
* igt@gem_exec_basic@basic-bsd2:
- fi-kbl-7500u: NOTRUN -> SKIP [fdo#109271] +9
- fi-icl-y: NOTRUN -> SKIP [fdo#109276] +7
* igt@gem_exec_parse@basic-rejected:
- fi-icl-y: NOTRUN -> SKIP [fdo#109289] +1
* igt@gem_exec_suspend@basic-s4-devices:
- fi-icl-y: NOTRUN -> DMESG-WARN [fdo#109638]
- fi-blb-e6850: PASS -> INCOMPLETE [fdo#107718]
* igt@i915_pm_rpm@module-reload:
- fi-skl-6770hq: PASS -> FAIL [fdo#108511]
* igt@i915_selftest@live_contexts:
- fi-icl-y: NOTRUN -> DMESG-FAIL [fdo#108569]
* igt@i915_selftest@live_execlists:
- fi-apl-guc: PASS -> INCOMPLETE [fdo#103927] / [fdo#109720]
* igt@kms_busy@basic-flip-c:
- fi-gdg-551: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
* igt@kms_chamelium@dp-crc-fast:
- fi-kbl-7500u: NOTRUN -> DMESG-WARN [fdo#103841]
- fi-icl-y: NOTRUN -> SKIP [fdo#109284] +8
* igt@kms_force_connector_basic@force-load-detect:
- fi-icl-y: NOTRUN -> SKIP [fdo#109285] +3
* igt@kms_frontbuffer_tracking@basic:
- fi-byt-clapper: PASS -> FAIL [fdo#103167]
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
- fi-byt-clapper: PASS -> FAIL [fdo#107362]
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
- fi-byt-clapper: PASS -> FAIL [fdo#103191] / [fdo#107362] +1
* igt@kms_psr@primary_mmap_gtt:
- fi-icl-y: NOTRUN -> SKIP [fdo#110189] +3
* igt@prime_vgem@basic-fence-flip:
- fi-icl-y: NOTRUN -> SKIP [fdo#109294]
* igt@runner@aborted:
- fi-kbl-7500u: NOTRUN -> FAIL [fdo#103841]
- fi-apl-guc: NOTRUN -> FAIL [fdo#108622] / [fdo#109720]
#### Possible fixes ####
* igt@gem_ctx_exec@basic:
- fi-icl-y: INCOMPLETE -> PASS
* igt@i915_selftest@live_contexts:
- fi-bdw-gvtdvm: DMESG-FAIL [fdo#110235 ] -> PASS
* igt@i915_selftest@live_uncore:
- fi-ivb-3770: DMESG-FAIL [fdo#110210] -> PASS
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
- fi-byt-clapper: FAIL [fdo#103191] / [fdo#107362] -> PASS
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103841]: https://bugs.freedesktop.org/show_bug.cgi?id=103841
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108511]: https://bugs.freedesktop.org/show_bug.cgi?id=108511
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#108622]: https://bugs.freedesktop.org/show_bug.cgi?id=108622
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109294]: https://bugs.freedesktop.org/show_bug.cgi?id=109294
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109638]: https://bugs.freedesktop.org/show_bug.cgi?id=109638
[fdo#109720]: https://bugs.freedesktop.org/show_bug.cgi?id=109720
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#110210]: https://bugs.freedesktop.org/show_bug.cgi?id=110210
[fdo#110235 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110235
Participating hosts (46 -> 40)
------------------------------
Additional (2): fi-gdg-551 fi-kbl-7500u
Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-bsw-n3050 fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus
Build changes
-------------
* IGT: IGT_4925 -> IGTPW_2778
CI_DRM_5863: d2c849411d8ae6de9c718b9c0cd1e00da7f0f121 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2778: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2778/
IGT_4925: ca623acb8b2b6f0a4cdb01946dc9002e11d62574 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2778/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.IGT: success for lib/rendercopy: Assert that buffer dimensions/stride are acceptable
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: lib/rendercopy: Assert that buffer dimensions/stride are acceptable
URL : https://patchwork.freedesktop.org/series/58953/
State : success
== Summary ==
CI Bug Log - changes from IGT_4925_full -> IGTPW_2778_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/58953/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2778_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_basic@basic-bsd1:
- shard-glk: NOTRUN -> SKIP [fdo#109271] +40
* igt@gem_tiled_swapping@non-threaded:
- shard-hsw: PASS -> INCOMPLETE [fdo#103540] / [fdo#108686]
* igt@kms_busy@extended-modeset-hang-newfb-render-a:
- shard-hsw: PASS -> DMESG-WARN [fdo#110222] +2
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
- shard-snb: PASS -> DMESG-WARN [fdo#110222]
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
- shard-kbl: PASS -> DMESG-WARN [fdo#110222] +1
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-f:
- shard-hsw: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +3
* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
- shard-hsw: NOTRUN -> DMESG-WARN [fdo#110222]
* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-f:
- shard-glk: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +3
* igt@kms_color@pipe-b-ctm-max:
- shard-glk: NOTRUN -> FAIL [fdo#108147]
* igt@kms_cursor_crc@cursor-128x42-random:
- shard-apl: PASS -> FAIL [fdo#103232]
* igt@kms_cursor_crc@cursor-256x85-onscreen:
- shard-glk: PASS -> FAIL [fdo#103232]
* igt@kms_cursor_crc@cursor-256x85-sliding:
- shard-glk: NOTRUN -> FAIL [fdo#103232] +1
* igt@kms_cursor_legacy@2x-cursor-vs-flip-atomic:
- shard-snb: NOTRUN -> SKIP [fdo#109271] +19
- shard-hsw: PASS -> FAIL [fdo#105767] +1
* igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-spr-indfb-draw-mmap-cpu:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] +7
* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
- shard-glk: PASS -> FAIL [fdo#108145]
* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-snb: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +4
* igt@kms_plane_scaling@pipe-a-scaler-with-rotation:
- shard-glk: PASS -> SKIP [fdo#109271] / [fdo#109278]
* igt@kms_psr@no_drrs:
- shard-apl: NOTRUN -> SKIP [fdo#109271] +1
* igt@kms_setmode@basic:
- shard-apl: PASS -> FAIL [fdo#99912]
* igt@kms_universal_plane@disable-primary-vs-flip-pipe-d:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
* igt@kms_vblank@pipe-c-ts-continuation-modeset:
- shard-kbl: PASS -> FAIL [fdo#104894]
- shard-apl: PASS -> FAIL [fdo#104894]
* igt@perf_pmu@rc6-runtime-pm:
- shard-glk: PASS -> FAIL [fdo#105010]
* igt@prime_busy@hang-bsd1:
- shard-hsw: NOTRUN -> SKIP [fdo#109271] +24
#### Possible fixes ####
* igt@gem_create@create-clear:
- shard-snb: INCOMPLETE [fdo#105411] -> PASS
* igt@gem_softpin@noreloc-s3:
- shard-apl: DMESG-WARN [fdo#108566] -> PASS
* igt@i915_pm_rc6_residency@rc6-accuracy:
- shard-snb: SKIP [fdo#109271] -> PASS
* igt@kms_available_modes_crc@available_mode_test_crc:
- shard-hsw: FAIL [fdo#106641] -> PASS
* igt@kms_busy@extended-modeset-hang-newfb-render-b:
- shard-hsw: DMESG-WARN [fdo#110222] -> PASS
- shard-snb: DMESG-WARN [fdo#110222] -> PASS
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
- shard-kbl: DMESG-WARN [fdo#110222] -> PASS +1
* igt@kms_cursor_crc@cursor-128x128-dpms:
- shard-kbl: FAIL [fdo#103232] -> PASS
- shard-apl: FAIL [fdo#103232] -> PASS
* igt@kms_cursor_legacy@cursor-vs-flip-atomic:
- shard-hsw: FAIL [fdo#103355] -> PASS
* igt@kms_plane@pixel-format-pipe-c-planes-source-clamping:
- shard-glk: SKIP [fdo#109271] -> PASS
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS
* igt@kms_plane_scaling@pipe-c-scaler-with-pixel-format:
- shard-glk: SKIP [fdo#109271] / [fdo#109278] -> PASS
* igt@kms_setmode@basic:
- shard-kbl: FAIL [fdo#99912] -> PASS
* igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm:
- shard-apl: FAIL [fdo#104894] -> PASS
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
[fdo#105010]: https://bugs.freedesktop.org/show_bug.cgi?id=105010
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
[fdo#106641]: https://bugs.freedesktop.org/show_bug.cgi?id=106641
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#110222]: https://bugs.freedesktop.org/show_bug.cgi?id=110222
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (7 -> 5)
------------------------------
Missing (2): shard-skl shard-iclb
Build changes
-------------
* IGT: IGT_4925 -> IGTPW_2778
CI_DRM_5863: d2c849411d8ae6de9c718b9c0cd1e00da7f0f121 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2778: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2778/
IGT_4925: ca623acb8b2b6f0a4cdb01946dc9002e11d62574 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2778/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoting Ville Syrjala (2019-04-03 16:41:04)
Quoted 12 lines
From: Ville Syrjälä <[email protected]>
Sprinkle some asserts into rendercopy to make sure we don't try to exceed the render engine surface size/stride limitations.
Signed-off-by Ville Syrjälä <[email protected]>---
lib/rendercopy_gen6.c +0
-0
lib/rendercopy_gen6.c gen6_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf, · line 84
Quoted 6 lines
lib/rendercopy_gen6.c +3
-0@@ -79,6 +79,10 @@ gen6_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf,uint32_t write_domain, read_domain;int ret; +igt_assert_lte (buf->stride,128 *1024 ); +igt_assert_lte (igt_buf_width (buf),8192 ); +igt_assert_lte (igt_buf_height (buf),8192 );
Indeed. I had it down as 256k, but the field seems to be only 17b and not 18b as ivb+.
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 16 lines · Chris Wilson
Quoting Ville Syrjala (2019-04-03 16:41:04)
Quoted 15 lines
From: Ville Syrjälä <[email protected]>
Sprinkle some asserts into rendercopy to make sure we don't try to exceed the render engine surface size/stride limitations.
Signed-off-by Ville Syrjälä <[email protected]>---
lib/rendercopy_gen6.c +0
-0@@ -79,6 +79,10 @@ gen6_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf,uint32_t write_domain, read_domain;int ret;
Quoted 6 lines
lib/rendercopy_gen6.c gen6_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf, · line 84
Quoted 3 lines
lib/rendercopy_gen6.c +3
-0+igt_assert_lte (buf->stride,128 *1024 ); +igt_assert_lte (igt_buf_width (buf),8192 ); +igt_assert_lte (igt_buf_height (buf),8192 );Indeed. I had it down as 256k, but the field seems to be only 17b and not 18b as ivb+.
Yeah, I had the same misconception when working on the gtt remapping stuff. Also some version of the spec even mistakenly documented it as 512k IIRC
Quoted 1 line
Reviewed-by Chris Wilson <[email protected]>
Ta. Pushed.
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev