public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 06/23] drm/i915: Add an optional atomic state argument to intel_set_mode()
Date: Wed, 4 Mar 2015 16:41:41 +0100	[thread overview]
Message-ID: <20150304154141.GC18775@phenom.ffwll.local> (raw)
In-Reply-To: <1425388937-1247-7-git-send-email-ander.conselvan.de.oliveira@intel.com>

On Tue, Mar 03, 2015 at 03:22:00PM +0200, Ander Conselvan de Oliveira wrote:
> In the set config modeset path, the atomic state is updated when
> changing the staged config in intel_modeset_stage_output_config(). The
> load detect code also causes a modeset, but it changes the staged config
> before calling intel_set_mode(). A follow up patch will change that
> function to also update a drm_atomic_state, and it will need to be able
> to pass that to intel_set_mode().
> 
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>

Hm given this patch and the nesting in the previous one maybe we should
just add drm_atomic_state scaffolding to all callers of intel_set_mode?

Long term we need to switch over the restore_mode function over to atomic
anyway (I have ideas for generic helpers already). And the load detect
code needs to switch to atomic too anyway.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_display.c | 29 +++++++++++++++++------------
>  1 file changed, 17 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 97d4df5..3c3b5b2 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -83,7 +83,8 @@ static void ironlake_pch_clock_get(struct intel_crtc *crtc,
>  				   struct intel_crtc_state *pipe_config);
>  
>  static int intel_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode,
> -			  int x, int y, struct drm_framebuffer *old_fb);
> +			  int x, int y, struct drm_framebuffer *old_fb,
> +			  struct drm_atomic_state *state);
>  static int intel_framebuffer_init(struct drm_device *dev,
>  				  struct intel_framebuffer *ifb,
>  				  struct drm_mode_fb_cmd2 *mode_cmd,
> @@ -8854,7 +8855,7 @@ retry:
>  		goto fail;
>  	}
>  
> -	if (intel_set_mode(crtc, mode, 0, 0, fb)) {
> +	if (intel_set_mode(crtc, mode, 0, 0, fb, NULL)) {
>  		DRM_DEBUG_KMS("failed to set mode on load-detect pipe\n");
>  		if (old->release_fb)
>  			old->release_fb->funcs->destroy(old->release_fb);
> @@ -8898,7 +8899,7 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
>  		intel_encoder->new_crtc = NULL;
>  		intel_crtc->new_enabled = false;
>  		intel_crtc->new_config = NULL;
> -		intel_set_mode(crtc, NULL, 0, 0, NULL);
> +		intel_set_mode(crtc, NULL, 0, 0, NULL, NULL);
>  
>  		if (old->release_fb) {
>  			drm_framebuffer_unregister_private(old->release_fb);
> @@ -11316,19 +11317,21 @@ static int intel_set_mode_pipes(struct drm_crtc *crtc,
>  
>  static int intel_set_mode(struct drm_crtc *crtc,
>  			  struct drm_display_mode *mode,
> -			  int x, int y, struct drm_framebuffer *fb)
> +			  int x, int y, struct drm_framebuffer *fb,
> +			  struct drm_atomic_state *state)
>  {
>  	struct drm_device *dev = crtc->dev;
> -	struct drm_atomic_state *state;
>  	struct intel_crtc_state *pipe_config;
>  	unsigned modeset_pipes, prepare_pipes, disable_pipes;
>  	int ret = 0;
>  
> -	state = drm_atomic_state_alloc(dev);
> -	if (!state)
> -		return -ENOMEM;
> +	if (!state) {
> +		state = drm_atomic_state_alloc(dev);
> +		if (!state)
> +			return -ENOMEM;
>  
> -	state->acquire_ctx = dev->mode_config.acquire_ctx;
> +		state->acquire_ctx = dev->mode_config.acquire_ctx;
> +	}
>  
>  	pipe_config = intel_modeset_compute_config(crtc, mode, fb, state,
>  						   &modeset_pipes,
> @@ -11353,7 +11356,8 @@ out:
>  
>  void intel_crtc_restore_mode(struct drm_crtc *crtc)
>  {
> -	intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, crtc->primary->fb);
> +	intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, crtc->primary->fb,
> +		       NULL);
>  }
>  
>  #undef for_each_intel_crtc_masked
> @@ -11813,7 +11817,8 @@ fail:
>  		/* Try to restore the config */
>  		if (config->mode_changed &&
>  		    intel_set_mode(save_set.crtc, save_set.mode,
> -				   save_set.x, save_set.y, save_set.fb))
> +				   save_set.x, save_set.y, save_set.fb,
> +				   NULL))
>  			DRM_ERROR("failed to restore config after modeset failure\n");
>  	}
>  
> @@ -13857,7 +13862,7 @@ void intel_modeset_setup_hw_state(struct drm_device *dev,
>  				dev_priv->pipe_to_crtc_mapping[pipe];
>  
>  			intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y,
> -				       crtc->primary->fb);
> +				       crtc->primary->fb, NULL);
>  		}
>  	} else {
>  		intel_modeset_update_staged_output_state(dev);
> -- 
> 2.1.0
> 
> _______________________________________________
> 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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-03-04 15:40 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 13:21 [PATCH 00/23] Remove depencies on staged config for atomic transition Ander Conselvan de Oliveira
2015-03-03 13:21 ` [PATCH 01/23] drm/i915: Set crtc backpointer when duplicating crtc state Ander Conselvan de Oliveira
2015-03-04 15:24   ` Daniel Vetter
2015-03-03 13:21 ` [PATCH 02/23] drm/i915: Add a for_each_intel_connector macro Ander Conselvan de Oliveira
2015-03-03 13:21 ` [PATCH 03/23] drm/i915: Improve staged config logging Ander Conselvan de Oliveira
2015-03-03 13:21 ` [PATCH 04/23] drm/i915: Add intel_atomic_get_crtc_state() helper function Ander Conselvan de Oliveira
2015-03-04 15:27   ` Daniel Vetter
2015-03-03 13:21 ` [PATCH 05/23] drm/i915: Allocate a drm_atomic_state for the legacy modeset code Ander Conselvan de Oliveira
2015-03-04 15:33   ` Daniel Vetter
2015-03-09 23:19     ` Matt Roper
2015-03-12 12:28       ` Ander Conselvan De Oliveira
2015-03-03 13:22 ` [PATCH 06/23] drm/i915: Add an optional atomic state argument to intel_set_mode() Ander Conselvan de Oliveira
2015-03-04 15:41   ` Daniel Vetter [this message]
2015-03-03 13:22 ` [PATCH 07/23] drm/i915: Use an atomic state for the load detect modeset Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 08/23] drm/i915: Allocate a crtc_state also when the crtc is being disabled Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 09/23] drm/i915: Update dummy connector atomic state with current config Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 10/23] drm/i915: Implement connector state duplication Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 11/23] drm/i915: Copy the staged connector config to the legacy atomic state Ander Conselvan de Oliveira
2015-03-04 15:46   ` Daniel Vetter
2015-03-04 16:58     ` Conselvan De Oliveira, Ander
2015-03-04 17:51       ` Daniel Vetter
2015-03-03 13:22 ` [PATCH 12/23] drm/i915: Don't use encoder->new_crtc in intel_modeset_pipe_config() Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 13/23] drm/i915: Don't use encoder->new_crtc in compute_baseline_pipe_bpp() Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 14/23] drm/i915: Don't depend on encoder->new_crtc in intel_dp_compute_config() Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 15/23] drm/i915: Don't depend on encoder->new_crtc in intel_hdmi_compute_config Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 16/23] drm/i915: Use atomic state in intel_ddi_crtc_get_new_encoder() Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 17/23] drm/i915: Don't use staged config in intel_dp_mst_compute_config() Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 18/23] drm/i915: Don't use encoder->new_crtc in intel_lvds_compute_config() Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 19/23] drm/i915: Pass an atomic state to modeset_global_resources() functions Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 20/23] drm/i915: Use atomic state in pipe_has_enabled_pch() Ander Conselvan de Oliveira
2015-03-04 15:55   ` Daniel Vetter
2015-03-03 13:22 ` [PATCH 21/23] drm/i915: Convert intel_pipe_will_have_type() to using atomic state Ander Conselvan de Oliveira
2015-03-04 16:03   ` Daniel Vetter
2015-03-04 16:51     ` Conselvan De Oliveira, Ander
2015-03-04 16:57       ` Daniel Vetter
2015-03-03 13:22 ` [PATCH 22/23] drm/i915: Don't look at staged config crtc when changing DRRS state Ander Conselvan de Oliveira
2015-03-03 13:22 ` [PATCH 23/23] drm/i915: Remove usage of encoder->new_crtc from clock computations Ander Conselvan de Oliveira
2015-03-04  7:22   ` shuang.he
2015-03-04 15:21 ` [PATCH 00/23] Remove depencies on staged config for atomic transition 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=20150304154141.GC18775@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=ander.conselvan.de.oliveira@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox