Wrap up ILK-style atomic watermarks (v2)
Subsystems (3)
cover Wrap up ILK-style atomic watermarks (v2)
Previous patch series was here:
http://lists.freedesktop.org/archives/intel-gfx/2015-November/081270.html
The changes since the last version are mainly minor fixes based on review feedback from Ville and Maarten.
Matt Roper (7):
drm/i915: Disable primary plane if we fail to reconstruct BIOS fb (v2) drm/i915: Extract plane dumping from intel_dump_pipe_config() drm/i915: Setup clipped src/dest coordinates during FB reconstruction
(v2)
drm/i915: Convert hsw_compute_linetime_wm to use in-flight state drm/i915: Add extra paranoia to ILK watermark calculations drm/i915: Sanitize watermarks after hardware state readout (v4) drm/i915: Add two-stage ILK-style watermark programming (v8)
drivers/gpu/drm/drm_crtc.c | 3 + drivers/gpu/drm/i915/i915_drv.h | 5 + drivers/gpu/drm/i915/intel_atomic.c | 1 + drivers/gpu/drm/i915/intel_display.c | 266 ++++++++++++++++++++++++++++++----- drivers/gpu/drm/i915/intel_drv.h | 31 +++- drivers/gpu/drm/i915/intel_pm.c | 189 ++++++++++++++++++------- include/drm/drm_crtc.h | 1 + 7 files changed, 405 insertions(+), 91 deletions(-)
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/7 drm/i915: Disable primary plane if we fail to reconstruct BIOS fb (v2)
If we fail to reconstruct the BIOS fb (e.g., because the FB is too large), we'll be left with plane state that indicates the primary plane is visible yet has a NULL fb. This mismatch causes problems later on (e.g., for the watermark code). Since we've failed to reconstruct the BIOS FB, the best solution is to just disable the primary plane and pretend the BIOS never had it enabled.
v2: Add intel_pre_disable_primary() call (Maarten)
---
As previously noted, this might also fix some GPU hangs on older platforms (unconfirmed). Potential bugzillas include:
https://bugs.freedesktop.org/show_bug.cgi?id=89319 https://bugs.freedesktop.org/show_bug.cgi?id=87677 https://bugs.freedesktop.org/show_bug.cgi?id=89146 https://bugs.freedesktop.org/show_bug.cgi?id=91653
This should probably go into -fixes (and possibly stable if we get confirmation on any of those bugzillas?)
drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/gpu/drm/i915/intel_display.c +15 -0
@@ -116,6 +116,7 @@ static void skylake_pfit_enable(struct intel_crtc *crtc);static void ironlake_pfit_disable (struct intel_crtc *crtc,bool force);static void ironlake_pfit_enable (struct intel_crtc *crtc);static void intel_modeset_setup_hw_state (struct drm_device *dev); +static void intel_pre_disable_primary (struct drm_crtc *crtc); typedef struct { int min, max;
@@ -2597,6 +2598,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,struct drm_i915_gem_object *obj;struct drm_plane *primary = intel_crtc->base.primary;struct drm_plane_state *plane_state = primary->state; +struct drm_crtc_state *crtc_state = intel_crtc->base.state; +struct intel_plane *intel_plane =to_intel_plane (primary);struct drm_framebuffer *fb;if (!plane_config->fb)
@@ -2633,6 +2636,18 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, } } +/* +* We've failed to reconstruct the BIOS FB. Current display state +* indicates that the primary plane is visible, but has a NULL FB, +* which will lead to problems later if we don't fix it up. The +* simplest solution is to just disable the primary plane now and +* pretend the BIOS never had it enabled. +*/ +to_intel_plane_state (plane_state)->visible = false; + crtc_state->plane_mask &= ~(1 <<drm_plane_index (primary)); +intel_pre_disable_primary (&intel_crtc->base); + intel_plane->disable_plane (primary, &intel_crtc->base); +return ; valid_fb:
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 1/7] drm/i915: Disable primary plane if we fail to reconstruct BIOS fb (v2)
Quoted 7 lines · Matt Roper
If we fail to reconstruct the BIOS fb (e.g., because the FB is too large), we'll be left with plane state that indicates the primary plane is visible yet has a NULL fb. This mismatch causes problems later on (e.g., for the watermark code). Since we've failed to reconstruct the BIOS FB, the best solution is to just disable the primary plane and pretend the BIOS never had it enabled.
Quoted 7 lines
v2: Add
intel_pre_disable_primary()call (Maarten)Cc Daniel Vetter <[email protected]>Cc Ville Syrjälä <[email protected]>Cc Maarten Lankhorst <[email protected]>Signed-off-by Matt Roper <[email protected]>Reviewed-by Maarten Lankhorst <[email protected]>
+drm-intel-fixes
We're still waiting for the rest of the series to be reviewed, but this first patch already has Maarten's r-b and should probably go into -fixes. Possibly stable as well if we get confirmation that this also fixes any of the bugzillas listed below?
Matt
Quoted 58 lines
---
As previously noted, this might also fix some GPU hangs on older platforms (unconfirmed). Potential bugzillas include:https://bugs.freedesktop.org/show_bug.cgi?id=89319 https://bugs.freedesktop.org/show_bug.cgi?id=87677 https://bugs.freedesktop.org/show_bug.cgi?id=89146 https://bugs.freedesktop.org/show_bug.cgi?id=91653This should probably go into -fixes (and possibly stable if we get confirmation on any of those bugzillas?)
drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)drivers/gpu/drm/i915/intel_display.c +15
-0@@ -116,6 +116,7 @@ static void skylake_pfit_enable(struct intel_crtc *crtc);static void ironlake_pfit_disable (struct intel_crtc *crtc,bool force);static void ironlake_pfit_enable (struct intel_crtc *crtc);static void intel_modeset_setup_hw_state (struct drm_device *dev); +static void intel_pre_disable_primary (struct drm_crtc *crtc); typedef struct { int min, max;@@ -2597,6 +2598,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,struct drm_i915_gem_object *obj;struct drm_plane *primary = intel_crtc->base.primary;struct drm_plane_state *plane_state = primary->state; +struct drm_crtc_state *crtc_state = intel_crtc->base.state; +struct intel_plane *intel_plane =to_intel_plane (primary);struct drm_framebuffer *fb;if (!plane_config->fb)@@ -2633,6 +2636,18 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, } } +/* +* We've failed to reconstruct the BIOS FB. Current display state +* indicates that the primary plane is visible, but has a NULL FB, +* which will lead to problems later if we don't fix it up. The +* simplest solution is to just disable the primary plane now and +* pretend the BIOS never had it enabled. +*/ +to_intel_plane_state (plane_state)->visible = false; + crtc_state->plane_mask &= ~(1 <<drm_plane_index (primary)); +intel_pre_disable_primary (&intel_crtc->base); + intel_plane->disable_plane (primary, &intel_crtc->base); +return ; valid_fb:Signature · 1 line
2.1.4
Signature · 9 lines
Matt Roper Graphics Software Engineer IoTG Platform Enabling & Development Intel Corporation (916) 356-2795 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/7 drm/i915: Extract plane dumping from intel_dump_pipe_config()
In reply to Matt RoperThe plane information isn't important in most of the places where we dump the pipe config; the one place where it would be valuable is during initial HW state readout, but currently we dump the pipe config before FB's are reconstructed, so the data dumped is misleading anyway. Even worse, in places where we're dumping an in-flight pipe config, we're still dumping the already-committed plane state, which is confusing/misleading.
Extract the plane dumping to its own function that can be called in the specific place(s) where we actually want to see this information.
A few other changes are made while extracting this dumping logic:
* show planes that have an FB, but are invisible (e.g., because they're offscreen or hidden by other planes) as "not visible" rather than "enabled."
* display the FB format as a human-readable string rather than a hex format code
* List the actual plane type ("Primary," "Overlay," or "Cursor") rather than just "STANDARD" or "CURSOR."
--- drivers/gpu/drm/drm_crtc.c | 3 ++ drivers/gpu/drm/i915/intel_display.c | 75 +++++++++++++++++++----------------- include/drm/drm_crtc.h | 1 + 3 files changed, 43 insertions(+), 36 deletions(-)
drivers/gpu/drm/drm_crtc.c +3 -0
@@ -78,6 +78,9 @@ static const struct drm_prop_enum_list drm_plane_type_enum_list[] = { { DRM_PLANE_TYPE_CURSOR, "Cursor" }, }; +DRM_ENUM_NAME_FN(drm_get_plane_type, drm_plane_type_enum_list) +EXPORT_SYMBOL (drm_get_plane_type); +/* * Optional properties */
drivers/gpu/drm/i915/intel_display.c +39 -36
101 lines not on this page · raw message
include/drm/drm_crtc.h +1 -0
@@ -1286,6 +1286,7 @@ extern void drm_encoder_cleanup(struct drm_encoder *encoder);extern const char *drm_get_connector_status_name (enum drm_connector_status status);extern const char *drm_get_subpixel_order_name (enum subpixel_order order);extern const char *drm_get_dpms_name (int val); +extern const char *drm_get_plane_type (int val);extern const char *drm_get_dvi_i_subconnector_name (int val);extern const char *drm_get_dvi_i_select_name (int val);extern const char *drm_get_tv_subconnector_name (int val);
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/7 drm/i915: Setup clipped src/dest coordinates during FB reconstruction (v2)
In reply to Matt RoperPlane state objects contain two copies of src/dest coordinates: the original (requested by userspace) coordinates in the base drm_plane_state object, and a second, clipped copy (i.e., what we actually want to program to the hardware) in intel_plane_state. We've only been setting up the former set of values during boot time FB reconstruction, but we should really be initializing both.
Note that the code here probably still needs some more work since we make a lot of assumptions about how the BIOS programmed the hardware that may not always be true, especially on gen9+; e.g.,
* Primary plane might not be positioned at 0,0
* Primary plane could have been rotated by the BIOS
* Primary plane might be scaled
* The BIOS fb might be a single "extended mode" FB that spans multiple displays.
* ...etc...
v2: Reword/expand commit message description of assumptions we make
Reviewed-by(v1): Ville Syrjälä <[email protected]>
--- drivers/gpu/drm/i915/intel_display.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/gpu/drm/i915/intel_display.c +11 -0
@@ -2600,6 +2600,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,struct drm_plane_state *plane_state = primary->state;struct drm_crtc_state *crtc_state = intel_crtc->base.state;struct intel_plane *intel_plane =to_intel_plane (primary); +struct intel_plane_state *intel_state = +to_intel_plane_state (plane_state);struct drm_framebuffer *fb;if (!plane_config->fb)
@@ -2661,6 +2663,15 @@ valid_fb: plane_state->crtc_w = fb->width; plane_state->crtc_h = fb->height; + intel_state->src.x1 = plane_state->src_x; + intel_state->src.y1 = plane_state->src_y; + intel_state->src.x2 = plane_state->src_x + plane_state->src_w; + intel_state->src.y2 = plane_state->src_y + plane_state->src_h; + intel_state->dst.x1 = plane_state->crtc_x; + intel_state->dst.y1 = plane_state->crtc_y; + intel_state->dst.x2 = plane_state->crtc_x + plane_state->crtc_w; + intel_state->dst.y2 = plane_state->crtc_y + plane_state->crtc_h; + obj =intel_fb_obj (fb);if (obj->tiling_mode !=I915_TILING_NONE ) dev_priv->preserve_bios_swizzle = true;
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/7 drm/i915: Convert hsw_compute_linetime_wm to use in-flight state
In reply to Matt RoperWhen watermark calculation was moved up to the atomic check phase, the code was updated to calculate based on in-flight atomic state rather than already-committed state. However the hsw_compute_linetime_wm() didn't get updated and continued to pull values out of the currently-committed CRTC state. On platforms that call this function (HSW/BDW only), this will cause problems when we go to enable the CRTC since we'll pull the current mode (off) rather than the mode we're calculating for and wind up with a divide by zero error.
This was an oversight in commit:
commit a28170f3389f4e42db95e595b0d86384a79de696
Author: Matt Roper <[email protected]>
Date: Thu Sep 24 15:53:16 2015 -0700
drm/i915: Calculate ILK-style watermarks during atomic check (v3)
--- drivers/gpu/drm/i915/intel_pm.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +10 -6
@@ -1998,14 +1998,19 @@ static void ilk_compute_wm_level(const struct drm_i915_private *dev_priv, }static uint32_t -hsw_compute_linetime_wm (struct drm_device *dev,struct drm_crtc *crtc) +hsw_compute_linetime_wm (struct drm_device *dev, +struct intel_crtc_state *cstate) {struct drm_i915_private *dev_priv = dev->dev_private; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -const struct drm_display_mode *adjusted_mode = &intel_crtc->config->base.adjusted_mode; +const struct drm_display_mode *adjusted_mode = + &cstate->base.adjusted_mode;u32 linetime, ips_linetime; -if (!intel_crtc->active) +if (!cstate->base.active) +return 0 ; +if (WARN_ON (adjusted_mode->crtc_clock ==0 )) +return 0 ; +if (WARN_ON (dev_priv->cdclk_freq ==0 ))return 0 ;/* The WM are computed with base on how long it takes to fill a single
@@ -2313,8 +2318,7 @@ static int ilk_compute_pipe_wm(struct intel_crtc *intel_crtc, pristate, sprstate, curstate, &pipe_wm->wm[0]);if (IS_HASWELL (dev) ||IS_BROADWELL (dev)) - pipe_wm->linetime =hsw_compute_linetime_wm (dev, - &intel_crtc->base); + pipe_wm->linetime =hsw_compute_linetime_wm (dev, cstate);/* LP0 watermarks always use 1/2 DDB partitioning */ ilk_compute_wm_maximums (dev,0 , &config,INTEL_DDB_PART_1_2 , &max);
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/7 drm/i915: Add extra paranoia to ILK watermark calculations
In reply to Matt RoperOur low-level watermark calculation functions don't get called when the CRTC is disabled or the relevant plane is invisible, so they should never see a zero htotal or zero bpp. However add some checks to ensure this is true so that we don't wind up dividing by zero if we make a mistake elsewhere in the driver (which the atomic watermark series has revealed we might be).
References: http://lists.freedesktop.org/archives/intel-gfx/2015-October/077370.html
--- drivers/gpu/drm/i915/intel_pm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +16 -0
@@ -1672,6 +1672,9 @@ uint32_t ilk_pipe_pixel_rate(const struct intel_crtc_state *pipe_config)if (pipe_h < pfit_h) pipe_h = pfit_h; +if (WARN_ON (!pfit_w || !pfit_h)) +return pixel_rate; + pixel_rate =div_u64 ((uint64_t ) pixel_rate * pipe_w * pipe_h, pfit_w * pfit_h); }
@@ -1703,6 +1706,8 @@ static uint32_t ilk_wm_method2(uint32_t pixel_rate, uint32_t pipe_htotal,if (WARN (latency ==0 ,"Latency value missing\n" ))return UINT_MAX ; +if (WARN_ON (!pipe_htotal)) +return UINT_MAX ; ret = (latency * pixel_rate) / (pipe_htotal *10000 ); ret = (ret +1 ) * horiz_pixels * bytes_per_pixel;
@@ -1713,6 +1718,17 @@ static uint32_t ilk_wm_method2(uint32_t pixel_rate, uint32_t pipe_htotal,static uint32_t ilk_wm_fbc (uint32_t pri_val,uint32_t horiz_pixels,uint8_t bytes_per_pixel) { +/* +* Neither of these should be possible since this function shouldn't be +* called if the CRTC is off or the plane is invisible. But let's be +* extra paranoid to avoid a potential divide-by-zero if we screw up +* elsewhere in the driver. +*/ +if (WARN_ON (!bytes_per_pixel)) +return 0 ; +if (WARN_ON (!horiz_pixels)) +return 0 ; +return DIV_ROUND_UP (pri_val *64 , horiz_pixels * bytes_per_pixel) +2 ; }
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/7 drm/i915: Sanitize watermarks after hardware state readout (v4)
In reply to Matt RoperAlthough we can do a good job of reading out hardware state, the graphics firmware may have programmed the watermarks in a creative way that doesn't match how i915 would have chosen to program them. We shouldn't trust the firmware's watermark programming, but should rather re-calculate how we think WM's should be programmed and then shove those values into the hardware.
We can do this pretty easily by creating a dummy top-level state, running it through the check process to calculate all the values, and then just programming the watermarks for each CRTC.
v2: Move watermark sanitization after our BIOS fb reconstruction; the
watermark calculations that we do here need to look at pstate->fb, which isn't setup yet in intel_modeset_setup_hw_state(), even though we have an enabled & visible plane.
v3:
- Don't move 'active = optimal' watermark assignment; we just undo that change in the next patch anyway. (Ville)
- Move atomic helper locking fix to separate patch. (Maarten)
v4:
- Grab connection_mutex before calling atomic helper to duplicate state. The connector loop inside the helper will throw a WARN if we don't hold something to protect the connector list (and the helper itself doesn't try to lock the list).
- Make failure to calculate watermarks for inherited state a WARN() since it probably indicates a serious problem in either our state readout code or our watermark code for this platform.
--- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_display.c | 79 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_pm.c | 10 +++-- 3 files changed, 86 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -630,6 +630,7 @@ struct drm_i915_display_funcs { struct dpll *best_clock);int (*compute_pipe_wm)(struct intel_crtc *crtc,struct drm_atomic_state *state); +void (*program_watermarks)(struct intel_crtc_state *cstate);void (*update_wm)(struct drm_crtc *crtc);int (*modeset_calc_cdclk)(struct drm_atomic_state *state);void (*modeset_commit_cdclk)(struct drm_atomic_state *state);
drivers/gpu/drm/i915/intel_display.c +79 -0
91 lines not on this page · raw message
drivers/gpu/drm/i915/intel_pm.c +6 -4
@@ -3618,9 +3618,11 @@ static void skl_update_wm(struct drm_crtc *crtc) dev_priv->wm.skl_hw = *results; } -static void ilk_program_watermarks (struct drm_i915_private *dev_priv) +static void ilk_program_watermarks (struct intel_crtc_state *cstate) { -struct drm_device *dev = dev_priv->dev; +struct drm_crtc *crtc = cstate->base.crtc; +struct drm_device *dev = crtc->dev; +struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_pipe_wm lp_wm_1_2 = {}, lp_wm_5_6 = {}, *best_lp_wm;struct ilk_wm_maximums max;struct intel_wm_config *config = &dev_priv->wm.config;
@@ -3651,7 +3653,6 @@ static void ilk_program_watermarks(struct drm_i915_private *dev_priv)static void ilk_update_wm (struct drm_crtc *crtc) { -struct drm_i915_private *dev_priv =to_i915 (crtc->dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc);struct intel_crtc_state *cstate =to_intel_crtc_state (crtc->state);
@@ -3671,7 +3672,7 @@ static void ilk_update_wm(struct drm_crtc *crtc) intel_crtc->wm.active.ilk = cstate->wm.optimal.ilk; -ilk_program_watermarks (dev_priv); +ilk_program_watermarks (cstate); } static void skl_pipe_wm_active_state(uint32_t val,
@@ -6979,6 +6980,7 @@ void intel_init_pm(struct drm_device *dev) dev_priv->wm.spr_latency[0] && dev_priv->wm.cur_latency[0])) { dev_priv->display.update_wm = ilk_update_wm; dev_priv->display.compute_pipe_wm = ilk_compute_pipe_wm; + dev_priv->display.program_watermarks = ilk_program_watermarks; } else {DRM_DEBUG_KMS ("Failed to read display plane latency. " "Disable CxSR\n" );
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/7 drm/i915: Add two-stage ILK-style watermark programming (v8)
In reply to Matt RoperIn addition to calculating final watermarks, let's also pre-calculate a set of intermediate watermark values at atomic check time. These intermediate watermarks are a combination of the watermarks for the old state and the new state; they should satisfy the requirements of both states which means they can be programmed immediately when we commit the atomic state (without waiting for a vblank). Once the vblank does happen, we can then re-program watermarks to the more optimal final value.
v2: Significant rebasing/rewriting.
v3:
- Move 'need_postvbl_update' flag to CRTC state (Daniel)
- Don't forget to check intermediate watermark values for validity (Maarten)
- Don't due async watermark optimization; just do it at the end of the atomic transaction, after waiting for vblanks. We do want it to be async eventually, but adding that now will cause more trouble for Maarten's in-progress work. (Maarten)
- Don't allocate space in crtc_state for intermediate watermarks on platforms that don't need it (gen9+).
- Move WaCxSRDisabledForSpriteScaling:ivb into intel_begin_crtc_commit now that ilk_update_wm is gone.
v4:
- Add a wm_mutex to cover updates to intel_crtc->active and the need_postvbl_update flag. Since we don't have async yet it isn't terribly important yet, but might as well add it now.
- Change interface to program watermarks. Platforms will now expose .initial_watermarks() and .optimize_watermarks() functions to do watermark programming. These should lock wm_mutex, copy the appropriate state values into intel_crtc->active, and then call the internal program watermarks function.
v5:
- Skip intermediate watermark calculation/check during initial hardware readout since we don't trust the existing HW values (and don't have valid values of our own yet).
- Don't try to call .optimize_watermarks() on platforms that don't have atomic watermarks yet. (Maarten)
v6:
- Rebase
v7:
- Further rebase
v8:
- A few minor indentation and line length fixes
Reviewed-by(v5): Maarten Lankhorst <[email protected]>
--- drivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/intel_atomic.c | 1 + drivers/gpu/drm/i915/intel_display.c | 90 ++++++++++++++++++- drivers/gpu/drm/i915/intel_drv.h | 31 ++++++- drivers/gpu/drm/i915/intel_pm.c | 163 ++++++++++++++++++++++++----------- 5 files changed, 235 insertions(+), 56 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +5 -1
@@ -630,7 +630,11 @@ struct drm_i915_display_funcs { struct dpll *best_clock);int (*compute_pipe_wm)(struct intel_crtc *crtc,struct drm_atomic_state *state); -void (*program_watermarks)(struct intel_crtc_state *cstate); +int (*compute_intermediate_wm)(struct drm_device *dev, +struct intel_crtc *intel_crtc, +struct intel_crtc_state *newstate); +void (*initial_watermarks)(struct intel_crtc_state *cstate); +void (*optimize_watermarks)(struct intel_crtc_state *cstate);void (*update_wm)(struct drm_crtc *crtc);int (*modeset_calc_cdclk)(struct drm_atomic_state *state);void (*modeset_commit_cdclk)(struct drm_atomic_state *state);
drivers/gpu/drm/i915/intel_atomic.c +1 -0
@@ -95,6 +95,7 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) crtc_state->update_pipe = false; crtc_state->disable_lp_wm = false; + crtc_state->wm.need_postvbl_update = false;return &crtc_state->base; }
drivers/gpu/drm/i915/intel_display.c +86 -4
150 lines not on this page · raw message
drivers/gpu/drm/i915/intel_drv.h +29 -2
@@ -249,6 +249,12 @@ struct intel_atomic_state {bool dpll_set;struct intel_shared_dpll_config shared_dpll[I915_NUM_PLLS ];struct intel_wm_config wm_config; + +/* +* Current watermarks can't be trusted during hardware readout, so +* don't bother calculating intermediate watermarks. +*/ +bool skip_intermediate_wm; };struct intel_plane_state {
@@ -494,13 +500,29 @@ struct intel_crtc_state {struct {/* -* optimal watermarks, programmed post-vblank when this state -* is committed +* Optimal watermarks, programmed post-vblank when this state +* is committed. */ union {struct intel_pipe_wm ilk;struct skl_pipe_wm skl; } optimal; + +/* +* Intermediate watermarks; these can be programmed immediately +* since they satisfy both the current configuration we're +* switching away from and the new configuration we're switching +* to. +*/ +struct intel_pipe_wm intermediate; + +/* +* Platforms with two-step watermark programming will need to +* update watermark programming post-vblank to switch from the +* safe intermediate watermarks to the optimal final +* watermarks. +*/ +bool need_postvbl_update; } wm; };
@@ -590,8 +612,12 @@ struct intel_crtc {struct intel_pipe_wm ilk;struct skl_pipe_wm skl; } active; +/* allow CxSR on this pipe */ bool cxsr_allowed; + +/* Protects active and need_postvbl_update */ +struct mutex wm_mutex; } wm;int scanline_offset;
@@ -1467,6 +1493,7 @@ void skl_wm_get_hw_state(struct drm_device *dev);void skl_ddb_get_hw_state (struct drm_i915_private *dev_priv,struct skl_ddb_allocation *ddb/* out */ );uint32_t ilk_pipe_pixel_rate (const struct intel_crtc_state *pipe_config); +bool ilk_disable_lp_wm (struct drm_device *dev);/* intel_sdvo.c */ bool intel_sdvo_init(struct drm_device *dev,
drivers/gpu/drm/i915/intel_pm.c +114 -49
248 lines not on this page · raw message
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/7 drm/i915: Add two-stage ILK-style watermark programming (v9)
In addition to calculating final watermarks, let's also pre-calculate a set of intermediate watermark values at atomic check time. These intermediate watermarks are a combination of the watermarks for the old state and the new state; they should satisfy the requirements of both states which means they can be programmed immediately when we commit the atomic state (without waiting for a vblank). Once the vblank does happen, we can then re-program watermarks to the more optimal final value.
v2: Significant rebasing/rewriting.
v3:
- Move 'need_postvbl_update' flag to CRTC state (Daniel)
- Don't forget to check intermediate watermark values for validity (Maarten)
- Don't due async watermark optimization; just do it at the end of the atomic transaction, after waiting for vblanks. We do want it to be async eventually, but adding that now will cause more trouble for Maarten's in-progress work. (Maarten)
- Don't allocate space in crtc_state for intermediate watermarks on platforms that don't need it (gen9+).
- Move WaCxSRDisabledForSpriteScaling:ivb into intel_begin_crtc_commit now that ilk_update_wm is gone.
v4:
- Add a wm_mutex to cover updates to intel_crtc->active and the need_postvbl_update flag. Since we don't have async yet it isn't terribly important yet, but might as well add it now.
- Change interface to program watermarks. Platforms will now expose .initial_watermarks() and .optimize_watermarks() functions to do watermark programming. These should lock wm_mutex, copy the appropriate state values into intel_crtc->active, and then call the internal program watermarks function.
v5:
- Skip intermediate watermark calculation/check during initial hardware readout since we don't trust the existing HW values (and don't have valid values of our own yet).
- Don't try to call .optimize_watermarks() on platforms that don't have atomic watermarks yet. (Maarten)
v6:
- Rebase
v7:
- Further rebase
v8:
- A few minor indentation and line length fixes
v9:
- Yet another rebase since Maarten's patches reworked a bunch of the code (wm_pre, wm_post, etc.) that this was previously based on.
Reviewed-by(v5): Maarten Lankhorst <[email protected]>
--- drivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/intel_atomic.c | 1 + drivers/gpu/drm/i915/intel_display.c | 93 +++++++++++++++++++- drivers/gpu/drm/i915/intel_drv.h | 31 ++++++- drivers/gpu/drm/i915/intel_pm.c | 163 ++++++++++++++++++++++++----------- 5 files changed, 238 insertions(+), 56 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +5 -1
@@ -630,7 +630,11 @@ struct drm_i915_display_funcs { struct dpll *best_clock);int (*compute_pipe_wm)(struct intel_crtc *crtc,struct drm_atomic_state *state); -void (*program_watermarks)(struct intel_crtc_state *cstate); +int (*compute_intermediate_wm)(struct drm_device *dev, +struct intel_crtc *intel_crtc, +struct intel_crtc_state *newstate); +void (*initial_watermarks)(struct intel_crtc_state *cstate); +void (*optimize_watermarks)(struct intel_crtc_state *cstate);void (*update_wm)(struct drm_crtc *crtc);int (*modeset_calc_cdclk)(struct drm_atomic_state *state);void (*modeset_commit_cdclk)(struct drm_atomic_state *state);
drivers/gpu/drm/i915/intel_atomic.c +1 -0
@@ -97,6 +97,7 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) crtc_state->disable_lp_wm = false; crtc_state->disable_cxsr = false; crtc_state->wm_changed = false; + crtc_state->wm.need_postvbl_update = false;return &crtc_state->base; }
drivers/gpu/drm/i915/intel_display.c +89 -4
148 lines not on this page · raw message
drivers/gpu/drm/i915/intel_drv.h +29 -2
@@ -249,6 +249,12 @@ struct intel_atomic_state {bool dpll_set;struct intel_shared_dpll_config shared_dpll[I915_NUM_PLLS ];struct intel_wm_config wm_config; + +/* +* Current watermarks can't be trusted during hardware readout, so +* don't bother calculating intermediate watermarks. +*/ +bool skip_intermediate_wm; };struct intel_plane_state {
@@ -496,13 +502,29 @@ struct intel_crtc_state {struct {/* -* optimal watermarks, programmed post-vblank when this state -* is committed +* Optimal watermarks, programmed post-vblank when this state +* is committed. */ union {struct intel_pipe_wm ilk;struct skl_pipe_wm skl; } optimal; + +/* +* Intermediate watermarks; these can be programmed immediately +* since they satisfy both the current configuration we're +* switching away from and the new configuration we're switching +* to. +*/ +struct intel_pipe_wm intermediate; + +/* +* Platforms with two-step watermark programming will need to +* update watermark programming post-vblank to switch from the +* safe intermediate watermarks to the optimal final +* watermarks. +*/ +bool need_postvbl_update; } wm; };
@@ -589,8 +611,12 @@ struct intel_crtc {struct intel_pipe_wm ilk;struct skl_pipe_wm skl; } active; +/* allow CxSR on this pipe */ bool cxsr_allowed; + +/* Protects active and need_postvbl_update */ +struct mutex wm_mutex; } wm;int scanline_offset;
@@ -1472,6 +1498,7 @@ void skl_wm_get_hw_state(struct drm_device *dev);void skl_ddb_get_hw_state (struct drm_i915_private *dev_priv,struct skl_ddb_allocation *ddb/* out */ );uint32_t ilk_pipe_pixel_rate (const struct intel_crtc_state *pipe_config); +bool ilk_disable_lp_wm (struct drm_device *dev);/* intel_sdvo.c */ bool intel_sdvo_init(struct drm_device *dev,
drivers/gpu/drm/i915/intel_pm.c +114 -49
248 lines not on this page · raw message
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerRe: [PATCH 7/7] drm/i915: Add two-stage ILK-style watermark programming (v9)
Hey,
Op 15-12-15 om 00:51 schreef Matt Roper:
Quoted 8 lines
In addition to calculating final watermarks, let's also pre-calculate a set of intermediate watermark values at atomic check time. These intermediate watermarks are a combination of the watermarks for the old state and the new state; they should satisfy the requirements of both states which means they can be programmed immediately when we commit the atomic state (without waiting for a vblank). Once the vblank does happen, we can then re-program watermarks to the more optimal final value.
<snip>
Quoted 16 lines
drivers/gpu/drm/i915/intel_pm.c +3
-11-static void ilk_update_wm (struct drm_crtc *crtc) +static void ilk_initial_watermarks (struct intel_crtc_state *cstate) { -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_crtc_state *cstate =to_intel_crtc_state (crtc->state); - -WARN_ON (cstate->base.active != intel_crtc->active); +struct drm_i915_private *dev_priv =to_i915 (cstate->base.crtc->dev); +struct intel_crtc *intel_crtc =to_intel_crtc (cstate->base.crtc); -/* -* IVB workaround: must disable low power watermarks for at least -* one frame before enabling scaling. LP watermarks can be re-enabled -* when scaling is disabled. -* -* WaCxSRDisabledForSpriteScaling:ivb
drivers/gpu/drm/i915/intel_pm.c static void ilk_program_watermarks(struct intel_crtc_state *cstate) · line 3723
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +5
-5-*/ -if (cstate->disable_lp_wm) { -ilk_disable_lp_wm (crtc->dev); -intel_wait_for_vblank (crtc->dev, intel_crtc->pipe); - } +mutex_lock (&intel_crtc->wm.wm_mutex); + intel_crtc->wm.active.ilk = cstate->wm.intermediate; +ilk_program_watermarks (dev_priv); +mutex_unlock (&intel_crtc->wm.wm_mutex); +}
Do the locks even protect anything correctly? It seems to me like this mutex may need to be in dev_priv.
ilk_program_watermarks seems to be depending on all crtc's wm state.
Not a criticism on this patch, but is there an way to hammer in per crtc only wm's without having to look at the exact details of the global wm state outside of modesets?
drivers/gpu/drm/i915/intel_pm.c static void ilk_program_watermarks(struct intel_crtc_state *cstate) · line 3734
Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +9
-2- intel_crtc->wm.active.ilk = cstate->wm.optimal.ilk; +static void ilk_optimize_watermarks (struct intel_crtc_state *cstate) +{ +struct drm_i915_private *dev_priv =to_i915 (cstate->base.crtc->dev); +struct intel_crtc *intel_crtc =to_intel_crtc (cstate->base.crtc); -ilk_program_watermarks (cstate); +mutex_lock (&intel_crtc->wm.wm_mutex); +if (cstate->wm.need_postvbl_update) { + intel_crtc->wm.active.ilk = cstate->wm.optimal.ilk; +ilk_program_watermarks (dev_priv); + cstate->wm.need_postvbl_update = false;
You don't need to reset the flag here, it's already cleared when duplicating the state..
~Maarten
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 7/7] drm/i915: Add two-stage ILK-style watermark programming (v9)
Quoted 32 lines · Maarten Lankhorst
Hey,
Op 15-12-15 om 00:51 schreef Matt Roper:
Quoted 8 lines
In addition to calculating final watermarks, let's also pre-calculate a set of intermediate watermark values at atomic check time. These intermediate watermarks are a combination of the watermarks for the old state and the new state; they should satisfy the requirements of both states which means they can be programmed immediately when we commit the atomic state (without waiting for a vblank). Once the vblank does happen, we can then re-program watermarks to the more optimal final value.
<snip>
Quoted 20 lines
drivers/gpu/drm/i915/intel_pm.c +3
-15-static void ilk_update_wm (struct drm_crtc *crtc) +static void ilk_initial_watermarks (struct intel_crtc_state *cstate) { -struct intel_crtc *intel_crtc =to_intel_crtc (crtc); -struct intel_crtc_state *cstate =to_intel_crtc_state (crtc->state); - -WARN_ON (cstate->base.active != intel_crtc->active); +struct drm_i915_private *dev_priv =to_i915 (cstate->base.crtc->dev); +struct intel_crtc *intel_crtc =to_intel_crtc (cstate->base.crtc); -/* -* IVB workaround: must disable low power watermarks for at least -* one frame before enabling scaling. LP watermarks can be re-enabled -* when scaling is disabled. -* -* WaCxSRDisabledForSpriteScaling:ivb -*/ -if (cstate->disable_lp_wm) { -ilk_disable_lp_wm (crtc->dev); -intel_wait_for_vblank (crtc->dev, intel_crtc->pipe);
Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c static void ilk_program_watermarks(struct intel_crtc_state *cstate) · line 3723
Quoted 6 lines
drivers/gpu/drm/i915/intel_pm.c +5
-1- } +mutex_lock (&intel_crtc->wm.wm_mutex); + intel_crtc->wm.active.ilk = cstate->wm.intermediate; +ilk_program_watermarks (dev_priv); +mutex_unlock (&intel_crtc->wm.wm_mutex); +}Do the locks even protect anything correctly? It seems to me like this mutex may need to be in
dev_priv.
My original reasoning for the wm_mutex was to ensure that once we allow post-vblank operations to happen via a workqueue that they don't race with the 'initial' step of a subsequent commit. We don't actually have that async postvbl support yet, so you're right that the mutex doesn't really protect anything yet.
But you're right that we should move the mutex to dev_priv instead of having it per-crtc; I guess the other case we need to worry about (which my patch isn't currently protecting) is two racing atomic commits against two disjoint sets of CRTC's. In that case the ilk_write_wm_values() needs to happen under under a lock. I'll send an update shortly with this change.
Quoted 4 lines
ilk_program_watermarksseems to be depending on all crtc's wm state.Not a criticism on this patch, but is there an way to hammer in per crtc only wm's without having to look at the exact details of the global wm state outside of modesets?
I don't think so; most of the watermark logic has several different methods of calculating various watermark values; the decision for which method is supposed to be used is dependent on the global state. For example, turning on a sprite on CRTC 1 could change the method that needs to be used to calculate the values of CRTC 2.
Matt
Quoted 16 lines
drivers/gpu/drm/i915/intel_pm.c static void ilk_program_watermarks(struct intel_crtc_state *cstate) · line 3734
Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +9
-2- intel_crtc->wm.active.ilk = cstate->wm.optimal.ilk; +static void ilk_optimize_watermarks (struct intel_crtc_state *cstate) +{ +struct drm_i915_private *dev_priv =to_i915 (cstate->base.crtc->dev); +struct intel_crtc *intel_crtc =to_intel_crtc (cstate->base.crtc); -ilk_program_watermarks (cstate); +mutex_lock (&intel_crtc->wm.wm_mutex); +if (cstate->wm.need_postvbl_update) { + intel_crtc->wm.active.ilk = cstate->wm.optimal.ilk; +ilk_program_watermarks (dev_priv); + cstate->wm.need_postvbl_update = false;You don't need to reset the flag here, it's already cleared when duplicating the state..
~Maarten
Signature · 9 lines
Matt Roper Graphics Software Engineer IoTG Platform Enabling & Development Intel Corporation (916) 356-2795 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 drm/i915: Add two-stage ILK-style watermark programming (v10)
In reply to Maarten LankhorstIn addition to calculating final watermarks, let's also pre-calculate a set of intermediate watermark values at atomic check time. These intermediate watermarks are a combination of the watermarks for the old state and the new state; they should satisfy the requirements of both states which means they can be programmed immediately when we commit the atomic state (without waiting for a vblank). Once the vblank does happen, we can then re-program watermarks to the more optimal final value.
v2: Significant rebasing/rewriting.
v3:
- Move 'need_postvbl_update' flag to CRTC state (Daniel)
- Don't forget to check intermediate watermark values for validity (Maarten)
- Don't due async watermark optimization; just do it at the end of the atomic transaction, after waiting for vblanks. We do want it to be async eventually, but adding that now will cause more trouble for Maarten's in-progress work. (Maarten)
- Don't allocate space in crtc_state for intermediate watermarks on platforms that don't need it (gen9+).
- Move WaCxSRDisabledForSpriteScaling:ivb into intel_begin_crtc_commit now that ilk_update_wm is gone.
v4:
- Add a wm_mutex to cover updates to intel_crtc->active and the need_postvbl_update flag. Since we don't have async yet it isn't terribly important yet, but might as well add it now.
- Change interface to program watermarks. Platforms will now expose .initial_watermarks() and .optimize_watermarks() functions to do watermark programming. These should lock wm_mutex, copy the appropriate state values into intel_crtc->active, and then call the internal program watermarks function.
v5:
- Skip intermediate watermark calculation/check during initial hardware readout since we don't trust the existing HW values (and don't have valid values of our own yet).
- Don't try to call .optimize_watermarks() on platforms that don't have atomic watermarks yet. (Maarten)
v6:
- Rebase
v7:
- Further rebase
v8:
- A few minor indentation and line length fixes
v9:
- Yet another rebase since Maarten's patches reworked a bunch of the code (wm_pre, wm_post, etc.) that this was previously based on.
v10:
- Move wm_mutex to dev_priv to protect against racing commits against disjoint CRTC sets. (Maarten)
- Drop unnecessary clearing of cstate->wm.need_postvbl_update (Maarten)
--- drivers/gpu/drm/i915/i915_dma.c | 1 + drivers/gpu/drm/i915/i915_drv.h | 13 ++- drivers/gpu/drm/i915/intel_atomic.c | 1 + drivers/gpu/drm/i915/intel_display.c | 92 +++++++++++++++++++- drivers/gpu/drm/i915/intel_drv.h | 28 +++++- drivers/gpu/drm/i915/intel_pm.c | 162 ++++++++++++++++++++++++----------- 6 files changed, 241 insertions(+), 56 deletions(-)
drivers/gpu/drm/i915/i915_dma.c +1 -0
@@ -893,6 +893,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)mutex_init (&dev_priv->sb_lock);mutex_init (&dev_priv->modeset_restore_lock);mutex_init (&dev_priv->av_mutex); +mutex_init (&dev_priv->wm.wm_mutex);intel_pm_setup (dev);
drivers/gpu/drm/i915/i915_drv.h +12 -1
@@ -623,7 +623,11 @@ struct drm_i915_display_funcs { struct dpll *best_clock);int (*compute_pipe_wm)(struct intel_crtc *crtc,struct drm_atomic_state *state); -void (*program_watermarks)(struct intel_crtc_state *cstate); +int (*compute_intermediate_wm)(struct drm_device *dev, +struct intel_crtc *intel_crtc, +struct intel_crtc_state *newstate); +void (*initial_watermarks)(struct intel_crtc_state *cstate); +void (*optimize_watermarks)(struct intel_crtc_state *cstate);void (*update_wm)(struct drm_crtc *crtc);int (*modeset_calc_cdclk)(struct drm_atomic_state *state);void (*modeset_commit_cdclk)(struct drm_atomic_state *state);
@@ -1927,6 +1931,13 @@ struct drm_i915_private { };uint8_t max_level; + +/* +* Should be held around atomic WM register writing; also +* protects * intel_crtc->wm.active and +* cstate->wm.need_postvbl_update. +*/ +struct mutex wm_mutex; } wm;struct i915_runtime_pm pm;
drivers/gpu/drm/i915/intel_atomic.c +1 -0
@@ -97,6 +97,7 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc) crtc_state->disable_lp_wm = false; crtc_state->disable_cxsr = false; crtc_state->wm_changed = false; + crtc_state->wm.need_postvbl_update = false;return &crtc_state->base; }
drivers/gpu/drm/i915/intel_display.c +88 -4
141 lines not on this page · raw message
drivers/gpu/drm/i915/intel_drv.h +26 -2
@@ -260,6 +260,12 @@ struct intel_atomic_state {struct intel_shared_dpll_config shared_dpll[I915_NUM_PLLS ];struct intel_wm_config wm_config; + +/* +* Current watermarks can't be trusted during hardware readout, so +* don't bother calculating intermediate watermarks. +*/ +bool skip_intermediate_wm; };struct intel_plane_state {
@@ -507,13 +513,29 @@ struct intel_crtc_state {struct {/* -* optimal watermarks, programmed post-vblank when this state -* is committed +* Optimal watermarks, programmed post-vblank when this state +* is committed. */ union {struct intel_pipe_wm ilk;struct skl_pipe_wm skl; } optimal; + +/* +* Intermediate watermarks; these can be programmed immediately +* since they satisfy both the current configuration we're +* switching away from and the new configuration we're switching +* to. +*/ +struct intel_pipe_wm intermediate; + +/* +* Platforms with two-step watermark programming will need to +* update watermark programming post-vblank to switch from the +* safe intermediate watermarks to the optimal final +* watermarks. +*/ +bool need_postvbl_update; } wm; };
@@ -600,6 +622,7 @@ struct intel_crtc {struct intel_pipe_wm ilk;struct skl_pipe_wm skl; } active; +/* allow CxSR on this pipe */ bool cxsr_allowed; } wm;
@@ -1566,6 +1589,7 @@ void skl_wm_get_hw_state(struct drm_device *dev);void skl_ddb_get_hw_state (struct drm_i915_private *dev_priv,struct skl_ddb_allocation *ddb/* out */ );uint32_t ilk_pipe_pixel_rate (const struct intel_crtc_state *pipe_config); +bool ilk_disable_lp_wm (struct drm_device *dev);/* intel_sdvo.c */ bool intel_sdvo_init(struct drm_device *dev,
drivers/gpu/drm/i915/intel_pm.c +113 -49
247 lines not on this page · raw message
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerRe: [PATCH] drm/i915: Add two-stage ILK-style watermark programming (v10)
Op 06-01-16 om 20:34 schreef Matt Roper:
Quoted 54 lines
In addition to calculating final watermarks, let's also pre-calculate a set of intermediate watermark values at atomic check time. These intermediate watermarks are a combination of the watermarks for the old state and the new state; they should satisfy the requirements of both states which means they can be programmed immediately when we commit the atomic state (without waiting for a vblank). Once the vblank does happen, we can then re-program watermarks to the more optimal final value.
v2: Significant rebasing/rewriting.
v3:
- Move 'need_postvbl_update' flag to CRTC state (Daniel)
- Don't forget to check intermediate watermark values for validity (Maarten)
- Don't due async watermark optimization; just do it at the end of the atomic transaction, after waiting for vblanks. We do want it to be async eventually, but adding that now will cause more trouble for Maarten's in-progress work. (Maarten)
- Don't allocate space incrtc_statefor intermediate watermarks on platforms that don't need it (gen9+).
- Move WaCxSRDisabledForSpriteScaling:ivb intointel_begin_crtc_commitnow thatilk_update_wmis gone.v4:
- Add awm_mutexto cover updates tointel_crtc->activeand theneed_postvbl_updateflag. Since we don't have async yet it isn't terribly important yet, but might as well add it now.
- Change interface to program watermarks. Platforms will now expose .initial_watermarks() and .optimize_watermarks() functions to do watermark programming. These should lockwm_mutex, copy the appropriate state values intointel_crtc->active, and then call the internal program watermarks function.v5:
- Skip intermediate watermark calculation/check during initial hardware readout since we don't trust the existing HW values (and don't have valid values of our own yet).
- Don't try to call .optimize_watermarks() on platforms that don't have atomic watermarks yet. (Maarten)v6:
- Rebasev7:
- Further rebasev8:
- A few minor indentation and line length fixesv9:
- Yet another rebase since Maarten's patches reworked a bunch of the code (wm_pre,wm_post, etc.) that this was previously based on.
Quoted 8 lines
v10:
- Movewm_mutextodev_privto protect against racing commits against disjoint CRTC sets. (Maarten)
- Drop unnecessary clearing ofcstate->wm.need_postvbl_update(Maarten)Cc Maarten Lankhorst <[email protected]>Signed-off-by Matt Roper <[email protected]>
Pushed, thanks.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst
maintainerOp 03-12-15 om 20:37 schreef Matt Roper:
Quoted 9 lines
Previous patch series was here:
http://lists.freedesktop.org/archives/intel-gfx/2015-November/081270.htmlThe changes since the last version are mainly minor fixes based on review feedback from Ville and Maarten.
Matt Roper (7):
drm/i915: Disable primary plane if we fail to reconstruct BIOS fb (v2)
This one is in fixes.
Quoted 1 line
drm/i915: Extract plane dumping from
intel_dump_pipe_config()
Holding this one for now, I believe it may need to go through drm-misc.
Quoted 5 lines
drm/i915: Setup clipped src/dest coordinates during FB reconstruction
(v2)drm/i915: Convert
hsw_compute_linetime_wmto use in-flight state drm/i915: Add extra paranoia to ILK watermark calculations drm/i915: Sanitize watermarks after hardware state readout (v4)
Committed, thanks.
Quoted 2 lines
drm/i915: Add two-stage ILK-style watermark programming (v8)
~Maarten
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx