[igt-dev] [PATCH i-g-t v4 4/6] kms_writeback: Add writeback-check-output

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Mon Nov 12 08:53:58 UTC 2018


Op 09-11-18 om 16:09 schreef Brian Starkey:
> Hi,
>
> On Mon, Nov 05, 2018 at 10:16:14AM +0000, Liviu Dudau wrote:
>> From: Brian Starkey <brian.starkey at arm.com>
>>
>> Add a test which makes commits using the writeback connector, and
>> checks the output buffer hash to make sure it is/isn't written as
>> appropriate.
>>
>> Signed-off-by: Brian Starkey <brian.starkey at arm.com>
>> [rebased and addressed comments from Maarten]
>> Signed-off-by: Liviu Dudau <liviu.dudau at arm.com>
>>
>> ---
>> tests/kms_writeback.c | 127 ++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 127 insertions(+)
>>
>> diff --git a/tests/kms_writeback.c b/tests/kms_writeback.c
>> index 636777d0b..7cb65207e 100644
>> --- a/tests/kms_writeback.c
>> +++ b/tests/kms_writeback.c
>> @@ -30,6 +30,7 @@
>> #include "igt.h"
>> #include "igt_core.h"
>> #include "igt_fb.h"
>> +#include "sw_sync.h"
>>
>> static drmModePropertyBlobRes *get_writeback_formats_blob(igt_output_t *output)
>> {
>> @@ -221,6 +222,119 @@ static void writeback_fb_id(igt_output_t *output, igt_fb_t *valid_fb, igt_fb_t *
>> 	igt_assert(ret == 0);
>> }
>>
>> +static void fill_fb(igt_fb_t *fb, double color[3])
>> +{
>> +	cairo_t *cr = igt_get_cairo_ctx(fb->fd, fb);
>> +	igt_assert(cr);
>> +
>> +	igt_paint_color(cr, 0, 0, fb->width, fb->height,
>> +			color[0], color[1], color[2]);
>> +}
>> +
>> +static void get_and_wait_out_fence(igt_output_t *output)
>> +{
>> +	int ret;
>> +
>> +	igt_assert(output->writeback_out_fence_fd >= 0);
>> +
>> +	ret = sync_fence_wait(output->writeback_out_fence_fd, 1000);
>> +	igt_assert(ret == 0);
>> +	close(output->writeback_out_fence_fd);
> Setting to -1 could be helpful here too. Tracking down double-closed
> fds is always a pain.

I'm advertising keeping it open to keep the lifetime tracked by igt_display,
there's no point in handling it in the test unnecessarily. :)

We don't close them for crtc out fences either.

kms_atomic_transition.c:wait_for_transition()

In the same test, run_transition_test() TRANSITION_AFTER_FREE
does close it manaully, but it has to keep the fd after completion, to test
the fence is signaled as intended.

~Maarten



More information about the igt-dev mailing list