summaryrefslogtreecommitdiff
path: root/tests/kms_plane_scaling.c
AgeCommit message (Collapse)Author
2019-04-24tests/kms_plane_scaling: Update list of supported pixel formats for rotationMika Kahola
Update the list of pixel formats that cannot be rotated by 90/270 degrees. With this patch, the kernel and IGT are aligned for i915 driver. References: https://bugs.freedesktop.org/show_bug.cgi?id=109052 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110369 Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2019-04-18tests/kms_plane_scaling: Skip testing unsupported fp16 featuresKevin Strasser
Disallow Yf tiling and Y-tiled 90/270 rotation for fp16 on Intel hardware. rfc2: - Move check into can_rotate (Maarten) - Use igt_plane_has_format_mod (Maarten) v1: - Drop Y tile check (Ville) Signed-off-by: Kevin Strasser <kevin.strasser@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-04-10tests/kms_plane_scaling: Check supported pixel formatMika Kahola
Let's add a check for supported pixel format. Otherwise, we fail the test, for example, with the following error message "[drm:intel_framebuffer_init [i915]] unsupported pixel format Y210 little-endian (0x30313259) / modifier 0x100000000000003" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110369 Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-04-08tests/kms_plane_scaling: Check supported format for rotationMika Kahola
Let's check if 90/270 rotation is supported for the format that we are trying to test. Currently, if we try to test unsupported format the kernel complains with the following message. "[drm:skl_plane_check [i915]] Unsupported pixel format Y210 little-endian (0x30313259) for 90/270!" v2: Use igt_plane_has_format_mod() function to select formats that are capable of 90/270 rotation (Ville) Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-04-02tests/kms_plane_scaling: Use IGT helpers for selecting planes to scaleNicholas Kazlauskas
These tests intend to test scaling on hardware with overlay planes. They will incorrectly try to scale the cursor plane or occasionally crash by trying to access planes that don't exist for hardware that doesn't expose any overlay planes. Make plane selection explicit by requesting the plane by type and index using the igt helper igt_pipe_get_plane_type_index. Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Leo Li <sunpeng.li@amd.com>
2019-03-22tests/kms_plane_scaling: Minimum width and height for planar YUV formats on ↵Mika Kahola
i915 devices Use minimum of 16x16 size for i915 devices only as other HW's may have different limitations. The default is 8x8. Suggested-by: Ville Syrjala <ville.syrjala@linux.intel.com> Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-03-21tests/kms_plane_scaling: Ensure minimum height and width for planar uyv formatsMika Kahola
Let's ensure that we test with minimum width and height of 16 for all planar uyv formats. References: https://bugs.freedesktop.org/show_bug.cgi?id=110098 Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-03-12tests/kms_plane_scaling: Rip out unused igt_pipe_crc_tArkadiusz Hiler
It's set up for capture and then freed but never used. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2019-01-08tests: Enable plane tests for AMDGPUNicholas Kazlauskas
The i915 specific feature requirements that would have failed subtests from kms_plane, kms_plane_multiple and kms_plane_scaling have been conditionally guarded against. These tests can now be run on AMDGPU with the i915 specific tests skipped appropriately. Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
2019-01-08tests/kms_plane_scaling: Add support for testing AMDGPUNicholas Kazlauskas
The plane_scaling subtests are capable of running on AMDGPU when not using i915 specific tiling formats and when the test only requires one scaler per pipe. This patch removes the forced i915 devid and gen checks from non i915 devices. It also adds logic for getting the number of scalers per pipe in a way that doesn't only depend on devid. One scaler per pipe is assumed for AMDGPU. There isn't any specific reason that the x-tiled formats need to be used on the non-rotation tests on i915 but this patch keeps the existing test behavior. It's a little simpler to keep it this way for the prepare_crtc helper that's shared between the scaling test and the clipping/clamping test. v2: Use igt_plane_has_format_mod helper (Ville) v3: Use helpers to check x-tiled support (Ville) Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-10-01igt: Require a display (KMS enabled) for KMS testsChris Wilson
Simple rule of thumb, if a kms_* test calls igt_display_init() in its global fixture, skip the entire test if the driver has disabled KMS. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-09-06tests/kms_plane_scaling: Allow DRM_FORMAT_RGB565 rotation on gen>=11Juha-Pekka Heikkila
Test DRM_FORMAT_RGB565 rotation when gen is 11 or higher. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-05-23tests/kms_plane_scaling: Reduce the fb size 8x8 from 9x9Ville Syrjälä
The 9x9 was maybe a workaround for the kernel's rounding behaviour? The kernel was changed so that's no longer necessary. So let's go for 8x8 since that actually works with YUV formats. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #irc
2018-05-23tests/kms_plane_scaling: Allow clip test to fail with YUVVille Syrjälä
YUV formats require the clipped src coordinates to be suitably aligned. We'd need to very carefully compute the unclipped dst coordinates to guarantee that. That's too much hassle so let's just accept failure in case YUV formats are used. v2: Actually remove the original igt_display_commit2() (Maarten) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #irc
2018-04-12igt/kms_plane_scaling: Open DRM_MASTERChris Wilson
Modesetting requires DRM_MASTER privileges, so use drm_open_driver_master() to assert that we do acquire them. References: https://bugs.freedesktop.org/show_bug.cgi?id=105997 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-04-03tests/kms_plane_scaling: fb height to be min 16 for NV12Vidya Srinivas
Per Bspec, fb height needs to be min 16 for NV12 (YUV planar formats). We also need the src height and width to be multiple of 4. Reviewed-By: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Uma Shankar <uma.shankar@intel.com> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-03-15tests/kms_plane_scaling: Change minimum fb height for YUV 420 planarVidya Srinivas
When the plane scaling is used with YUV 420 planar formats, the height should be a minimum of 16 scanlines as per BSpec. Minimum of 8 scanlines is for non-YUV 420 planar formats. Patch changes the minimum fb height being used in the test in case of YUV 420 planar (currently done for NV12, as that is the only planar format supported) v2: Addressed review comments from Maarten Signed-off-by: Uma Shankar <uma.shankar@intel.com> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-02-20tests/kms_plane_scaling: Use existing igt_kms apis to paint the fbCarlos Santa
itg_kms already defines an api that creates and colors a new fb, let's use that instead of recreating that all over again. Signed-off-by: Carlos Santa <carlos.santa@intel.com> CC: Jyoti Yadav <jyoti.r.yadav@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-02-12lib/igt_fb: Add igt_fb_supported_format()Maarten Lankhorst
This makes it possible to iterate whether a format is supported or not, without each driver having to open code it. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> Tested-by: Vidya Srinivas <vidya.srinivas@intel.com>
2018-02-12tests: Always call igt_remove_fb without checking.Maarten Lankhorst
This cleans up the tests slightly. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> Tested-by: Vidya Srinivas <vidya.srinivas@intel.com>
2018-02-05tests/kms_plane_scaling: Test all pixel formats with clamping and clipping tooMaarten Lankhorst
Run across all combinations of pixel formats to ensure better testing. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-02-05tests/kms_plane_scaling: Test all pixel formats in pipe-*-scaler-with-rotationMaarten Lankhorst
This will allow us to test NV12 as well, when available. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-02-01lib/igt_fb: Add igt_put_cairo_ctx as counter to igt_get_cairo_ctxMaarten Lankhorst
This will allow support for NV12 in the future, where igt_get_cairo_ctx will return a RGB image to draw with, which will be converted in igt_put_cairo_ctx so tests don't have to add special support for NV12. This is the same as cairo_destroy + checking for errors, but not all tests use this correctly so it's better to have a single handler for it. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-01-17tests/kms_plane_scaling: test for multi pipe with scaling, v3.Jyoti Yadav
Add a subtest to display primary and overlay planes on two connected pipes and runs scaling test on both pipes Changes since v1: - Commit first before trying any scaling. (Maarten) - Use the same logic as kms_cursor_legacy to find a pipe and output. (Maarten) - Rework test to work with how cleanup is handled. (Maarten) Changes since v2: - Use get_num_scalers() to only use 2 scalers if available. (Maarten) Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-01-17tests/kms_plane_scaling: test scaler with clipping clamping, v3.Jyoti Yadav
This patch adds subtest to test scaler clipping and clamping scenario. Changes since v1: - Modify test to work with the changes to kms_plane_scaling. (Maarten) Changes since v2: - Use get_num_scalers() to skip when needed. Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-01-17tests/kms_plane_scaling: test scaling with tiling rotation and pixel ↵Jyoti Yadav
formats, v3. This patch adds subtest for testing scaling in combination with rotation and pixel formats. Changes since v1: - Rework test to work with the other changes to kms_plane_scaling. (Maarten) - Remove hardcodes for MIN/MAX_SRC_WIDTH, and use the value directly. (Maarten) Changes since v2: - Put rotation and tiling in an array. (Maarten) Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-01-17tests/kms_plane_scaling: Clean up tests to work better with igt_kms, v2.Maarten Lankhorst
The test only runs on gen9+, so we can safely replace all calls with COMMIT_ATOMIC. Also perform some cleanups by making fb an array, and cleaning up in prepare_crtc. This way failed subtests won't cause failures in other subtests. Changes since v1: - Rebase on top of num_scalers changes. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-01-17tests/kms_plane_scaling: Move get_num_scalers to a function, v2.Maarten Lankhorst
The number of scalers can depend on the pipe, so require at least 1 scaler before running any subtests. Changes since v1: - More closely match kernel implementation. (Mika) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-01-17tests/kms_plane_scaling: Convert from simple test to full testMaarten Lankhorst
Convert the test to run subtests per pipe, before we start adding more subtests. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-01-17tests/kms_plane_scaling: Fix basic scaling test, v3.Mahesh Kumar
PIPEC doesnt have 3rd plane in GEN9. So, we skip the 3rd plane related scaling test where 2nd OVERLAY plane is not available. Restricting downscaling to (9/10)x original size of the image to avoid "Max pixel rate limitation" of the hardware. When testing with a resolution of 1024x768, the test fails in iterate_plane_scaling because height becomes out of bounds. Lastly, instead of a fixed test image, generate a test pattern at runtime to not run into bxt's hardware limits for scaling. Later patches in this series will cover corner cases of scaling. Changes since v1: - Move out the code reshuffle to a separate commit. (Maarten) This makes it more clear what's fixed. Changes since v2: - Fix iterate_plane_scaling on 1024x768. (Maarten) - Instead of upscaling a test image, use the test pattern with a color. (Maarten) Using a 600x600 test pattern doesn't run into BXT's hardware limits for scaling. Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com> Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-01-17tests/kms_plane_scaling: Move the actual test to its own function.Maarten Lankhorst
We will add more subtests in the future, it's more clear if we split out the actual test to its own function first. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-11-06tests/kms_plane_scaling: Fix off-by-one plane selectionGabriel Krisman Bertazi
Commit ca20170afc6f ("tests/kms_plane_scaling: Add support for dynamic number of planes") shifted the tested planes by one after the refactoring, accidentally ignoring the first plane, which is zero indexed. A symptom of the issue appears on KBL, where the third plane is already the shared cursor, causing igt to configure an unsupported framebuffer format on it, triggering the following error: [drm:__setplane_internal] Invalid pixel format XR24 little-endian (0x34325258) With this fixed, we can exposes the pixel clock scaling issue, which is the actual problem being tracked in Bug 103159, but let's start by reverting to the old behavior. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103159 Fixes: ca20170afc6f ("tests/kms_plane_scaling: Add support for dynamic number of planes") Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Reviewed-by: Robert Foss <robert.foss@collabora.com>
2017-10-02tests: Stop looking at plane private membersMaarten Lankhorst
Most of these tests have no reason to look at those members, so try other ways of getting the information. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-03-21Restore "lib: Open debugfs files for the given DRM device"Chris Wilson
This reverts commit 25fbae15262cf570e207e62f50e7c5233e06bc67, restoring commit 301ad44cdf1b868b1ab89096721da91fa8541fdc Author: Tomeu Vizoso <tomeu.vizoso@collabora.com> Date: Thu Mar 2 10:37:11 2017 +0100 lib: Open debugfs files for the given DRM device with fixes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-21Revert "lib: Open debugfs files for the given DRM device"Tomeu Vizoso
This reverts commit 301ad44cdf1b868b1ab89096721da91fa8541fdc. When a render-only device is opened and gem_quiescent_gpu is called, we need to use the debugfs dir for the master device instead. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2017-03-21lib: Open debugfs files for the given DRM deviceTomeu Vizoso
When opening a DRM debugfs file, locate the right path based on the given DRM device FD. This is needed so, in setups with more than one DRM device, any operations on debugfs files affect the expected DRM device. v2: - rebased and fixed new API additions v3: - updated chamelium test, which was missed previously - use the minor of the device for the debugfs path, not the major - have a proper exit handler for calling igt_hpd_storm_reset with the right device fd. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Robert Foss <robert.foss@collabora.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-01-31tests/kms_plane_scaling: Add support for dynamic number of planesRobert Foss
Add changes reflecting the new support for dynamic number of planes per pipe. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2016-12-08igt_kms: Remove support for drivers with <1 drm_planeLyude
We've had support for universal planes since kernel version 3.15, so there's not really a good reason to try supporting drivers that lack plane support now. As well, the current has_universal_planes logic is broken anyway as it makes the assumption that having display planes always means we have both a primary plane and a cursor plane (this isn't true on radeon/amdgpu and nouveau). So, remove this, and just check for whether or not we have a cursor plane. Signed-off-by: Lyude <lyude@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-26igt_kms: Remove pan members from igt_plane, v2.Maarten Lankhorst
They're duplicates with src_x/y, so just use those. Changes since v1: - Fix order of parameters in calls to igt_fb_set_position. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2016-07-26tests/kms: Clean up more users of unassigned pipes.Maarten Lankhorst
Use for_each_pipe_with_valid_output instead. This may increase test time slightly on the affected tests, because now outputs will be tested on every pipe instead of the first pipe. This will increase test coverage to all usable pipes though, so it shouldn't be an issue. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2016-01-08lib: Extract some common fb create+fill methods into helpersVille Syrjälä
Several tests do one or more of the following: * igt_create_fb() + igt_paint_test_pattern() * igt_create_color_fb() + igt_paint_test_pattern() * igt_create_fb() + igt_paint_image() Extract them into new helpers: igt_create_pattern_fb(), igt_create_color_pattern_fb(), igt_create_image_fb(). v2: Fix typos, and improve API docs (Thomas) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-03tests: Run igt.cocciDaniel Stone
Signed-off-by: Daniel Stone <daniels@collabora.com>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21lib: add a single include headerThomas Wood
Add a header that includes all the headers for the library. This allows reorganisation of the library without affecting programs using it and also simplifies the headers that need to be included to use the library. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14i-g-t: Adding plane scaling test casechandra konduru
This patch is adding i-g-t plane scaling test case to test couple basic display plane scaling usages. Additional test scenarios can be added later. v2: -Added iterative scaling to visually observe scaling (me) v3: -Added a flag to control primary plane scaling (me) v4: -Use new tiled types when calling igt_create_fb (me) Signed-off-by: chandra konduru <chandra.konduru@intel.com> [Thomas: convert test to use igt_simple_main] Signed-off-by: Thomas Wood <thomas.wood@intel.com>