Commit graph

26 commits

Author SHA1 Message Date
Simon Ser
c63676eda7 test: add silent mode to libdrm_mock
Useful for benchmarks.
2024-05-21 10:25:35 +02:00
Simon Ser
ce325b1ee6 Turn on -Wsign-conversion
References: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/74
2023-02-16 21:33:36 +01:00
Simon Ser
94f45a91c4 test: add liftoff_mock_plane_add_in_formats() 2023-02-15 19:19:24 +01:00
Simon Ser
8a9167f9fd test/libdrm_mock: add stub blob functions 2023-02-15 19:12:46 +01:00
Simon Ser
0811ce855b test/libdrm_mock: take initial prop value as separate arg
drmModePropertyRes.values never holds the current value. Stop
abusing this field.
2023-02-15 18:39:57 +01:00
Simon Ser
3e72fc3c5d test/libdrm_mock: add liftoff_mock_plane_get_id()
Useful when manually calling liftoff_plane_create() is desirable.
2023-02-15 18:20:23 +01:00
Simon Ser
a669c85be6 test/libdrm_mock: implement drmCloseBufferHandle() stub 2023-02-15 18:14:13 +01:00
Simon Ser
e03edeffba test/libdrm_mock: implement drmModeGetFB2()
By default, drmModeGetFB2() behaves as-if the kernel didn't support
the IOCTL. That way we don't need to update all tests to set sensible
FB info.

If a test is specifically interested in testing drmModeGetFB2()
behavior, it can call liftoff_mock_drm_set_fb_info().
2023-02-15 18:14:13 +01:00
Simon Ser
d39d1837fb test/libdrm_mock: add helpers to convert from/to object index
libdrm_mock's KMS object IDs record the type and index.
2023-02-15 17:56:50 +01:00
Simon Ser
32683879e7 Add newline after function return type
Aligns our style with Linux' and Weston's.
2021-08-13 22:02:33 +02:00
Simon Ser
8a971695bd test: introduce liftoff_mock_require_primary_plane
This allows to mimick i915's requirement of failing all commits
which don't have the primary plane enabled.

We could expand our test matrix to test with the param *and* without
it, but since enabling the param just makes the atomic check more
strict there's no real benefit of doing that. Enabling the param
can only make tests fail more often, not the other way around.
2021-08-13 12:28:13 +02:00
Simon Ser
eaf52b49fc
test: add test with immutable zpos plane props
Closes: https://github.com/emersion/libliftoff/issues/50
2020-12-05 18:52:52 +01:00
Simon Ser
46095c6428
test/libdrm_mock: add prefix to logs
Allows to easily tell where they're coming from.
2020-05-26 18:55:47 +02:00
Simon Ser
6d4e22a5f8
test: a test-only commit doesn't apply properties
This fixes a misunderstanding of the DRM API. Only a regular commit applies
properties.

Fixes: b16078769e ("test/libdrm_mock: a test-only commit applies properties")
2020-05-26 18:49:04 +02:00
Simon Ser
c214afa3ee
test: allow to attach props to mock planes
This allows tests to have planes which have additional properties, like
"alpha".
2020-05-22 17:39:56 +02:00
Simon Ser
7cca504ae6
test: add internal mutable prop list
This will allow tests to register their own properties.
2020-05-22 17:39:33 +02:00
Simon Ser
2b02f50553
Replace assert(0) with abort()
This avoids -Wreturn-type warnings.
2020-05-19 12:10:17 +02:00
Simon Ser
b16078769e
test/libdrm_mock: a test-only commit applies properties
The previous mock library assumed the DRM client would always set all
properties in the atomic request. However, if a previous test-only commit
has set a property, there's no need to set it again.

Accomodate for this in libdrm_mock. This will be useful when we'll skip
setting properties that haven't changed in libliftoff.

References: https://github.com/emersion/libliftoff/issues/37
2020-01-13 12:14:33 +01:00
Simon Ser
333e454e98
test: make mock drmModeAtomicAddProperty return cursor
For consistency with the original libdrm function.
2019-11-29 11:06:57 +01:00
Simon Ser
d51e2fb2fe
test/libdrm_mock: bump resource limitations
Bump the maximum number of layers and properties to allow more aggressive
benchmarking.
2019-10-30 21:16:42 +01:00
Simon Ser
ca0cbbee02
test: add liftoff_mock_commit_count
This allows tests to read the number of atomic commits performed by the library.
2019-10-14 18:44:48 +03:00
Simon Ser
d9024483c8
test: make our mock drmModeAtomicReq support more properties
We are hitting the 64 properties limit in some new tests.
2019-09-14 20:59:11 +03:00
Simon Ser
060023c6f1
test: fix atomic commit layer compatibility
Used wrong index while iterating.
2019-09-13 22:34:34 +03:00
Simon Ser
54bb501cae
test: add liftoff_mock_drm_get_plane
Allows to get a mock plane from a plane ID.
2019-09-13 19:46:21 +03:00
Simon Ser
1cd18f9156
test: mock atomic commit improvements
Don't fail the commit if FB_ID and CRTC_ID are set to zero. Print the reason
why the commit fails.
2019-09-13 19:44:12 +03:00
Simon Ser
5afeeb531a
Add test framework
When testing the library, the libdrm dependency is swapped with a mock libdrm.
The test sets up the mock libdrm's internal state and then runs the test.
2019-09-13 10:33:49 +03:00