[igt-dev] [PATCH i-g-t 2/4] lib/kms: Reprobe connector state after disabling modest

Imre Deak imre.deak at intel.com
Thu Apr 2 14:53:52 UTC 2020


On Tue, Mar 31, 2020 at 03:38:55PM +0300, Arkadiusz Hiler wrote:
> With TypeC we don't always get hotplug events for a connector until the
> mode is disabled.
> 
> Cc: Imre Deak <imre.deak at intel.com>
> Issue: https://gitlab.freedesktop.org/drm/intel/issues/323
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>

Looks ok, on patches 1 and 2:
Reviewed-by: Imre Deak <imre.deak at intel.com>

> ---
>  lib/igt_kms.c | 27 +++++++++++++++++++--------
>  1 file changed, 19 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 796da1fb..b461818a 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -2040,7 +2040,6 @@ void igt_display_require(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
> @@ -2051,13 +2050,6 @@ void igt_display_require(igt_display_t *display, int drm_fd)
>  		output->display = display;
>  
>  		igt_output_refresh(output);
> -
> -		connector = output->config.connector;
> -		if (connector && (!connector->count_modes ||
> -		    connector->connection == DRM_MODE_UNKNOWNCONNECTION)) {
> -			output->force_reprobe = true;
> -			igt_output_refresh(output);
> -		}
>  	}
>  
>  	drmModeFreePlaneResources(plane_resources);
> @@ -2070,6 +2062,25 @@ void igt_display_require(igt_display_t *display, int drm_fd)
>  	igt_display_commit2(display,
>  			    display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
>  
> +	/*
> +	 * Let's reprobe all connectors to make sure we have up to date stete.
> +	 * Some connectors may require disabling modeset to be detected
> +	 * correctly.
> +	 */
> +	for (i = 0; i < display->n_outputs; i++) {
> +		igt_output_t *output = &display->outputs[i];
> +		drmModeConnector *connector;
> +
> +		igt_output_refresh(output);
> +
> +		connector = output->config.connector;
> +		if (connector && (!connector->count_modes ||
> +		    connector->connection == DRM_MODE_UNKNOWNCONNECTION)) {
> +			output->force_reprobe = true;
> +			igt_output_refresh(output);
> +		}
> +	}
> +
>  out:
>  	LOG_UNINDENT(display);
>  
> -- 
> 2.24.1
> 


More information about the igt-dev mailing list