drm/i915/psr: Share the computation of idle frames
authorJosé Roberto de Souza <jose.souza@intel.com>
Mon, 13 Jan 2020 21:46:03 +0000 (13:46 -0800)
committerJosé Roberto de Souza <jose.souza@intel.com>
Thu, 16 Jan 2020 18:22:39 +0000 (10:22 -0800)
commit9e83713a721b185774e32879b85f0b2ea615936b
treea0b96d34d034047768aa666aafb3103f2e120df1
parent6f4194c8771f5182017be011e0a0fc1c053b18eb
drm/i915/psr: Share the computation of idle frames

Both activate functions and the dc3co disable function were doing the
same thing, so better move to a function and share.
Also while at it adding a WARN_ON to catch invalid values.

Cc: Anshuman Gupta <anshuman.gupta@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200113214603.52158-1-jose.souza@intel.com
drivers/gpu/drm/i915/display/intel_psr.c