提交 241bfc38 编写于 作者: D Damien Lespiau 提交者: Daniel Vetter

drm/i915: Use crtc_clock with the adjusted mode

struct drm_mode_display now has a separate crtc_ version of the clock to
be used when we're talking about the timings given to the harwadre (was
far as the mode is concerned).

This commit is really the result of a git grep adjusted_mode.*clock and
replacing those by adjusted_mode.crtc_clock. No functional change.

v2: Rebased on drm-intel-queued-next
Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
Acked-by: NDave Airlie <airlied@gmail.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 1342830c
...@@ -117,7 +117,7 @@ static void intel_crt_get_config(struct intel_encoder *encoder, ...@@ -117,7 +117,7 @@ static void intel_crt_get_config(struct intel_encoder *encoder,
if (HAS_PCH_SPLIT(dev)) if (HAS_PCH_SPLIT(dev))
ironlake_check_encoder_dotclock(pipe_config, dotclock); ironlake_check_encoder_dotclock(pipe_config, dotclock);
pipe_config->adjusted_mode.clock = dotclock; pipe_config->adjusted_mode.crtc_clock = dotclock;
} }
static void hsw_crt_get_config(struct intel_encoder *encoder, static void hsw_crt_get_config(struct intel_encoder *encoder,
......
...@@ -739,14 +739,14 @@ bool intel_crtc_active(struct drm_crtc *crtc) ...@@ -739,14 +739,14 @@ bool intel_crtc_active(struct drm_crtc *crtc)
/* Be paranoid as we can arrive here with only partial /* Be paranoid as we can arrive here with only partial
* state retrieved from the hardware during setup. * state retrieved from the hardware during setup.
* *
* We can ditch the adjusted_mode.clock check as soon * We can ditch the adjusted_mode.crtc_clock check as soon
* as Haswell has gained clock readout/fastboot support. * as Haswell has gained clock readout/fastboot support.
* *
* We can ditch the crtc->fb check as soon as we can * We can ditch the crtc->fb check as soon as we can
* properly reconstruct framebuffers. * properly reconstruct framebuffers.
*/ */
return intel_crtc->active && crtc->fb && return intel_crtc->active && crtc->fb &&
intel_crtc->config.adjusted_mode.clock; intel_crtc->config.adjusted_mode.crtc_clock;
} }
enum transcoder intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv, enum transcoder intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,
...@@ -2913,7 +2913,7 @@ static void lpt_program_iclkip(struct drm_crtc *crtc) ...@@ -2913,7 +2913,7 @@ static void lpt_program_iclkip(struct drm_crtc *crtc)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
int clock = to_intel_crtc(crtc)->config.adjusted_mode.clock; int clock = to_intel_crtc(crtc)->config.adjusted_mode.crtc_clock;
u32 divsel, phaseinc, auxdiv, phasedir = 0; u32 divsel, phaseinc, auxdiv, phasedir = 0;
u32 temp; u32 temp;
...@@ -2937,8 +2937,8 @@ static void lpt_program_iclkip(struct drm_crtc *crtc) ...@@ -2937,8 +2937,8 @@ static void lpt_program_iclkip(struct drm_crtc *crtc)
phaseinc = 0x20; phaseinc = 0x20;
} else { } else {
/* The iCLK virtual clock root frequency is in MHz, /* The iCLK virtual clock root frequency is in MHz,
* but the adjusted_mode->clock in in KHz. To get the divisors, * but the adjusted_mode->crtc_clock in in KHz. To get the
* it is necessary to divide one by another, so we * divisors, it is necessary to divide one by another, so we
* convert the virtual clock precision to KHz here for higher * convert the virtual clock precision to KHz here for higher
* precision. * precision.
*/ */
...@@ -4148,7 +4148,7 @@ static int ironlake_fdi_compute_config(struct intel_crtc *intel_crtc, ...@@ -4148,7 +4148,7 @@ static int ironlake_fdi_compute_config(struct intel_crtc *intel_crtc,
*/ */
link_bw = intel_fdi_link_freq(dev) * MHz(100)/KHz(1)/10; link_bw = intel_fdi_link_freq(dev) * MHz(100)/KHz(1)/10;
fdi_dotclock = adjusted_mode->clock; fdi_dotclock = adjusted_mode->crtc_clock;
lane = ironlake_get_lanes_required(fdi_dotclock, link_bw, lane = ironlake_get_lanes_required(fdi_dotclock, link_bw,
pipe_config->pipe_bpp); pipe_config->pipe_bpp);
...@@ -4204,12 +4204,12 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc, ...@@ -4204,12 +4204,12 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,
* otherwise pipe A only. * otherwise pipe A only.
*/ */
if ((crtc->pipe == PIPE_A || IS_I915G(dev)) && if ((crtc->pipe == PIPE_A || IS_I915G(dev)) &&
adjusted_mode->clock > clock_limit * 9 / 10) { adjusted_mode->crtc_clock > clock_limit * 9 / 10) {
clock_limit *= 2; clock_limit *= 2;
pipe_config->double_wide = true; pipe_config->double_wide = true;
} }
if (adjusted_mode->clock > clock_limit * 9 / 10) if (adjusted_mode->crtc_clock > clock_limit * 9 / 10)
return -EINVAL; return -EINVAL;
} }
...@@ -4869,7 +4869,7 @@ static void intel_crtc_mode_from_pipe_config(struct intel_crtc *intel_crtc, ...@@ -4869,7 +4869,7 @@ static void intel_crtc_mode_from_pipe_config(struct intel_crtc *intel_crtc,
crtc->mode.flags = pipe_config->adjusted_mode.flags; crtc->mode.flags = pipe_config->adjusted_mode.flags;
crtc->mode.clock = pipe_config->adjusted_mode.clock; crtc->mode.clock = pipe_config->adjusted_mode.crtc_clock;
crtc->mode.flags |= pipe_config->adjusted_mode.flags; crtc->mode.flags |= pipe_config->adjusted_mode.flags;
} }
...@@ -7473,7 +7473,7 @@ static void i9xx_crtc_clock_get(struct intel_crtc *crtc, ...@@ -7473,7 +7473,7 @@ static void i9xx_crtc_clock_get(struct intel_crtc *crtc,
/* /*
* This value includes pixel_multiplier. We will use * This value includes pixel_multiplier. We will use
* port_clock to compute adjusted_mode.clock in the * port_clock to compute adjusted_mode.crtc_clock in the
* encoder's get_config() function. * encoder's get_config() function.
*/ */
pipe_config->port_clock = clock.dot; pipe_config->port_clock = clock.dot;
...@@ -7508,11 +7508,11 @@ static void ironlake_pch_clock_get(struct intel_crtc *crtc, ...@@ -7508,11 +7508,11 @@ static void ironlake_pch_clock_get(struct intel_crtc *crtc,
/* /*
* This value does not include pixel_multiplier. * This value does not include pixel_multiplier.
* We will check that port_clock and adjusted_mode.clock * We will check that port_clock and adjusted_mode.crtc_clock
* agree once we know their relationship in the encoder's * agree once we know their relationship in the encoder's
* get_config() function. * get_config() function.
*/ */
pipe_config->adjusted_mode.clock = pipe_config->adjusted_mode.crtc_clock =
intel_dotclock_calculate(intel_fdi_link_freq(dev) * 10000, intel_dotclock_calculate(intel_fdi_link_freq(dev) * 10000,
&pipe_config->fdi_m_n); &pipe_config->fdi_m_n);
} }
...@@ -8489,8 +8489,8 @@ intel_modeset_pipe_config(struct drm_crtc *crtc, ...@@ -8489,8 +8489,8 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
/* Set default port clock if not overwritten by the encoder. Needs to be /* Set default port clock if not overwritten by the encoder. Needs to be
* done afterwards in case the encoder adjusts the mode. */ * done afterwards in case the encoder adjusts the mode. */
if (!pipe_config->port_clock) if (!pipe_config->port_clock)
pipe_config->port_clock = pipe_config->adjusted_mode.clock * pipe_config->port_clock = pipe_config->adjusted_mode.crtc_clock
pipe_config->pixel_multiplier; * pipe_config->pixel_multiplier;
ret = intel_crtc_compute_config(to_intel_crtc(crtc), pipe_config); ret = intel_crtc_compute_config(to_intel_crtc(crtc), pipe_config);
if (ret < 0) { if (ret < 0) {
...@@ -8820,7 +8820,7 @@ intel_pipe_config_compare(struct drm_device *dev, ...@@ -8820,7 +8820,7 @@ intel_pipe_config_compare(struct drm_device *dev,
PIPE_CONF_CHECK_I(pipe_bpp); PIPE_CONF_CHECK_I(pipe_bpp);
if (!IS_HASWELL(dev)) { if (!IS_HASWELL(dev)) {
PIPE_CONF_CHECK_CLOCK_FUZZY(adjusted_mode.clock); PIPE_CONF_CHECK_CLOCK_FUZZY(adjusted_mode.crtc_clock);
PIPE_CONF_CHECK_CLOCK_FUZZY(port_clock); PIPE_CONF_CHECK_CLOCK_FUZZY(port_clock);
} }
...@@ -9042,9 +9042,9 @@ void ironlake_check_encoder_dotclock(const struct intel_crtc_config *pipe_config ...@@ -9042,9 +9042,9 @@ void ironlake_check_encoder_dotclock(const struct intel_crtc_config *pipe_config
* FDI already provided one idea for the dotclock. * FDI already provided one idea for the dotclock.
* Yell if the encoder disagrees. * Yell if the encoder disagrees.
*/ */
WARN(!intel_fuzzy_clock_check(pipe_config->adjusted_mode.clock, dotclock), WARN(!intel_fuzzy_clock_check(pipe_config->adjusted_mode.crtc_clock, dotclock),
"FDI dotclock and encoder dotclock mismatch, fdi: %i, encoder: %i\n", "FDI dotclock and encoder dotclock mismatch, fdi: %i, encoder: %i\n",
pipe_config->adjusted_mode.clock, dotclock); pipe_config->adjusted_mode.crtc_clock, dotclock);
} }
static int __intel_set_mode(struct drm_crtc *crtc, static int __intel_set_mode(struct drm_crtc *crtc,
......
...@@ -811,7 +811,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, ...@@ -811,7 +811,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
DRM_DEBUG_KMS("DP link computation with max lane count %i " DRM_DEBUG_KMS("DP link computation with max lane count %i "
"max bw %02x pixel clock %iKHz\n", "max bw %02x pixel clock %iKHz\n",
max_lane_count, bws[max_clock], adjusted_mode->clock); max_lane_count, bws[max_clock],
adjusted_mode->crtc_clock);
/* Walk through all bpp values. Luckily they're all nicely spaced with 2 /* Walk through all bpp values. Luckily they're all nicely spaced with 2
* bpc in between. */ * bpc in between. */
...@@ -823,7 +824,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, ...@@ -823,7 +824,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
} }
for (; bpp >= 6*3; bpp -= 2*3) { for (; bpp >= 6*3; bpp -= 2*3) {
mode_rate = intel_dp_link_required(adjusted_mode->clock, bpp); mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock,
bpp);
for (clock = 0; clock <= max_clock; clock++) { for (clock = 0; clock <= max_clock; clock++) {
for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) { for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) {
...@@ -868,7 +870,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, ...@@ -868,7 +870,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
mode_rate, link_avail); mode_rate, link_avail);
intel_link_compute_m_n(bpp, lane_count, intel_link_compute_m_n(bpp, lane_count,
adjusted_mode->clock, pipe_config->port_clock, adjusted_mode->crtc_clock,
pipe_config->port_clock,
&pipe_config->dp_m_n); &pipe_config->dp_m_n);
intel_dp_set_clock(encoder, pipe_config, intel_dp->link_bw); intel_dp_set_clock(encoder, pipe_config, intel_dp->link_bw);
...@@ -1483,7 +1486,7 @@ static void intel_dp_get_config(struct intel_encoder *encoder, ...@@ -1483,7 +1486,7 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
if (HAS_PCH_SPLIT(dev_priv->dev) && port != PORT_A) if (HAS_PCH_SPLIT(dev_priv->dev) && port != PORT_A)
ironlake_check_encoder_dotclock(pipe_config, dotclock); ironlake_check_encoder_dotclock(pipe_config, dotclock);
pipe_config->adjusted_mode.clock = dotclock; pipe_config->adjusted_mode.crtc_clock = dotclock;
} }
static bool is_edp_psr(struct intel_dp *intel_dp) static bool is_edp_psr(struct intel_dp *intel_dp)
......
...@@ -217,7 +217,7 @@ struct intel_crtc_config { ...@@ -217,7 +217,7 @@ struct intel_crtc_config {
* preferred input timings. */ * preferred input timings. */
struct drm_display_mode requested_mode; struct drm_display_mode requested_mode;
/* Actual pipe timings ie. what we program into the pipe timing /* Actual pipe timings ie. what we program into the pipe timing
* registers. adjusted_mode.clock is the pipe pixel clock. */ * registers. adjusted_mode.crtc_clock is the pipe pixel clock. */
struct drm_display_mode adjusted_mode; struct drm_display_mode adjusted_mode;
/* Pipe source size (ie. panel fitter input size) /* Pipe source size (ie. panel fitter input size)
......
...@@ -154,7 +154,7 @@ static void intel_dvo_get_config(struct intel_encoder *encoder, ...@@ -154,7 +154,7 @@ static void intel_dvo_get_config(struct intel_encoder *encoder,
pipe_config->adjusted_mode.flags |= flags; pipe_config->adjusted_mode.flags |= flags;
pipe_config->adjusted_mode.clock = pipe_config->port_clock; pipe_config->adjusted_mode.crtc_clock = pipe_config->port_clock;
} }
static void intel_disable_dvo(struct intel_encoder *encoder) static void intel_disable_dvo(struct intel_encoder *encoder)
......
...@@ -737,7 +737,7 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, ...@@ -737,7 +737,7 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,
if (HAS_PCH_SPLIT(dev_priv->dev)) if (HAS_PCH_SPLIT(dev_priv->dev))
ironlake_check_encoder_dotclock(pipe_config, dotclock); ironlake_check_encoder_dotclock(pipe_config, dotclock);
pipe_config->adjusted_mode.clock = dotclock; pipe_config->adjusted_mode.crtc_clock = dotclock;
} }
static void intel_enable_hdmi(struct intel_encoder *encoder) static void intel_enable_hdmi(struct intel_encoder *encoder)
...@@ -873,7 +873,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, ...@@ -873,7 +873,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
struct drm_device *dev = encoder->base.dev; struct drm_device *dev = encoder->base.dev;
struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode; struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode;
int clock_12bpc = pipe_config->adjusted_mode.clock * 3 / 2; int clock_12bpc = pipe_config->adjusted_mode.crtc_clock * 3 / 2;
int portclock_limit = hdmi_portclock_limit(intel_hdmi); int portclock_limit = hdmi_portclock_limit(intel_hdmi);
int desired_bpp; int desired_bpp;
...@@ -915,7 +915,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, ...@@ -915,7 +915,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
pipe_config->pipe_bpp = desired_bpp; pipe_config->pipe_bpp = desired_bpp;
} }
if (adjusted_mode->clock > portclock_limit) { if (adjusted_mode->crtc_clock > portclock_limit) {
DRM_DEBUG_KMS("too high HDMI clock, rejecting mode\n"); DRM_DEBUG_KMS("too high HDMI clock, rejecting mode\n");
return false; return false;
} }
......
...@@ -123,7 +123,7 @@ static void intel_lvds_get_config(struct intel_encoder *encoder, ...@@ -123,7 +123,7 @@ static void intel_lvds_get_config(struct intel_encoder *encoder,
if (HAS_PCH_SPLIT(dev_priv->dev)) if (HAS_PCH_SPLIT(dev_priv->dev))
ironlake_check_encoder_dotclock(pipe_config, dotclock); ironlake_check_encoder_dotclock(pipe_config, dotclock);
pipe_config->adjusted_mode.clock = dotclock; pipe_config->adjusted_mode.crtc_clock = dotclock;
} }
/* The LVDS pin pair needs to be on before the DPLLs are enabled. /* The LVDS pin pair needs to be on before the DPLLs are enabled.
......
...@@ -1100,8 +1100,12 @@ static void pineview_update_wm(struct drm_crtc *unused_crtc) ...@@ -1100,8 +1100,12 @@ static void pineview_update_wm(struct drm_crtc *unused_crtc)
crtc = single_enabled_crtc(dev); crtc = single_enabled_crtc(dev);
if (crtc) { if (crtc) {
int clock = to_intel_crtc(crtc)->config.adjusted_mode.clock; const struct drm_display_mode *adjusted_mode;
int pixel_size = crtc->fb->bits_per_pixel / 8; int pixel_size = crtc->fb->bits_per_pixel / 8;
int clock;
adjusted_mode = &to_intel_crtc(crtc)->config.adjusted_mode;
clock = adjusted_mode->crtc_clock;
/* Display SR */ /* Display SR */
wm = intel_calculate_wm(clock, &pineview_display_wm, wm = intel_calculate_wm(clock, &pineview_display_wm,
...@@ -1174,7 +1178,7 @@ static bool g4x_compute_wm0(struct drm_device *dev, ...@@ -1174,7 +1178,7 @@ static bool g4x_compute_wm0(struct drm_device *dev,
} }
adjusted_mode = &to_intel_crtc(crtc)->config.adjusted_mode; adjusted_mode = &to_intel_crtc(crtc)->config.adjusted_mode;
clock = adjusted_mode->clock; clock = adjusted_mode->crtc_clock;
htotal = adjusted_mode->htotal; htotal = adjusted_mode->htotal;
hdisplay = to_intel_crtc(crtc)->config.pipe_src_w; hdisplay = to_intel_crtc(crtc)->config.pipe_src_w;
pixel_size = crtc->fb->bits_per_pixel / 8; pixel_size = crtc->fb->bits_per_pixel / 8;
...@@ -1261,7 +1265,7 @@ static bool g4x_compute_srwm(struct drm_device *dev, ...@@ -1261,7 +1265,7 @@ static bool g4x_compute_srwm(struct drm_device *dev,
crtc = intel_get_crtc_for_plane(dev, plane); crtc = intel_get_crtc_for_plane(dev, plane);
adjusted_mode = &to_intel_crtc(crtc)->config.adjusted_mode; adjusted_mode = &to_intel_crtc(crtc)->config.adjusted_mode;
clock = adjusted_mode->clock; clock = adjusted_mode->crtc_clock;
htotal = adjusted_mode->htotal; htotal = adjusted_mode->htotal;
hdisplay = to_intel_crtc(crtc)->config.pipe_src_w; hdisplay = to_intel_crtc(crtc)->config.pipe_src_w;
pixel_size = crtc->fb->bits_per_pixel / 8; pixel_size = crtc->fb->bits_per_pixel / 8;
...@@ -1302,7 +1306,7 @@ static bool vlv_compute_drain_latency(struct drm_device *dev, ...@@ -1302,7 +1306,7 @@ static bool vlv_compute_drain_latency(struct drm_device *dev,
if (!intel_crtc_active(crtc)) if (!intel_crtc_active(crtc))
return false; return false;
clock = to_intel_crtc(crtc)->config.adjusted_mode.clock; clock = to_intel_crtc(crtc)->config.adjusted_mode.crtc_clock;
pixel_size = crtc->fb->bits_per_pixel / 8; /* BPP */ pixel_size = crtc->fb->bits_per_pixel / 8; /* BPP */
entries = (clock / 1000) * pixel_size; entries = (clock / 1000) * pixel_size;
...@@ -1492,7 +1496,7 @@ static void i965_update_wm(struct drm_crtc *unused_crtc) ...@@ -1492,7 +1496,7 @@ static void i965_update_wm(struct drm_crtc *unused_crtc)
static const int sr_latency_ns = 12000; static const int sr_latency_ns = 12000;
const struct drm_display_mode *adjusted_mode = const struct drm_display_mode *adjusted_mode =
&to_intel_crtc(crtc)->config.adjusted_mode; &to_intel_crtc(crtc)->config.adjusted_mode;
int clock = adjusted_mode->clock; int clock = adjusted_mode->crtc_clock;
int htotal = adjusted_mode->htotal; int htotal = adjusted_mode->htotal;
int hdisplay = to_intel_crtc(crtc)->config.pipe_src_w; int hdisplay = to_intel_crtc(crtc)->config.pipe_src_w;
int pixel_size = crtc->fb->bits_per_pixel / 8; int pixel_size = crtc->fb->bits_per_pixel / 8;
...@@ -1567,11 +1571,13 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc) ...@@ -1567,11 +1571,13 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc)
fifo_size = dev_priv->display.get_fifo_size(dev, 0); fifo_size = dev_priv->display.get_fifo_size(dev, 0);
crtc = intel_get_crtc_for_plane(dev, 0); crtc = intel_get_crtc_for_plane(dev, 0);
if (intel_crtc_active(crtc)) { if (intel_crtc_active(crtc)) {
const struct drm_display_mode *adjusted_mode;
int cpp = crtc->fb->bits_per_pixel / 8; int cpp = crtc->fb->bits_per_pixel / 8;
if (IS_GEN2(dev)) if (IS_GEN2(dev))
cpp = 4; cpp = 4;
planea_wm = intel_calculate_wm(to_intel_crtc(crtc)->config.adjusted_mode.clock, adjusted_mode = &to_intel_crtc(crtc)->config.adjusted_mode;
planea_wm = intel_calculate_wm(adjusted_mode->crtc_clock,
wm_info, fifo_size, cpp, wm_info, fifo_size, cpp,
latency_ns); latency_ns);
enabled = crtc; enabled = crtc;
...@@ -1581,11 +1587,13 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc) ...@@ -1581,11 +1587,13 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc)
fifo_size = dev_priv->display.get_fifo_size(dev, 1); fifo_size = dev_priv->display.get_fifo_size(dev, 1);
crtc = intel_get_crtc_for_plane(dev, 1); crtc = intel_get_crtc_for_plane(dev, 1);
if (intel_crtc_active(crtc)) { if (intel_crtc_active(crtc)) {
const struct drm_display_mode *adjusted_mode;
int cpp = crtc->fb->bits_per_pixel / 8; int cpp = crtc->fb->bits_per_pixel / 8;
if (IS_GEN2(dev)) if (IS_GEN2(dev))
cpp = 4; cpp = 4;
planeb_wm = intel_calculate_wm(to_intel_crtc(crtc)->config.adjusted_mode.clock, adjusted_mode = &to_intel_crtc(crtc)->config.adjusted_mode;
planeb_wm = intel_calculate_wm(adjusted_mode->crtc_clock,
wm_info, fifo_size, cpp, wm_info, fifo_size, cpp,
latency_ns); latency_ns);
if (enabled == NULL) if (enabled == NULL)
...@@ -1614,7 +1622,7 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc) ...@@ -1614,7 +1622,7 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc)
static const int sr_latency_ns = 6000; static const int sr_latency_ns = 6000;
const struct drm_display_mode *adjusted_mode = const struct drm_display_mode *adjusted_mode =
&to_intel_crtc(enabled)->config.adjusted_mode; &to_intel_crtc(enabled)->config.adjusted_mode;
int clock = adjusted_mode->clock; int clock = adjusted_mode->crtc_clock;
int htotal = adjusted_mode->htotal; int htotal = adjusted_mode->htotal;
int hdisplay = to_intel_crtc(crtc)->config.pipe_src_w; int hdisplay = to_intel_crtc(crtc)->config.pipe_src_w;
int pixel_size = enabled->fb->bits_per_pixel / 8; int pixel_size = enabled->fb->bits_per_pixel / 8;
...@@ -1670,6 +1678,7 @@ static void i830_update_wm(struct drm_crtc *unused_crtc) ...@@ -1670,6 +1678,7 @@ static void i830_update_wm(struct drm_crtc *unused_crtc)
struct drm_device *dev = unused_crtc->dev; struct drm_device *dev = unused_crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_crtc *crtc; struct drm_crtc *crtc;
const struct drm_display_mode *adjusted_mode;
uint32_t fwater_lo; uint32_t fwater_lo;
int planea_wm; int planea_wm;
...@@ -1677,7 +1686,8 @@ static void i830_update_wm(struct drm_crtc *unused_crtc) ...@@ -1677,7 +1686,8 @@ static void i830_update_wm(struct drm_crtc *unused_crtc)
if (crtc == NULL) if (crtc == NULL)
return; return;
planea_wm = intel_calculate_wm(to_intel_crtc(crtc)->config.adjusted_mode.clock, adjusted_mode = &to_intel_crtc(crtc)->config.adjusted_mode;
planea_wm = intel_calculate_wm(adjusted_mode->crtc_clock,
&i830_wm_info, &i830_wm_info,
dev_priv->display.get_fifo_size(dev, 0), dev_priv->display.get_fifo_size(dev, 0),
4, latency_ns); 4, latency_ns);
...@@ -1764,7 +1774,7 @@ static bool ironlake_compute_srwm(struct drm_device *dev, int level, int plane, ...@@ -1764,7 +1774,7 @@ static bool ironlake_compute_srwm(struct drm_device *dev, int level, int plane,
crtc = intel_get_crtc_for_plane(dev, plane); crtc = intel_get_crtc_for_plane(dev, plane);
adjusted_mode = &to_intel_crtc(crtc)->config.adjusted_mode; adjusted_mode = &to_intel_crtc(crtc)->config.adjusted_mode;
clock = adjusted_mode->clock; clock = adjusted_mode->crtc_clock;
htotal = adjusted_mode->htotal; htotal = adjusted_mode->htotal;
hdisplay = to_intel_crtc(crtc)->config.pipe_src_w; hdisplay = to_intel_crtc(crtc)->config.pipe_src_w;
pixel_size = crtc->fb->bits_per_pixel / 8; pixel_size = crtc->fb->bits_per_pixel / 8;
...@@ -2112,7 +2122,7 @@ static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev, ...@@ -2112,7 +2122,7 @@ static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
uint32_t pixel_rate; uint32_t pixel_rate;
pixel_rate = intel_crtc->config.adjusted_mode.clock; pixel_rate = intel_crtc->config.adjusted_mode.crtc_clock;
/* We only use IF-ID interlacing. If we ever use PF-ID we'll need to /* We only use IF-ID interlacing. If we ever use PF-ID we'll need to
* adjust the pixel_rate here. */ * adjust the pixel_rate here. */
...@@ -2913,7 +2923,7 @@ sandybridge_compute_sprite_wm(struct drm_device *dev, int plane, ...@@ -2913,7 +2923,7 @@ sandybridge_compute_sprite_wm(struct drm_device *dev, int plane,
return false; return false;
} }
clock = to_intel_crtc(crtc)->config.adjusted_mode.clock; clock = to_intel_crtc(crtc)->config.adjusted_mode.crtc_clock;
/* Use the small buffer method to calculate the sprite watermark */ /* Use the small buffer method to calculate the sprite watermark */
entries = ((clock * pixel_size / 1000) * display_latency_ns) / 1000; entries = ((clock * pixel_size / 1000) * display_latency_ns) / 1000;
...@@ -2948,7 +2958,7 @@ sandybridge_compute_sprite_srwm(struct drm_device *dev, int plane, ...@@ -2948,7 +2958,7 @@ sandybridge_compute_sprite_srwm(struct drm_device *dev, int plane,
} }
crtc = intel_get_crtc_for_plane(dev, plane); crtc = intel_get_crtc_for_plane(dev, plane);
clock = to_intel_crtc(crtc)->config.adjusted_mode.clock; clock = to_intel_crtc(crtc)->config.adjusted_mode.crtc_clock;
if (!clock) { if (!clock) {
*sprite_wm = 0; *sprite_wm = 0;
return false; return false;
......
...@@ -1369,7 +1369,7 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder, ...@@ -1369,7 +1369,7 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder,
if (HAS_PCH_SPLIT(dev)) if (HAS_PCH_SPLIT(dev))
ironlake_check_encoder_dotclock(pipe_config, dotclock); ironlake_check_encoder_dotclock(pipe_config, dotclock);
pipe_config->adjusted_mode.clock = dotclock; pipe_config->adjusted_mode.crtc_clock = dotclock;
/* Cross check the port pixel multiplier with the sdvo encoder state. */ /* Cross check the port pixel multiplier with the sdvo encoder state. */
if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_CLOCK_RATE_MULT, if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_CLOCK_RATE_MULT,
......
...@@ -912,7 +912,7 @@ intel_tv_compute_config(struct intel_encoder *encoder, ...@@ -912,7 +912,7 @@ intel_tv_compute_config(struct intel_encoder *encoder,
if (!tv_mode) if (!tv_mode)
return false; return false;
pipe_config->adjusted_mode.clock = tv_mode->clock; pipe_config->adjusted_mode.crtc_clock = tv_mode->clock;
DRM_DEBUG_KMS("forcing bpc to 8 for TV\n"); DRM_DEBUG_KMS("forcing bpc to 8 for TV\n");
pipe_config->pipe_bpp = 8*3; pipe_config->pipe_bpp = 8*3;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册