[igt-dev] [i-g-t] lib/igt_kms: New api to iterate over all outputs

Modem, Bhanuprakash bhanuprakash.modem at intel.com
Fri Sep 30 09:01:10 UTC 2022


On Fri-30-09-2022 02:14 pm, Petri Latvala wrote:
> On Thu, Sep 29, 2022 at 08:00:18PM +0530, Bhanuprakash Modem wrote:
>> Few KMS tests are trying to run on all outputs irrespective of
> 
> Make this "A few" instead. English is funky.
> 
> (A few = some, whereas few = not many, emphasis on the amount being
> really small)

Thanks Petri,

:-) I'll fix this in next rev.

> 
> 
> 
>> their connection status. So add a new helper to iterate over all
>> outputs.
>>
>> Cc: Petri Latvala <petri.latvala at intel.com>
>> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
>> ---
>>   lib/igt_kms.h | 18 ++++++++++++++----
>>   1 file changed, 14 insertions(+), 4 deletions(-)
>>
>> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
>> index 3d78c37f..e0786aad 100644
>> --- a/lib/igt_kms.h
>> +++ b/lib/igt_kms.h
>> @@ -544,16 +544,26 @@ static inline bool igt_output_is_connected(igt_output_t *output)
>>   #define for_each_if(condition) if (!(condition)) {} else
>>   
>>   /**
>> - * for_each_connected_output:
>> + * for_each_output:
>>    * @display: a pointer to an #igt_display_t structure
>>    * @output: The output to iterate.
>>    *
>>    * This for loop iterates over all outputs.
>>    */
>> -#define for_each_connected_output(display, output)		\
>> +#define for_each_output(display, output)		\
>>   	for (int i__ = 0;  assert(igt_can_fail()), i__ < (display)->n_outputs; i__++)	\
>> -		for_each_if ((((output) = &(display)->outputs[i__]), \
>> -			      igt_output_is_connected((output))))
>> +		for_each_if (((output) = (&(display)->outputs[i__])))
>> +
>> +/**
>> + * for_each_connected_output:
>> + * @display: a pointer to an #igt_display_t structure
>> + * @output: The output to iterate.
>> + *
>> + * This for loop iterates over all connected outputs.
>> + */
>> +#define for_each_connected_output(display, output)		\
>> +	for_each_output((display), (output))	\
>> +		for_each_if ((igt_output_is_connected((output))))
>>   
> 
> Ah, misunderstood the purpose on that other patch. Fair enough.

hmm, I think we need one more helper to iterate over all disconnected 
outputs.

- Bhanu

> 
> With the commit message change from above,
> Reviewed-by: Petri Latvala <petri.latvala at intel.com>
> 
> 
>>   /**
>>    * for_each_pipe_static:
>> -- 
>> 2.37.3
>>



More information about the igt-dev mailing list