]> Git Repo - linux.git/log
linux.git
14 months agoMerge tag 'drm-intel-next-2023-12-07' of git://anongit.freedesktop.org/drm/drm-intel...
Dave Airlie [Fri, 8 Dec 2023 05:06:04 +0000 (15:06 +1000)]
Merge tag 'drm-intel-next-2023-12-07' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

- Improve display debug msgs and other general clean-ups (Ville, Rahuul)
- PSR fixes and improvements around selective fetch (Jouni, Ville)
- Remove FBC restrictions for Xe2LPD displays (Vinod)
- Skip some timing checks on BXT/GLK DSI transcoders (Ville)
- DP MST Fixes (Ville)
- Correct the input parameter on _intel_dsb_commit (heminhong)
- Fix IP version of the display WAs (Bala)
- DGFX uses direct VBT pin mapping (Clint)
- Proper handling of bool on PIPE_CONF_CHECK macros (Jani)
- Skip state verification with TBT-ALT mod (Mika Kahona)
- General organization of display code for reusage with Xe
  (Jouni, Luca, Jani, Maarten)
- Squelch a sparse warning (Jani)
- Don't use "proxy" headers (Andy Shevchenko)
- Use devm_gpiod_get() for all GPIOs (Hans)
- Fix ADL+ tiled plane stride (Ville)
- Use octal permissions in display debugfs (Jani)

Signed-off-by: Dave Airlie <[email protected]>
From: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915/display: Add intel_fb_bo_framebuffer_fini
Jouni Högander [Thu, 7 Dec 2023 08:34:51 +0000 (10:34 +0200)]
drm/i915/display: Add intel_fb_bo_framebuffer_fini

Xe needs intel_fb_bo_framebuffer_fini for taking care of unpinning the fb
and taking reference.  In i915 this can be empty.

Also move intel_frontbuffer_get to be done after
intel_fb_bo_framebuffer_init to have reasonable sequences:

intel_fb_bo_framebuffer_init
intel_frontbuffer_get
...
intel_frontbuffer_put
intel_fb_bo_framebuffer_fini

v2: Empty function instead of define

Signed-off-by: Jouni Högander <[email protected]>
Reviewed-by: Maarten Lankhorst <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915/display: Use i915_gem_object_get_dma_address to get dma address
Maarten Lankhorst [Wed, 25 Oct 2023 10:11:31 +0000 (12:11 +0200)]
drm/i915/display: Use i915_gem_object_get_dma_address to get dma address

Works better for xe like that. obj is no longer const.

Signed-off-by: Maarten Lankhorst <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jouni Högander <[email protected]>
14 months agodrm/i915: use octal permissions in display debugfs
Jani Nikula [Tue, 5 Dec 2023 13:41:43 +0000 (15:41 +0200)]
drm/i915: use octal permissions in display debugfs

Octal permissions are preferred over the symbolics ones.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915: pass struct intel_connector to connector debugfs fops
Jani Nikula [Tue, 5 Dec 2023 13:41:42 +0000 (15:41 +0200)]
drm/i915: pass struct intel_connector to connector debugfs fops

Prefer struct intel_connector over struct drm_connector, and unify the
declarations in the fops.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915: use intel_connector in intel_connector_debugfs_add()
Jani Nikula [Tue, 5 Dec 2023 13:41:41 +0000 (15:41 +0200)]
drm/i915: use intel_connector in intel_connector_debugfs_add()

Prefer struct intel_connector over struct drm_connector.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915/rpm: add rpm_to_i915() helper around container_of()
Jani Nikula [Tue, 5 Dec 2023 12:15:45 +0000 (14:15 +0200)]
drm/i915/rpm: add rpm_to_i915() helper around container_of()

Reduce the duplication.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915: handle uncore spinlock when not available
Luca Coelho [Fri, 1 Dec 2023 10:00:32 +0000 (12:00 +0200)]
drm/i915: handle uncore spinlock when not available

The uncore code may not always be available (e.g. when we build the
display code with Xe), so we can't always rely on having the uncore's
spinlock.

To handle this, split the spin_lock/unlock_irqsave/restore() into
spin_lock/unlock() followed by a call to local_irq_save/restore() and
create wrapper functions for locking and unlocking the uncore's
spinlock.  In these functions, we have a condition check and only
actually try to lock/unlock the spinlock when I915 is defined, and
thus uncore is available.

This keeps the ifdefs contained in these new functions and all such
logic inside the display code.

Cc: Tvrtko Ursulin <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Ville Syrjala <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Reviewed-by: Jouni Högander <[email protected]>
Signed-off-by: Jouni Högander <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915: Fix ADL+ tiled plane stride when the POT stride is smaller than the original
Ville Syrjälä [Mon, 4 Dec 2023 20:24:43 +0000 (22:24 +0200)]
drm/i915: Fix ADL+ tiled plane stride when the POT stride is smaller than the original

plane_view_scanout_stride() currently assumes that we had to pad the
mapping stride with dummy pages in order to align it. But that is not
the case if the original fb stride exceeds the aligned stride used
to populate the remapped view, which is calculated from the user
specified framebuffer width rather than the user specified framebuffer
stride.

Ignore the original fb stride in this case and just stick to the POT
aligned stride. Getting this wrong will cause the plane to fetch the
wrong data, and can lead to fault errors if the page tables at the
bogus location aren't even populated.

TODO: figure out if this is OK for CCS, or if we should instead increase
the width of the view to cover the entire user specified fb stride
instead...

Cc: Imre Deak <[email protected]>
Cc: Juha-Pekka Heikkila <[email protected]>
Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Imre Deak <[email protected]>
Reviewed-by: Juha-Pekka Heikkila <[email protected]>
14 months agoMerge tag 'amd-drm-next-6.8-2023-12-01' of https://gitlab.freedesktop.org/agd5f/linux...
Dave Airlie [Tue, 5 Dec 2023 02:11:41 +0000 (12:11 +1000)]
Merge tag 'amd-drm-next-6.8-2023-12-01' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.8-2023-12-01:

amdgpu:
- Add new 64 bit sequence number infrastructure.
  This will ultimately be used for user queue synchronization.
- GPUVM updates
- Misc code cleanups
- RAS updates
- DCN 3.5 updates
- Rework PCIe link speed handling
- Document GPU reset types
- DMUB fixes
- eDP fixes
- NBIO 7.9 updates
- NBIO 7.11 updates
- SubVP updates
- DCN 3.1.4 fixes
- ABM fixes
- AGP aperture fix
- DCN 3.1.5 fix
- Fix some potential error path memory leaks
- Enable PCIe PMEs
- Add XGMI, PCIe state dumping for aqua vanjaram
- GFX11 golden register updates
- Misc display fixes

amdkfd:
- Migrate TLB flushing logic to amdgpu
- Trap handler fixes
- Fix restore workers handling on suspend and reset
- Fix possible memory leak in pqm_uninit()

radeon:
- Fix some possible overflows in command buffer checking
- Check for errors in ring_lock

From: Alex Deucher <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dave Airlie <[email protected]>
14 months agodrm/i915/dsi: Use devm_gpiod_get() for all GPIOs
Hans de Goede [Fri, 1 Dec 2023 16:11:30 +0000 (17:11 +0100)]
drm/i915/dsi: Use devm_gpiod_get() for all GPIOs

soc_gpio_set_value() already uses devm_gpiod_get(), lets be consistent
and use devm_gpiod_get() for all GPIOs.

This allows removing the intel_dsi_vbt_gpio_cleanup() function,
which only function was to put the GPIO-descriptors.

Signed-off-by: Hans de Goede <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Acked-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915/display: Don't use "proxy" headers
Andy Shevchenko [Wed, 29 Nov 2023 14:01:28 +0000 (16:01 +0200)]
drm/i915/display: Don't use "proxy" headers

The driver uses math.h and not util_macros.h.

Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915/syncmap: squelch a sparse warning
Jani Nikula [Wed, 29 Nov 2023 17:35:06 +0000 (19:35 +0200)]
drm/i915/syncmap: squelch a sparse warning

The code is fine, really, but tweak it to get rid of the sparse warning:

drivers/gpu/drm/i915/selftests/i915_syncmap.c:80:54: warning: dubious: x | !y

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915/display: Split i915 specific code away from intel_fb.c
Jouni Högander [Sun, 3 Dec 2023 11:48:40 +0000 (13:48 +0200)]
drm/i915/display: Split i915 specific code away from intel_fb.c

We are preparing for Xe driver. Backing object implementation is differing
between i915 and Xe. Split i915 specific code into separate source file
built only for i915.

v9:
  - Use ERR_CAST
v8:
  - return original error code from intel_fb_bo_lookup_valid_bo on failure
v7:
  - drop #include <drm/drm_plane.h>
  - s/user_mode_cmd/mode_cmd/
  - Use passed i915 pointer instead of to_i915(obj->base.dev)
v6: Add missing intel_fb_bo.[ch]
v5:
  - Keep drm_any_plane_has_format check in intel_fb.c
  - Use mode_cmd instead of user_mode_cmd for intel_fb_bo_lookup_valid_bo
v4: Move drm_any_plane_has_format check into intel_fb_bo.c
v3: Fix failure handling in intel_framebuffer_init
v2: Couple of fixes to error value handling

Signed-off-by: Jouni Högander <[email protected]>
Reviewed-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915/display: Handle invalid fb_modifier in intel_fb_modifier_to_tiling
Jouni Högander [Sun, 3 Dec 2023 11:48:39 +0000 (13:48 +0200)]
drm/i915/display: Handle invalid fb_modifier in intel_fb_modifier_to_tiling

Lookup_modifier is returning INTEL_PLANE_CAP_TILING_4 on invalid
fb_modifier value. Use lookup_modifier_or_null in
intel_fb_modifier_to_tiling and return I915_TILING_NONE in case
lookup_modifier_or_null returns null.

Signed-off-by: Jouni Högander <[email protected]>
Reviewed-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915/display: Convert intel_fb_modifier_to_tiling as non-static
Jouni Högander [Sun, 3 Dec 2023 11:48:38 +0000 (13:48 +0200)]
drm/i915/display: Convert intel_fb_modifier_to_tiling as non-static

We are about to split i915 specific code from intel_fb.c. Convert
intel_fb_modifier_to_tiling as non-static to allow calling it from split
code.

Signed-off-by: Jouni Högander <[email protected]>
Reviewed-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915/display: use intel_bo_to_drm_bo in intel_fb.c
Jouni Högander [Sun, 3 Dec 2023 11:48:37 +0000 (13:48 +0200)]
drm/i915/display: use intel_bo_to_drm_bo in intel_fb.c

We are preparing for Xe driver. I915 and Xe object implementation are
differing. Do not use  i915_gem_object->base directly. Instead use
intel_bo_to_drm_bo.

Also use drm_gem_object_put instead of i915_gem_object_put. This should be
ok as i915_gem_object_put is really just doing  __drm_gem_object_put.

Signed-off-by: Jouni Högander <[email protected]>
Reviewed-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915/display: use intel_bo_to_drm_bo in intel_fbdev
Jouni Högander [Wed, 15 Nov 2023 09:07:19 +0000 (11:07 +0200)]
drm/i915/display: use intel_bo_to_drm_bo in intel_fbdev

We are preparing for Xe driver. I915 and Xe object implementation are
differing. Do not use  i915_gem_object->base directly. Instead use
intel_bo_to_drm_bo.

Signed-off-by: Jouni Högander <[email protected]>
Signed-off-by: Maarten Lankhorst <[email protected]>
Reviewed-by: Vinod Govindapillai <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915/display: split i915 specific code from intel_fbdev
Jouni Högander [Wed, 15 Nov 2023 09:07:18 +0000 (11:07 +0200)]
drm/i915/display: split i915 specific code from intel_fbdev

Split out code from intel_fbdev that can not be share between i915 and
xe. Create new i915 specific source/header file intel_fbdev_fb.[ch] which
contains this code.

Signed-off-by: Jouni Högander <[email protected]>
Reviewed-by: Vinod Govindapillai <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915/display: Skip state verification with TBT-ALT mode
Mika Kahola [Wed, 29 Nov 2023 12:22:21 +0000 (14:22 +0200)]
drm/i915/display: Skip state verification with TBT-ALT mode

With TBT-ALT mode we are not programming C20 chip PLL's and
hence we don't need to check state verification. We don't
need to program DP link signal levels i.e.pre-emphasis and
voltage swing either.

This patch fixes dmesg errors like this one

"[drm] ERROR PHY F Write 0c06 failed after 3 retries."

Signed-off-by: Mika Kahola <[email protected]>
Reviewed-by: Gustavo Sousa <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915: add bool type checks in PIPE_CONF_CHECK_*
Jani Nikula [Wed, 29 Nov 2023 17:33:17 +0000 (19:33 +0200)]
drm/i915: add bool type checks in PIPE_CONF_CHECK_*

Avoid bool/int mismatches in state checker macros.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/i915: use PIPE_CONF_CHECK_BOOL() for bool members
Jani Nikula [Wed, 29 Nov 2023 17:33:16 +0000 (19:33 +0200)]
drm/i915: use PIPE_CONF_CHECK_BOOL() for bool members

Don't treat bools as integers.

v2: Rebase

Signed-off-by: Jani Nikula <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
14 months agodrm/amd/display: Fix NULL pointer dereference at hibernate
Mario Limonciello [Wed, 29 Nov 2023 00:35:09 +0000 (18:35 -0600)]
drm/amd/display: Fix NULL pointer dereference at hibernate

During hibernate sequence the source context might not have a clk_mgr.
So don't use it to look for DML2 support.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2980
Fixes: 7966f319c66d ("drm/amd/display: Introduce DML2")
Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Mario Limonciello <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/radeon: check return value of radeon_ring_lock()
Nikita Zhandarovich [Tue, 8 Aug 2023 18:04:16 +0000 (11:04 -0700)]
drm/radeon: check return value of radeon_ring_lock()

In the unlikely event of radeon_ring_lock() failing, its errno return
value should be processed. This patch checks said return value and
prints a debug message in case of an error.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 48c0c902e2e6 ("drm/radeon/kms: add support for CP setup on SI")
Signed-off-by: Nikita Zhandarovich <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/radeon/r100: Fix integer overflow issues in r100_cs_track_check()
Nikita Zhandarovich [Wed, 29 Nov 2023 15:22:12 +0000 (07:22 -0800)]
drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check()

It may be possible, albeit unlikely, to encounter integer overflow
during the multiplication of several unsigned int variables, the
result being assigned to a variable 'size' of wider type.

Prevent this potential behaviour by converting one of the multiples
to unsigned long.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 0242f74d29df ("drm/radeon: clean up CS functions in r100.c")
Signed-off-by: Nikita Zhandarovich <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg()
Nikita Zhandarovich [Wed, 29 Nov 2023 15:22:30 +0000 (07:22 -0800)]
drm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg()

While improbable, there may be a chance of hitting integer
overflow when the result of radeon_get_ib_value() gets shifted
left.

Avoid it by casting one of the operands to larger data type (u64).

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 1729dd33d20b ("drm/radeon/kms: r600 CS parser fixes")
Signed-off-by: Nikita Zhandarovich <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: enable mca debug mode on APU by default
Yang Wang [Thu, 30 Nov 2023 10:39:03 +0000 (18:39 +0800)]
drm/amdgpu: enable mca debug mode on APU by default

enable MCA debug mode on APU device by default.

Signed-off-by: Yang Wang <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: distinguish rlc fw for different SKU
Likun Gao [Wed, 29 Nov 2023 02:59:53 +0000 (10:59 +0800)]
drm/amdgpu: distinguish rlc fw for different SKU

For some SKU, rlc firmware should use different one
compared with the normal rlc firmware.

Signed-off-by: Likun Gao <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: Fix missing mca debugfs node
Yang Wang [Thu, 30 Nov 2023 04:58:14 +0000 (12:58 +0800)]
drm/amdgpu: Fix missing mca debugfs node

Use amdgpu_ip_version() helper function to check ip version.

The ip version contains other information,
use the helper function to avoid reading wrong value.

Reviewed-by: Lijo Lazar <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: Skip access gfx11 golden registers under SRIOV
ZhenGuo Yin [Thu, 23 Nov 2023 08:47:33 +0000 (16:47 +0800)]
drm/amdgpu: Skip access gfx11 golden registers under SRIOV

[Why]
Golden registers are PF-only registers on gfx11.
RLCG interface will return "out-of-range" under SRIOV VF.

[How]
Skip access gfx11 golden registers under SRIOV.

Reviewed-by: Horace Chen <[email protected]>
Signed-off-by: ZhenGuo Yin <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/i915/dgfx: DGFX uses direct VBT pin mapping
Clint Taylor [Tue, 28 Nov 2023 19:03:29 +0000 (11:03 -0800)]
drm/i915/dgfx: DGFX uses direct VBT pin mapping

DDC pin mapping for DGFX cards uses direct VBT pin mapping

Cc: Lucas De Marchi <[email protected]>
Cc: Matt Roper <[email protected]>
Signed-off-by: Clint Taylor <[email protected]>
Reviewed-by: Lucas De Marchi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Lucas De Marchi <[email protected]>
14 months agodrm/amdgpu: Use another offset for GC 9.4.3 remap
Lijo Lazar [Tue, 28 Nov 2023 11:17:14 +0000 (16:47 +0530)]
drm/amdgpu: Use another offset for GC 9.4.3 remap

The legacy region at 0x7F000 maps to valid registers in GC 9.4.3 SOCs.
Use 0x1A000 offset instead as MMIO register remap region.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: Read aquavanjaram XGMI register state
Lijo Lazar [Sat, 7 Oct 2023 10:11:27 +0000 (15:41 +0530)]
drm/amdgpu: Read aquavanjaram XGMI register state

Add support to read state of XGMI links in aquavanjaram SOC.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: Read aquavanjaram PCIE register state
Lijo Lazar [Fri, 6 Oct 2023 08:50:45 +0000 (14:20 +0530)]
drm/amdgpu: Read aquavanjaram PCIE register state

Add support to read aqua vanjaram PCIE register state

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: Add reg_state sysfs attribute
Lijo Lazar [Fri, 6 Oct 2023 08:19:03 +0000 (13:49 +0530)]
drm/amdgpu: Add reg_state sysfs attribute

Add reg_state attribute to fetch the register snapshot of different
IPs like XGMI, WAFL,PCIE and USR. To get a snapshot for a particular IP
1) Open the sysfs file
2) Seek to the offset as defined in amdgpu_sysfs_reg_offset
3) Read

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: add amdgpu_reg_state.h
Alex Deucher [Wed, 13 Sep 2023 16:00:44 +0000 (12:00 -0400)]
drm/amdgpu: add amdgpu_reg_state.h

This header defines the reg state structures exposed via
sysfs for umr debugging.

v2: add content type

Signed-off-by: Alex Deucher <[email protected]>
Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
14 months agodrm/amd/display: Promote DAL to 3.2.262
Aric Cyr [Mon, 20 Nov 2023 04:02:26 +0000 (23:02 -0500)]
drm/amd/display: Promote DAL to 3.2.262

This version brings along following fixes:
- Add DSC granular throughput adjustment
- Allow DTBCLK disable for DCN35
- Update Fixed VS/PE Retimer Sequence
- Block dcn315 dynamic crb allocation when unintended
- Update dcn315 lpddr pstate latency
- Fix some HostVM parameters in DML

