All of lore.kernel.org
 help / color / mirror / Atom feed
From: Madhav Chauhan <madhav.chauhan@intel.com>
To: Jani Nikula <jani.nikula@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v9 08/15] drm/i915/icl: Consider DSI for getting transcoder state
Date: Fri, 2 Nov 2018 13:23:33 +0530	[thread overview]
Message-ID: <9090773a-7106-ad14-3a3b-02d21e9742f2@intel.com> (raw)
In-Reply-To: <64587139b36e9b95861a8c7e1920ca11220a406e.1541086315.git.jani.nikula@intel.com>

On 11/1/2018 9:04 PM, Jani Nikula wrote:
> From: Madhav Chauhan <madhav.chauhan@intel.com>
>
> For Gen11 DSI, we use similar registers like for eDP
> to find if DSI encoder is connected or not to a pipe.
> This patch refactors existing hsw_get_transcoder_state()
> to handle this.
>
> v2 by Jani:
>   - Add WARN_ON(dsi && edp) (Ville)

v2 changes looks fine to me.

Regards,
Madhav

>
> Signed-off-by: Madhav Chauhan <madhav.chauhan@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_display.c | 31 ++++++++++++++++++++++++-------
>   1 file changed, 24 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 2d5d034baa91..7337d579cbb6 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9366,6 +9366,8 @@ static bool hsw_get_transcoder_state(struct intel_crtc *crtc,
>   	struct drm_i915_private *dev_priv = to_i915(dev);
>   	enum intel_display_power_domain power_domain;
>   	u32 tmp;
> +	bool is_dsi = false;
> +	bool is_edp = false;
>   
>   	/*
>   	 * The pipe->transcoder mapping is fixed with the exception of the eDP
> @@ -9378,26 +9380,41 @@ static bool hsw_get_transcoder_state(struct intel_crtc *crtc,
>   	 * consistency and less surprising code; it's in always on power).
>   	 */
>   	tmp = I915_READ(TRANS_DDI_FUNC_CTL(TRANSCODER_EDP));
> -	if (tmp & TRANS_DDI_FUNC_ENABLE) {
> -		enum pipe trans_edp_pipe;
> +	if (tmp & TRANS_DDI_FUNC_ENABLE)
> +		is_edp = true;
> +
> +	if (IS_ICELAKE(dev_priv)) {
> +		tmp = I915_READ(TRANS_DDI_FUNC_CTL(TRANSCODER_DSI_0));
> +		if (tmp & TRANS_DDI_FUNC_ENABLE)
> +			is_dsi = true;
> +	}
> +
> +	WARN_ON(is_edp && is_dsi);
> +
> +	if (is_edp || is_dsi) {
> +		enum pipe trans_pipe;
>   		switch (tmp & TRANS_DDI_EDP_INPUT_MASK) {
>   		default:
>   			WARN(1, "unknown pipe linked to edp transcoder\n");
>   			/* fall through */
>   		case TRANS_DDI_EDP_INPUT_A_ONOFF:
>   		case TRANS_DDI_EDP_INPUT_A_ON:
> -			trans_edp_pipe = PIPE_A;
> +			trans_pipe = PIPE_A;
>   			break;
>   		case TRANS_DDI_EDP_INPUT_B_ONOFF:
> -			trans_edp_pipe = PIPE_B;
> +			trans_pipe = PIPE_B;
>   			break;
>   		case TRANS_DDI_EDP_INPUT_C_ONOFF:
> -			trans_edp_pipe = PIPE_C;
> +			trans_pipe = PIPE_C;
>   			break;
>   		}
>   
> -		if (trans_edp_pipe == crtc->pipe)
> -			pipe_config->cpu_transcoder = TRANSCODER_EDP;
> +		if (trans_pipe == crtc->pipe) {
> +			if (is_edp)
> +				pipe_config->cpu_transcoder = TRANSCODER_EDP;
> +			else if (is_dsi)
> +				pipe_config->cpu_transcoder = TRANSCODER_DSI_0;
> +		}
>   	}
>   
>   	power_domain = POWER_DOMAIN_TRANSCODER(pipe_config->cpu_transcoder);

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-11-02  7:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01 15:33 [PATCH v9 00/15] drm/i915/icl: dsi enabling Jani Nikula
2018-11-01 15:33 ` [PATCH v9 01/15] drm/i915/icl: Allocate DSI encoder/connector Jani Nikula
2018-11-02  6:45   ` Madhav Chauhan
2018-11-01 15:33 ` [PATCH v9 02/15] drm/i915/icl: Fill DSI ports info Jani Nikula
2018-11-01 15:33 ` [PATCH v9 03/15] drm/i915/icl: Allocate DSI hosts and imlement host transfer Jani Nikula
2018-11-02  6:49   ` Madhav Chauhan
2018-11-01 15:33 ` [PATCH v9 04/15] drm/i915/icl: Add get config functionality for DSI Jani Nikula
2018-11-02  6:43   ` Kulkarni, Vandita
2018-11-02 10:55     ` Jani Nikula
2018-11-01 15:33 ` [PATCH v9 05/15] drm/i915/icl: Get HW state for DSI encoder Jani Nikula
2018-11-01 17:02   ` Imre Deak
2018-11-01 15:34 ` [PATCH v9 06/15] drm/i915/icl: Add DSI encoder remaining functions Jani Nikula
2018-11-01 15:34 ` [PATCH v9 07/15] drm/i915/icl: Configure DSI Dual link mode Jani Nikula
2018-11-01 15:34 ` [PATCH v9 08/15] drm/i915/icl: Consider DSI for getting transcoder state Jani Nikula
2018-11-02  7:53   ` Madhav Chauhan [this message]
2018-11-01 15:34 ` [PATCH v9 09/15] drm/i915/icl: Get pipe timings for DSI Jani Nikula
2018-11-02  7:54   ` Madhav Chauhan
2018-11-01 15:34 ` [PATCH v9 10/15] drm/i915/icl: Define missing bitfield for shortplug reg Jani Nikula
2018-11-01 15:34 ` [PATCH v9 11/15] drm/i915/icl: Define Panel power ctrl register Jani Nikula
2018-11-01 15:34 ` [PATCH v9 12/15] drm/i915/icl: Define display GPIO pins for DSI Jani Nikula
2018-11-01 15:34 ` [PATCH v9 13/15] drm/i915/icl: add dummy DSI GPIO element execution function Jani Nikula
2018-11-01 15:34 ` [PATCH v9 14/15] HACK: drm/i915/icl: Add changes to program DSI panel GPIOs Jani Nikula
2018-11-01 15:34 ` [PATCH v9 15/15] HACK: drm/i915/icl: Configure backlight functions for DSI Jani Nikula
2018-11-01 15:37 ` [PATCH v9 00/15] drm/i915/icl: dsi enabling Jani Nikula
2018-11-01 16:44 ` ✗ Fi.CI.BAT: failure for drm/i915/icl: dsi enabling (rev4) 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=9090773a-7106-ad14-3a3b-02d21e9742f2@intel.com \
    --to=madhav.chauhan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.