[Intel-gfx] [RFC PATCH 04/12] drm/i915/dsi: call wait_for_dsi_fifo_empty() for each dsi port

Shobhit Kumar shobhit.kumar at linux.intel.com
Thu Jan 22 02:55:33 PST 2015


On 01/16/2015 05:57 PM, Jani Nikula wrote:
> Add port parameter to wait_for_dsi_fifo_empty, and call it for each dsi
> port.
>
> We can now remove the transitional intel_dsi_pipe_to_port() function.
>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>

Reviewed-By: Shobhit Kumar <shobhit.kumar at intel.com>


> ---
>   drivers/gpu/drm/i915/intel_dsi.c | 17 ++++++++++-------
>   drivers/gpu/drm/i915/intel_dsi.h | 12 ------------
>   2 files changed, 10 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index e82cf5f65c9a..9b0eaa9db845 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -42,13 +42,11 @@ static const struct intel_dsi_device intel_dsi_devices[] = {
>   	},
>   };
>
> -static void wait_for_dsi_fifo_empty(struct intel_dsi *intel_dsi)
> +static void wait_for_dsi_fifo_empty(struct intel_dsi *intel_dsi, enum port port)
>   {
>   	struct drm_encoder *encoder = &intel_dsi->base.base;
>   	struct drm_device *dev = encoder->dev;
>   	struct drm_i915_private *dev_priv = dev->dev_private;
> -	struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
> -	enum port port = intel_dsi_pipe_to_port(intel_crtc->pipe);
>   	u32 mask;
>
>   	mask = LP_CTRL_FIFO_EMPTY | HS_CTRL_FIFO_EMPTY |
> @@ -230,7 +228,8 @@ static void intel_dsi_enable(struct intel_encoder *encoder)
>   		if (intel_dsi->dev.dev_ops->enable)
>   			intel_dsi->dev.dev_ops->enable(&intel_dsi->dev);
>
> -		wait_for_dsi_fifo_empty(intel_dsi);
> +		for_each_dsi_port(port, intel_dsi->ports)
> +			wait_for_dsi_fifo_empty(intel_dsi, port);
>
>   		intel_dsi_port_enable(encoder);
>   	}
> @@ -243,6 +242,7 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)
>   	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
>   	struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
>   	enum pipe pipe = intel_crtc->pipe;
> +	enum port port;
>   	u32 tmp;
>
>   	DRM_DEBUG_KMS("\n");
> @@ -272,7 +272,8 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)
>   	if (intel_dsi->dev.dev_ops->send_otp_cmds)
>   		intel_dsi->dev.dev_ops->send_otp_cmds(&intel_dsi->dev);
>
> -	wait_for_dsi_fifo_empty(intel_dsi);
> +	for_each_dsi_port(port, intel_dsi->ports)
> +		wait_for_dsi_fifo_empty(intel_dsi, port);
>
>   	/* Enable port in pre-enable phase itself because as per hw team
>   	 * recommendation, port should be enabled befor plane & pipe */
> @@ -315,7 +316,8 @@ static void intel_dsi_disable(struct intel_encoder *encoder)
>   	DRM_DEBUG_KMS("\n");
>
>   	if (is_vid_mode(intel_dsi)) {
> -		wait_for_dsi_fifo_empty(intel_dsi);
> +		for_each_dsi_port(port, intel_dsi->ports)
> +			wait_for_dsi_fifo_empty(intel_dsi, port);
>
>   		intel_dsi_port_disable(encoder);
>   		msleep(2);
> @@ -344,7 +346,8 @@ static void intel_dsi_disable(struct intel_encoder *encoder)
>   	if (intel_dsi->dev.dev_ops->disable)
>   		intel_dsi->dev.dev_ops->disable(&intel_dsi->dev);
>
> -	wait_for_dsi_fifo_empty(intel_dsi);
> +	for_each_dsi_port(port, intel_dsi->ports)
> +		wait_for_dsi_fifo_empty(intel_dsi, port);
>   }
>
>   static void intel_dsi_clear_device_ready(struct intel_encoder *encoder)
> diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
> index 8fe2064dd804..2bb8c46c7889 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.h
> +++ b/drivers/gpu/drm/i915/intel_dsi.h
> @@ -137,18 +137,6 @@ struct intel_dsi {
>   	u16 panel_pwr_cycle_delay;
>   };
>
> -/* XXX: Transitional before dual port configuration */
> -static inline enum port intel_dsi_pipe_to_port(enum pipe pipe)
> -{
> -	if (pipe == PIPE_A)
> -		return PORT_A;
> -	else if (pipe == PIPE_B)
> -		return PORT_C;
> -
> -	WARN(1, "DSI on pipe %c, assuming port C\n", pipe_name(pipe));
> -	return PORT_C;
> -}
> -
>   #define for_each_dsi_port(__port, __ports_mask) \
>   	for ((__port) = PORT_A; (__port) < I915_MAX_PORTS; (__port)++)	\
>   		if ((__ports_mask) & (1 << (__port)))
>


More information about the Intel-gfx mailing list