aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-26 04:58:18 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-11 17:50:59 -0500
commit47fab7370b45c6708e57430831839261d0d63f53 (patch)
treec8f4af05ee9dc9ebe094b45983c80f766d941340
parente95d41e1233f0c05f858f2bc5e43858972542581 (diff)
drm/i915: add ->display.modeset_global_resources callback
After all relevant pipes are disabled and after we've updated all the state with the staged state, but before we call the per-crtc ->mode_set functions there's a very natural point to set up any shared/global resources like - shared plls (obviously only the setup, the enabling needs to be separately handling with a separate refcount) - global watermark state like the DSPARB on gmch platforms - workaround bits that depend upon the exact global output configuration - enabling the right set of refclocks - enabling/disabling manual power wells. Now for a lot of these things we can't move them into this function yet, most often because we only compute the required information in the per-crtc ->mode_set callback. Which is too late. But due to a bunch of reasons (check-only atomic modeset, fastboot&hw state checks, ...) we need to separate the computation of that state from the actual hw frobbery anyway. So we can move things into this new callback step- by-step. Others can't be moved here (or implemented at all) because our code lacks the smarts to properly update them. E.g. the DSPARB can only be updated when all pipes are disabled, so if we decide to change it's value, we need to disable _all_ pipes. The infrastructure for that is already in place (with the various pipe masks that driver the modeset logic). But again we need to move a few things out of ->mode_set first before we can even implement the correct decision making. In any case, we need to start somewhere, so let's start with the callback: Some small follow-up patches will make immediate good use of it. Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h1
-rw-r--r--drivers/gpu/drm/i915/intel_display.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 2fcf284869df..f5120d024fdf 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -257,6 +257,7 @@ struct drm_i915_display_funcs {
257 uint32_t sprite_width, int pixel_size); 257 uint32_t sprite_width, int pixel_size);
258 void (*update_linetime_wm)(struct drm_device *dev, int pipe, 258 void (*update_linetime_wm)(struct drm_device *dev, int pipe,
259 struct drm_display_mode *mode); 259 struct drm_display_mode *mode);
260 void (*modeset_global_resources)(struct drm_device *dev);
260 int (*crtc_mode_set)(struct drm_crtc *crtc, 261 int (*crtc_mode_set)(struct drm_crtc *crtc,
261 struct drm_display_mode *mode, 262 struct drm_display_mode *mode,
262 struct drm_display_mode *adjusted_mode, 263 struct drm_display_mode *adjusted_mode,
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index d6cdbc622dd0..0b2224c592d8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7548,6 +7548,9 @@ bool intel_set_mode(struct drm_crtc *crtc,
7548 * update the the output configuration. */ 7548 * update the the output configuration. */
7549 intel_modeset_update_state(dev, prepare_pipes); 7549 intel_modeset_update_state(dev, prepare_pipes);
7550 7550
7551 if (dev_priv->display.modeset_global_resources)
7552 dev_priv->display.modeset_global_resources(dev);
7553
7551 /* Set up the DPLL and any encoders state that needs to adjust or depend 7554 /* Set up the DPLL and any encoders state that needs to adjust or depend
7552 * on the DPLL. 7555 * on the DPLL.
7553 */ 7556 */