[Intel-gfx] [PATCH v2 16/27] drm/i915: move detaching scalers to begin_crtc_commit, v2.
Matt Roper
matthew.d.roper at intel.com
Wed Jun 10 18:36:06 PDT 2015
On Thu, Jun 04, 2015 at 02:47:46PM +0200, Maarten Lankhorst wrote:
> This is probably intended to be be done during vblank evasion.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_atomic.c | 3 ---
> drivers/gpu/drm/i915/intel_display.c | 8 ++++----
> drivers/gpu/drm/i915/intel_drv.h | 1 -
> 3 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index 7ca225194b7c..8447a1fef332 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -144,9 +144,6 @@ int intel_atomic_commit(struct drm_device *dev,
> for_each_crtc_in_state(state, crtc, crtc_state, i) {
> to_intel_crtc(crtc)->config = to_intel_crtc_state(crtc->state);
>
> - if (INTEL_INFO(dev)->gen >= 9)
> - skl_detach_scalers(to_intel_crtc(crtc));
> -
> drm_atomic_helper_commit_planes_on_crtc(crtc_state);
> }
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index f5f074524603..2ba3d6abbd0c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2911,16 +2911,13 @@ unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane,
> /*
> * This function detaches (aka. unbinds) unused scalers in hardware
> */
> -void skl_detach_scalers(struct intel_crtc *intel_crtc)
> +static void skl_detach_scalers(struct intel_crtc *intel_crtc)
> {
> struct drm_device *dev;
> struct drm_i915_private *dev_priv;
> struct intel_crtc_scaler_state *scaler_state;
> int i;
>
> - if (!intel_crtc || !intel_crtc->config)
> - return;
> -
> dev = intel_crtc->base.dev;
> dev_priv = dev->dev_private;
> scaler_state = &intel_crtc->config->scaler_state;
> @@ -13505,6 +13502,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
> intel_crtc->atomic.evade =
> intel_pipe_update_start(intel_crtc,
> &intel_crtc->atomic.start_vbl_count);
> +
> + if (!needs_modeset(crtc->state) && INTEL_INFO(dev)->gen >= 9)
> + skl_detach_scalers(intel_crtc);
I'm not sure I follow where the !needs_modeset test comes from. Do
these get blown away somewhere else in the modeset sequence that I'm
overlooking? Detaching scalers here when we are doing a modeset
wouldn't cause actual problems would it?
Matt
> }
>
> static void intel_finish_crtc_commit(struct drm_crtc *crtc)
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 0dae94631094..d96c9a24b94b 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1135,7 +1135,6 @@ void intel_mode_from_pipe_config(struct drm_display_mode *mode,
> struct intel_crtc_state *pipe_config);
> void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc);
> void intel_modeset_preclose(struct drm_device *dev, struct drm_file *file);
> -void skl_detach_scalers(struct intel_crtc *intel_crtc);
>
> int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state, int force_detach);
> int skl_max_scale(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state);
> --
> 2.1.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
More information about the Intel-gfx
mailing list