All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915/sdvo: Utilize intel_panel for fixed_mode
Date: Tue, 09 Oct 2018 17:44:57 +0300	[thread overview]
Message-ID: <87ftxfnpqu.fsf@intel.com> (raw)
In-Reply-To: <20180917151504.8754-2-ville.syrjala@linux.intel.com>

On Mon, 17 Sep 2018, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Remove the local lvds fixed mode pointer from the sdvo encoder
> structure and instead utilize intel_panel like everyone else.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_sdvo.c | 40 ++++++++++++++++++++-------------------
>  1 file changed, 21 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
> index 701372e512a8..11e8d598702e 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -105,11 +105,6 @@ struct intel_sdvo {
>  	bool has_hdmi_audio;
>  	bool rgb_quant_range_selectable;
>  
> -	/**
> -	 * This is sdvo fixed pannel mode pointer
> -	 */
> -	struct drm_display_mode *sdvo_lvds_fixed_mode;
> -
>  	/* DDC bus used by this SDVO encoder */
>  	uint8_t ddc_bus;
>  
> @@ -765,10 +760,14 @@ intel_sdvo_create_preferred_input_timing(struct intel_sdvo *intel_sdvo,
>  	args.height = height;
>  	args.interlace = 0;
>  
> -	if (IS_LVDS(intel_sdvo_connector) &&
> -	   (intel_sdvo->sdvo_lvds_fixed_mode->hdisplay != width ||
> -	    intel_sdvo->sdvo_lvds_fixed_mode->vdisplay != height))
> -		args.scaled = 1;
> +	if (IS_LVDS(intel_sdvo_connector)) {
> +		const struct drm_display_mode *fixed_mode =
> +			intel_sdvo_connector->base.panel.fixed_mode;
> +
> +		if (fixed_mode->hdisplay != width ||
> +		    fixed_mode->vdisplay != height)
> +			args.scaled = 1;
> +	}
>  
>  	return intel_sdvo_set_value(intel_sdvo,
>  				    SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING,
> @@ -1144,7 +1143,7 @@ static bool intel_sdvo_compute_config(struct intel_encoder *encoder,
>  		pipe_config->sdvo_tv_clock = true;
>  	} else if (IS_LVDS(intel_sdvo_connector)) {
>  		if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo,
> -							     intel_sdvo->sdvo_lvds_fixed_mode))
> +							     intel_sdvo_connector->base.panel.fixed_mode))
>  			return false;
>  
>  		(void) intel_sdvo_get_preferred_input_mode(intel_sdvo,
> @@ -1301,7 +1300,7 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,
>  	/* lvds has a special fixed output timing. */
>  	if (IS_LVDS(intel_sdvo_connector))
>  		intel_sdvo_get_dtd_from_mode(&output_dtd,
> -					     intel_sdvo->sdvo_lvds_fixed_mode);
> +					     intel_sdvo_connector->base.panel.fixed_mode);
>  	else
>  		intel_sdvo_get_dtd_from_mode(&output_dtd, mode);
>  	if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd))
> @@ -1642,10 +1641,13 @@ intel_sdvo_mode_valid(struct drm_connector *connector,
>  		return MODE_CLOCK_HIGH;
>  
>  	if (IS_LVDS(intel_sdvo_connector)) {
> -		if (mode->hdisplay > intel_sdvo->sdvo_lvds_fixed_mode->hdisplay)
> +		const struct drm_display_mode *fixed_mode =
> +			intel_sdvo_connector->base.panel.fixed_mode;
> +
> +		if (mode->hdisplay > fixed_mode->hdisplay)
>  			return MODE_PANEL;
>  
> -		if (mode->vdisplay > intel_sdvo->sdvo_lvds_fixed_mode->vdisplay)
> +		if (mode->vdisplay > fixed_mode->vdisplay)
>  			return MODE_PANEL;
>  	}
>  
> @@ -2063,6 +2065,7 @@ static void intel_sdvo_destroy(struct drm_connector *connector)
>  	struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector);
>  
>  	drm_connector_cleanup(connector);
> +	intel_panel_fini(&intel_sdvo_connector->base.panel);
>  	kfree(intel_sdvo_connector);
>  }
>  
> @@ -2267,10 +2270,6 @@ static void intel_sdvo_enc_destroy(struct drm_encoder *encoder)
>  {
>  	struct intel_sdvo *intel_sdvo = to_sdvo(to_intel_encoder(encoder));
>  
> -	if (intel_sdvo->sdvo_lvds_fixed_mode != NULL)
> -		drm_mode_destroy(encoder->dev,
> -				 intel_sdvo->sdvo_lvds_fixed_mode);
> -
>  	i2c_del_adapter(&intel_sdvo->ddc);
>  	intel_encoder_destroy(encoder);
>  }
> @@ -2663,13 +2662,16 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
>  
>  	list_for_each_entry(mode, &connector->probed_modes, head) {
>  		if (mode->type & DRM_MODE_TYPE_PREFERRED) {
> -			intel_sdvo->sdvo_lvds_fixed_mode =
> +			struct drm_display_mode *fixed_mode =
>  				drm_mode_duplicate(connector->dev, mode);
> +
> +			intel_panel_init(&intel_connector->panel,
> +					 fixed_mode, NULL);
>  			break;
>  		}
>  	}
>  
> -	if (!intel_sdvo->sdvo_lvds_fixed_mode)
> +	if (!intel_connector->panel.fixed_mode)
>  		goto err;
>  
>  	return true;

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-10-09 14:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17 15:15 [PATCH 1/2] drm/i915/sdvo: Fix multi function encoder stuff Ville Syrjala
2018-09-17 15:15 ` [PATCH 2/2] drm/i915/sdvo: Utilize intel_panel for fixed_mode Ville Syrjala
2018-10-09 14:44   ` Jani Nikula [this message]
2018-09-17 15:21 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/sdvo: Fix multi function encoder stuff Patchwork
2018-09-17 15:41 ` ✓ Fi.CI.BAT: success " Patchwork
2018-09-17 16:41 ` ✓ Fi.CI.IGT: " Patchwork
2018-09-17 17:16 ` [PATCH 1/2] " Rodrigo Vivi
2018-09-17 17:34   ` Ville Syrjälä
2018-09-18 18:10     ` Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ftxfnpqu.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.