summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2024-05-27tests/amdgpu: fix compile error with gcc14Flora Cui1-1/+1
../../drm/tests/amdgpu/shader_code.h:114:9: error: initialization of ‘const uint32_t *’ {aka ‘const unsigned int *’} from incompatible pointer type ‘const uint32_t (*)[10][6]’ {aka ‘const unsigned int (*)[10][6]’} [-Wincompatible-pointer-types] 114 | ps_##_ps##_shader_patchinfo_code_gfx##_n, \ | ^~~ ../../drm/tests/amdgpu/shader_code.h:119:10: note: in expansion of macro ‘SHADER_PS_INFO’ 119 | {SHADER_PS_INFO(const, 9), SHADER_PS_INFO(tex, 9)}, | ^~~~~~~~~~~~~~ Signed-off-by: Flora Cui <flora.cui@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2024-05-27tests/amdgpu: fix compile error with gcc7.5Flora Cui4-34/+35
fix commit cc3c80c6("tests/amdgpu: refactor dispatch/draw test") ../../SOURCES/drm/tests/amdgpu/shader_code.h:113:2: error: initializer element is not constant ps_##_ps##_shader_patchinfo_code_size_gfx##_n, \ ^ Signed-off-by: Flora Cui <flora.cui@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2024-05-27tests/amdgpu: fix compile warning with the guard enum valueFlora Cui1-0/+28
../../drm/tests/amdgpu/shader_test_util.c: In function ‘amdgpu_dispatch_init’: ../../drm/tests/amdgpu/shader_test_util.c:296:9: warning: enumeration value ‘AMDGPU_TEST_GFX_MAX’ not handled in switch [-Wswitch] 296 | switch (test_priv->info->version) { | ^~~~~~ Signed-off-by: Flora Cui <flora.cui@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2024-02-26tests/util: add tidss driverFrancesco Valla1-0/+1
Add an entry for the "tidss" driver, so that the test utilities work with this driver without passing the -M argument. Signed-off-by: Francesco Valla <valla.francesco@gmail.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-11-15modetest: switch usage to proper options grammarNeil Armstrong1-4/+26
It was unclear how #mode could be used, so fixup the usage string and print the struct grammar of the -s and -P options to clarify the usage. The following grammar was compiled: <plane_topology> ::= <plane_id> "@" <crtc_id> ":" <width> "x" <height> ( <plane_offsets> )? <plane_offsets> ::= "+" <x_offset> "+" <y_offset> ( <plane_scale> )? <plane_scale> ::= "*" <scale> ( <plane_format> )? <plane_format> ::= "@" <format> <mode_topology> ::= <connector_id> ( "," <connector_id> )* ( "@" <crtc_id> )? ":" <mode_selection> ( "@" <format> )? <mode_selection> ::= <indexed_mode> | <named_mode> | <custom_mode> <indexed_mode> ::= "#" <mode_index> <named_mode> ::= <width> "x" <height> ( "-" <vrefresh> )? <custom_mode> ::= <hdisplay> "," <hsyncstart> "," <hsyncend> "," <htotal> "," <vdisplay> "," <vsyncstart> "," <vsyncend> "," <vtotal> "-" <vrefresh> <property> ::= <object_id> ":" <property_name> ":" <value> <plane_id> ::= [0-9]+ <crtc_id> ::= [0-9]+ <width> ::= [0-9]+ <height> ::= [0-9]+ <x_offset> ::= [0-9]+ <y_offset> ::= [0-9]+ <scale> ::= [0-9]+ ( "." [0-9]+ ) <format> ::= ( [A-Z] | [0-9] )+ <connector_id> ::= [0-9]+ <mode_index> ::= [0-9]+ <hdisplay> ::= [0-9]+ <hsyncstart> ::= [0-9]+ <hsyncend> ::= [0-9]+ <htotal> ::= [0-9]+ <vdisplay> ::= [0-9]+ <vsyncstart> ::= [0-9]+ <vsyncend> ::= [0-9]+ <vtotal> ::= [0-9]+ <object_id> ::= [0-9]+ <vrefresh> ::= [0-9]+ <property_name> ::= ( [A-Z] | [0-9] | "_" )+ <value> ::= [0-9]+ with the https://bnfplayground.pauliankline.com/ service Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-10-31modetest: add support for big-endian XRGB1555/RGB565Geert Uytterhoeven1-0/+4
Add support for creating buffers using big-endian formats. For now this is limited to XRGB1555 and RGB565, which are the most common big-endian formats. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - No changes, v2: - New.
2023-10-31util: add pwetty support for big-endian RGB565Geert Uytterhoeven1-0/+1
Add support for rendering the crosshairs in a buffer using the big-endian RGB565 format. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - No changes, v2: - New.
2023-10-31util: fix pwetty on big-endianGeert Uytterhoeven1-0/+44
Cairo always uses native byte order for rendering. Hence if the byte order of the frame buffer differs from the byte order of the CPU, the frame buffer contents need to be byteswapped twice: once before rendering, to convert to native byte order, and a second time after rendering, to restore the frame buffer format's byte order. Note that byte swapping is not done for ARGB32 formats, as for these formats, byte order only affects the order of the red, green, and blue channels, which we do not care about here. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - Wrap byteswap_buffer{16,32}() implementation inside #if HAVE_CAIRO to avoid defined-but-not-used compiler warnings, v2: - RGB30 is untested.
2023-10-31util: add test pattern support for big-endian XRGB1555/RGB565Geert Uytterhoeven1-10/+21
Add support for drawing the SMPTE and tiles test patterns in buffers using big-endian formats. For now this is limited to XRGB1555 and RGB565, which are the most common big-endian formats. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - Increase indentation after definition of cpu_to_be16(), v2: - New.
2023-10-31modetest: add support for parsing big-endian formatsGeert Uytterhoeven1-6/+9
When specifying a frame buffer format like "RG16_BE" (big-endian RG16), modetest still uses the little-endian variant, as the format string is truncated to four characters. Fix this by increasing the format string size to 8 bytes (7 characters + NUL terminator). Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - Update for suffix change from "be" to "_BE", cfr. commit ffb9375a505700ad ("xf86drm: handle DRM_FORMAT_BIG_ENDIAN in drmGetFormatName()"), - Replace hardcoded numbers in code by sizeof(), v2: - New.
2023-10-31util: add missing big-endian RGB16 frame buffer formatsGeert Uytterhoeven1-0/+3
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - Update for suffix change from "be" to "_BE", cfr. commit ffb9375a505700ad ("xf86drm: handle DRM_FORMAT_BIG_ENDIAN in drmGetFormatName()"), v2: - New.
2023-10-31util: fix 16 bpp patterns on big-endianGeert Uytterhoeven1-7/+14
DRM formats are defined to be little-endian, unless the DRM_FORMAT_BIG_ENDIAN flag is set. Hence writes of multi-byte pixel values need to take endianness into account. Introduce a swap16() helper to byteswap 16-bit values, and a cpu_to_le16() helper to convert 16-bit values from CPU-endian to little-endian, and use the latter in the various pattern fill functions for 16-bit formats. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - Increase indentation after definition of cpu_to_le16(), v2: - New.
2023-10-31util: fix 32 bpp patterns on big-endianGeert Uytterhoeven1-9/+23
DRM formats are defined to be little-endian, unless the DRM_FORMAT_BIG_ENDIAN flag is set. Hence writes of multi-byte pixel values need to take endianness into account. Introduce a swap32() helper to byteswap 32-bit values, and a cpu_to_le32() helper to convert 32-bit values from CPU-endian to little-endian, and use the latter in the various pattern fill functions for 32-bit formats. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - Use new HAVE_BIG_ENDIAN symbol, v3: - Increase indentation after definition of cpu_to_le32(), v2: - Add Acked-by, - Add swap32() intermediate helper, - Add __ARM_BIG_ENDIAN and __s390__.
2023-10-30modetest: add support for DRM_FORMAT_NV{15,20,30}Jonas Karlman3-10/+223
Add smpte and tiles pattern for 10-bit NV15, NV20 and NV30 pixel formats based on the existing pattern for NV12 with colors simply scaled from 8-bit to 10-bit. These pixel formats are typically used by video decoder and display pipeline on Rockchip SoCs, e.g. on RK322X, RK3288, RK3328 and RK3399 the video decoder produce 10-bit video frames in NV15 and NV20 format. NV20 and NV30 pixel formats was added in drm-misc commit 728c15b4b5f3 ("drm/fourcc: Add NV20 and NV30 YUV formats"). This can be tested/validated on Rockchip SoCs with drm-misc commit d4b384228562 ("drm/rockchip: vop: Add NV15, NV20 and NV30 support"). Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Christopher Obbard <chris.obbard@collabora.com> Tested-by: Christopher Obbard <chris.obbard@collabora.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-10-24modetest: add SMPTE pattern support for C[124] formatsGeert Uytterhoeven1-3/+6
Add support for drawing the SMPTE pattern in buffers using a color-indexed frame buffer formats with two, four, or sixteen colors. Note that this still uses 256 as the CLUT size, as DRM_IOCTL_MODE_SETGAMMA enforces that the size matches against the (fixed) gamma size, while the CLUT size depends on the format. Move clearing the color LUT entries from util_smpte_index_gamma() to its caller, as only the caller knows how many entries there really are (currently DRM always assumes 256 entries). Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - Add missing C[12] to oneline-summary, - Do not remove memset() of full lut, else some entries may stay uninitialized, v3: - Add Acked-by, v2: - Split off changes to tests/modetest/modetest.c, - Add C1 and C2 support. The linuxdoc comments say userspace can query the gamma size: * drm_mode_gamma_set_ioctl - set the gamma table * * Set the gamma table of a CRTC to the one passed in by the user. Userspace can * inquire the required gamma table size through drm_mode_gamma_get_ioctl. * drm_mode_gamma_get_ioctl - get the gamma table * * Copy the current gamma table into the storage provided. This also provides * the gamma table size the driver expects, which can be used to size the * allocated storage. but the code doesn't seem to support that in an easy way (like setting red/green/blue to NULL on input, retrieving gamma_size on output), only by providing big enough buffers for red/green/blue, and looping over gamma_size until -EINVAL is no longer returned.
2023-10-24modetest: add support for DRM_FORMAT_C[124]Geert Uytterhoeven1-0/+15
Add support for creating buffers using the new color-indexed frame buffer formats with two, four, and sixteen colors. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - Add Acked-by, v2: - Split off changes to tests/modetest/buffers.c.
2023-10-24util: add SMPTE pattern support for C2 formatGeert Uytterhoeven1-1/+99
Add support for drawing the SMPTE pattern in a buffer using the C2 indexed format. As only four colors are available, resolution is halved, and the pattern is drawn in a PenTile RG-GB matrix, using Floyd-Steinberg dithering. The magnitude of the green subpixels is reduced, as there are twice as many green subpixels as red or blue subpixels. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- Dithering example at https://drive.google.com/file/d/1g5O8XeacrjrC8rgaVENvR65YeI6QvmtO/view v5: - Add Reviewed-by, v4: - Replace FILL_COLOR() use by pentile_color_lut[], v3: - Add Acked-by, v2: - New.
2023-10-24util: add SMPTE pattern support for C1 formatGeert Uytterhoeven1-3/+171
Add support for drawing the SMPTE pattern in a buffer using the C1 indexed format. As only two colors are available, the pattern is drawn in black and white, using Floyd-Steinberg dithering[1]. [1] https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dithering Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- Dithering example at https://drive.google.com/file/d/1waJczErrIaEKRhBCCU1ynxRG8agpo0Xx/view v5: - Add Reviewed-by, v4: - Replace FILL_COLOR() use by bw_color_lut[], v3: - Add Acked-by, - Add Wikipedia link, v2: New.
2023-10-24util: add SMPTE pattern support for C4 formatGeert Uytterhoeven1-0/+42
Add support for drawing the SMPTE pattern in a buffer using the C4 indexed format. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - Add Acked-by, v2: - Use new smpte_top[], - Split off changes to tests/util/pattern.c.
2023-10-24util: store number of colors for indexed formatsGeert Uytterhoeven2-4/+5
Store the number of available colors for color-indexed frame buffer formats in the format_info[] array. This avoids the need of test code for having to use switch statements all the time to obtain the number of colors, or to check if a mode is color-indexed or not. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - Add Acked-by, v2: - New.
2023-10-24util: add support for DRM_FORMAT_C[124]Geert Uytterhoeven1-0/+3
Add support for creating buffers using the new color-indexed frame buffer formats with two, four, and sixteen colors. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - Add Acked-by, v2: - Split off changes to tests/util/format.c.
2023-10-24util: factor out and optimize C8 SMPTE color LUTGeert Uytterhoeven3-44/+82
The color LUT for the SMPTE pattern in indexed mode contains 22 entries, although only 13 are non-unique. Reduce the size of the color LUT by dropping duplicate entries, so it can be reused for formats supporting e.g. 16 colors. Rename the function util_smpte_c8_gamma() to util_smpte_fill_lut(), and its first parameter size to ncolors, to match their actual use. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - Rename util_smpte_index_gamma() to util_smpte_fill_lut(), and its first parameter from size to ncolors, - Move smpte_color_lut[] down, - Kill FILL_COLOR() macro, - Add and use EXPAND_COLOR() macro, v3: - Add Acked-by, v2: - Factor out smpte color LUT.
2023-10-24util: improve SMPTE color LUT accuracyGeert Uytterhoeven1-3/+3
Fill in the LSB when converting color components from 8-bit to 16-bit. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - Add Acked-by, v2: - New.
2023-09-13modetest: print modifiers in hex as wellChia-I Wu1-1/+1
Print modifiers in hex in addtion to in strings returned by drmGetFormatModifierName. In some cases, hex numbers can be more easily compared visually. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2023-09-10modetest: allocate and commit atomic request around set_property()Marijn Suijten1-9/+10
Currently the atomic request is only assigned after `set_property()` is called, leaving `dev.req` in its uninitialized state causing `drmModeAtomicAddProperty()` to return an error code, which is printed as `"Success"` because `errno` is not set by `libdrm` (but it would have been when non-atomic `drmModeObjectSetProperty()` called an IOCTL immediately): sony-akatsuki-row ~ $ modetest -M msm -a -w 81:ACTIVE:0 failed to set CRTC 81 property ACTIVE to 0: Success Solve this by assigning a new atomic request object before calling `set_property()`, when there are properties to set. Likewise, commit these properties after `set_property()` even if there is no other operation (setting modes or planes) specified. Furthermore `drmModeObjectSetProperty()` is implemented in terms of `DRM_IOCTL()` which already returns `-errno` when `ioctl()` returns `-1`, so we should instead pass `ret` to `strerror()` and get an accurate error string out of `drmModeAtomicAddProperty()` too. Fixes: 93220283 ("tests/modetest: Add atomic support") Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
2023-09-10modetest: allow using -r and -PNeil Armstrong1-5/+0
Since now -r sets the pipe struct and count like -s we can also use -P with -r. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-09-10modetest: permit -r and -s to work togetherNeil Armstrong1-23/+28
Let's permit testing vsync with the default mode, this returns back the pipe content and count when calling set_mode() so the vsync test can also be used. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2023-09-09modetest: document why no blob is created for linear gamma LUTMarijn Suijten1-0/+5
As found and discussed in [MR 58] a blob is not created in the else arm because adding the GAMMA_LUT property with a NULL/0 blob_id causes it to be reset to a default linear / pass-thru gamma table. The values in the gamma_lut table might still be consumed in the legacy API path below though, so it has to be initialized to a linear table. [MR 58]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/58#note_466972 Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
2023-09-09modetest: avoid erroring if there's no gamma legacy supportEzequiel Garcia1-1/+2
Let's follow the Rule of Silence. And while here, document what's going on. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
2023-09-08modetest: custom mode supportDmitry Baryshkov2-1/+22
It is useful to be able to specify mode parameters manually. Add support for setting user-supplied modes. This patch is based on the original idea by Rohit and Jessica, but implemented from scratch. Suggested-by: Rohith Iyer <quic_rohiiyer@quicinc.com> Suggested-by: Jessica Zhang <quic_jesszhan@quicinc.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-09-08util: remove unused definitions of RED, GREEN, and BLUEGeert Uytterhoeven1-5/+0
These are unused since commit edcef53685edf5fb ("modetest: Add test pattern support for missing RGB formats"). Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- v2: - Add Reviewed-by.
2023-09-08modetest: fix mode_vrefresh() for interlace/dblscan/vscanGeert Uytterhoeven1-2/+13
mode_vrefresh() does not take into account interlaced, doublescan, and multiscan modes, leading to incorrect refresh rates. Fix this, based on drm_mode_vrefresh() in Linux. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2023-09-08util: fix grey in YUV SMPTE patternsGeert Uytterhoeven1-2/+2
The YUV SMPTE patterns use RGB 191/192/192 instead of 192/192/192 for the grey color in the top color bar. Change it to 192/192/192, to match the RGB SMPTE patterns. Fixes: a94ee624292bff96 ("modetest: Add SMPTE test pattern") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- v2: - Add Reviewed-by.
2023-09-08modetest: add support for DRM_FORMAT_NV{24,42}Geert Uytterhoeven1-0/+20
Add support for creating buffers using semi-planar YUV formats with non-subsampled chroma planes. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> --- v2: - Add Reviewed-by.
2023-09-08util: add pattern support for DRM_FORMAT_NV{24,42}Geert Uytterhoeven1-0/+4
Add support for drawing the SMPTE and tiles patterns in buffers using semi-planar YUV formats with non-subsampled chroma planes. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> --- v2: - Add Reviewed-by.
2023-09-08util: add NV24 and NV42 frame buffer formatsGeert Uytterhoeven1-0/+2
Add the missing entries for semi-planar YUV formats with non-subsampled chroma planes. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> --- v2: - Add Reviewed-by.
2023-09-08modetest: add support for writeback connectorRohith Iyer3-3/+146
Add writeback support to modetest with the below options: - Passing in -a -c will now also show the writeback connector - Dump the writeback output buffer to bitstream Usage: "./modetest -M msm -s <connector_id>:<widthxheight> -a -o <filepath> -P <plane_id>@<crtc_id>:<widthxheight>+0+0@RG24" This currently supports single writeback connector. Co-developed-by: Rohith Iyer <quic_rohiiyer@quicinc.com> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com> [DB: dropped custom mode support, fixed segfault] Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-09-04amdgpu: Use PRI?64 to format uint64_tGeert Uytterhoeven1-4/+5
On 32-bit: ../tests/amdgpu/amdgpu_stress.c: In function ‘alloc_bo’: ../tests/amdgpu/amdgpu_stress.c:178:49: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=] fprintf(stdout, "Allocated BO number %u at 0x%lx, domain 0x%x, size %lu\n", ~~^ %llx num_buffers++, addr, domain, size); ~~~~ ../tests/amdgpu/amdgpu_stress.c:178:72: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=] fprintf(stdout, "Allocated BO number %u at 0x%lx, domain 0x%x, size %lu\n", ~~^ %llu num_buffers++, addr, domain, size); ~~~~ ../tests/amdgpu/amdgpu_stress.c: In function ‘submit_ib’: ../tests/amdgpu/amdgpu_stress.c:276:54: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=] fprintf(stdout, "Submitted %u IBs to copy from %u(%lx) to %u(%lx) %lu bytes took %lu usec\n", ~~^ %llx count, from, virtual[from], to, virtual[to], copied, delta / 1000); ~~~~~~~~~~~~~ ../tests/amdgpu/amdgpu_stress.c:276:65: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=] fprintf(stdout, "Submitted %u IBs to copy from %u(%lx) to %u(%lx) %lu bytes took %lu usec\n", ~~^ %llx count, from, virtual[from], to, virtual[to], copied, delta / 1000); ~~~~~~~~~~~ ../tests/amdgpu/amdgpu_stress.c:276:70: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=] fprintf(stdout, "Submitted %u IBs to copy from %u(%lx) to %u(%lx) %lu bytes took %lu usec\n", ~~^ %llu count, from, virtual[from], to, virtual[to], copied, delta / 1000); ~~~~~~ ../tests/amdgpu/amdgpu_stress.c:276:85: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 9 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=] fprintf(stdout, "Submitted %u IBs to copy from %u(%lx) to %u(%lx) %lu bytes took %lu usec\n", ~~^ %llu count, from, virtual[from], to, virtual[to], copied, delta / 1000); ~~~~~~~~~~~~ ../tests/amdgpu/amdgpu_stress.c: In function ‘parse_size’: ../tests/amdgpu/amdgpu_stress.c:296:24: warning: format ‘%li’ expects argument of type ‘long int *’, but argument 3 has type ‘uint64_t *’ {aka ‘long long unsigned int *’} [-Wformat=] if (sscanf(optarg, "%li%1[kmgKMG]", &size, ext) < 1) { ~~^ ~~~~~ %lli ../tests/amdgpu/amdgpu_stress.c: In function ‘main’: ../tests/amdgpu/amdgpu_stress.c:378:45: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=] fprintf(stderr, "Buffer size to small %lu\n", size); ~~^ ~~~~ %llu Fix this by using the proper "PRI?64" format specifiers. Fixes: d77ccdf3ba6f5a39 ("amdgpu: add amdgpu_stress utility v2") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Marek Olšák <marek.olsak@amd.com> --- On Linux/amd64, the format strings in the resulting binary are unchanged. v3: - Add Reviewed-by, v2: - Use PRI?64 to unbreak 64-bit build.
2023-07-17tests/amdgpu/vcn: fix session buffer issue for vcn1-vcn3Ruijing Dong1-13/+5
issue: in vcn1-vcn3, session buffer was not truly added, it shows decoding creation commands cannot be sent multiple times. problem: session buffer has to be the first buffer sending out. Otherwise, system could assume session buffer doesn't exist. solution: move session buffer sending sequence to be the first one. Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com> Signed-off-by: Ruijing Dong <ruijing.dong@amd.com> Signed-off-by: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com>
2023-07-06tests/amdgpu/vcn:update decoder unit testSaleemkhan Jamadar1-5/+21
update decoder unit test with session context buffer for VCN v1 to v4 v2: remove multiple checks for vcn4 (Ruijing Dong) Signed-off-by: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com> Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
2023-05-11tests/amdgpu/vcn: fix drm test failureRuijing Dong1-19/+28
1. fixed an issue that drm test vcn3/4 encoding test could cause VCN engine stuck. 2. adding missing or errous encoding ib package members. Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com> Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
2023-05-11tests/amdgpu/vcn: change vbv_buffer name to inputRuijing Dong1-11/+11
It is input buffer instead of vbv_buffer. Correct its name. Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com> Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
2023-03-24tests/amdgpu: Allow to exclude a test or a suite of testsLuben Tuikov1-35/+152
Add the command line argument -e s[.t] to exclude (disable) suite s, or to exclude suite s test t. This is useful for instance to run the Basic Suite, but disable the GPU reset test, on the command line, like this: amdgpu_tests -s 1 -e 1.13 This option can be specified more than once on the command line, in order to exclude more than one suite and/or suite and test combination from being run. Cc: Alex Deucher <Alexander.Deucher@amd.com> Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
2023-03-24tests/amdgpu: Add all 9 options to the help outputLuben Tuikov1-8/+10
Add -s and -t to the help output, as well as sort the options output alphabetically. v1: Fix a spelling in the subject of this commit. Cc: Alex Deucher <Alexander.Deucher@amd.com> Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
2023-03-24tests/amdgpu: Fix Usage stringLuben Tuikov1-2/+2
Fix the Usage: string on -h (help) in amdgpu_tests.c, so brackets match, and remove mismatched angle brackets. Cc: Alex Deucher <Alexander.Deucher@amd.com> Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
2023-03-17test/amdgpu/hotunplug: add apu check for hotplug testjie zhang1-0/+4
For apu, it is integrated with cpu. So hotplug test should be unnecessary for it. Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Reviewed-by: Flora Cui <flora.cui@amd.com>
2023-02-10tests/util: Add vkms driverYi Xie1-0/+1
Add an entry for the "vkms" driver, so that the test utilities work with the vkms driver without passing the -M argument. Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Yi Xie <yixie@google.com>
2022-11-11tests/amdgpu/jpeg: enable unit test for jpeg 4Saleemkhan Jamadar1-1/+1
Enable decode unit test for jpeg4. Signed-off-by: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com> Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
2022-11-09tests/amdgpu: use AMDGPU_TIMEOUT_INFINITE to query fenceLang Yu1-2/+2
We need to wait longer when running on emulator. Signed-off-by: Lang Yu <Lang.Yu@amd.com>
2022-11-02modetest: use dumb buffer helpersSimon Ser1-21/+7
Signed-off-by: Simon Ser <contact@emersion.fr>