Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: reuse the sdvo tv clock adjustment in ilk mode_set
@ 2012-05-30 12:52 Daniel Vetter
  2012-05-30 12:56 ` Chris Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2012-05-30 12:52 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Jesse extracted this nice helper in his i9xx_crtc_mode_set refactor,
but we have the identical code in ironlake_ccrtc_mode_set. And that
function is huge, so extracting some code full of magic numbers is
always nice.

Noticed while trying to get a handle on our dp clock code.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_display.c |   23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 9147894..e483148 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4405,25 +4405,10 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
 						    &clock,
 						    &reduced_clock);
 	}
-	/* SDVO TV has fixed PLL values depend on its clock range,
-	   this mirrors vbios setting. */
-	if (is_sdvo && is_tv) {
-		if (adjusted_mode->clock >= 100000
-		    && adjusted_mode->clock < 140500) {
-			clock.p1 = 2;
-			clock.p2 = 10;
-			clock.n = 3;
-			clock.m1 = 16;
-			clock.m2 = 8;
-		} else if (adjusted_mode->clock >= 140500
-			   && adjusted_mode->clock <= 200000) {
-			clock.p1 = 1;
-			clock.p2 = 10;
-			clock.n = 6;
-			clock.m1 = 12;
-			clock.m2 = 8;
-		}
-	}
+
+	if (is_sdvo && is_tv)
+		i9xx_adjust_sdvo_tv_clock(adjusted_mode, &clock);
+
 
 	/* FDI link */
 	pixel_multiplier = intel_mode_get_pixel_multiplier(adjusted_mode);
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: reuse the sdvo tv clock adjustment in ilk mode_set
  2012-05-30 12:52 [PATCH] drm/i915: reuse the sdvo tv clock adjustment in ilk mode_set Daniel Vetter
@ 2012-05-30 12:56 ` Chris Wilson
  2012-05-31  7:31   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2012-05-30 12:56 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

On Wed, 30 May 2012 14:52:26 +0200, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Jesse extracted this nice helper in his i9xx_crtc_mode_set refactor,
> but we have the identical code in ironlake_ccrtc_mode_set. And that
> function is huge, so extracting some code full of magic numbers is
> always nice.
> 
> Noticed while trying to get a handle on our dp clock code.
> 
> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: reuse the sdvo tv clock adjustment in ilk mode_set
  2012-05-30 12:56 ` Chris Wilson
@ 2012-05-31  7:31   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2012-05-31  7:31 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, Intel Graphics Development

On Wed, May 30, 2012 at 01:56:01PM +0100, Chris Wilson wrote:
> On Wed, 30 May 2012 14:52:26 +0200, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > Jesse extracted this nice helper in his i9xx_crtc_mode_set refactor,
> > but we have the identical code in ironlake_ccrtc_mode_set. And that
> > function is huge, so extracting some code full of magic numbers is
> > always nice.
> > 
> > Noticed while trying to get a handle on our dp clock code.
> > 
> > Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Queued for -next, thanks for the review.
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-31  7:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 12:52 [PATCH] drm/i915: reuse the sdvo tv clock adjustment in ilk mode_set Daniel Vetter
2012-05-30 12:56 ` Chris Wilson
2012-05-31  7:31   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox