[igt-dev] [PATCH i-g-t] lib/igt_debugfs: explicitly wait for first crc in igt_pipe_crc_start

Kumar, Mahesh mahesh1.kumar at intel.com
Wed Aug 8 15:20:09 UTC 2018


Hi,


On 8/8/2018 7:34 PM, Maarten Lankhorst wrote:
> Op 08-08-18 om 15:17 schreef Mahesh Kumar:
>> Now crc framework does not wait for first CRC during open, User need
>> to wait for crc if he wants so.
>> This patch make changes in igt_pipe_crc_start to make sure we wait
>> for first crc after open to keep the tests behaviour same.
>> Without this if driver is skipping few initial crcs there will be
>> mismatch in expected and actual number of crcs returned by crc
>> framework.
>>
>> Signed-off-by: Mahesh Kumar <mahesh1.kumar at intel.com>
>> ---
>>   lib/igt_debugfs.c | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
>> index f3196f43..f4c388bf 100644
>> --- a/lib/igt_debugfs.c
>> +++ b/lib/igt_debugfs.c
>> @@ -748,6 +748,7 @@ static void read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
>>   void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
>>   {
>>   	const char *src = pipe_crc_source_name(pipe_crc->source);
>> +	igt_crc_t first_crc;
>>   	char buf[32];
>>   
>>   	/* Stop first just to make sure we don't have lingering state left. */
>> @@ -757,11 +758,13 @@ void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
>>   
>>   	sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
>>   
>> -	igt_set_timeout(10, "Opening crc fd, which waits for first CRC.");
>> +	igt_set_timeout(10, "Opening crc fd, and wait for first CRC.");
>>   	pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc->flags);
>> +	igt_assert(pipe_crc->crc_fd != -1);
>> +	read_one_crc(pipe_crc, &first_crc);
>> +
>>   	igt_reset_timeout();
>>   
>> -	igt_assert(pipe_crc->crc_fd != -1);
>>   	errno = 0;
>>   }
>>   
> Could you use poll() for the first CRC instead?
Thank for review,
sure, sounds good to me, even it'll avoid loosing first CRC. Will make 
changes
-Mahesh
> ~Maarten
>



More information about the igt-dev mailing list