Reviewed-by: Tom Chung <[email protected]>
Acked-by: Tom Chung <[email protected]>
Signed-off-by: Aric Cyr <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Fix some HostVM parameters in DML
Taimur Hassan [Fri, 10 Nov 2023 15:24:20 +0000 (10:24 -0500)]
drm/amd/display: Fix some HostVM parameters in DML

[Why]
A number of DML parameters related to HostVM were either missing or
being set incorrectly, which may cause inaccuracies in calculating
margins and determining BW limitations.

[How]
Correct these values where needed and populate the missing values.

Cc: [email protected]
Reviewed-by: Nicholas Kazlauskas <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Taimur Hassan <[email protected]>
Signed-off-by: Roman Li <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Add DSC granular throughput adjustment
Ilya Bakoulin [Thu, 16 Nov 2023 20:28:53 +0000 (15:28 -0500)]
drm/amd/display: Add DSC granular throughput adjustment

[Why/How]
Update DSC DPCD parsing to take granular throughput adjustment into
consideration.

Reviewed-by: Wenjing Liu <[email protected]>
Acked-by: Tom Chung <[email protected]>
Signed-off-by: Ilya Bakoulin <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdkfd: Free gang_ctx_bo and wptr_bo in pqm_uninit
ZhenGuo Yin [Mon, 6 Nov 2023 10:07:51 +0000 (18:07 +0800)]
drm/amdkfd: Free gang_ctx_bo and wptr_bo in pqm_uninit

[Why]
Memory leaks of gang_ctx_bo and wptr_bo.

[How]
Free gang_ctx_bo and wptr_bo in pqm_uninit.

v2: add a common function pqm_clean_queue_resource to
free queue's resources.
v3: reset pdd->pqd.num_gws when destorying GWS queue.

Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: ZhenGuo Yin <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: Update EEPROM I2C address for smu v13_0_0
Candice Li [Fri, 24 Nov 2023 01:33:47 +0000 (09:33 +0800)]
drm/amdgpu: Update EEPROM I2C address for smu v13_0_0

Check smu v13_0_0 SKU type to select EEPROM I2C address.

Signed-off-by: Candice Li <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Allow DTBCLK disable for DCN35
Nicholas Kazlauskas [Tue, 14 Nov 2023 16:22:09 +0000 (11:22 -0500)]
drm/amd/display: Allow DTBCLK disable for DCN35

[Why]
DTBCLK is enabled on idle and it will burn power.

[How]
There's a few issues here:
- Always enabling DTBCLK on clock manager init
- Setting refclk when DTBCLK is supposed to be disabled
- Not applying the correct calculated version refclk, but instead the
  base value which might be zero

On dtbclk_en change we'll message PMFW to enable or disable the clock
accordingly.

The DTBDTO will be then based on refclk, but it will be set to the
default fixed value if there was nothing calculated in DML despite the
clock being considered enabled.

Reviewed-by: Charlene Liu <[email protected]>
Acked-by: Tom Chung <[email protected]>
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: [FW Promotion] Release 0.0.194.0
Anthony Koo [Sat, 18 Nov 2023 19:39:40 +0000 (14:39 -0500)]
drm/amd/display: [FW Promotion] Release 0.0.194.0

- Add a new dmub command in enum dmub_cmd_cab_type

Reviewed-by: Tom Chung <[email protected]>
Acked-by: Tom Chung <[email protected]>
Signed-off-by: Anthony Koo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdkfd: Run restore_workers on freezable WQs
Felix Kuehling [Fri, 27 Oct 2023 22:21:55 +0000 (18:21 -0400)]
drm/amdkfd: Run restore_workers on freezable WQs

Make restore workers freezable so we don't have to explicitly flush them
in suspend and GPU reset code paths, and we don't accidentally try to
restore BOs while the GPU is suspended. Not having to flush restore_work
also helps avoid lock/fence dependencies in the GPU reset case where we're
not allowed to wait for fences.

A side effect of this is, that we can now have multiple concurrent threads
trying to signal the same eviction fence. Rework eviction fence signaling
and replacement to account for that.

The GPU reset path can no longer rely on restore_process_worker to resume
queues because evict/restore workers can run independently of it. Instead
call a new restore_process_helper directly.

This is an RFC and request for testing.

v2:
- Reworked eviction fence signaling
- Introduced restore_process_helper

v3:
- Handle unsignaled eviction fences in restore_process_bos

Signed-off-by: Felix Kuehling <[email protected]>
Acked-by: Christian König <[email protected]>
Tested-by: Emily Deng <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Update Fixed VS/PE Retimer Sequence
Michael Strauss [Fri, 13 Oct 2023 16:13:28 +0000 (12:13 -0400)]
drm/amd/display: Update Fixed VS/PE Retimer Sequence

[WHY/HOW]
Add a new AUX sequence provided by vendor to improve
interop with specific display configurations.

Reviewed-by: Wenjing Liu <[email protected]>
Acked-by: Tom Chung <[email protected]>
Signed-off-by: Michael Strauss <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: block dcn315 dynamic crb allocation when unintended
Dmytro Laktyushkin [Mon, 13 Nov 2023 18:12:44 +0000 (13:12 -0500)]
drm/amd/display: block dcn315 dynamic crb allocation when unintended

[WHY/HOW]
Limit the dynamic crb to dual stream configs that include eDP

Reviewed-by: Charlene Liu <[email protected]>
Acked-by: Tom Chung <[email protected]>
Signed-off-by: Dmytro Laktyushkin <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd: Enable PCIe PME from D3
Mario Limonciello [Fri, 24 Nov 2023 15:56:32 +0000 (09:56 -0600)]
drm/amd: Enable PCIe PME from D3

When dGPU is put into BOCO it may be in D3cold but still able send
PME on display hotplug event. For this to work it must be enabled
as wake source from D3.

When runpm is enabled use pci_wake_from_d3() to mark wakeup as
enabled by default.

Cc: [email protected] # 6.1+
Signed-off-by: Mario Limonciello <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: Fix cat debugfs amdgpu_regs_didt causes kernel null pointer
Lu Yao [Thu, 23 Nov 2023 01:22:34 +0000 (09:22 +0800)]
drm/amdgpu: Fix cat debugfs amdgpu_regs_didt causes kernel null pointer

For 'AMDGPU_FAMILY_SI' family cards, in 'si_common_early_init' func, init
'didt_rreg' and 'didt_wreg' to 'NULL'. But in func
'amdgpu_debugfs_regs_didt_read/write', using 'RREG32_DIDT' 'WREG32_DIDT'
lacks of relevant judgment. And other 'amdgpu_ip_block_version' that use
these two definitions won't be added for 'AMDGPU_FAMILY_SI'.

So, add null pointer judgment before calling.

