Without watermark the power consumption will blow up, but when enabling platforms and dealing with different kinds of crashes, screen corruptions, pipe underuns, etc we need to be able to easily disable watermark to see if we are on the right investigation track. Another possibility was to skip at the beginning and avoid all calculations, but I'm not sure about it. Maybe it might be still useful to know the calculated values when debuging. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx> --- drivers/gpu/drm/i915/i915_params.c | 4 ++++ drivers/gpu/drm/i915/i915_params.h | 1 + drivers/gpu/drm/i915/intel_pm.c | 14 +++++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c index 8d90c25..7a0909d 100644 --- a/drivers/gpu/drm/i915/i915_params.c +++ b/drivers/gpu/drm/i915/i915_params.c @@ -42,6 +42,7 @@ struct i915_params i915 __read_mostly = { .preliminary_hw_support = IS_ENABLED(CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT), .disable_power_well = -1, .enable_ips = 1, + .enable_watermark = 1, .fastboot = 0, .prefault_disable = 0, .load_detect_test = 0, @@ -141,6 +142,9 @@ MODULE_PARM_DESC(disable_power_well, module_param_named_unsafe(enable_ips, i915.enable_ips, int, 0600); MODULE_PARM_DESC(enable_ips, "Enable IPS (default: true)"); +module_param_named_unsafe(enable_watermark, i915.enable_watermark, int, 0600); +MODULE_PARM_DESC(enable_watermark, "Enable Watermark (default: true)"); + module_param_named(fastboot, i915.fastboot, bool, 0600); MODULE_PARM_DESC(fastboot, "Try to skip unnecessary mode sets at boot time (default: false)"); diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h index 5299290..a1856e0 100644 --- a/drivers/gpu/drm/i915/i915_params.h +++ b/drivers/gpu/drm/i915/i915_params.h @@ -43,6 +43,7 @@ struct i915_params { unsigned int preliminary_hw_support; int disable_power_well; int enable_ips; + int enable_watermark; int invert_brightness; int enable_cmd_parser; int guc_log_level; diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 02fe081..6f14cd7 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -2484,7 +2484,7 @@ static void ilk_compute_wm_results(struct drm_device *dev, (r->pri_val << WM1_LP_SR_SHIFT) | r->cur_val; - if (r->enable) + if (r->enable && i915.enable_watermark) results->wm_lp[wm_lp - 1] |= WM1_LP_SR_EN; if (INTEL_INFO(dev)->gen >= 8) @@ -3258,7 +3258,8 @@ static void skl_compute_wm_results(struct drm_device *dev, temp |= p_wm->wm[level].plane_res_l[i] << PLANE_WM_LINES_SHIFT; temp |= p_wm->wm[level].plane_res_b[i]; - if (p_wm->wm[level].plane_en[i]) + if (p_wm->wm[level].plane_en[i] + && i915.enable_watermark) temp |= PLANE_WM_EN; r->plane[pipe][i][level] = temp; @@ -3269,7 +3270,8 @@ static void skl_compute_wm_results(struct drm_device *dev, temp |= p_wm->wm[level].plane_res_l[PLANE_CURSOR] << PLANE_WM_LINES_SHIFT; temp |= p_wm->wm[level].plane_res_b[PLANE_CURSOR]; - if (p_wm->wm[level].plane_en[PLANE_CURSOR]) + if (p_wm->wm[level].plane_en[PLANE_CURSOR] + && i915.enable_watermark) temp |= PLANE_WM_EN; r->plane[pipe][PLANE_CURSOR][level] = temp; @@ -3281,7 +3283,8 @@ static void skl_compute_wm_results(struct drm_device *dev, temp = 0; temp |= p_wm->trans_wm.plane_res_l[i] << PLANE_WM_LINES_SHIFT; temp |= p_wm->trans_wm.plane_res_b[i]; - if (p_wm->trans_wm.plane_en[i]) + if (p_wm->trans_wm.plane_en[i] + && i915.enable_watermark) temp |= PLANE_WM_EN; r->plane_trans[pipe][i] = temp; @@ -3290,7 +3293,8 @@ static void skl_compute_wm_results(struct drm_device *dev, temp = 0; temp |= p_wm->trans_wm.plane_res_l[PLANE_CURSOR] << PLANE_WM_LINES_SHIFT; temp |= p_wm->trans_wm.plane_res_b[PLANE_CURSOR]; - if (p_wm->trans_wm.plane_en[PLANE_CURSOR]) + if (p_wm->trans_wm.plane_en[PLANE_CURSOR] + && i915.enable_watermark) temp |= PLANE_WM_EN; r->plane_trans[pipe][PLANE_CURSOR] = temp; -- 2.4.3 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx