[igt-dev] [PATCH i-g-t] lib/igt_kms: Handle outputs with no modes better

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Wed Apr 11 07:47:31 UTC 2018


Op 10-04-18 om 13:50 schreef Lofstedt, Marta:
> Reviewed-by: Marta Lofstedt <marta.lofstedt at intel.com>
>
>> -----Original Message-----
>> From: igt-dev [mailto:igt-dev-bounces at lists.freedesktop.org] On Behalf Of
>> Maarten Lankhorst
>> Sent: Friday, April 6, 2018 2:07 PM
>> To: igt-dev at lists.freedesktop.org
>> Subject: [igt-dev] [PATCH i-g-t] lib/igt_kms: Handle outputs with no modes
>> better
>>
>> Pretend that outputs without modes are disabled, and try reprobing if no
>> modes are initially detected, just in case that the reprobe will find modes.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105798
>> ---
>>  lib/igt_kms.c | 13 ++++++++-----
>>  lib/igt_kms.h |  3 ++-
>>  2 files changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 19d650a8dcf8..4b25f8361a42
>> 100644
>> --- a/lib/igt_kms.c
>> +++ b/lib/igt_kms.c
>> @@ -1033,9 +1033,10 @@ static bool _kmstest_connector_config(int
>> drm_fd, uint32_t connector_id,
>>  		goto err2;
>>
>>  	if (!connector->count_modes) {
>> -		igt_warn("connector %d/%s-%d has no
>> modes\n", connector_id,
>> -
>> kmstest_connector_type_str(connector->connector_type),
>> -			 connector->connector_type_id);
>> +		if (probe)
>> +			igt_warn("connector %d/%s-%d
>> has no modes\n", connector_id,
>> +
>> 	kmstest_connector_type_str(connector->connector_type),
>> +				connector-
>>> connector_type_id);
>>  		goto err2;
>>  	}
>>
>> @@ -1950,6 +1951,7 @@ void igt_display_init(igt_display_t *display, int
>> drm_fd)
>>
>>  	for (i = 0; i < display->n_outputs; i++) {
>>  		igt_output_t *output = &display->outputs[i];
>> +		drmModeConnector *connector;
>>
>>  		/*
>>  		 * We don't assign each output a pipe unless
>> @@ -1961,8 +1963,9 @@ void igt_display_init(igt_display_t *display, int
>> drm_fd)
>>
>>  		igt_output_refresh(output);
>>
>> -		if (output->config.connector &&
>> -		    output->config.connector->connection ==
>> DRM_MODE_UNKNOWNCONNECTION) {
>> +		connector = output->config.connector;
>> +		if (connector && (!connector->count_modes ||
>> +		    connector->connection ==
>> DRM_MODE_UNKNOWNCONNECTION)) {
>>  			output->force_reprobe = true;
>>  			igt_output_refresh(output);
>>  		}
>> diff --git a/lib/igt_kms.h b/lib/igt_kms.h index b37370a0b05e..0e75d0c9e6b9
>> 100644
>> --- a/lib/igt_kms.h
>> +++ b/lib/igt_kms.h
>> @@ -411,7 +411,8 @@ void igt_wait_for_vblank_count(int drm_fd, enum
>> pipe pipe, int count);  static inline bool
>> igt_output_is_connected(igt_output_t *output)  {
>>  	/* Something went wrong during probe? */
>> -	if (!output->config.connector)
>> +	if (!output->config.connector ||
>> +	    !output->config.connector->count_modes)
>>  		return false;
>>
>>  	if (output->config.connector->connection ==
>> DRM_MODE_CONNECTED)
>> --
>> 2.16.3
>>
>> _______________________________________________
>> igt-dev mailing list
>> igt-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/igt-dev

Thanks for review, pushed.



More information about the igt-dev mailing list