From: Daniel Vetter Subject: Re: [PATCH 2/2] drm/i915: Make adjusted_mode.clock non-pixel multiplied Date: Tue, 3 Sep 2013 15:52:17 +0200 Message-ID: <20130903135217.GI5767@phenom.ffwll.local> References: <1378214464-11948-1-git-send-email-ville.syrjala@linux.intel.com> <1378214464-11948-3-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-ee0-f42.google.com (mail-ee0-f42.google.com [74.125.83.42]) by gabe.freedesktop.org (Postfix) with ESMTP id 74B42E62C8 for ; Tue, 3 Sep 2013 06:52:03 -0700 (PDT) Received: by mail-ee0-f42.google.com with SMTP id b45so3063601eek.1 for ; Tue, 03 Sep 2013 06:52:02 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1378214464-11948-3-git-send-email-ville.syrjala@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: ville.syrjala@linux.intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Sep 03, 2013 at 04:21:04PM +0300, ville.syrjala@linux.intel.com wro= te: > From: Ville Syrj=E4l=E4 > = > It would be easier if adjusted_mode.clock would be the pipe pixel clock, > and it actually is, except for the cases where pixel_multiplier > 1. > = > So let's change intel_sdvo to use port_clock as the multiplied clock, > and then we can leave adjusted_mode.clock as pipe pixel clock. > = > Signed-off-by: Ville Syrj=E4l=E4 Yeah I think this makes sense. Comment updates for port_clock in intel_drv.h to also mention the pixel multiplier would be good. Plus adding a fuzzy port_clock check to the config comparator - teaching intel_fuzzy_clock_check to just compare two clocks and adding a PIPE_CONF_FUZZY_CLOCK_CHECK macro for both adjusted_mode.clock and port_clock would be great. Of course we still need to make those checks conditional on !HSW :( Cheers, Daniel > --- > drivers/gpu/drm/i915/intel_display.c | 10 ++++------ > drivers/gpu/drm/i915/intel_sdvo.c | 3 +-- > 2 files changed, 5 insertions(+), 8 deletions(-) > = > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/= intel_display.c > index 1ed042d..3bd9a72 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -4095,7 +4095,6 @@ retry: > link_bw =3D intel_fdi_link_freq(dev) * MHz(100)/KHz(1)/10; > = > fdi_dotclock =3D adjusted_mode->clock; > - fdi_dotclock /=3D pipe_config->pixel_multiplier; > = > lane =3D ironlake_get_lanes_required(fdi_dotclock, link_bw, > pipe_config->pipe_bpp); > @@ -7362,8 +7361,7 @@ static void i9xx_crtc_clock_get(struct intel_crtc *= crtc, > } > } > = > - pipe_config->adjusted_mode.clock =3D clock.dot * > - pipe_config->pixel_multiplier; > + pipe_config->adjusted_mode.clock =3D clock.dot; > } > = > static void ironlake_crtc_clock_get(struct intel_crtc *crtc, > @@ -7408,8 +7406,7 @@ static void ironlake_crtc_clock_get(struct intel_cr= tc *crtc, > clock =3D ((u64)link_m * (u64)link_freq); > do_div(clock, link_n); > = > - pipe_config->adjusted_mode.clock =3D clock * > - pipe_config->pixel_multiplier; > + pipe_config->adjusted_mode.clock =3D clock; > } > = > /** Returns the currently programmed mode of the given pipe. */ > @@ -8360,7 +8357,8 @@ encoder_retry: > /* Set default port clock if not overwritten by the encoder. Needs to be > * done afterwards in case the encoder adjusts the mode. */ > if (!pipe_config->port_clock) > - pipe_config->port_clock =3D pipe_config->adjusted_mode.clock; > + pipe_config->port_clock =3D pipe_config->adjusted_mode.clock * > + pipe_config->pixel_multiplier; > = > ret =3D intel_crtc_compute_config(to_intel_crtc(crtc), pipe_config); > if (ret < 0) { > diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/int= el_sdvo.c > index 317e058..3381a52 100644 > --- a/drivers/gpu/drm/i915/intel_sdvo.c > +++ b/drivers/gpu/drm/i915/intel_sdvo.c > @@ -1059,7 +1059,7 @@ intel_sdvo_get_preferred_input_mode(struct intel_sd= vo *intel_sdvo, > = > static void i9xx_adjust_sdvo_tv_clock(struct intel_crtc_config *pipe_con= fig) > { > - unsigned dotclock =3D pipe_config->adjusted_mode.clock; > + unsigned dotclock =3D pipe_config->port_clock; > struct dpll *clock =3D &pipe_config->dpll; > = > /* SDVO TV has fixed PLL values depend on its clock range, > @@ -1124,7 +1124,6 @@ static bool intel_sdvo_compute_config(struct intel_= encoder *encoder, > */ > pipe_config->pixel_multiplier =3D > intel_sdvo_get_pixel_multiplier(adjusted_mode); > - adjusted_mode->clock *=3D pipe_config->pixel_multiplier; > = > if (intel_sdvo->color_range_auto) { > /* See CEA-861-E - 5.1 Default Encoding Parameters */ > -- = > 1.8.1.5 > = > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch