Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd: Introduce additional IPS debug flags

[Why]

Idle power states (IPS) describe levels of power-gating within DCN. DM
and DC is responsible for ensuring that we are out of IPS before any DCN
programming happens. Any DCN programming while we're in IPS leads to
undefined behavior (mostly hangs).

Because IPS intersects with all display features, the ability to disable
IPS by default while ironing out the known issues is desired. However,
disabing it completely will cause important features such as s0ix entry
to fail.

Therefore, more granular IPS debug flags are desired.

[How]

Extend the dc debug mask bits to include the available list of IPS
debug flags.

All the flags should work as documented, with the exception of
IPS_DISABLE_DYNAMIC. It requires dm changes which will be done in
later changes.

v2: enable docs and fix docstring format

Signed-off-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Leo Li and committed by
Alex Deucher
a08d7592 b86a6a57

+81 -2
+1 -1
Documentation/gpu/amdgpu/driver-core.rst
··· 179 179 :doc: IP Blocks 180 180 181 181 .. kernel-doc:: drivers/gpu/drm/amd/include/amd_shared.h 182 - :identifiers: amd_ip_block_type amd_ip_funcs 182 + :identifiers: amd_ip_block_type amd_ip_funcs DC_DEBUG_MASK
+6
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 1864 1864 1865 1865 if (amdgpu_dc_debug_mask & DC_DISABLE_IPS) 1866 1866 init_data.flags.disable_ips = DMUB_IPS_DISABLE_ALL; 1867 + else if (amdgpu_dc_debug_mask & DC_DISABLE_IPS_DYNAMIC) 1868 + init_data.flags.disable_ips = DMUB_IPS_DISABLE_DYNAMIC; 1869 + else if (amdgpu_dc_debug_mask & DC_DISABLE_IPS2_DYNAMIC) 1870 + init_data.flags.disable_ips = DMUB_IPS_RCG_IN_ACTIVE_IPS2_IN_OFF; 1871 + else if (amdgpu_dc_debug_mask & DC_FORCE_IPS_ENABLE) 1872 + init_data.flags.disable_ips = DMUB_IPS_ENABLE; 1867 1873 else 1868 1874 init_data.flags.disable_ips = DMUB_IPS_ENABLE; 1869 1875
+74 -1
drivers/gpu/drm/amd/include/amd_shared.h
··· 61 61 * acquires the list of IP blocks for the GPU in use on initialization. 62 62 * It can then operate on this list to perform standard driver operations 63 63 * such as: init, fini, suspend, resume, etc. 64 - * 64 + * 65 65 * 66 66 * IP block implementations are named using the following convention: 67 67 * <functionality>_v<version> (E.g.: gfx_v6_0). ··· 251 251 DC_REPLAY_MASK = (1 << 9), //0x200, disabled by default for dcn < 3.1.4 252 252 }; 253 253 254 + /** 255 + * enum DC_DEBUG_MASK - Bits that are useful for debugging the Display Core IP 256 + */ 254 257 enum DC_DEBUG_MASK { 258 + /** 259 + * @DC_DISABLE_PIPE_SPLIT: If set, disable pipe-splitting 260 + */ 255 261 DC_DISABLE_PIPE_SPLIT = 0x1, 262 + 263 + /** 264 + * @DC_DISABLE_STUTTER: If set, disable memory stutter mode 265 + */ 256 266 DC_DISABLE_STUTTER = 0x2, 267 + 268 + /** 269 + * @DC_DISABLE_DSC: If set, disable display stream compression 270 + */ 257 271 DC_DISABLE_DSC = 0x4, 272 + 273 + /** 274 + * @DC_DISABLE_CLOCK_GATING: If set, disable clock gating optimizations 275 + */ 258 276 DC_DISABLE_CLOCK_GATING = 0x8, 277 + 278 + /** 279 + * @DC_DISABLE_PSR: If set, disable Panel self refresh v1 and PSR-SU 280 + */ 259 281 DC_DISABLE_PSR = 0x10, 282 + 283 + /** 284 + * @DC_FORCE_SUBVP_MCLK_SWITCH: If set, force mclk switch in subvp, even 285 + * if mclk switch in vblank is possible 286 + */ 260 287 DC_FORCE_SUBVP_MCLK_SWITCH = 0x20, 288 + 289 + /** 290 + * @DC_DISABLE_MPO: If set, disable multi-plane offloading 291 + */ 261 292 DC_DISABLE_MPO = 0x40, 293 + 294 + /** 295 + * @DC_ENABLE_DPIA_TRACE: If set, enable trace logging for DPIA 296 + */ 262 297 DC_ENABLE_DPIA_TRACE = 0x80, 298 + 299 + /** 300 + * @DC_ENABLE_DML2: If set, force usage of DML2, even if the DCN version 301 + * does not default to it. 302 + */ 263 303 DC_ENABLE_DML2 = 0x100, 304 + 305 + /** 306 + * @DC_DISABLE_PSR_SU: If set, disable PSR SU 307 + */ 264 308 DC_DISABLE_PSR_SU = 0x200, 309 + 310 + /** 311 + * @DC_DISABLE_REPLAY: If set, disable Panel Replay 312 + */ 265 313 DC_DISABLE_REPLAY = 0x400, 314 + 315 + /** 316 + * @DC_DISABLE_IPS: If set, disable all Idle Power States, all the time. 317 + * If more than one IPS debug bit is set, the lowest bit takes 318 + * precedence. For example, if DC_FORCE_IPS_ENABLE and 319 + * DC_DISABLE_IPS_DYNAMIC are set, then DC_DISABLE_IPS_DYNAMIC takes 320 + * precedence. 321 + */ 266 322 DC_DISABLE_IPS = 0x800, 323 + 324 + /** 325 + * @DC_DISABLE_IPS_DYNAMIC: If set, disable all IPS, all the time, 326 + * *except* when driver goes into suspend. 327 + */ 328 + DC_DISABLE_IPS_DYNAMIC = 0x1000, 329 + 330 + /** 331 + * @DC_DISABLE_IPS2_DYNAMIC: If set, disable IPS2 (IPS1 allowed) if 332 + * there is an enabled display. Otherwise, enable all IPS. 333 + */ 334 + DC_DISABLE_IPS2_DYNAMIC = 0x2000, 335 + 336 + /** 337 + * @DC_FORCE_IPS_ENABLE: If set, force enable all IPS, all the time. 338 + */ 339 + DC_FORCE_IPS_ENABLE = 0x4000, 267 340 }; 268 341 269 342 enum amd_dpm_forced_level;