Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Vandita Kulkarni <vandita.kulkarni@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/tgl: Do not read the transcoder register for mipi dsi
Date: Mon, 11 Nov 2019 13:48:42 +0200	[thread overview]
Message-ID: <87woc64orp.fsf@intel.com> (raw)
In-Reply-To: <20191111105207.7583-1-vandita.kulkarni@intel.com>

On Mon, 11 Nov 2019, Vandita Kulkarni <vandita.kulkarni@intel.com> wrote:
> As per the Bspec the port mapping is fixed for mipi dsi

The "tgl" in the patch subject is slightly confusing, because this isn't
new to tgl.

>
> Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 27 ++++++++++++++++----
>  1 file changed, 22 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index f1328c08f4ad..d4a8617d6185 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -10397,21 +10397,38 @@ static bool bxt_get_dsi_transcoder_state(struct intel_crtc *crtc,
>  	return transcoder_is_dsi(pipe_config->cpu_transcoder);
>  }
>  
> -static void haswell_get_ddi_port_state(struct intel_crtc *crtc,
> -				       struct intel_crtc_state *pipe_config)
> +static enum port
> +intel_transcoder_to_port(struct drm_i915_private *dev_priv,
> +			  enum transcoder cpu_transcoder)

This is also confusing naming because this is definitely not universal
across platforms.

>  {
> -	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> -	struct intel_shared_dpll *pll;
>  	enum port port;
>  	u32 tmp;
>  
> -	tmp = I915_READ(TRANS_DDI_FUNC_CTL(pipe_config->cpu_transcoder));
> +	/* DSI transcoders have fixed ddi mapping*/
> +	if (transcoder_is_dsi(cpu_transcoder)) {
> +		port = (cpu_transcoder == TRANSCODER_DSI_A) ? PORT_A : PORT_B;
> +		return port;
> +	}

I think I'd just add that in the existing haswell_get_ddi_port_state()
without another function.

        if (dsi) {
        } else {

        do the below
>  
> +	tmp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder));
>  	if (INTEL_GEN(dev_priv) >= 12)
>  		port = TGL_TRANS_DDI_FUNC_CTL_VAL_TO_PORT(tmp);
>  	else
>  		port = TRANS_DDI_FUNC_CTL_VAL_TO_PORT(tmp);
>  
> +	return port;
> +}
> +
> +static void haswell_get_ddi_port_state(struct intel_crtc *crtc,
> +				       struct intel_crtc_state *pipe_config)
> +{
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	struct intel_shared_dpll *pll;
> +	enum port port;
> +	u32 tmp;
> +
> +	port = intel_transcoder_to_port(dev_priv, pipe_config->cpu_transcoder);
> +
>  	if (INTEL_GEN(dev_priv) >= 11)
>  		icelake_get_ddi_pll(dev_priv, port, pipe_config);
>  	else if (IS_CANNONLAKE(dev_priv))

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@intel.com>
To: Vandita Kulkarni <vandita.kulkarni@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/tgl: Do not read the transcoder register for mipi dsi
Date: Mon, 11 Nov 2019 13:48:42 +0200	[thread overview]
Message-ID: <87woc64orp.fsf@intel.com> (raw)
Message-ID: <20191111114842.qnVyG8yiiFnskFzTXFVv3BqqNvUFXU2yAF50FS0rcko@z> (raw)
In-Reply-To: <20191111105207.7583-1-vandita.kulkarni@intel.com>

On Mon, 11 Nov 2019, Vandita Kulkarni <vandita.kulkarni@intel.com> wrote:
> As per the Bspec the port mapping is fixed for mipi dsi

The "tgl" in the patch subject is slightly confusing, because this isn't
new to tgl.

>
> Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 27 ++++++++++++++++----
>  1 file changed, 22 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index f1328c08f4ad..d4a8617d6185 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -10397,21 +10397,38 @@ static bool bxt_get_dsi_transcoder_state(struct intel_crtc *crtc,
>  	return transcoder_is_dsi(pipe_config->cpu_transcoder);
>  }
>  
> -static void haswell_get_ddi_port_state(struct intel_crtc *crtc,
> -				       struct intel_crtc_state *pipe_config)
> +static enum port
> +intel_transcoder_to_port(struct drm_i915_private *dev_priv,
> +			  enum transcoder cpu_transcoder)

This is also confusing naming because this is definitely not universal
across platforms.

>  {
> -	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> -	struct intel_shared_dpll *pll;
>  	enum port port;
>  	u32 tmp;
>  
> -	tmp = I915_READ(TRANS_DDI_FUNC_CTL(pipe_config->cpu_transcoder));
> +	/* DSI transcoders have fixed ddi mapping*/
> +	if (transcoder_is_dsi(cpu_transcoder)) {
> +		port = (cpu_transcoder == TRANSCODER_DSI_A) ? PORT_A : PORT_B;
> +		return port;
> +	}

I think I'd just add that in the existing haswell_get_ddi_port_state()
without another function.

        if (dsi) {
        } else {

        do the below
>  
> +	tmp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder));
>  	if (INTEL_GEN(dev_priv) >= 12)
>  		port = TGL_TRANS_DDI_FUNC_CTL_VAL_TO_PORT(tmp);
>  	else
>  		port = TRANS_DDI_FUNC_CTL_VAL_TO_PORT(tmp);
>  
> +	return port;
> +}
> +
> +static void haswell_get_ddi_port_state(struct intel_crtc *crtc,
> +				       struct intel_crtc_state *pipe_config)
> +{
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	struct intel_shared_dpll *pll;
> +	enum port port;
> +	u32 tmp;
> +
> +	port = intel_transcoder_to_port(dev_priv, pipe_config->cpu_transcoder);
> +
>  	if (INTEL_GEN(dev_priv) >= 11)
>  		icelake_get_ddi_pll(dev_priv, port, pipe_config);
>  	else if (IS_CANNONLAKE(dev_priv))

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-11-11 11:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11 10:52 [PATCH] drm/i915/tgl: Do not read the transcoder register for mipi dsi Vandita Kulkarni
2019-11-11 10:52 ` [Intel-gfx] " Vandita Kulkarni
2019-11-11 11:48 ` Jani Nikula [this message]
2019-11-11 11:48   ` Jani Nikula
2019-11-11 16:28 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-11-11 16:28   ` [Intel-gfx] " Patchwork
2019-11-11 16:52 ` ✓ Fi.CI.BAT: success " Patchwork
2019-11-11 16:52   ` [Intel-gfx] " Patchwork
2019-11-12  4:35 ` ✓ Fi.CI.IGT: " Patchwork
2019-11-12  4:35   ` [Intel-gfx] " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87woc64orp.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vandita.kulkarni@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox