linux-stable/drivers
Tvrtko Ursulin df6a420535 drm/i915/pmu: Ensure monotonic rc6
Avoid rc6 counter going backward in close to 0% RC6 scenarios like:

    15.005477996        114,246,613 ns   i915/rc6-residency/
    16.005876662            667,657 ns   i915/rc6-residency/
    17.006131417              7,286 ns   i915/rc6-residency/
    18.006615031 18,446,744,073,708,914,688 ns   i915/rc6-residency/
    19.007158361 18,446,744,073,709,447,168 ns   i915/rc6-residency/
    20.007806498                  0 ns   i915/rc6-residency/
    21.008227495          1,440,403 ns   i915/rc6-residency/

There are two aspects to this fix.

First is not assuming rc6 value zero means GT is asleep since that can
also mean GPU is fully busy and we do not want to enter the estimation
path in that case.

Second is ensuring monotonicity on the estimation path itself. I suspect
what is happening is with extremely rapid park/unpark cycles we get no
updates on the real rc6 and therefore have to careful not to
unconditionally trust use last known real rc6 when creating a new
estimation.

v2:
 * Simplify logic by not tracking the estimate but last reported value.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Fixes: 16ffe73c18 ("drm/i915/pmu: Use GT parked for estimating RC6 while asleep")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v1
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191217142057.1000-1-tvrtko.ursulin@linux.intel.com
2019-12-18 15:23:41 +00:00
..
accessibility
acpi ACPI / LPSS: Rename pwm_backlight pwm-lookup to pwm_soc_backlight 2019-12-17 11:24:47 +01:00
amba
android
ata
atm
auxdisplay auxdisplay: charlcd: deduplicate simple_strtoul() 2019-12-04 19:44:12 -08:00
base ARM: SoC-related driver updates 2019-12-05 11:43:31 -08:00
bcma
block xen: branch for v5.5-rc1 2019-12-07 14:49:20 -08:00
bluetooth
bus Few ti-sysc related fixes for v5.5 merge window 2019-12-06 08:26:50 -08:00
cdrom
char drm msm + fixes for 5.5-rc1 2019-12-06 10:28:09 -08:00
clk ARM: SoC platform updates 2019-12-05 11:38:40 -08:00
clocksource
connector
counter
cpufreq cpufreq: tegra: Changes for v5.5-rc1 2019-12-06 08:28:13 -08:00
cpuidle
crypto
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware ARM: SoC fixes 2019-12-06 14:19:37 -08:00
fpga
fsi
gnss
gpio gpio: pca953x: tighten up indentation 2019-12-04 19:44:14 -08:00
gpu drm/i915/pmu: Ensure monotonic rc6 2019-12-18 15:23:41 +00:00
greybus
hid
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
ide
idle
iio
infiniband net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup 2019-12-04 12:27:13 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2019-12-07 18:33:01 -08:00
interconnect
iommu
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md
media
memory memory: tegra: Fixes for v5.5-rc1 2019-12-06 08:28:51 -08:00
memstick
message
mfd mfd: intel_soc_pmic: Rename pwm_backlight pwm-lookup to pwm_pmic_backlight 2019-12-17 11:24:47 +01:00
misc lib/genalloc.c: rename addr_in_gen_pool to gen_pool_has_addr 2019-12-04 19:44:13 -08:00
mmc
mtd
mux
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-08 13:28:11 -08:00
nfc
ntb Add Hygon Device ID to the AMD NTB device driver 2019-12-07 18:38:17 -08:00
nubus
nvdimm
nvme
nvmem ARM: SoC-related driver updates 2019-12-05 11:43:31 -08:00
of
opp
oprofile
parisc
parport
pci
pcmcia
perf
phy ARM: SoC-related driver updates 2019-12-05 11:43:31 -08:00
pinctrl
platform
pnp
power Additional power management updates for 5.5-rc1 2019-12-04 10:48:09 -08:00
powercap
pps
ps3
ptp
pwm pwm: Changes for v5.5-rc1 2019-12-05 11:28:14 -08:00
rapidio drivers/rapidio/rio-access.c: fix missing include of <linux/rio_drv.h> 2019-12-04 19:44:13 -08:00
ras
regulator
remoteproc
reset ARM: SoC-related driver updates 2019-12-05 11:43:31 -08:00
rpmsg
rtc
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-08 13:28:11 -08:00
sbus
scsi SCSI misc on 20191207 2019-12-08 12:23:42 -08:00
sfi
sh
siox
slimbus
soc ARM: SoC fixes 2019-12-06 14:19:37 -08:00
soundwire
spi
spmi
ssb
staging
target
tc
tee Merge mainline/master into arm/fixes 2019-12-05 13:18:54 -08:00
thermal Merge branch 'thermal/next' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux 2019-12-05 11:21:24 -08:00
thunderbolt
tty
uio
usb usb, kcov: collect coverage from hub_event 2019-12-04 19:44:14 -08:00
vfio VFIO updates for v5.5-rc1 2019-12-07 14:51:04 -08:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-08 13:28:11 -08:00
video
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen xen: branch for v5.5-rc1 2019-12-07 14:49:20 -08:00
zorro
Kconfig
Makefile