summaryrefslogtreecommitdiff
path: root/tests/kms_addfb_basic.c
AgeCommit message (Collapse)Author
2022-03-24tests/kms_addfb_basic: Add support for Tile4 formatJeevan B
X-Patchwork-Id: 478682 Message-Id: <20220317205414.13668-3-jeevan.b@intel.com> To: igt-dev@lists.freedesktop.org Date: Fri, 18 Mar 2022 02:24:12 +0530 Adding subtest to test new tiling format Signed-off-by: Jeevan B <jeevan.b@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2021-10-11igt: s/DRM_FORMAT_MOD_NONE/DRM_FORMAT_MOD_LINEAR/Ville Syrjälä
DRM_FORMAT_MOD_LINEAR is the more sensible name for DRM_FORMAT_MOD_NONE. Use the better name. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-10-03lib: Partially revert 22643ce4014aAshutosh Dixit
In 22643ce4014a ("Return allocated size in gem_create_in_memory_regions() and friends") we modified __gem_create_in_memory_regions and gem_create_in_memory_regions to return the allocated size for buffer objects. However, this also unnecessarily complicates programming in the majority of cases where the allocated size is not needed. For example in several cases it requires tracking the requested and allocated sizes separately, the size used must be strictly uint64_t etc. In order to simplify things and provide greater flexibility, here we change 22643ce4014a to follow the same scheme followed in gem_create_ext (and in gem_create) where __gem_create_ext returns the allocated size but gem_create_ext doesn't. With this change, __gem_create_in_memory_regions returns the allocated size for situations where it is needed but in the majority of cases where the allocated size is not needed we can just use gem_create_in_memory_regions for casual use as before. v2: Store requested not allocated bo size in intel_buf->size (Zbigniew) Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-09-29Return allocated size in gem_create_in_memory_regions() and friendsAshutosh Dixit
Often the allocated size is of interest and is different from the requested size. Therefore return allocated size for the object (by __gem_create_ext()) in gem_create_in_memory_regions() and friends. v2: Assign buf->size correctly in __intel_buf_init (Zbigniew) Cc: Andrzej Turko <andrzej.turko@linux.intel.com> Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com> Cc: John Harrison <John.C.Harrison@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2021-09-27tests/kms_addfb_basic: Remove handling for Unknown Vendor.Mark Yacoub
[Why] Looking at multiple drivers such as i915, amdgpu, and msm, EINVAL is the standard errno when failing some fb errors. Unless it's an exception like nouveau, every driver should act in a standard manner and return EINVAL just like every other driver. Hence, no special handling for unknown vendor is needed. [How] Remove asserts for specific drivers except for a known exception. Tested on ChromeOS Trogdor(msm). Signed-off-by: Mark Yacoub <markyacoub@chromium.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2021-09-13tests/kms_addfb_basic: Skip basic-y-tiled-legacy on discreteAshutosh Dixit
The test will fail on discrete and needs to be skipped. Cc: Imre Deak <imre.deak@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2021-09-08tests/kms_addfb_basic: Skip tiling subtests on device without hw tilingVanshidhar Konda
Skip subtests that are testing interoperability of FB modifiers and hardware tiling if the device does not support HW tiling. v2: Don't skip basic-y-tiled-legacy even on platforms w/o fences (Imre) Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Vanshidhar Konda <vanshidhar.r.konda@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-09-01tests/kms_addfb_basic: Test addfb2 with DRM_FORMAT_C8 only if supported.Mark Yacoub
[Why] Some devices such as Trogdor do not support DRM_FORMAT_C8 pixel format. Skip any addfb2 test on such devices that is expected to succeed such as subtest size-max. [How] Only run the check on devices with DRM_FORMAT_C8 support Tested on ChromeOS Trogdor v1: Use igt_display_has_format_mod instead of checking for specific drivers. Signed-off-by: Mark Yacoub <markyacoub@chromium.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2021-07-15Nuke local versions of DRM_FORMAT and DRM_MODELucas De Marchi
Use the definition from kernel headers. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-07-15Remove local copies of I915 macrosLucas De Marchi
Just use the one from the kernel headers. Updated with: git grep -l LOCAL_I915 | \ xargs sed -i -e '/^#define LOCAL_I915/d' -e 's/LOCAL_\(I915[[:alnum:]_]*\)/\1/g' Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-07-15tests/kms_addfb_basic: pass the actual fd to gem_has_lmemMatthew Auld
Currently we pass the devid as if it were the fd, which doesn't work. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Cc: Latvala Petri <petri.latvala@intel.com> Cc: Michael J. Ruhl <michael.j.ruhl@intel.com> Reviewed-by: Ramalingam C <ramalingam.c@intel.com>
2021-07-02kms_addfb_basic: Check for AMDGPU and MSM bad pitch.Mark Yacoub
[Why] AMDGPU and MSM devices have a known errno when it fails coorectly for bad pitches. [How] Assert `errno` to `EINVAL` for both AMDGPU and MSM as well. Signed-off-by: Mark Yacoub <markyacoub@chromium.org> Reviewed-by: Arkadiusz Hiler <arek@hiler.eu>
2021-06-30tests/kms_addfb_basic: Add invalid buffer object test for discreteMohammed Khajapasha
Add invalid buffer object test case for discrete, to validate IOCTL_MODE_ADDFB2 ioctl for LMEM, the framebuffer backing gem objects should be from local memory for discrete. Cc: Latvala Petri <petri.latvala@intel.com> Cc: Michael J. Ruhl <michael.j.ruhl@intel.com> Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Acked-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2021-03-23tests/kms_addfb_basic: simplify addfb25_ytile testsJuha-Pekka Heikkila
use igt_display_has_format_mod(..) to test if tile supported or no. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-03-08tests/kms_addfb_basic:Added subtest descriptionArundhati Hagaragi
Added description for all subtests Signed-off-by: Arundhati Hagaragi <arundhati.hagaragi@intel.com> Cc: Laxminarayan Bharadiya, Pankaj<Pankaj.Laxminarayan.Bharadiya@intel.com> v2: Modified description to be more specific. (Pankaj) v3, v4: Modified description. (Pankaj) Reviewed-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
2020-11-18tests/kms_addfb_basic: add vendor-specific errno assertionsJeremy Cline
This adjusts the check on failed calls to DRM_IOCTL_MODE_ADDFB2 in various scenarios. According to the kernel's drm_mode_config_funcs.fb_create documentation, a negative return code is all that is required to signal failure, and different drivers return different errors in these scenarios. Particularly, Nouveau returns -ERANGE rather than -EINVAL in scenarios where the buffer is too small for the proposed configuration. In situations where Nouveau and Intel return codes diverge, split out the errno assertions into device-specific blocks. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Jeremy Cline <jcline@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2020-11-18tests/kms_addfb_basic: Mark Intel-only tests as suchJeremy Cline
Several tests in the addfb suite only apply to i915 devices. Mark them as such so these tests are skipped on non-Intel devices. Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Jeremy Cline <jcline@redhat.com>
2020-10-13tests/kms_addfb_basic: Renaming tests as legacy tilingSwati Sharma
Tests require legacy get_tiling/set_tiling API's. Renaming the subtest names to make it obvious that these are legacy-only tests. v2: Made test name consistent (Matt) v3: Changed test names in fastfeedback (Petri) Suggested-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Swati Sharma <swati2.sharma@intel.com> Acked-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-07-23tests/kms_addfb_basic: Require an intel card for tests using tilingMihail Atanassov
Not skipping the affected tests causes all the rest to fail on non-Intel drivers. Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com> Reviewed-by: Simon Ser <simon.ser@intel.com>
2019-07-22tests/fb/tgl: Yf tiling does not exist on gen-12Dhinakaran Pandiyan
Fix test to check for addfb failure instead. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-03-01tests/kms_addfb_basic: Check that only the owner can rmfbDaniel Vetter
Just realized we don't seem to have any testcase for this. Fill this gap asap! v2: Use igt_device_set/drop_master (Chris) v3: Use "" for local includes (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v1) Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2018-09-14igt/kms_addfb_basic: Skip if the KMS interface is not supportedChris Wilson
Some drivers and some hardware do not support KMS and so the addfb ioctls are expected to fail. However, since they are expected to fail with a specific errno (ENOTSUP) in the case KMS is not supported on the fd, we can check for that and skip the tests where they are not appropriate. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-09-06igt/kms_addfb_basic: Exercise legacy interface to addfb2Chris Wilson
The legacy interface passes in a single handle, and instead of providing the pixel_format fourcc, passes in a bpp/depth combination that the kernel translates into a fourcc. If that is an illegal combination, the kernel should be reporting EINVAL rather than pass an unknown framebuffer to the drivers. As the number of possible permutations of bpp/depth (both are strictly u32 parameters) is huge, we simply fuzz the interface for 1s. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-12-31igt/kms_addfb_basic: Try changing tiling on the framebuffer [addfb2]Chris Wilson
If we request the object to be tiled with the same tiling as it currently has, the kernel may spot the no-op and report success. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-30igt/kms_addfb_basic: Try changing tiling on the framebufferChris Wilson
If we request the object to be tiled with the same tiling as it currently has, the kernel may spot the no-op and report success. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-07tests/kms_addfb_basic: Add invalid tests to set fb propsDaniel Vetter
There's no properties on fb modeset objects, bug bugs in the kernel when trying to use those ioctls in such an invalid way. Cc: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-05-06tests/kms_addfb_basic: Move tiling tests into their own groupsTomeu Vizoso
So those subtests that require tiling don't cause unrelated subtests to be skipped. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-04-15tests/kms_addfb_basic: Set tiling in addfb25 subtestTomeu Vizoso
When moving the call to gem_set_tiling into the subtests, the one needed by addfb25-framebuffer-vs-set-tiling was left out. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2016-04-14tests: Open any driverTomeu Vizoso
For those tests that now pass on drivers other than i915, call drm_open_driver_master with DRIVER_ANY. Also do so from igt_enable_connectors. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-14kms_addfb_basic: Get intel gen from within subtestTomeu Vizoso
Because determining the Intel GFX generation requires a call to DRM_IOCTL_I915_GETPARAM, move the code that requires it to a subtest that can be skipped on drivers other than i915. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-14kms_addfb_basic: Move calls to gem_set_tiling to the subtestsTomeu Vizoso
So they don't cause unrelated subtests to be skipped when testing drivers other than i915. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-14kms_addfb_basic: Split tiling_tests offTomeu Vizoso
Move tests requiring tiled BOs to the end so they don't cause unrelated subtests to be skipped when testing drivers with only dumb buffer support. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-14kms_addfb_basic: move tiling functionality into each subtestTomeu Vizoso
Because calls to gem_set_tiling will cause the subtest to be skipped on drivers other than i915, move them to each subtest that needs them so the other subtests aren't skipped as well. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-14kms_addfb_basic: call igt_create_bo_with_dimensionsTomeu Vizoso
Many tests can do their work on drivers other than i915 and even with just dumb buffers, so call igt_create_bo_with_dimensions instead of gem_create which will paper out the differences and call the proper ioctls or cause the subtest to be skipped if that's not possible. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-11-16tests/kms_addfb_basic: Add clobbered-modifier subtestVille Syrjälä
Make sure the kernel doesn't clobber the modifiers when the user didn't pass any. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.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-09-08kms_addfb_basic: Require fb modifiers for unused field testsAnder Conselvan de Oliveira
The drm core doesn't check unused fields of ADDFB2 for pre-FB_MODIFIERS userspace, so use igt_require_fb_modifiers(). Also, the size of the ioctl changed with the addition of the modifiers, so it is necessary to use the LOCAL_ version of it, otherwise some data may get truncated. v2: Improve commit message. (Thomas) Remove one spurious change to use LOCAL_DRM_IOCTL_ADDFB2. (Thomas) Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> 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-08-14tests/kms_addfb: mark simple fb creation tests as basic v2Jesse Barnes
We should always be able to create simple and tiled objects. v2: make the whole test basic (Daniel) add to .gitignore Reviewed-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>