All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH 2/7] drm/i915: move sdvo TV clock computation to intel_sdvo.c
Date: Fri, 10 May 2013 14:13:34 +0300	[thread overview]
Message-ID: <87ehdf9jfl.fsf@intel.com> (raw)
In-Reply-To: <1367323306-13605-3-git-send-email-daniel.vetter@ffwll.ch>

On Tue, 30 Apr 2013, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> We have a very nice infrastructure for this now!
>
> Note that the multifunction sdvo support is pretty neatly broken: We
> completely ignore userspace's request for which connector to wire up
> with the encoder and just use whatever the last detect callback has
> seen.
>
> Not something I'll fix in this patch, but unfortunately something
> which is also broken in the DDI code ...
>
> v2: Don't call sdvo_tv_clock twice.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 30 ------------------------------
>  drivers/gpu/drm/i915/intel_sdvo.c    | 30 ++++++++++++++++++++++++++++++
>  2 files changed, 30 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 1128f83..f10f094 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -4286,30 +4286,6 @@ static int i9xx_get_refclk(struct drm_crtc *crtc, int num_connectors)
>  	return refclk;
>  }
>  
> -static void i9xx_adjust_sdvo_tv_clock(struct intel_crtc *crtc)
> -{
> -	unsigned dotclock = crtc->config.adjusted_mode.clock;
> -	struct dpll *clock = &crtc->config.dpll;
> -
> -	/* SDVO TV has fixed PLL values depend on its clock range,
> -	   this mirrors vbios setting. */
> -	if (dotclock >= 100000 && dotclock < 140500) {
> -		clock->p1 = 2;
> -		clock->p2 = 10;
> -		clock->n = 3;
> -		clock->m1 = 16;
> -		clock->m2 = 8;
> -	} else if (dotclock >= 140500 && dotclock <= 200000) {
> -		clock->p1 = 1;
> -		clock->p2 = 10;
> -		clock->n = 6;
> -		clock->m1 = 12;
> -		clock->m2 = 8;
> -	}
> -
> -	crtc->config.clock_set = true;
> -}
> -
>  static uint32_t pnv_dpll_compute_fp(struct dpll *dpll)
>  {
>  	return (1 << dpll->n) << 16 | dpll->m1 << 8 | dpll->m2;
> @@ -4926,9 +4902,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
>  		intel_crtc->config.dpll.p2 = clock.p2;
>  	}
>  
> -	if (is_sdvo && is_tv)
> -		i9xx_adjust_sdvo_tv_clock(intel_crtc);
> -
>  	if (IS_GEN2(dev))
>  		i8xx_update_pll(intel_crtc, adjusted_mode,
>  				has_reduced_clock ? &reduced_clock : NULL,
> @@ -5538,9 +5511,6 @@ static bool ironlake_compute_clocks(struct drm_crtc *crtc,
>  						     reduced_clock);
>  	}
>  
> -	if (is_sdvo && is_tv)
> -		i9xx_adjust_sdvo_tv_clock(to_intel_crtc(crtc));
> -

With this change, is_sdvo and is_tv are no longer used, and could be
dropped from the function. All the same,

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

>  	return true;
>  }
>  
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
> index d154284..f6bf9fc 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -1041,6 +1041,32 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,
>  	return true;
>  }
>  
> +static void i9xx_adjust_sdvo_tv_clock(struct intel_crtc_config *pipe_config)
> +{
> +	unsigned dotclock = pipe_config->adjusted_mode.clock;
> +	struct dpll *clock = &pipe_config->dpll;
> +
> +	/* SDVO TV has fixed PLL values depend on its clock range,
> +	   this mirrors vbios setting. */
> +	if (dotclock >= 100000 && dotclock < 140500) {
> +		clock->p1 = 2;
> +		clock->p2 = 10;
> +		clock->n = 3;
> +		clock->m1 = 16;
> +		clock->m2 = 8;
> +	} else if (dotclock >= 140500 && dotclock <= 200000) {
> +		clock->p1 = 1;
> +		clock->p2 = 10;
> +		clock->n = 6;
> +		clock->m1 = 12;
> +		clock->m2 = 8;
> +	} else {
> +		WARN(1, "SDVO TV clock out of range: %i\n", dotclock);
> +	}
> +
> +	pipe_config->clock_set = true;
> +}
> +
>  static bool intel_sdvo_compute_config(struct intel_encoder *encoder,
>  				      struct intel_crtc_config *pipe_config)
>  {
> @@ -1097,6 +1123,10 @@ static bool intel_sdvo_compute_config(struct intel_encoder *encoder,
>  	if (intel_sdvo->color_range)
>  		pipe_config->limited_color_range = true;
>  
> +	/* Clock computation needs to happen after pixel multiplier. */
> +	if (intel_sdvo->is_tv)
> +		i9xx_adjust_sdvo_tv_clock(pipe_config);
> +
>  	return true;
>  }
>  
> -- 
> 1.7.11.7
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2013-05-10 11:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-30 12:01 [PATCH 0/7] sdvo tv clock improvements + some random stuff Daniel Vetter
2013-04-30 12:01 ` [PATCH 1/7] drm/i915: simplify DP/DDI port width macros Daniel Vetter
2013-05-02 13:34   ` Paulo Zanoni
2013-05-02 14:51     ` Daniel Vetter
2013-05-02 17:38       ` Paulo Zanoni
2013-05-02 19:29         ` Daniel Vetter
2013-04-30 12:01 ` [PATCH 2/7] drm/i915: move sdvo TV clock computation to intel_sdvo.c Daniel Vetter
2013-05-10 11:13   ` Jani Nikula [this message]
2013-04-30 12:01 ` [PATCH 3/7] drm/i915: drop TVclock special casing on ilk+ Daniel Vetter
2013-05-10 11:18   ` Jani Nikula
2013-04-30 12:01 ` [PATCH 4/7] drm/i915: rip out TV-out lore Daniel Vetter
2013-05-10 11:34   ` Jani Nikula
2013-04-30 12:01 ` [PATCH 5/7] drm/i915: rip out now unused is_foo tracking from crtc code Daniel Vetter
2013-05-10 11:39   ` Jani Nikula
2013-04-30 12:01 ` [PATCH 6/7] drm/i915: make SDVO TV-out work for multifunction devices Daniel Vetter
2013-04-30 12:49   ` Chris Wilson
2013-04-30 13:10     ` Daniel Vetter
2013-05-06 13:36   ` Jani Nikula
2013-05-06 14:15     ` Daniel Vetter
2013-05-10 11:47   ` Jani Nikula
2013-04-30 12:01 ` [PATCH 7/7] drm/i915: rip out an unused lvds_reg variable Daniel Vetter
2013-05-10 11:42   ` Jani Nikula
2013-05-10 14:03     ` Daniel Vetter

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=87ehdf9jfl.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.