From: Daniel Vetter <daniel@ffwll.ch>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/4] drm/i915: add modeset_global_pipes callback for global config adjustments
Date: Fri, 1 Nov 2013 20:37:04 +0100 [thread overview]
Message-ID: <20131101193704.GU4167@phenom.ffwll.local> (raw)
In-Reply-To: <1383320487-790-3-git-send-email-jbarnes@virtuousgeek.org>
On Fri, Nov 01, 2013 at 08:41:26AM -0700, Jesse Barnes wrote:
> In some cases we may need to turn off more pipes than just the ones
> affected by a connector or encoder change, probably due to modifying
> some global resource that requires all pipes to shut down. Add a hook
> for this purpose to allow platform code to adjust the prepare_pipes
> mask, which allows otherwise active pipes to get shut down for the
> duration of the mode set, then restored at the end.
>
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 12 ++++++++++++
> drivers/gpu/drm/i915/intel_display.c | 7 +++++++
> 2 files changed, 19 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 5edf9bb..7530cd4 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -380,6 +380,18 @@ struct drm_i915_display_funcs {
> struct drm_crtc *crtc,
> uint32_t sprite_width, int pixel_size,
> bool enable, bool scaled);
> + /**
> + * modeset_global_pipes - figure out which pipes need to be disabled
> + * @dev: drm device
> + * @prepare_pipes: bitmask of pipes to disable
> + *
> + * In some cases, adjusting a global resource may require shutting
> + * down seemingly unrelated pipes on a mode set. This function
> + * should determine that and adjust the prepare_pipes bitmask
> + * as needed.
> + */
> + void (*modeset_global_pipes)(struct drm_device *dev,
> + unsigned *prepare_pipes);
> void (*modeset_global_resources)(struct drm_device *dev);
> /* Returns the active state of the crtc, and if the crtc is active,
> * fills out the pipe-config with the hw state. */
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 606a594..faa7548 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9298,6 +9298,13 @@ static int __intel_set_mode(struct drm_crtc *crtc,
> intel_modeset_affected_pipes(crtc, &modeset_pipes,
> &prepare_pipes, &disable_pipes);
>
> + /*
> + * See if the config requires any additional preparation, e.g.
> + * to adjust global state with pipes off.
> + */
> + if (dev_priv->display.modeset_global_pipes)
> + dev_priv->display.modeset_global_pipes(dev, &prepare_pipes);
tbh I'd have just added a small callback here - as long as all the global
modeset config stuff is still in flux I wouldn't bother with fancy-looking
callbacks which we need to change later on anyway. And avoiding the vfunc
helps with following the code a bit ...
-Daniel
> +
> *saved_hwmode = crtc->hwmode;
> *saved_mode = crtc->mode;
>
> --
> 1.8.3.1
>
> _______________________________________________
> 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
next prev parent reply other threads:[~2013-11-01 19:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-01 15:41 [PATCH 1/4] drm/i915: add bunit read/write routines Jesse Barnes
2013-11-01 15:41 ` [PATCH 2/4] drm/i915: move VLV DDR freq fetch into init_clock_gating Jesse Barnes
2013-11-01 15:41 ` [PATCH 3/4] drm/i915: add modeset_global_pipes callback for global config adjustments Jesse Barnes
2013-11-01 19:37 ` Daniel Vetter [this message]
2013-11-01 15:41 ` [PATCH 4/4] drm/i915/vlv: modeset_global_* for VLV Jesse Barnes
2013-11-01 18:02 ` [PATCH] drm/i915/vlv: modeset_global_* for VLV v2 Jesse Barnes
2013-11-01 19:13 ` [PATCH] drm/i915/vlv: modeset_global_* for VLV v3 Jesse Barnes
2013-11-01 19:24 ` [PATCH] drm/i915: add modeset_global_pipes callback for global config adjustments Jesse Barnes
2013-11-01 19:28 ` Jesse Barnes
2013-11-01 19:28 ` [PATCH] drm/i915/vlv: modeset_global_* for VLV v4 Jesse Barnes
2013-11-01 19:52 ` Ville Syrjälä
2013-11-01 20:01 ` Daniel Vetter
2013-11-04 17:41 ` Jesse Barnes
2013-11-01 19:54 ` [PATCH 1/4] drm/i915: add bunit read/write routines 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=20131101193704.GU4167@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jbarnes@virtuousgeek.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