stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
	Lyude <cpaul@redhat.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Paulo Zanoni <paulo.r.zanoni@intel.com>,
	Jani Nikula <jani.nikula@intel.com>
Subject: [PATCH 4.8 026/125] drm/i915/gen9: fix plane_blocks_per_line on watermarks calculations
Date: Sat, 29 Oct 2016 09:49:04 -0400	[thread overview]
Message-ID: <20161029134948.300726363@linuxfoundation.org> (raw)
In-Reply-To: <20161029134947.232372651@linuxfoundation.org>

4.8-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

commit cf6c525a31fac11b0775b8c06c00a508c6356d9b upstream.

The confusing thing is that plane_blocks_per_line is listed as part of
the method 2 calculation but is also used for other things. We
calculated it in two different places and different ways: one inside
skl_wm_method2() and the other inside skl_compute_plane_wm(). The
skl_wm_method2() implementation is the one that matches the
specification.

With this patch we fix the skl_compute_plane_wm() calculation and just
pass it as a parameter to skl_wm_method2(). We also take care to not
modify the value of plane_bytes_per_line since we're going to rely on
it having a correct value in later patches.

This should affect the watermarks for Linear and Y-tiled.

>>From my analysis, it looks like the two plane_blocks_per_line
variables got out of sync on 0fda65680e92, but we can't really say
that commit was a regression, it looks like just an incomplete fix.
There's always the possibility that 0fda65680e92 matched our
specification at that time, and then later the specification changed.

v2: Try to add a "Fixes" tag (Maarten).

Fixes: 0fda65680e92 ("drm/i915/skl: Update watermarks for Y tiling")
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Lyude <cpaul@redhat.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1474578035-424-7-git-send-email-paulo.r.zanoni@intel.com
(cherry picked from commit 7a1a8aed67e0a60772defe3f6499eb340da48634)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/i915/intel_pm.c |   39 +++++++++++++++------------------------
 1 file changed, 15 insertions(+), 24 deletions(-)

--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3475,30 +3475,14 @@ static uint32_t skl_wm_method1(uint32_t
 }
 
 static uint32_t skl_wm_method2(uint32_t pixel_rate, uint32_t pipe_htotal,
-			       uint32_t horiz_pixels, uint8_t cpp,
-			       uint64_t tiling, uint32_t latency,
-			       uint32_t y_min_scanlines)
+			       uint32_t latency, uint32_t plane_blocks_per_line)
 {
 	uint32_t ret;
-	uint32_t plane_bytes_per_line, plane_blocks_per_line;
 	uint32_t wm_intermediate_val;
 
 	if (latency == 0)
 		return UINT_MAX;
 
-	plane_bytes_per_line = horiz_pixels * cpp;
-
-	if (tiling == I915_FORMAT_MOD_Y_TILED ||
-	    tiling == I915_FORMAT_MOD_Yf_TILED) {
-		plane_bytes_per_line *= y_min_scanlines;
-		plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512);
-		plane_blocks_per_line /= y_min_scanlines;
-	} else if (tiling == DRM_FORMAT_MOD_NONE) {
-		plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512) + 1;
-	} else {
-		plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512);
-	}
-
 	wm_intermediate_val = latency * pixel_rate;
 	ret = DIV_ROUND_UP(wm_intermediate_val, pipe_htotal * 1000) *
 				plane_blocks_per_line;
@@ -3587,17 +3571,24 @@ static int skl_compute_plane_wm(const st
 		y_min_scanlines = 4;
 	}
 
