Compare commits

...

2 Commits

Author SHA1 Message Date
Marius Vlad
e7ba07ca61 Merge branch 'wip/mvlad/drm-wb-outputs' into 'main'
tests/drm-writeback-screenshot-test: Grab the first available output

See merge request wayland/weston!1225
2024-06-25 22:09:00 +00:00
Marius Vlad
21980e88c1 tests/drm-writeback-screenshot-test: Grab the first available output
This is basically a small follow-up from commit
'drm-smoke-test: Explicitly set-up the output name DRM test' which did
the same thing.

With multiple virtual outputs in the system, we would override the output and
pick/use up the last one available, with the client placing the
window/surface on the first output. This would make things easier when
testing and transitioning to multiple virtual outputs.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-04-20 09:53:49 +03:00

View File

@ -88,12 +88,15 @@ TEST(drm_writeback_screenshot) {
char *fname;
bool match;
int frame;
struct output *first_available_output;
/* create client */
testlog("Creating client for test\n");
client = create_client_and_test_surface(100, 100, 100, 100);
assert(client);
surface = client->surface->wl_surface;
first_available_output = container_of(client->output_list.prev,
struct output, link);
/* move pointer away from image so it does not interfere with the
* comparison of the writeback screenshot with the reference image */
@ -110,7 +113,7 @@ TEST(drm_writeback_screenshot) {
/* take screenshot */
testlog("Taking a screenshot\n");
screenshot = client_capture_output(client, client->output,
screenshot = client_capture_output(client, first_available_output,
WESTON_CAPTURE_V1_SOURCE_WRITEBACK);
assert(screenshot);
buffer_destroy(screenshot);
@ -118,7 +121,7 @@ TEST(drm_writeback_screenshot) {
/* take another screenshot; this is important to ensure the
* writeback state machine is working correctly */
testlog("Taking another screenshot\n");
screenshot = client_capture_output(client, client->output,
screenshot = client_capture_output(client, first_available_output,
WESTON_CAPTURE_V1_SOURCE_WRITEBACK);
assert(screenshot);