Reviewed-by: Christian König <[email protected]>
Signed-off-by: Lu Yao <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/pm: fix a memleak in aldebaran_tables_init
Dinghao Liu [Thu, 23 Nov 2023 07:33:22 +0000 (15:33 +0800)]
drm/amd/pm: fix a memleak in aldebaran_tables_init

When kzalloc() for smu_table->ecc_table fails, we should free
the previously allocated resources to prevent memleak.

Fixes: edd794208555 ("drm/amd/pm: add message smu to get ecc_table v2")
Signed-off-by: Dinghao Liu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: fix AGP addressing when GART is not at 0
Alex Deucher [Fri, 10 Nov 2023 14:39:18 +0000 (09:39 -0500)]
drm/amdgpu: fix AGP addressing when GART is not at 0

This worked by luck if the GART aperture ended up at 0.  When
we ended up moving GART on some chips, the GART aperture ended
up offsetting the AGP address since the resource->start is
a GART offset, not an MC address.  Fix this by moving the AGP
address setup into amdgpu_bo_gpu_offset_no_check().

v2: check mem_type before checking agp
v3: check if the ttm bo has a ttm_tt allocated yet

Fixes: 67318cb84341 ("drm/amdgpu/gmc11: set gart placement GC11")
Tested-by: Mario Limonciello <[email protected]>
Reported-by: Jesse Zhang <[email protected]>
Reported-by: Yifan Zhang <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
Cc: [email protected]
14 months agodrm/amd/display: remove unnecessary braces to fix coding style
RutingZhang [Tue, 21 Nov 2023 04:36:20 +0000 (12:36 +0800)]
drm/amd/display: remove unnecessary braces to fix coding style

checkpatch complains that:

WARNING: braces {} are not necessary for single statement blocks
+                if (pool->base.irqs != NULL) {
+                        dal_irq_service_destroy(&pool->base.irqs);
+                }

Fixed it by removing unnecessary braces to fix the coding style issue.

Signed-off-by: RutingZhang <[email protected]>
Reviewed-by: Dongliang Mu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: update dcn315 lpddr pstate latency
Dmytro Laktyushkin [Fri, 3 Nov 2023 18:55:37 +0000 (14:55 -0400)]
drm/amd/display: update dcn315 lpddr pstate latency

[WHY/HOW]
Increase the pstate latency to improve ac/dc transition

Reviewed-by: Charlene Liu <[email protected]>
Acked-by: Tom Chung <[email protected]>
Signed-off-by: Dmytro Laktyushkin <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: fix ABM disablement
Hamza Mahfooz [Wed, 22 Nov 2023 19:50:34 +0000 (14:50 -0500)]
drm/amd/display: fix ABM disablement

On recent versions of DMUB firmware, if we want to completely disable
ABM we have to pass ABM_LEVEL_IMMEDIATE_DISABLE as the requested ABM
level to DMUB. Otherwise, LCD eDP displays are unable to reach their
maximum brightness levels. So, to fix this whenever the user requests an
ABM level of 0 pass ABM_LEVEL_IMMEDIATE_DISABLE to DMUB instead. Also,
to keep the user's experience consistent map ABM_LEVEL_IMMEDIATE_DISABLE
to 0 when a user tries to read the requested ABM level.

Cc: [email protected] # 6.1+
Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: Move mca debug mode decision to ras
Lijo Lazar [Thu, 9 Nov 2023 05:20:38 +0000 (10:50 +0530)]
drm/amdgpu: Move mca debug mode decision to ras

Refactor code such that ras block decides the default mca debug mode,
and not swsmu block.

By default mca debug mode is set to false.

v2: squash in uninitialized value fix (Alex)

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: 3.2.261
Aric Cyr [Mon, 13 Nov 2023 14:07:22 +0000 (09:07 -0500)]
drm/amd/display: 3.2.261

This version brings along the following:
- DCN314 fixes
- DCN32 fixes
- DCN35 fixes
- DML2 fixes
- eDP fixes
- HDR fixes
- MST fixes
- Replay fixes
- SubVP support for more configs

Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Aric Cyr <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: [FW Promotion] Release 0.0.193.0
Anthony Koo [Sun, 12 Nov 2023 03:47:50 +0000 (22:47 -0500)]
drm/amd/display: [FW Promotion] Release 0.0.193.0

- Add a tracing framework, to measure duration, execution count and
  longest duration of main loop/vsync interrupt work
  GPINT command is used to start/stop the measurements.

Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Anthony Koo <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Fix black screen on video playback with embedded panel
Sung Joon Kim [Fri, 10 Nov 2023 16:33:45 +0000 (11:33 -0500)]
drm/amd/display: Fix black screen on video playback with embedded panel

[why]
We have dynamic power control in driver but
should be ignored when power is forced on.

[how]
Bypass any power control when it's forced on.

Cc: [email protected]
Reviewed-by: Nicholas Kazlauskas <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Sung Joon Kim <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Fix conversions between bytes and KB
Taimur Hassan [Fri, 10 Nov 2023 15:15:28 +0000 (10:15 -0500)]
drm/amd/display: Fix conversions between bytes and KB

[Why]
There are a number of instances where we convert HostVMMinPageSize or
GPUVMMinPageSize from bytes to KB by dividing (rather than multiplying) and
vice versa.
Additionally, in some cases, a parameter is passed through DML in KB but
later checked as if it were in bytes.

Cc: [email protected]
Reviewed-by: Nicholas Kazlauskas <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Taimur Hassan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdkfd: Use common function for IP version check
Mukul Joshi [Wed, 22 Nov 2023 20:17:22 +0000 (15:17 -0500)]
drm/amdkfd: Use common function for IP version check

KFD_GC_VERSION was recently updated to use a new function
for IP version checks. As a result, use KFD_GC_VERSION as
the common function for all IP version checks in KFD.

Signed-off-by: Mukul Joshi <[email protected]>
Reviewed-by: Harish Kasiviswanathan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Remove config update
Taimur Hassan [Fri, 10 Nov 2023 15:06:09 +0000 (10:06 -0500)]
drm/amd/display: Remove config update

[Why]
Prevent overwrite of dc->config.use_default_clock_table, as it should be
pre-configured.

Reviewed-by: Nicholas Kazlauskas <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Taimur Hassan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Update DCN35 clock table policy
Nicholas Kazlauskas [Fri, 3 Nov 2023 22:07:11 +0000 (18:07 -0400)]
drm/amd/display: Update DCN35 clock table policy

[Why]
The new table doesn't have an implicit mapping between Fclk SOC voltage
and MemClk and it currently builds the table off of number of Fclk
states rather than DcfClock states.

The DML table in use is not correct for functionality or power and
does not align with our existing policies for DCN3x.

