linux_dsm_epyc7002/drivers/gpu/drm/i915
Anshuman Gupta 1c4d821db9 drm/i915/tgl: Switch between dc3co and dc5 based on display idleness
DC3CO is useful power state, when DMC detects PSR2 idle frame
while an active video playback, playing 30fps video on 60hz panel
is the classic example of this use case.

B.Specs:49196 has a restriction to enable DC3CO only for Video Playback.
It will be worthy to enable DC3CO after completion of each pageflip
and switch back to DC5 when display is idle because driver doesn't
differentiate between video playback and a normal pageflip.
We will use Frontbuffer flush call tgl_dc3co_flush() to enable DC3CO
state only for ORIGIN_FLIP flush call, because DC3CO state has primarily
targeted for VPB use case. We are not interested here for frontbuffer
invalidates calls because that triggers PSR2 exit, which will
explicitly disable DC3CO.

DC5 and DC6 saves more power, but can't be entered during video
playback because there are not enough idle frames in a row to meet
most PSR2 panel deep sleep entry requirement typically 4 frames.
As PSR2 existing implementation is using minimum 6 idle frames for
deep sleep, it is safer to enable DC5/6 after 6 idle frames
(By scheduling a delayed work of 6 idle frames, once DC3CO has been
enabled after a pageflip).

After manually waiting for 6 idle frames DC5/6 will be enabled and
PSR2 deep sleep idle frames will be restored to 6 idle frames, at this
point DMC will triggers DC5/6 once PSR2 enters to deep sleep after
6 idle frames.
In future when we will enable S/W PSR2 tracking, we can change the
PSR2 required deep sleep idle frames to 1 so DMC can trigger the
DC5/6 immediately after S/W manual waiting of 6 idle frames get
complete.

v2: calculated s/w state to switch over dc3co when there is an
    update. [Imre]
    Used cancel_delayed_work_sync() in order to avoid any race
    with already scheduled delayed work. [Imre]
v3: Cancel_delayed_work_sync() may blocked the commit work.
    hence dropping it, dc5_idle_thread() checks the valid wakeref before
    putting the reference count, which avoids any chances of dropping
    a zero wakeref. [Imre (IRC)]
v4: Used frontbuffer flush mechanism. [Imre]
v5: Used psr.pipe to extract frontbuffer busy bits. [Imre]
    Used cancel_delayed_work_sync() in encoder disable path. [Imre]
    Used mod_delayed_work() instead of cancelling and scheduling a
    delayed work. [Imre]
    Used psr.lock in tgl_dc5_idle_thread() to enable psr2 deep
    sleep. [Imre]
    Removed DC5_REQ_IDLE_FRAMES macro. [Imre]
v6: Used dc3co_exitline check instead of TGL and dc3co allowed_dc_mask
    checks, used delayed_work_pending with the psr lock and removed the
    psr2_deep_slp_disabled flag. [Imre]
