public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915/tv: add ->get_config callback
@ 2013-11-18  8:00 Daniel Vetter
  2013-11-18  8:00 ` [PATCH 2/2] drm/i915: encoder->get_config is no longer optional Daniel Vetter
  2013-11-18 20:14 ` [PATCH 1/2] drm/i915/tv: add ->get_config callback Ville Syrjälä
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Vetter @ 2013-11-18  8:00 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Jani Nikula, Daniel Vetter

We need this to properly fill in adjusted_mode.crtc_clock, otherwise
the state checker gets unhappy. This seems to have been forgotten in
the big clock rework in

commit 18442d08786472c63a0a80c27f92b033dffc26de
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Fri Sep 13 16:00:08 2013 +0300

    drm/i915: Fix port_clock and adjusted_mode.clock readout all over

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_tv.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 18c406246a2d..22cf0f4ba248 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -902,6 +902,13 @@ intel_tv_mode_valid(struct drm_connector *connector,
 }
 
 
+static void
+intel_tv_get_config(struct intel_encoder *encoder,
+		    struct intel_crtc_config *pipe_config)
+{
+	pipe_config->adjusted_mode.crtc_clock = pipe_config->port_clock;
+}
+
 static bool
 intel_tv_compute_config(struct intel_encoder *encoder,
 			struct intel_crtc_config *pipe_config)
@@ -1621,6 +1628,7 @@ intel_tv_init(struct drm_device *dev)
 			 DRM_MODE_ENCODER_TVDAC);
 
 	intel_encoder->compute_config = intel_tv_compute_config;
+	intel_encoder->get_config = intel_tv_get_config;
 	intel_encoder->mode_set = intel_tv_mode_set;
 	intel_encoder->enable = intel_enable_tv;
 	intel_encoder->disable = intel_disable_tv;
-- 
1.8.4.rc3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH 2/2] drm/i915: encoder->get_config is no longer optional
  2013-11-18  8:00 [PATCH 1/2] drm/i915/tv: add ->get_config callback Daniel Vetter
@ 2013-11-18  8:00 ` Daniel Vetter
  2013-11-18 20:14 ` [PATCH 1/2] drm/i915/tv: add ->get_config callback Ville Syrjälä
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2013-11-18  8:00 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

We must have one to fill out the adjusted_mode.crtc_clock. And with
the tv encoder fixed up every encoder we have has a ->get_config
callback. So we can drop the checks.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_display.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 65884d1fee2a..1aec86454d45 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9428,8 +9428,7 @@ check_crtc_state(struct drm_device *dev)
 			enum pipe pipe;
 			if (encoder->base.crtc != &crtc->base)
 				continue;
-			if (encoder->get_config &&
-			    encoder->get_hw_state(encoder, &pipe))
+			if (encoder->get_hw_state(encoder, &pipe))
 				encoder->get_config(encoder, &pipe_config);
 		}
 
@@ -11093,8 +11092,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
 		if (encoder->get_hw_state(encoder, &pipe)) {
 			crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
 			encoder->base.crtc = &crtc->base;
-			if (encoder->get_config)
-				encoder->get_config(encoder, &crtc->config);
+			encoder->get_config(encoder, &crtc->config);
 		} else {
 			encoder->base.crtc = NULL;
 		}
