All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: force full modeset if the connector is in DPMS OFF mode
Date: Fri, 03 May 2013 14:51:39 +0300	[thread overview]
Message-ID: <87txmkth6c.fsf@intel.com> (raw)
In-Reply-To: <1367580129-6681-1-git-send-email-imre.deak@intel.com>

On Fri, 03 May 2013, Imre Deak <imre.deak@intel.com> wrote:
> Currently the driver's assumed behavior for a modeset with an attached
> FB is that the corresponding connector will be switched to DPMS ON mode
> if it happened to be in DPMS OFF (or another power save mode). This
> wasn't enforced though if only the FB changed, everything else (format,
> connector etc.) remaining the same. In this case we only set the new FB
> base and left the connector in the old power save mode.
>
> Fix this by forcing a full modeset whenever there is an attached FB and
> any affected connector is in a power save mode.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c |   21 ++++++++++++++++++++-
>  1 file changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 2939524..0aee2ba 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -8380,6 +8380,21 @@ static void intel_set_config_restore_state(struct drm_device *dev,
>  	}
>  }
>  
> +static bool
> +crtc_connector_off(struct drm_crtc *crtc, struct drm_connector *connectors,
> +		   int num_connectors)
> +{
> +	int i;
> +
> +	for (i = 0; i < num_connectors; i++)
> +		if (connectors[i].encoder &&
> +		    connectors[i].encoder->crtc == crtc &&
> +		    connectors[i].dpms != DRM_MODE_DPMS_ON)
> +			return true;
> +
> +	return false;
> +}
> +
>  static void
>  intel_set_config_compute_mode_changes(struct drm_mode_set *set,
>  				      struct intel_set_config *config)
> @@ -8397,8 +8412,12 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set,
>  		} else if (set->fb->pixel_format !=
>  			   set->crtc->fb->pixel_format) {
>  			config->mode_changed = true;
> -		} else
> +		} else if (crtc_connector_off(set->crtc, *set->connectors,
> +					      set->num_connectors)) {

Bikeshed, crtc_connector_off() sounds like disabling something, while
is_crtc_connector_off() would sound like checking the state.

Jani.


> +			config->mode_changed = true;
> +		} else {
>  			config->fb_changed = true;
> +		}
>  	}
>  
>  	if (set->fb && (set->x != set->crtc->x || set->y != set->crtc->y))
> -- 
> 1.7.10.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2013-05-03 11:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-03 11:22 [PATCH] drm/i915: force full modeset if the connector is in DPMS OFF mode Imre Deak
2013-05-03 11:27 ` Daniel Vetter
2013-05-03 11:32   ` Daniel Vetter
2013-05-03 11:39     ` Imre Deak
2013-05-03 11:44 ` Chris Wilson
2013-05-03 11:55   ` Imre Deak
2013-05-03 12:22     ` Chris Wilson
2013-05-03 12:43       ` Imre Deak
2013-05-03 15:55       ` Daniel Vetter
2013-05-03 16:22         ` Jesse Barnes
2013-05-03 16:28         ` Chris Wilson
2013-05-03 16:50           ` Daniel Vetter
2013-05-08 19:02             ` Daniel Vetter
2013-05-03 11:51 ` Jani Nikula [this message]
2013-05-03 17:40 ` Egbert Eich
2013-05-03 17:44   ` [PATCH V2] " Egbert Eich
2013-05-20 21:13     ` Jesse Barnes
2013-05-21 16:44       ` Daniel Vetter

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=87txmkth6c.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.