[How]
Build the table based on DcfClock with the following assumptions:

1. Raising Soc voltage is the most expensive operation, so assume that
running at max DispClock or DppClock is preferable.

2. Assume that we can run at max Fclk / MemClk at any state, but
restrict the maximum state to the very last entry in the table as the
worst case scenario.

3. Assume that Fclk always has a 2x multiplier on DcfClock unless the
table specifies something lower.

Reviewed-by: Taimur Hassan <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Refactor OPTC into component folder
Parandhaman K [Thu, 9 Nov 2023 10:22:17 +0000 (15:52 +0530)]
drm/amd/display: Refactor OPTC into component folder

[why]
Move all optc files to unique
folder optc.

[how]
creating optc repo in dc, and moved the dcnxx_optc.c and .h files into
corresponding new folders inside the optc and cleared the linkage
errors by adding relative paths in the Makefile.template.

Reviewed-by: Martin Leung <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Parandhaman K <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: force toggle rate wa for first link training for a retimer
Zhongwei [Wed, 8 Nov 2023 08:34:36 +0000 (16:34 +0800)]
drm/amd/display: force toggle rate wa for first link training for a retimer

[WHY]
Handover from DMUB to driver does not perform link rate toggle.
It might cause link training failure for boot up.

[HOW]
Force toggle rate wa for first link train.
link->vendor_specific_lttpr_link_rate_wa should be zero then.

Cc: [email protected] # 6.1+
Reviewed-by: Michael Strauss <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Zhongwei <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: If P-State is supported try SubVP for smaller vlevel
Alvin Lee [Thu, 9 Nov 2023 23:08:17 +0000 (18:08 -0500)]
drm/amd/display: If P-State is supported try SubVP for smaller vlevel

[Description]
- To reduce vlevel further, we can try to apply subvp on
  configs that already support p-state since the natural
  p-state support may not allow for DPM0.
- Add code to try subvp to reduce UCLK DPM level further
  if already supported, but don't use subvp if it does not
  optimize the DPM level even lower

Reviewed-by: Samson Tam <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: correct the amdgpu runtime dereference usage count
Prike Liang [Wed, 8 Nov 2023 06:38:29 +0000 (14:38 +0800)]
drm/amdgpu: correct the amdgpu runtime dereference usage count

Fix the amdgpu runpm dereference usage count.

Signed-off-by: Prike Liang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agoRevert "drm/amd/display: Enable CM low mem power optimization"
Gabe Teeger [Thu, 9 Nov 2023 22:53:49 +0000 (17:53 -0500)]
Revert "drm/amd/display: Enable CM low mem power optimization"

This reverts commit fcfc6ceec3ebb725a0d6381a1120e7cd546e1df4.

[why]
Flickering observed. Regression search pointed to this being
the offending commit.

Reviewed-by: Charlene Liu <[email protected]>
Reviewed-by: Yihan Zhu <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Gabe Teeger <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Update min Z8 residency time to 2100 for DCN314
Nicholas Kazlauskas [Wed, 8 Nov 2023 15:59:00 +0000 (10:59 -0500)]
drm/amd/display: Update min Z8 residency time to 2100 for DCN314

[Why]
Some panels with residency period of 2054 exhibit flickering with
Z8 at the end of the frame.

[How]
As a workaround, increase the limit to block these panels.

Cc: [email protected] # 6.1+
Reviewed-by: Syed Hassan <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Remove min_dst_y_next_start check for Z8
Nicholas Kazlauskas [Wed, 8 Nov 2023 15:55:53 +0000 (10:55 -0500)]
drm/amd/display: Remove min_dst_y_next_start check for Z8

[Why]
Flickering occurs on DRR supported panels when engaged in DRR due to
min_dst_y_next becoming larger than the frame size itself.

[How]
In general, we should be able to enter Z8 when this is engaged but it
might be a net power loss even if the calculation wasn't bugged.

Don't support enabling Z8 during the DRR region.

Cc: [email protected] # 6.1+
Reviewed-by: Syed Hassan <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Fix tiled display misalignment
Meenakshikumar Somasundaram [Thu, 9 Nov 2023 05:04:36 +0000 (00:04 -0500)]
drm/amd/display: Fix tiled display misalignment

[Why]
When otg workaround is applied during clock update, otgs of
tiled display went out of sync.

[How]
To call dc_trigger_sync() after clock update to sync otgs again.

Reviewed-by: Nicholas Kazlauskas <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Meenakshikumar Somasundaram <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: fix memory overflow in the IB test
Tim Huang [Tue, 21 Nov 2023 03:06:51 +0000 (11:06 +0800)]
drm/amdgpu: fix memory overflow in the IB test

Fix a memory overflow issue in the gfx IB test
for some ASICs. At least 20 bytes are needed for
the IB test packet.

v2: correct code indentation errors. (Christian)

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: add init_registers for nbio v7.11
Li Ma [Tue, 21 Nov 2023 08:54:59 +0000 (16:54 +0800)]
drm/amdgpu: add init_registers for nbio v7.11

enable init_registers callback func for nbio v7.11.

Signed-off-by: Li Ma <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Enable SubVP on 1080p60 displays
Alvin Lee [Thu, 9 Nov 2023 15:50:30 +0000 (10:50 -0500)]
drm/amd/display: Enable SubVP on 1080p60 displays

[Description]
- Previously SubVP would never be selected on 1080p60 displays because
  it has too much vactive margin. However, implement a change to allow
  it like how 1440p60 is allowed.
- Add a new struct such that we have a list of allowed modes for
  enabling subvp with vactive margin (currently 1080p60 and 1440p60)
- Also ensure to block drr + vblank cases to prevent unexpected
  enablement of new display configs
- Update SW cursor fallback for these new potential cases as well

Reviewed-by: Samson Tam <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Disable Timing sync check in Full-Screen Video Case
Dennis Chan [Tue, 31 Oct 2023 02:09:02 +0000 (10:09 +0800)]
drm/amd/display: Disable Timing sync check in Full-Screen Video Case

[why]
If Panel max link off frame count is low, it will cause low residency
for Replay, then Disabled timing sync check in Full screen Video Case.

Reviewed-by: Robin Chen <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Dennis Chan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: adjust flow for deallocation mst payload
Wayne Lin [Mon, 7 Aug 2023 07:34:39 +0000 (15:34 +0800)]
drm/amd/display: adjust flow for deallocation mst payload