-- 
1.8.4.rc3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/2] drm/i915/tv: add ->get_config callback
  2013-11-18  8:00 [PATCH 1/2] drm/i915/tv: add ->get_config callback Daniel Vetter
  2013-11-18  8:00 ` [PATCH 2/2] drm/i915: encoder->get_config is no longer optional Daniel Vetter
@ 2013-11-18 20:14 ` Ville Syrjälä
  2013-11-18 21:59   ` Daniel Vetter
  1 sibling, 1 reply; 4+ messages in thread
From: Ville Syrjälä @ 2013-11-18 20:14 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Jani Nikula, Intel Graphics Development

On Mon, Nov 18, 2013 at 09:00:58AM +0100, Daniel Vetter wrote:
> We need this to properly fill in adjusted_mode.crtc_clock, otherwise
> the state checker gets unhappy. This seems to have been forgotten in
> the big clock rework in
> 
> commit 18442d08786472c63a0a80c27f92b033dffc26de
> Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Date:   Fri Sep 13 16:00:08 2013 +0300
> 
>     drm/i915: Fix port_clock and adjusted_mode.clock readout all over
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

For the series:
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Although using adjusted_mode.crtc_clock in intel_tv compute_config and
get_config is a bit wrong I think. That's not really the pixel clock
we're shoveling into it, so we're going to be computing the watermarks
incorrectly.

To do it really right, I think we should stick the tv_mode clock to
port_clock, and then compute the pixel rate based on the input mode
and the refresh rate. Or maybe we just need a TV out specific version
of ilk_pipe_pixel_rate() (just like we'd need one for GMCH panel fitter).
The TV out scaler is essentially just another panel fitter anyway.


> ---
>  drivers/gpu/drm/i915/intel_tv.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
> index 18c406246a2d..22cf0f4ba248 100644
> --- a/drivers/gpu/drm/i915/intel_tv.c
> +++ b/drivers/gpu/drm/i915/intel_tv.c
> @@ -902,6 +902,13 @@ intel_tv_mode_valid(struct drm_connector *connector,
>  }
>  
>  
> +static void
> +intel_tv_get_config(struct intel_encoder *encoder,
> +		    struct intel_crtc_config *pipe_config)
> +{
> +	pipe_config->adjusted_mode.crtc_clock = pipe_config->port_clock;
> +}
> +
>  static bool
>  intel_tv_compute_config(struct intel_encoder *encoder,
>  			struct intel_crtc_config *pipe_config)
> @@ -1621,6 +1628,7 @@ intel_tv_init(struct drm_device *dev)
>  			 DRM_MODE_ENCODER_TVDAC);
>  
>  	intel_encoder->compute_config = intel_tv_compute_config;
> +	intel_encoder->get_config = intel_tv_get_config;
>  	intel_encoder->mode_set = intel_tv_mode_set;
>  	intel_encoder->enable = intel_enable_tv;
>  	intel_encoder->disable = intel_disable_tv;
> -- 
> 1.8.4.rc3

-- 
Ville Syrjälä
Intel OTC

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

* Re: [PATCH 1/2] drm/i915/tv: add ->get_config callback
  2013-11-18 20:14 ` [PATCH 1/2] drm/i915/tv: add ->get_config callback Ville Syrjälä
@ 2013-11-18 21:59   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2013-11-18 21:59 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: Jani Nikula, Daniel Vetter, Intel Graphics Development

On Mon, Nov 18, 2013 at 10:14:26PM +0200, Ville Syrjälä wrote:
> On Mon, Nov 18, 2013 at 09:00:58AM +0100, Daniel Vetter wrote:
> > We need this to properly fill in adjusted_mode.crtc_clock, otherwise
> > the state checker gets unhappy. This seems to have been forgotten in
> > the big clock rework in
> > 
> > commit 18442d08786472c63a0a80c27f92b033dffc26de
> > Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Date:   Fri Sep 13 16:00:08 2013 +0300
> > 
> >     drm/i915: Fix port_clock and adjusted_mode.clock readout all over
> > 
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> For the series:
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Thanks for the review, patches merged to -fixes

> Although using adjusted_mode.crtc_clock in intel_tv compute_config and
> get_config is a bit wrong I think. That's not really the pixel clock
> we're shoveling into it, so we're going to be computing the watermarks
> incorrectly.
> 
> To do it really right, I think we should stick the tv_mode clock to
> port_clock, and then compute the pixel rate based on the input mode
> and the refresh rate. Or maybe we just need a TV out specific version
> of ilk_pipe_pixel_rate() (just like we'd need one for GMCH panel fitter).
> The TV out scaler is essentially just another panel fitter anyway.

Yeah, it's just duct-tape over duct-tape at this point. But meh, it's
tv-out. I have a similar series bubbling for sdvo-tv, but that's still
stalled since my g33 decided to be a bit more hang-happy than I'd prefer.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

end of thread, other threads:[~2013-11-18 21:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-18  8:00 [PATCH 1/2] drm/i915/tv: add ->get_config callback Daniel Vetter
2013-11-18  8:00 ` [PATCH 2/2] drm/i915: encoder->get_config is no longer optional Daniel Vetter
2013-11-18 20:14 ` [PATCH 1/2] drm/i915/tv: add ->get_config callback Ville Syrjälä
2013-11-18 21:59   ` Daniel Vetter

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