aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-07 15:54:59 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-10 18:13:51 -0400
commit021357acc8ea85273a9882b3fe89935629f51b12 (patch)
tree0b3203f90289d2f7e31b299d6804a8aa61fe407d /drivers/gpu/drm/i915
parent8c4223bee91b771782f2ec07f2c85d81cdff3ed5 (diff)
drm/i915: Use the real FDI frequency for determining b/w
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h1
-rw-r--r--drivers/gpu/drm/i915/intel_display.c17
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h3
3 files changed, 20 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index d0b4b2375d5..fbf58e0f258 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -2398,6 +2398,7 @@
2398#define RR_HW_HIGH_POWER_FRAMES_MASK 0xff00 2398#define RR_HW_HIGH_POWER_FRAMES_MASK 0xff00
2399 2399
2400#define FDI_PLL_BIOS_0 0x46000 2400#define FDI_PLL_BIOS_0 0x46000
2401#define FDI_PLL_FB_CLOCK_MASK 0xff
2401#define FDI_PLL_BIOS_1 0x46004 2402#define FDI_PLL_BIOS_1 0x46004
2402#define FDI_PLL_BIOS_2 0x46008 2403#define FDI_PLL_BIOS_2 0x46008
2403#define DISPLAY_PORT_PLL_BIOS_0 0x4600c 2404#define DISPLAY_PORT_PLL_BIOS_0 0x4600c
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index df410e4827e..5279b0c88e9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -342,6 +342,13 @@ static bool
342intel_find_pll_ironlake_dp(const intel_limit_t *, struct drm_crtc *crtc, 342intel_find_pll_ironlake_dp(const intel_limit_t *, struct drm_crtc *crtc,
343 int target, int refclk, intel_clock_t *best_clock); 343 int target, int refclk, intel_clock_t *best_clock);
344 344
345static inline u32 /* units of 100MHz */
346intel_fdi_link_freq(struct drm_device *dev)
347{
348 struct drm_i915_private *dev_priv = dev->dev_private;
349 return (I915_READ(FDI_PLL_BIOS_0) & FDI_PLL_FB_CLOCK_MASK) + 2;
350}
351
345static const intel_limit_t intel_limits_i8xx_dvo = { 352static const intel_limit_t intel_limits_i8xx_dvo = {
346 .dot = { .min = I8XX_DOT_MIN, .max = I8XX_DOT_MAX }, 353 .dot = { .min = I8XX_DOT_MIN, .max = I8XX_DOT_MAX },
347 .vco = { .min = I8XX_VCO_MIN, .max = I8XX_VCO_MAX }, 354 .vco = { .min = I8XX_VCO_MIN, .max = I8XX_VCO_MAX },
@@ -3767,7 +3774,15 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
3767 target_clock = mode->clock; 3774 target_clock = mode->clock;
3768 else 3775 else
3769 target_clock = adjusted_mode->clock; 3776 target_clock = adjusted_mode->clock;
3770 link_bw = 270000; 3777
3778 /* FDI is a binary signal running at ~2.7GHz, encoding
3779 * each output octet as 10 bits. The actual frequency
3780 * is stored as a divider into a 100MHz clock, and the
3781 * mode pixel clock is stored in units of 1KHz.
3782 * Hence the bw of each lane in terms of the mode signal
3783 * is:
3784 */
3785 link_bw = intel_fdi_link_freq(dev) * MHz(100)/KHz(1)/10;
3771 } 3786 }
3772 3787
3773 /* determine panel color depth */ 3788 /* determine panel color depth */
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 1ada684ea56..6c6b897539f 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -49,6 +49,9 @@
49#define wait_for(COND, MS) _wait_for(COND, MS, 1) 49#define wait_for(COND, MS) _wait_for(COND, MS, 1)
50#define wait_for_atomic(COND, MS) _wait_for(COND, MS, 0) 50#define wait_for_atomic(COND, MS) _wait_for(COND, MS, 0)
51 51
52#define KHz(x) (1000*x)
53#define MHz(x) KHz(1000*x)
54
52/* 55/*
53 * Display related stuff 56 * Display related stuff
54 */ 57 */