[Why]
MST relevant variables are maintained at drm side. As the result, we
still have to call drm_dp_remove_payload_part2() to update the relevant
values regardless the link is under mst mode or not. We used to have a
workaround patch to tackle this: commit 3d8fcc6740c9 ("drm/amd/display:
Extract temp drm mst deallocation wa into its own function")

Now it's time to remove the workaround and adjust the flow.

[How]
During deallocate_mst_payload(), source actually doesn't send out
ALLOCATE_PAYLOAD at the end as like the flow in allocate_mst_payload().
Call function dm_helpers_dp_mst_send_payload_allocation() at the end of
deallocate_mst_payload() is a bit confusing.

Separate dm_helpers_dp_mst_send_payload_allocation() into 2 functions.
Have a new function dm_helpers_dp_mst_update_mst_mgr_for_deallocation()
to replace dm_helpers_dp_mst_send_payload_allocation() for payload
deallocation.

Cc: Ville Syrjälä <[email protected]>
Reviewed-by: Wenjing Liu <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Wayne Lin <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Simplify brightness initialization
Camille Cho [Fri, 3 Nov 2023 04:08:42 +0000 (12:08 +0800)]
drm/amd/display: Simplify brightness initialization

[Why]
Remove the brightness cache in DC. It uses a single value to represent
the brightness for both SDR and HDR mode. This leads to flash in HDR
on/off. It also unconditionally programs brightness as in HDR mode. This
may introduce garbage on SDR mode in miniLED panel.

[How]
Simplify the initialization flow by removing the DC cache and taking
what panel has as default. Expand the mechanism for PWM to DPCD Aux to
restore cached brightness value generally.

Cc: [email protected] # 6.1+
Reviewed-by: Krunoslav Kovac <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Camille Cho <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: replay: Augment Frameupdate Command
Max Tseng [Wed, 8 Nov 2023 03:31:50 +0000 (11:31 +0800)]
drm/amd/display: replay: Augment Frameupdate Command

[Why]
Sending certain Frameupdate number for Replay Power Evaluation

Reviewed-by: Dennis Chan <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Max Tseng <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Increase num voltage states to 40
Alvin Lee [Wed, 8 Nov 2023 22:16:28 +0000 (17:16 -0500)]
drm/amd/display: Increase num voltage states to 40

[Description]
If during driver init stage there are greater than 20
intermediary voltage states while constructing the SOC
BB we could hit issues because we will index outside of the
clock_limits array and start overwriting data. Increase the
total number of states to 40 to avoid this issue.

Cc: [email protected] # 6.1+
Reviewed-by: Samson Tam <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Do not read DPREFCLK spread info from LUT on DCN35
Michael Strauss [Fri, 27 Oct 2023 18:12:51 +0000 (14:12 -0400)]
drm/amd/display: Do not read DPREFCLK spread info from LUT on DCN35

[WHY]
Currently DCN35 does not spread DPREFCLK

[HOW]
Remove hardcoded table with nonzero caps

Reviewed-by: Nicholas Kazlauskas <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Michael Strauss <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: replay: generalize the send command function usage
Max Tseng [Tue, 7 Nov 2023 07:00:03 +0000 (15:00 +0800)]
drm/amd/display: replay: generalize the send command function usage

Augment the function to allow send different format data in different
use case.

Reviewed-by: Dennis Chan <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Max Tseng <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Refactor DSC into component folder
Bhuvana Chandra Pinninti [Wed, 18 Oct 2023 13:46:17 +0000 (19:16 +0530)]
drm/amd/display: Refactor DSC into component folder

[why]

To refactor DSC and make DSC files unit testable.

[how]

moved the dcnxx_dsc.c and .h files
into corresponding dcn folders inside
the dsc and cleared the linkage errors.

Reviewed-by: Wenjing Liu <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Bhuvana Chandra Pinninti <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Use DRAM speed from validation for dummy p-state
Alvin Lee [Tue, 7 Nov 2023 22:01:49 +0000 (17:01 -0500)]
drm/amd/display: Use DRAM speed from validation for dummy p-state

[Description]
When choosing which dummy p-state latency to use, we
need to use the DRAM speed from validation. The DRAMSpeed
DML variable can change because we use different input
params to DML when populating watermarks set B.

Cc: [email protected] # 6.1+
Reviewed-by: Samson Tam <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Fix MPCC 1DLUT programming
Ilya Bakoulin [Tue, 7 Nov 2023 20:07:56 +0000 (15:07 -0500)]
drm/amd/display: Fix MPCC 1DLUT programming

[Why]
Wrong function is used to translate LUT values to HW format, leading to
visible artifacting in some cases.

[How]
Use the correct cm3_helper function.

Cc: [email protected] # 6.1+
Reviewed-by: Krunoslav Kovac <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Ilya Bakoulin <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Feed SR and Z8 watermarks into DML2 for DCN35
Nicholas Kazlauskas [Tue, 7 Nov 2023 16:15:16 +0000 (11:15 -0500)]
drm/amd/display: Feed SR and Z8 watermarks into DML2 for DCN35

[Why]
We've updated the table but the values aren't being reflected in DML2
calculation.

[How]
Pass them into the bbox overrides.

Reviewed-by: Jun Lei <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: Force order between a read and write to the same address
Alex Sierra [Mon, 20 Nov 2023 17:31:32 +0000 (11:31 -0600)]
drm/amdgpu: Force order between a read and write to the same address

Setting register to force ordering to prevent read/write or write/read
hazards for un-cached modes.

Signed-off-by: Alex Sierra <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: Do not issue gpu reset from nbio v7_9 bif interrupt
Hawking Zhang [Mon, 20 Nov 2023 02:14:21 +0000 (10:14 +0800)]
drm/amdgpu: Do not issue gpu reset from nbio v7_9 bif interrupt

In nbio v7_9, host driver should not issu gpu reset

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Stanley Yang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Add Z8 watermarks for DML2 bbox overrides
Nicholas Kazlauskas [Tue, 7 Nov 2023 16:12:45 +0000 (11:12 -0500)]
drm/amd/display: Add Z8 watermarks for DML2 bbox overrides

[Why]
We can override SR watermarks but not Z8 ones.

[How]
Add new parameters for Z8 matching the SR ones and feed them into the
states.

These also weren't being applied to every state, so make sure that
we loop over and update all SOC states if given an override.

Reviewed-by: Jun Lei <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: always use mpc factor of 2 for stereo timings
Wenjing Liu [Thu, 2 Nov 2023 19:02:42 +0000 (15:02 -0400)]
drm/amd/display: always use mpc factor of 2 for stereo timings

[why]
In the new pipe resource management logic, the special handling for
stereo timings is missing.
This commit implements the same stereo timings handling as old
pipe resource management code.

Reviewed-by: Chaitanya Dhere <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Wenjing Liu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: update pixel clock params after stream slice count change in context
Wenjing Liu [Thu, 2 Nov 2023 18:59:13 +0000 (14:59 -0400)]
drm/amd/display: update pixel clock params after stream slice count change in context

[why]
When ODM slice count is changed, otg master pipe's pixel clock params is
no longer valid as the value is dependent on ODM slice count.

Reviewed-by: Chaitanya Dhere <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Wenjing Liu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: optimize RLC powerdown notification on Vangogh
Perry Yuan [Tue, 1 Aug 2023 14:37:41 +0000 (10:37 -0400)]
drm/amdgpu: optimize RLC powerdown notification on Vangogh

The smu needs to get the rlc power down message to sync the rlc state
with smu, the rlc state updating message need to be sent at while smu
begin suspend sequence , otherwise SMU will crash while RLC state is not
notified by driver, and rlc state probally changed after that
notification, so it needs to notify rlc state to smu at the end of the
suspend sequence in amdgpu_device_suspend() that can make sure the rlc
state  is correctly set to SMU.

[  101.000590] amdgpu 0000:03:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000001E SMN_C2PMSG_82:0x00000000
[  101.000598] amdgpu 0000:03:00.0: amdgpu: Failed to disable gfxoff!
[  110.838026] amdgpu 0000:03:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000001E SMN_C2PMSG_82:0x00000000
[  110.838035] amdgpu 0000:03:00.0: amdgpu: Failed to disable smu features.
[  110.838039] amdgpu 0000:03:00.0: amdgpu: Fail to disable dpm features!
[  110.838040] [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block <smu> failed -62
[  110.884394] PM: suspend of devices aborted after 21213.620 msecs
[  110.884402] PM: start suspend of devices aborted after 21213.882 msecs
[  110.884405] PM: Some devices failed to suspend, or early wake event detected

Reviewed-by: Yifan Zhang <[email protected]>
Signed-off-by: Perry Yuan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: Retire query/reset_ras_err_status from gfx_v9_4_3
Hawking Zhang [Mon, 20 Nov 2023 03:04:45 +0000 (11:04 +0800)]
drm/amdgpu: Retire query/reset_ras_err_status from gfx_v9_4_3

Not needed anymore.

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Stanley Yang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: fix a pipe mapping error in dcn32_fpu
Wenjing Liu [Mon, 6 Nov 2023 21:47:19 +0000 (16:47 -0500)]
drm/amd/display: fix a pipe mapping error in dcn32_fpu

[why]
In dcn32 DML pipes are ordered the same as dc pipes but only for used
pipes. For example, if dc pipe 1 and 2 are used, their dml pipe indices
would be 0 and 1 respectively. However
update_pipe_slice_table_with_split_flags doesn't skip indices for free
pipes. This causes us to not reference correct dml pipe output when
building pipe topology.

[how]
Use two variables to iterate dc and dml pipes respectively and only
increment dml pipe index when current dc pipe is not free.

Cc: [email protected] # 6.1+
Reviewed-by: Chaitanya Dhere <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Wenjing Liu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: add skip_implict_edp_power_control flag for dce110
Ian Chen [Mon, 6 Nov 2023 07:46:19 +0000 (15:46 +0800)]
drm/amd/display: add skip_implict_edp_power_control flag for dce110

If the link requests to skip implicit eDP power control, we should honor
that request.

Reviewed-by: Robin Chen <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Update DCN35 watermarks
Nicholas Kazlauskas [Mon, 6 Nov 2023 22:29:33 +0000 (17:29 -0500)]
drm/amd/display: Update DCN35 watermarks

[Why & How]
Update to the new values per HW team request. Affects both stutter
and z8.

Reviewed-by: Charlene Liu <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdgpu: update xgmi num links info post gc9.4.2
Jonathan Kim [Thu, 16 Nov 2023 18:57:07 +0000 (13:57 -0500)]
drm/amdgpu: update xgmi num links info post gc9.4.2

GC IP 9.4.2 and up support TA reporting of the number
of xGMI links between peers.

Tested-by: Vignesh Chander <[email protected]>
Signed-off-by: Jonathan Kim <[email protected]>
Reviewed-by: Mukul Joshi <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amdkfd: Copy HW exception data to user event
David Yat Sin [Fri, 17 Nov 2023 05:16:59 +0000 (05:16 +0000)]
drm/amdkfd: Copy HW exception data to user event

Fixes issue where user events of type KFD_EVENT_TYPE_HW_EXCEPTION do not
have valid data

Signed-off-by: David Yat Sin <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Add z-state support policy for dcn35
Nicholas Kazlauskas [Fri, 3 Nov 2023 14:01:01 +0000 (10:01 -0400)]
drm/amd/display: Add z-state support policy for dcn35

[Why]
DML2 means that the dcn3x policy for calculating z-state support
no longer runs from validate_bandwidth.

This means we are unconditionally allowing Z8, the hardware default.

[How]
Port the policy over to DCN35, but with a few modifications:
- Don't use min_dst_y_next_start as a check for Z8/Z10 allow
- Add support for overriding the Z10 stutter period per ASIC
- Cleanup the code to make the policy assignment more clear

Reviewed-by: Charlene Liu <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Include udelay when waiting for INBOX0 ACK
Alvin Lee [Mon, 6 Nov 2023 16:20:15 +0000 (11:20 -0500)]
drm/amd/display: Include udelay when waiting for INBOX0 ACK

When waiting for the ACK for INBOX0 message,
we have to ensure to include the udelay
for proper wait time

Cc: [email protected] # 6.1+
Reviewed-by: Samson Tam <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/display: Add new Replay command and Disabled Replay Timing Resync
Dennis Chan [Fri, 27 Oct 2023 03:00:36 +0000 (11:00 +0800)]
drm/amd/display: Add new Replay command and Disabled Replay Timing Resync

[why]
To support dynamic switching for Replay timing sync mechanism.

Reviewed-by: ChunTao Tso <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Dennis Chan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/pm: Add sysfs attribute to get pm metrics
Lijo Lazar [Fri, 29 Sep 2023 06:26:49 +0000 (11:56 +0530)]
drm/amd/pm: Add sysfs attribute to get pm metrics

Add sysfs attribute to read power management metrics. A snapshot is
captured to the buffer when the attribute is read.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Reviewed-by: Yang Wang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
14 months agodrm/amd/pm: Add pm metrics support to SMU v13.0.6
Lijo Lazar [Fri, 29 Sep 2023 06:05:19 +0000 (11:35 +0530)]
drm/amd/pm: Add pm metrics support to SMU v13.0.6

Add support to fetch PM metrics sample from SMU v13.0.6

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Reviewed-by: Yang Wang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
This page took 0.111669 seconds and 4 git commands to generate.