+	plane_bytes_per_line = width * cpp;
+	if (fb->modifier[0] == I915_FORMAT_MOD_Y_TILED ||
+	    fb->modifier[0] == I915_FORMAT_MOD_Yf_TILED) {
+		plane_blocks_per_line =
+		      DIV_ROUND_UP(plane_bytes_per_line * y_min_scanlines, 512);
+		plane_blocks_per_line /= y_min_scanlines;
+	} else if (fb->modifier[0] == DRM_FORMAT_MOD_NONE) {
+		plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512)
+					+ 1;
+	} else {
+		plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512);
+	}
+
 	method1 = skl_wm_method1(plane_pixel_rate, cpp, latency);
 	method2 = skl_wm_method2(plane_pixel_rate,
 				 cstate->base.adjusted_mode.crtc_htotal,
-				 width,
-				 cpp,
-				 fb->modifier[0],
 				 latency,
-				 y_min_scanlines);
-
-	plane_bytes_per_line = width * cpp;
-	plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512);
+				 plane_blocks_per_line);
 
 	if (fb->modifier[0] == I915_FORMAT_MOD_Y_TILED ||
 	    fb->modifier[0] == I915_FORMAT_MOD_Yf_TILED) {



  parent reply	other threads:[~2016-10-29 13:51 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20161029135133uscas1p244a56d26b4705445442b5e2e8454ba28@uscas1p2.samsung.com>
2016-10-29 13:48 ` [PATCH 4.8 000/125] 4.8.6-stable review Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 001/125] drm/vc4: Fix races when the CS reads from render targets Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 005/125] drm/amdgpu: fix IB alignment for UVD Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 006/125] drm/amdgpu/dce10: disable hpd on local panels Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 007/125] drm/amdgpu/dce8: " Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 008/125] drm/amdgpu/dce11: " Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 009/125] drm/amdgpu/dce11: add missing drm_mode_config_cleanup call Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 011/125] drm/amdgpu: change vblank_times calculation method to reduce computational error Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 012/125] drm/radeon: narrow asic_init for virtualization Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 013/125] drm/radeon/si/dpm: fix phase shedding setup Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 014/125] drm/radeon: change vblank_times calculation method to reduce computational error Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 015/125] drm/vmwgfx: Limit the user-space command buffer size Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 016/125] drm/fsl-dcu: fix endian issue when using clk_register_divider Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 017/125] drm/amd/powerplay: fix mclk not switching back after multi-head was disabled Greg Kroah-Hartman
2016-10-29 13:48   ` [PATCH 4.8 018/125] HID: add quirk for Akai MIDImix Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 022/125] drm/i915/skl: Dont try to update plane watermarks if they havent changed Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 023/125] drm/i915/gen9: only add the planes actually affected by ddb changes Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 024/125] drm/i915/gen9: fix the WaWmMemoryReadLatency implementation Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 025/125] drm/i915/gen9: minimum scanlines for Y tile is not always 4 Greg Kroah-Hartman
2016-10-29 13:49   ` Greg Kroah-Hartman [this message]
2016-10-29 13:49   ` [PATCH 4.8 027/125] drm/i915/gen9: fix the watermark res_blocks value Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 028/125] drm/i915: SAGV is not SKL-only, so rename a few things Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 029/125] drm/i915: introduce intel_has_sagv() Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 030/125] drm/i915/kbl: KBL also needs to run the SAGV code Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 031/125] Revert "drm/i915: Check live status before reading edid" Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 037/125] drm/i915: Just clear the mmiodebug before a register access Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 038/125] drm/i915: Unalias obj->phys_handle and obj->userptr Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 039/125] posix_acl: Clear SGID bit when setting file permissions Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 040/125] rt2x00usb: Fix error return code Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 041/125] scsi: cxlflash: Remove the device cleanly in the system shutdown path Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 042/125] genirq/generic_chip: Add irq_unmap callback Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 043/125] coresight: Remove erroneous dma_free_coherent in tmc_probe Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 044/125] uio: fix dmem_region_start computation Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 046/125] spi: spi-fsl-dspi: Drop extra spi_master_put in device remove function Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 047/125] i40e: remove a stray unlock Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 048/125] i40e: fix broken i40e_config_rss_aq function Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 049/125] mwifiex: correct aid value during tdls setup Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 050/125] mwifiex: fix failed to reconnect after interface disabled/enabled Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 051/125] ath10k: Add WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT wmi service Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 052/125] ath10k: fix sending frame in management path in push txq logic Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 053/125] ath10k: fix reporting channel survey data Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 054/125] ath10k: fix throughput regression in multi client mode Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 055/125] crypto: marvell - Dont overwrite default creq->state during initialization Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 057/125] crypto: marvell - Update transformation context for each dequeued req Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 058/125] crypto: arm/ghash-ce - add missing async import/export Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 059/125] crypto: ccp - Fix return value check in ccp_dmaengine_register() Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 060/125] hwrng: omap - Only fail if pm_runtime_get_sync returns < 0 Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 061/125] ASoC: topology: Fix error return code in soc_tplg_dapm_widget_create() Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 062/125] ASoC: dapm: Fix possible uninitialized variable in snd_soc_dapm_get_volsw() Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 063/125] ASoC: dapm: Fix value setting for _ENUM_DOUBLE MUXs second channel Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 064/125] ASoC: dapm: Fix kcontrol creation for output driver widget Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 065/125] ASoC: sst-bxt-rt298: fix obsoleted initializers for array Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 066/125] ASoC: sst-bxt-da7219_max98357a: " Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 067/125] iio: ad5755: fix off-by-one on devnr limit check Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 068/125] iio: light: us5182d: Add missing error code assignment before test Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 069/125] staging: android ion/hisi: fix dependencies Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 070/125] staging: sm750fb: Correctly set CLOCK_PHASE bit of display controller Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 071/125] staging: r8188eu: Fix scheduling while atomic splat Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 072/125] staging: ks7010: fix wait_for_completion_interruptible_timeout return handling Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 073/125] staging: ks7010: declare private functions static Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 074/125] IB/hfi1: Move iowait_init() to priv allocate Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 075/125] IB/rdmavt: Correct sparse annotation Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 076/125] IB/qib: Remove qpt_mask global Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 077/125] IB/mlx5: Fix steering resource leak Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 078/125] power: bq24257: Fix use of uninitialized pointer bq->charger Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 079/125] dmaengine: ipu: remove bogus NO_IRQ reference Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 080/125] mm/hugetlb: check for reserved hugepages during memory offline Greg Kroah-Hartman
2016-10-29 13:49   ` [PATCH 4.8 081/125] mm/hugetlb: improve locking in dissolve_free_huge_pages() Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 082/125] drm/vmwgfx: Avoid validating views on view destruction Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 083/125] s390/cio: fix accidental interrupt enabling during resume Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 084/125] s390/con3270: fix use of uninitialised data Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 085/125] s390/con3270: fix insufficient space padding Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 086/125] clk: bcm2835: Skip PLLC clocks when deciding on a new clock parent Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 087/125] clk: gcc-msm8996: Fix pcie 2 pipe register offset Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 088/125] clk: qcom: select GDSC for msm8996 gcc and mmcc Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 089/125] clk: qoriq: fix a register offset error Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 090/125] clk: Return errors from clk providers in __of_clk_get_from_provider() Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 091/125] clk: core: Force setting the phase delay when no change Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 092/125] clk: divider: Fix clk_divider_round_rate() to use clk_readl() Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 093/125] perf data: Fix building in 32 bit platform with libbabeltrace Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 094/125] perf hists browser: Fix event group display Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 095/125] perf powerpc: Fix build-test failure Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 097/125] perf ui/stdio: Always reset output width for hierarchy Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 098/125] perf symbols: Check symbol_conf.allow_aliases for kallsyms loading too Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 099/125] perf symbols: Fixup symbol sizes before picking best ones Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 100/125] iwlwifi: check for valid ethernet address provided by OEM Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 101/125] iwlwifi: mvm: fix pending frames tracking on tx resp Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 102/125] iwlwifi: mvm: call a different txq_enable function Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 103/125] iwlwifi: mvm: free reserved queue on STA removal Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 104/125] iwlwifi: mvm: support BAR in reorder buffer Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 105/125] iwlwifi: mvm: disable P2P queue on mac context release Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 106/125] iwlwifi: mvm: bail out if CTDP start operation fails Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 107/125] ARM: dts: sun9i: Add missing #interrupt-cells to R_PIO pinctrl device node Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 108/125] pinctrl: qcom: fix masking of pinmux functions Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 109/125] mpt3sas: Dont spam logs if logging level is 0 Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 110/125] powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 111/125] powerpc: Add check_if_tm_restore_required() to giveup_all() Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 112/125] powerpc/nvram: Fix an incorrect partition merge Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 113/125] powerpc: Fix usage of _PAGE_RO in hugepage Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 114/125] ARM: pxa: pxa_cplds: fix interrupt handling Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 115/125] ARM: pxa: fix GPIO double shifts Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 116/125] ARM: dts: NSP: Correct RAM amount for BCM958625HR board Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 117/125] ARM: dts: fix RealView EB SMSC ethernet version Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 118/125] ARM: dts: omap3: overo: add missing unit name for lcd35 display Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 119/125] PCI: rcar: Fix pci_remap_iospace() failure path Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 120/125] PCI: aardvark: " Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 121/125] PCI: generic: " Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 122/125] PCI: versatile: " Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 123/125] PCI: designware: " Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 124/125] PCI: tegra: " Greg Kroah-Hartman
2016-10-29 13:50   ` [PATCH 4.8 125/125] libnvdimm: clear the internal poison_list when clearing badblocks Greg Kroah-Hartman
2016-10-29 23:07   ` [PATCH 4.8 000/125] 4.8.6-stable review Shuah Khan
2016-10-30 10:29     ` Greg Kroah-Hartman
2016-10-30  0:44   ` Guenter Roeck
2016-10-30 10:28     ` Greg Kroah-Hartman

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=20161029134948.300726363@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=cpaul@redhat.com \
    --cc=jani.nikula@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=paulo.r.zanoni@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tvrtko.ursulin@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).