v7: Code refactoring, moved most of functional code to inte_psr.c [Imre]
    Using frontbuffer_bits on psr.pipe check instead of
    busy_frontbuffer_bits. [Imre]
    Calculating dc3co_exit_delay in intel_psr_enable_locked. [Imre]

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Animesh Manna <animesh.manna@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191003081738.22101-6-anshuman.gupta@intel.com
2019-10-08 11:05:28 +03:00
..
display drm/i915/tgl: Switch between dc3co and dc5 based on display idleness 2019-10-08 11:05:28 +03:00
gem drm/i915/stolen: make the object creation interface consistent 2019-10-04 19:27:41 +01:00
gt drm/i915/gt: Treat a busy timeline as 'active' while waiting 2019-10-07 21:44:02 +01:00
gvt drm/i915: Move context management under GEM 2019-10-04 15:39:34 +01:00
oa
selftests drm/i915: Drop struct_mutex from around GEM initialisation 2019-10-04 15:39:43 +01:00
i915_active_types.h drm/i915: Coordinate i915_active with its own mutex 2019-10-04 15:39:12 +01:00
i915_active.c drm/i915: Move idle barrier cleanup into engine-pm 2019-10-04 15:39:16 +01:00
i915_active.h drm/i915: Coordinate i915_active with its own mutex 2019-10-04 15:39:12 +01:00
i915_buddy.c drm/i915/buddy: add missing call to i915_global_register 2019-09-09 10:58:20 +01:00
i915_buddy.h
i915_cmd_parser.c
i915_debugfs.c drm/i915: Remove struct_mutex guard for debugfs/opregion 2019-10-04 15:39:40 +01:00
i915_debugfs.h
i915_drv.c drm/i915: move gmbus setup down to intel_modeset_init() 2019-10-06 11:25:06 +03:00
i915_drv.h drm/i915/tgl: Switch between dc3co and dc5 based on display idleness 2019-10-08 11:05:28 +03:00
i915_fixed.h
i915_gem_evict.c drm/i915: Move request runtime management onto gt 2019-10-04 15:39:26 +01:00
i915_gem_fence_reg.c drm/i915: Pull i915_vma_pin under the vm->mutex 2019-10-04 15:39:02 +01:00
i915_gem_fence_reg.h drm/i915: Track ggtt fence reservations under its own mutex 2019-08-22 08:53:40 +01:00
i915_gem_gtt.c drm/i915: Move context management under GEM 2019-10-04 15:39:34 +01:00
i915_gem_gtt.h drm/i915: Pull i915_vma_pin under the vm->mutex 2019-10-04 15:39:02 +01:00
i915_gem.c drm/i915: Drop struct_mutex from around GEM initialisation 2019-10-04 15:39:43 +01:00
i915_gem.h
i915_getparam.c drm/i915: Pass intel_gt to has-reset? 2019-09-27 23:25:14 +01:00
i915_globals.c
i915_globals.h
i915_gpu_error.c drm/i915: Remove logical HW ID 2019-10-04 15:39:30 +01:00
i915_gpu_error.h drm/i915: Remove logical HW ID 2019-10-04 15:39:30 +01:00
i915_ioc32.c
i915_irq.c drm/i915/gt: Prefer local path to runtime powermanagement 2019-10-07 21:44:02 +01:00
i915_irq.h drm/i915: Implement a better i945gm vblank irq vs. C-states workaround 2019-10-04 18:43:49 +03:00
i915_memcpy.c
i915_memcpy.h
i915_mm.c
i915_params.c drm/i915/tgl: Add DC3CO mask to allowed_dc_mask and gen9_dc_mask 2019-10-08 11:05:26 +03:00
i915_params.h
i915_pci.c drm/i915/display: abstract all vgaarb access to intel_vga.[ch] 2019-10-02 13:31:54 +03:00
i915_perf_types.h drm/i915/perf: Wean ourselves off dev_priv 2019-10-08 07:52:35 +01:00
i915_perf.c drm/i915/perf: Set the exclusive stream under perf->lock 2019-10-08 07:52:36 +01:00
i915_perf.h drm/i915/perf: move perf types to their own header 2019-10-07 16:55:50 +03:00
i915_pmu.c drm/i915: Extract GT render sleep (rc6) management 2019-09-27 13:01:57 +01:00
i915_pmu.h drm/i915/pmu: Use GT parked for estimating RC6 while asleep 2019-09-12 17:02:50 +01:00
i915_priolist_types.h
i915_pvinfo.h
i915_query.c drm/i915: Add EU stride runtime parameter 2019-08-23 19:14:22 +01:00
i915_query.h
i915_reg.h drm/i915/tgl: Add DC3CO required register and bits 2019-10-08 11:05:25 +03:00
i915_request.c drm/i915: Move request runtime management onto gt 2019-10-04 15:39:26 +01:00
i915_request.h drm/i915: Move request runtime management onto gt 2019-10-04 15:39:26 +01:00
i915_scatterlist.c
i915_scatterlist.h drm/i915: s/for_each_sgt_dma/for_each_sgt_daddr/ 2019-08-29 21:59:16 +01:00
i915_scheduler_types.h
i915_scheduler.c
i915_scheduler.h
i915_selftest.h
i915_suspend.c drm/i915: Drop struct_mutex from suspend state save/restore 2019-10-04 15:39:41 +01:00
i915_suspend.h
i915_sw_fence_work.c drm/i915: Generalise the clflush dma-worker 2019-08-22 08:27:44 +01:00
i915_sw_fence_work.h drm/i915: Generalise the clflush dma-worker 2019-08-22 08:27:44 +01:00
i915_sw_fence.c Merge drm/drm-next into drm-intel-next-queued 2019-08-22 00:10:36 -07:00
i915_sw_fence.h Merge drm/drm-next into drm-intel-next-queued 2019-08-22 00:10:36 -07:00
i915_switcheroo.c drm/i915: split out i915_switcheroo.[ch] from i915_drv.c 2019-10-06 11:25:00 +03:00
i915_switcheroo.h drm/i915: split out i915_switcheroo.[ch] from i915_drv.c 2019-10-06 11:25:00 +03:00
i915_syncmap.c
i915_syncmap.h
i915_sysfs.c drm/i915: Move context management under GEM 2019-10-04 15:39:34 +01:00
i915_sysfs.h
i915_trace_points.c
i915_trace.h drm/i915: Move context management under GEM 2019-10-04 15:39:34 +01:00
i915_user_extensions.c
i915_user_extensions.h
i915_utils.c
i915_utils.h
i915_vgpu.c drm/i915: to make vgpu ppgtt notificaiton as atomic operation 2019-08-24 12:12:34 +01:00
i915_vgpu.h
i915_vma.c drm/i915: Coordinate i915_active with its own mutex 2019-10-04 15:39:12 +01:00
i915_vma.h drm/i915: Pull i915_vma_pin under the vm->mutex 2019-10-04 15:39:02 +01:00
intel_csr.c drm/i915/dmc: Update ICL DMC version to v1.09 2019-09-27 10:20:39 -07:00
intel_csr.h
intel_device_info.c drm/i915/tgl: s/ss/eu fuse reading support 2019-09-21 08:31:08 +01:00
intel_device_info.h drm/i915/dsb: feature flag added for display state buffer. 2019-09-23 09:37:54 +03:00
intel_gvt.c
intel_gvt.h
intel_pch.c drm/i915/cml: Add second PCH ID for CMP 2019-09-18 11:00:40 +01:00
intel_pch.h drm/i915/cml: Add second PCH ID for CMP 2019-09-18 11:00:40 +01:00
intel_pm.c drm/i915: Extract GT render sleep (rc6) management 2019-09-27 13:01:57 +01:00
intel_pm.h drm/i915: Extract GT render sleep (rc6) management 2019-09-27 13:01:57 +01:00
intel_runtime_pm.c drm/i915/display: abstract all vgaarb access to intel_vga.[ch] 2019-10-02 13:31:54 +03:00
intel_runtime_pm.h
intel_sideband.c
intel_sideband.h
intel_uncore.c drm/i915/tgl: Introduce gen12 forcewake ranges 2019-09-13 20:07:36 +01:00
intel_uncore.h drm/i915: Only apply a rmw mmio update if the value changes 2019-09-17 15:25:40 +01:00
intel_wakeref.c
intel_wakeref.h
intel_wopcm.c
intel_wopcm.h
Kconfig drm/i915: Fix Kconfig indentation 2019-10-08 09:18:19 +03:00
Kconfig.debug drm/i915: Fix Kconfig indentation 2019-10-08 09:18:19 +03:00
Kconfig.profile
Makefile drm/i915: split out i915_switcheroo.[ch] from i915_drv.c 2019-10-06 11:25:00 +03:00