linux-2.6-microblaze.git
11 months agodrm/amd/display: clean up some inconsistent indentings
Yang Li [Thu, 28 Sep 2023 01:13:51 +0000 (09:13 +0800)]
drm/amd/display: clean up some inconsistent indentings

drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn35/dcn35_fpu.c:261 dcn35_update_bw_bounding_box_fpu() warn: inconsistent indenting

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Handle non-terminated overdrive commands.
Bas Nieuwenhuizen [Tue, 17 Oct 2023 14:01:35 +0000 (16:01 +0200)]
drm/amd/pm: Handle non-terminated overdrive commands.

The incoming strings might not be terminated by a newline
or a 0.

(found while testing a program that just wrote the string
 itself, causing a crash)

Cc: stable@vger.kernel.org
Fixes: e3933f26b657 ("drm/amd/pp: Add edit/commit/show OD clock/voltage support in sysfs")
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Enable software RAS in vcn v4_0_3
Hawking Zhang [Thu, 28 Sep 2023 09:00:31 +0000 (17:00 +0800)]
drm/amdgpu: Enable software RAS in vcn v4_0_3

Set VCN/JPEG RAS masks to enable software RAS for
VCN and JPEG.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: define ras_reset_error_count function
Tao Zhou [Wed, 11 Oct 2023 10:36:15 +0000 (18:36 +0800)]
drm/amdgpu: define ras_reset_error_count function

Make the code architecture more simple.

v2: reuse ras_reset_error_count in ras_reset_error_status.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdkfd:remove unused code
Jesse Zhang [Thu, 19 Oct 2023 06:39:48 +0000 (14:39 +0800)]
drm/amdkfd:remove unused code

Function svm_range_split_by_grinity is not used,
so it is removed.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Suggested-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Support for getting power1_cap_min value
Ma Jun [Thu, 12 Oct 2023 01:33:45 +0000 (09:33 +0800)]
drm/amd/pm: Support for getting power1_cap_min value

Support for getting power1_cap_min value on smu13 and smu11.
For other Asics, we still use 0 as the default value.

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Log UE corrected by replay as correctable error
Candice Li [Wed, 18 Oct 2023 07:16:39 +0000 (15:16 +0800)]
drm/amdgpu: Log UE corrected by replay as correctable error

Support replay mode where UE could be converted to CE.

Signed-off-by: Candice Li <candice.li@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Reserve fences for VM update
Felix Kuehling [Mon, 17 Jul 2023 19:28:52 +0000 (15:28 -0400)]
drm/amdgpu: Reserve fences for VM update

In amdgpu_dma_buf_move_notify reserve fences for the page table updates
in amdgpu_vm_clear_freed and amdgpu_vm_handle_moved. This fixes a BUG_ON
in dma_resv_add_fence when using SDMA for page table updates.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Fix possible null pointer dereference
Felix Kuehling [Tue, 17 Oct 2023 20:51:03 +0000 (16:51 -0400)]
drm/amdgpu: Fix possible null pointer dereference

abo->tbo.resource may be NULL in amdgpu_vm_bo_update.

Fixes: 180253782038 ("drm/ttm: stop allocating dummy resources during BO creation")
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Workaround to skip kiq ring test during ras gpu recovery
Stanley.Yang [Tue, 17 Oct 2023 13:49:09 +0000 (21:49 +0800)]
drm/amdgpu: Workaround to skip kiq ring test during ras gpu recovery

This is workaround, kiq ring test failed in suspend stage when do ras
recovery.

Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Fix a handful of spelling mistakes in dml_print output
Colin Ian King [Tue, 17 Oct 2023 08:06:16 +0000 (09:06 +0100)]
drm/amd/display: Fix a handful of spelling mistakes in dml_print output

There are a few spelling mistakes and an minor grammatical issue in
some dml_print messages. Fix these.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdkfd: clean up some inconsistent indenting
Jiapeng Chong [Fri, 13 Oct 2023 03:21:29 +0000 (11:21 +0800)]
drm/amdkfd: clean up some inconsistent indenting

No functional modification involved.

drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:305 svm_range_free() warn: inconsistent indenting.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6804
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Remove brackets in macro to conform to coding style
Stylon Wang [Fri, 13 Oct 2023 08:10:53 +0000 (16:10 +0800)]
drm/amd/display: Remove brackets in macro to conform to coding style

[Why]
Many of the register macros defined ind dcn32_resource.h have
extra brackets. This is not conforming to the style of those
defined in other DC header files.

[How]
Remove these brackets in dcn32_resource.h

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Stylon Wang <stylon.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd: Read IMU FW version from scratch register during hw_init
Mario Limonciello [Fri, 13 Oct 2023 19:26:04 +0000 (14:26 -0500)]
drm/amd: Read IMU FW version from scratch register during hw_init

If the IMU version wasn't discovered from the header, such as when
the firmware was directly loaded by PSP then there is no firmware
version to show to userspace from sysfs or IOCTL.

The IMU F/W stores the version in the first scratch register though,
so fetch it in these cases to let the driver export.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd: Don't parse IMU ucode version if it won't be loaded
Mario Limonciello [Fri, 13 Oct 2023 19:26:03 +0000 (14:26 -0500)]
drm/amd: Don't parse IMU ucode version if it won't be loaded

When the IMU ucode is loaded by the PSP parsing the version that comes from
Linux will vary. Rather than showing the wrong data to kernel interface
consumers, avoid populating it in this case.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd: Move microcode init step to early_init()
Mario Limonciello [Fri, 13 Oct 2023 19:26:02 +0000 (14:26 -0500)]
drm/amd: Move microcode init step to early_init()

The intention for early init is to find any missing microcode early
and fail the driver load if it's missing.  Move this step to earlier
in driver init to match other IP blocks.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: update retry times for psp BL wait
Asad Kamal [Mon, 16 Oct 2023 14:10:34 +0000 (22:10 +0800)]
drm/amdgpu: update retry times for psp BL wait

Increase retry time for PSP BL wait, to compensate
for longer time to set c2pmsg 35 ready bit during
mode1 with RAS

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd: Add missing kernel doc for prepare_suspend()
Mario Limonciello [Tue, 17 Oct 2023 19:37:43 +0000 (14:37 -0500)]
drm/amd: Add missing kernel doc for prepare_suspend()

prepare_suspend() is intended to be used for any IP blocks
that must allocate memory during the suspend sequence.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/all/20231017143555.6a6450fc@canb.auug.org.au/
Fixes: cb11ca3233aa ("drm/amd: Add concept of running prepare_suspend() sequence for IP blocks")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: update to the latest GC 11.5 headers
Alex Deucher [Thu, 21 Sep 2023 19:43:30 +0000 (15:43 -0400)]
drm/amdgpu: update to the latest GC 11.5 headers

Add some additional bitfields.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Fix a memory leak on an error path
Kunwu.Chan [Tue, 10 Oct 2023 06:10:39 +0000 (14:10 +0800)]
drm/amd/pm: Fix a memory leak on an error path

Add missing free on an error path.

Fixes: 511a95552ec8 ("drm/amd/pm: Add SMU 13.0.6 support")
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Kunwu.Chan <chentao@kylinos.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/mes11: remove aggregated doorbell code
Alex Deucher [Wed, 11 Oct 2023 13:49:14 +0000 (09:49 -0400)]
drm/amdgpu/mes11: remove aggregated doorbell code

It's not enabled in hardware so the code is dead.
Remove it.

Reviewed-by: Jack Xiao <Jack.Xiao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu : Add hive ras recovery check
Asad Kamal [Thu, 5 Oct 2023 07:40:42 +0000 (15:40 +0800)]
drm/amdgpu : Add hive ras recovery check

If one of the devices in the hive detects a
fatal error, need to send ras recovery reset
message to PMFW of all devices in the hive.
For that add a flag in hive to indicate that
it's undergoing ras recovery

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Add missing lines of code in dc.c
Stylon Wang [Thu, 12 Oct 2023 09:07:10 +0000 (17:07 +0800)]
drm/amd/display: Add missing lines of code in dc.c

[Why & How]
A critial part of "drm/amd/display: Fix windowed MPO video with ODM
combine for DCN32" is lost during promotion to upstream. This patch
addes the code back to dc.c.

Signed-off-by: Stylon Wang <stylon.wang@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amdgpu: Program xcp_ctl registers as needed"
Mangesh Gadre [Wed, 11 Oct 2023 08:33:17 +0000 (16:33 +0800)]
Revert "drm/amdgpu: Program xcp_ctl registers as needed"

This reverts commit 0bdebfef3fb2b6291000765eaa9c6c8030293fce.

XCP_CTL register is programmed by firmware and
register access is protected.

Signed-off-by: Mangesh Gadre <Mangesh.Gadre@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/umsch: add suspend and resume callback
Lang Yu [Thu, 12 Oct 2023 09:48:40 +0000 (17:48 +0800)]
drm/amdgpu/umsch: add suspend and resume callback

Add missing IP callbacks.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/pm: update SMU 13.0.0 PMFW version check
Alex Deucher [Thu, 12 Oct 2023 19:10:53 +0000 (15:10 -0400)]
drm/amdgpu/pm: update SMU 13.0.0 PMFW version check

Update the PMFW version check the the ROCm optimizations.

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoMerge tag 'amd-drm-next-6.7-2023-10-13' of https://gitlab.freedesktop.org/agd5f/linux...
Dave Airlie [Wed, 18 Oct 2023 06:08:07 +0000 (16:08 +1000)]
Merge tag 'amd-drm-next-6.7-2023-10-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.7-2023-10-13:

amdgpu:
- DC replay fixes
- Misc code cleanups and spelling fixes
- Documentation updates
- RAS EEPROM Updates
- FRU EEPROM Updates
- IP discovery updates
- SR-IOV fixes
- RAS updates
- DC PQ fixes
- SMU 13.0.6 updates
- GC 11.5 Support
- NBIO 7.11 Support
- GMC 11 Updates
- Reset fixes
- SMU 11.5 Updates
- SMU 13.0 OD support
- Use flexible arrays for bo list handling
- W=1 Fixes
- SubVP fixes
- DPIA fixes
- DCN 3.5 Support
- Devcoredump fixes
- VPE 6.1 support
- VCN 4.0 Updates
- S/G display fixes
- DML fixes
- DML2 Support
- MST fixes
- VRR fixes
- Enable seamless boot in more cases
- Enable content type property for HDMI
- OLED fixes
- Rework and clean up GPUVM TLB flushing
- DC ODM fixes
- DP 2.x fixes
- AGP aperture fixes
- SDMA firmware loading cleanups
- Cyan Skillfish GPU clock counter fix
- GC 11 GART fix
- Cache GPU fault info for userspace queries
- DC cursor check fixes
- eDP fixes
- DC FP handling fixes
- Variable sized array fixes
- SMU 13.0.x fixes
- IB start and size alignment fixes for VCN
- SMU 14 Support
- Suspend and resume sequence rework
- vkms fix

amdkfd:
- GC 11 fixes
- GC 10 fixes
- Doorbell fixes
- CWSR fixes
- SVM fixes
- Clean up GC info enumeration
- Rework memory limit handling
- Coherent memory handling fixes
- Use partial migrations in GPU faults
- TLB flush fixes
- DMA unmap fixes
- GC 9.4.3 fixes
- SQ interrupt fix
- GTT mapping fix
- GC 11.5 Support

radeon:
- Misc code cleanups
- W=1 Fixes
- Fix possible buffer overflow
- Fix possible NULL pointer dereference

UAPI:
- Add EXT_COHERENT memory allocation flags.  These allow for system scope atomics.
  Proposed userspace: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/pull/88
- Add support for new VPE engine.  This is a memory to memory copy engine with advanced scaling, CSC, and color management features
  Proposed mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25713
- Add INFO IOCTL interface to query GPU faults
  Proposed Mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238
  Proposed libdrm MR: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/298

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231013175758.1735031-1-alexander.deucher@amd.com
11 months agoMerge tag 'drm-habanalabs-next-2023-10-10' of https://git.kernel.org/pub/scm/linux...
Dave Airlie [Tue, 17 Oct 2023 08:07:53 +0000 (18:07 +1000)]
Merge tag 'drm-habanalabs-next-2023-10-10' of https://git./linux/kernel/git/ogabbay/linux into drm-next

This tag contains habanalabs driver changes for v6.7.

The notable changes are:

- uAPI changes:
  - Expose tsc clock sampling to better sync clock information in profiler.
  - Enhance engine error reporting in the info ioctl.
  - Block access to the eventfd operations through the control device.
  - Disable the option of the user to register multiple times with the same
    offset for timestamp dump by the driver. If a user wants to use the same
    offset in the timestamp buffer for different interrupt, it needs to first
    de-register the offset.
  - When exporting dma-buf (for p2p), force the user to specify size/offset
    in multiples of PAGE_SIZE. This is instead of the driver doing the
    rounding to PAGE_SIZE, which has caused the driver to map more memory
    than was intended by the user.

- New features and improvements:
  - Complete the move of the driver to the accel subsystem by removing the
    custom habanalabs class and major and registering to accel subsystem.
  - Move the firmware interface files to include/linux/habanalabs. This is
    a pre-requisite for upstreaming the NIC drivers of Gaudi (as they need to
    include those files).
  - Perform device hard-reset upon PCIe AXI drain event to prevent the failure
    from cascading to different IP blocks in the SoC. In secured environments,
    this is done automatically by the firmware.
  - Print device name when it is removed for better debuggability.
  - Add support for trace of dma map sgtable operations.
  - Optimize handling of user interrupts by splitting the interrupts to two
    lists. One list for fast handling and second list for handling with
    timestamp recording, which is slower.
  - Prevent double device hard-reset due to 2 adjacent H/W events.
  - Set device status 'malfunction' while in rmmod.

- Firmware related fixes:
  - Extend preboot timeout because preboot loading might take longer than
    expected in certain cases.
  - Add a protection mechanism for the Event Queue. In case it is full, the
    firmware will be able to notify about it through a dedicated interrupt.
  - Perform device hard-reset in case scrubbing of memory has failed.

- Bug fixes and code cleanups:
  - Small fixes of dma-buf handling in Gaudi2, such as handling an offset != 0,
    using the correct exported size, creation of sg table.
  - Fix spmu mask creation.
  - Fix bug in wait for cs completion for decoder workloads.
  - Cleanup Greco name from documentation.
  - Fix bug in recording timestamp during cs completion interrupt handling.
  - Fix CoreSight ETF configuration and flush logic.
  - Fix small bug in hpriv_list handling (the list that contains the private
    data per process that opens our device).

Signed-off-by: Dave Airlie <airlied@redhat.com>
# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEE7TEboABC71LctBLFZR1NuKta54AFAmUlHoQACgkQZR1NuKta
# 54DsXQf8CW+W4iWJf5UDTj/E/giu9rVRrsUsU0hhCcXbecIxRsLObYXtulENu5/u
# VuEAo/tAvo0LUKi8pdIv6ernDKaxZ1+fimlfXMCzllAA/ts3yp1NgunprsIsx3tv
# YgcJ2GNR8UlVZ1qYuZl+4dOTyD0yfRMROUXBe7wqKnUXOEepOiLBxq6W15tZiJnx
# L+V0yGkNk6pAoADIXLW9EgEXiN/bJZCXGPWp06i/Nz7cHIHJGoV59wAqftqllCtk
# 8ZMkLByjlQKPhc5AgWBtKE8EGVip3sm7b/Q2Gq0ZXdZiebyVJ+AjuuDOdtq1UCIw
# Rcp2576E7rByIBu3RAFlrioWhuR5Zw==
# =2ien
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 10 Oct 2023 19:51:00 AEST
# gpg:                using RSA key ED311BA00042EF52DCB412C5651D4DB8AB5AE780
# gpg: Can't check signature: No public key
From: Oded Gabbay <ogabbay@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/ZSUfiX4J7v4Wn0cU@ogabbay-vm-u22.habana-labs.com
11 months agoMerge tag 'drm-intel-gt-next-2023-10-12' of git://anongit.freedesktop.org/drm/drm...
Dave Airlie [Tue, 17 Oct 2023 03:46:21 +0000 (13:46 +1000)]
Merge tag 'drm-intel-gt-next-2023-10-12' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

Driver Changes:

Fixes/improvements/new stuff:

- Register engines early to avoid type confusion (Mathias Krause)
- Suppress 'ignoring reset notification' message [guc] (John Harrison)
- Update 'recommended' version to 70.12.1 for DG2/ADL-S/ADL-P/MTL [guc] (John Harrison)
- Enable WA 14018913170 [guc, dg2] (Daniele Ceraolo Spurio)

Future platform enablement:

- Clean steer semaphore on resume (Nirmoy Das)
- Skip MCR ops for ring fault register [mtl] (Nirmoy Das)
- Make i915_gem_shrinker multi-gt aware [gem] (Jonathan Cavitt)
- Enable GGTT updates with binder in MTL (Nirmoy Das, Chris Wilson)
- Invalidate the TLBs on each GT (Chris Wilson)

Miscellaneous:

- Clarify type evolution of uabi_node/uabi_engines (Mathias Krause)
- Annotate struct ct_incoming_msg with __counted_by [guc] (Kees Cook)
- More use of GT specific print helpers [gt] (John Harrison)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZSfKotZVdypU6NaX@tursulin-desk
11 months agoMerge tag 'drm-intel-next-2023-10-12' of git://anongit.freedesktop.org/drm/drm-intel...
Dave Airlie [Mon, 16 Oct 2023 06:44:43 +0000 (16:44 +1000)]
Merge tag 'drm-intel-next-2023-10-12' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

drm/i915 feature pull #2 for v6.7:

Features and functionality:
- Preparation for i915 display code reuse in upcoming Xe driver (Jani)
- Drop the fastboot module parameter and use the platform defaults (Arun)
- Enable new LNL FBC features (Vinod)
- Add LNL display feature capability reads (Vinod)

Refactoring and cleanups:
- Locally enable W=1 warnings by default in i915 (Jani)
- Move HDCP GSC message code to a separate file (Suraj)
- GVT include cleanups (Jani)
- Move more display init under display/ (Jani)
- DPLL ID refactoring (Ville)
- Better abstraction of GT0 (Jani)
- Move VGA decode function to GMCH code (Uma)
- Use local64_try_cmpxchg() to optimize PMU event read (Uros Bizjak)
- Clean up FBC checks (Ville)
- Constify and unify state checker calling conventions (Ville)
- Add display step name helper (Chaitanya)

Documentation:
- Update CCS and GSC CS documentation (Rodrigo)
- Fix a number of documentation typos (Randy Dunlap)

Fixes:
- VLV DSI fixes and quirks (Hans)
- Fix crtc state memory leaks (Suraj)
- Increase LSPCON mode settle timeout (Niko Tsirakis)
- Stop clobbering old crtc state during state check (Ville)
- Fix VLV color state readout (Ville)
- Fix cx0 PHY pipe reset to allow S0iX (Khaled)
- Ensure DP MST pbn_div is up-to-date after sink reconnect (Imre)
- Drop an unnecessary NULL check to fix static analyzer warning (Suraj)
- Use an explicit rather than implicit include for frontbuffer tracking (Jouni)

Merges:
- Backmerge drm-next to fix a conflict (Jani)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/87r0m00xew.fsf@intel.com
11 months agoMerge tag 'drm-misc-next-2023-10-12' of git://anongit.freedesktop.org/drm/drm-misc...
Dave Airlie [Mon, 16 Oct 2023 00:40:31 +0000 (10:40 +1000)]
Merge tag 'drm-misc-next-2023-10-12' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for v6.7-rc1:

Contains the previous pull request drm-misc-next-2023-10-06 + following:

Cross-subsystem Changes:
- Rename fb_pgprot to pgprot_framebuffer and remove file argument/
- Update iosys-map documentation typos.

Core Changes:
- Assorted fixes to drm/panel.
- Add HPD state to drm_connector_oob_hotplug_event(), and implement
  oob hotplug events in bridge connector.
- Replace drm_framebuffer_plane_width/height  with calls to
  drm_format_info_plane_width/height.

Driver Changes:
- Clock and debug fixes for bridge/samsung-dsim.
- More btree -> maple tree conversions.
- Assorted bugfixes in rockchip, panel-tpo-tpg110,
- Add LTK050H3148W-CTA6 panel support.
- Assorted small fixes in host1x, tegra, simpledrm.
- Suspend fixes for host1x.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/3812345e-b086-4d72-8504-f58d84e8feab@linux.intel.com
11 months agodrm/amdgpu/vkms: fix a possible null pointer dereference
Ma Ke [Fri, 13 Oct 2023 01:53:43 +0000 (09:53 +0800)]
drm/amdgpu/vkms: fix a possible null pointer dereference

In amdgpu_vkms_conn_get_modes(), the return value of drm_cvt_mode()
is assigned to mode, which will lead to a NULL pointer dereference
on failure of drm_cvt_mode(). Add a check to avoid null pointer
dereference.

Signed-off-by: Ma Ke <make_ruc2021@163.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/swsmu: update smu v14_0_0 header files and metrics table
Li Ma [Wed, 11 Oct 2023 14:51:50 +0000 (22:51 +0800)]
drm/amd/swsmu: update smu v14_0_0 header files and metrics table

Update driver if, pmfw and ppsmc header files.
Add new gpu_metrics_v3_0 for metrics table updated in driver if
and reserve legacy metrics table to maintain backward compatibility.
---
v1:
Update header files and add gpu_metrics_v3_0.
v2:
Update smu_types.h, smu headers and drop smu_cmn_get_smc_version in smu v14_0_0.

Signed-off-by: Li Ma <li.ma@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: add RAS error info support for umc_v12_0
Yang Wang [Wed, 27 Sep 2023 03:31:16 +0000 (11:31 +0800)]
drm/amdgpu: add RAS error info support for umc_v12_0

add RAS error info support for umc_v12_0.

Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: add RAS error info support for mmhub_v1_8
Yang Wang [Wed, 27 Sep 2023 04:21:12 +0000 (12:21 +0800)]
drm/amdgpu: add RAS error info support for mmhub_v1_8

add RAS error info support for mmhub_v1_8.

Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: add RAS error info support for gfx_v9_4_3
Yang Wang [Wed, 27 Sep 2023 04:02:28 +0000 (12:02 +0800)]
drm/amdgpu: add RAS error info support for gfx_v9_4_3

add RAS error info support for gfx_v9_4_3.

Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: add RAS error info support for sdma_v4_4_2.
Yang Wang [Wed, 27 Sep 2023 03:39:30 +0000 (11:39 +0800)]
drm/amdgpu: add RAS error info support for sdma_v4_4_2.

add RAS error info support for sdma_v4_4_2.

Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: add ras_err_info to identify RAS error source
Yang Wang [Mon, 25 Sep 2023 11:30:26 +0000 (19:30 +0800)]
drm/amdgpu: add ras_err_info to identify RAS error source

introduced "ras_err_info" to better identify a RAS ERROR source.

NOTE:
For legacy chips, keep the original RAS error print format.

v1:
RAS errors may come from different dies during a RAS error query,
therefore, need a new data structure to identify the source of RAS ERROR.

v2:
- use new data structure 'amdgpu_smuio_mcm_config_info' instead of
  ras_err_id (in v1 patch)
- refine ras error dump function name
- refine ras error dump log format

Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: flush the correct vmid tlb for specific pasid
Yifan Zhang [Thu, 12 Oct 2023 07:27:39 +0000 (15:27 +0800)]
drm/amdgpu: flush the correct vmid tlb for specific pasid

flush the correct vmid tlb for specific pasid on gmc 11.

Fixes: 041a5743883d ("drm/amdgpu: fix and cleanup gmc_v11_0_flush_gpu_tlb_pasid")
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: make err_data structure built-in for ras_manager
Yang Wang [Wed, 11 Oct 2023 06:09:20 +0000 (14:09 +0800)]
drm/amdgpu: make err_data structure built-in for ras_manager

(No effect outside the ras_mgr data structure)

Since a new member was added to the ras_err_data data structure,
it becomes unreasonable for the ras_mgr instance to contain this data,
because ras mgr only uses the 2 member information of ue_count/ce_count in err_data.

This patch changes the code err_data into built-in structure members,
making the code directly compatible.

Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: disable GFXOFF and PG during compute for GFX9
Jesse Zhang [Fri, 13 Oct 2023 01:28:44 +0000 (09:28 +0800)]
drm/amdgpu: disable GFXOFF and PG during compute for GFX9

Temporary workaround to fix issues observed in some compute
applications when GFXOFF is enabled on GFX9.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/umsch: fix missing stuff during rebase
Lang Yu [Wed, 11 Oct 2023 09:08:34 +0000 (17:08 +0800)]
drm/amdgpu/umsch: fix missing stuff during rebase

These are missed during rebase.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/umsch: correct IP version format
Lang Yu [Thu, 12 Oct 2023 04:27:01 +0000 (12:27 +0800)]
drm/amdgpu/umsch: correct IP version format

FW uses IP_VERSION_MAJ_MIN_REV format.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: don't use legacy invalidation on MMHUB v3.3
Lang Yu [Wed, 11 Oct 2023 05:03:46 +0000 (13:03 +0800)]
drm/amdgpu: don't use legacy invalidation on MMHUB v3.3

Legacy invalidation is not supported.
This is missed during rebase.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: correct NBIO v7.11 programing
Lang Yu [Thu, 12 Oct 2023 06:30:40 +0000 (14:30 +0800)]
drm/amdgpu: correct NBIO v7.11 programing

Use v7.7 before, switch to v7.11 now.
Fix incorrect programing.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/radeon: fix a possible null pointer dereference
Ma Ke [Wed, 11 Oct 2023 01:21:43 +0000 (09:21 +0800)]
drm/radeon: fix a possible null pointer dereference

In radeon_tv_get_modes(), the return value of drm_cvt_mode()
is assigned to mode, which will lead to a NULL pointer
dereference on failure of drm_cvt_mode(). Add a check to
avoid null point dereference.

Signed-off-by: Ma Ke <make_ruc2021@163.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Correctly use bo_va->ref_count in compute VMs
Xiaogang Chen [Thu, 12 Oct 2023 20:48:06 +0000 (15:48 -0500)]
drm/amdgpu: Correctly use bo_va->ref_count in compute VMs

This is needed to correctly handle BOs imported into compute VM from gfx.
Both kfd and gfx should use same bo_va and set bo_va->ref_count correctly
when map the Bos into same VM, otherwise we may trigger kernel general
protection when iterate mappings over bo_va's valids or invalids list.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ramesh Errabolu <Ramesh.Errabolu@amd.com>
Tested-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Add P2S tables for SMU v13.0.6
Lijo Lazar [Wed, 11 Oct 2023 14:27:38 +0000 (19:57 +0530)]
drm/amd/pm: Add P2S tables for SMU v13.0.6

Add P2S table load support on SMU v13.0.6 ASICs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Add support to load P2S tables
Lijo Lazar [Wed, 11 Oct 2023 14:26:21 +0000 (19:56 +0530)]
drm/amdgpu: Add support to load P2S tables

Add support to load P2S tables through PSP.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Update PSP interface header
Lijo Lazar [Wed, 11 Oct 2023 14:13:56 +0000 (19:43 +0530)]
drm/amdgpu: Update PSP interface header

Adds FW id for P2S table.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Avoid FRU EEPROM access on APU
Lijo Lazar [Thu, 12 Oct 2023 07:33:22 +0000 (13:03 +0530)]
drm/amdgpu: Avoid FRU EEPROM access on APU

FRU EEPROM access is not valid for APU devices.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: save VCN instances init info before jpeg init
Lin.Cao [Tue, 10 Oct 2023 08:58:31 +0000 (16:58 +0800)]
drm/amdgpu: save VCN instances init info before jpeg init

JPEG init header will overwirte vcn init header info which will loss
some debug information

Signed-off-by: Lin.Cao <lincao12@amd.com>
Reviewed-by: Jingwen Chen <Jingwen.Chen2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Skip entire amdgpu_dm build if !CONFIG_DRM_AMD_DC"
Alex Hung [Wed, 11 Oct 2023 19:24:00 +0000 (13:24 -0600)]
Revert "drm/amd/display: Skip entire amdgpu_dm build if !CONFIG_DRM_AMD_DC"

This reverts commit 1b097bcd224e76807b66ef32cee76a3e87271a2b.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Create one virtual connector in DC"
Alex Hung [Wed, 11 Oct 2023 19:23:07 +0000 (13:23 -0600)]
Revert "drm/amd/display: Create one virtual connector in DC"

This reverts commit 554340133e4f596fc40fd75a58f9cf18b6b8dbbc.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Disable virtual links"
Alex Hung [Wed, 11 Oct 2023 19:23:05 +0000 (13:23 -0600)]
Revert "drm/amd/display: Disable virtual links"

This reverts commit b22c336268e477e3e8fc21e7d6b18fa8c4cd1f9a.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Initialize writeback connector"
Alex Hung [Wed, 11 Oct 2023 19:21:50 +0000 (13:21 -0600)]
Revert "drm/amd/display: Initialize writeback connector"

This reverts commit a2830b9e852f4007f7ee53f2c5765ab07ddb55e2.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Skip writeback connector when we get amdgpu_dm_connector"
Alex Hung [Wed, 11 Oct 2023 19:21:49 +0000 (13:21 -0600)]
Revert "drm/amd/display: Skip writeback connector when we get amdgpu_dm_connector"

This reverts commit 30a24318cc8f4947c6567c78997c8deb546e7a0b.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Return drm_connector from find_first_crtc_matching_connector"
Alex Hung [Wed, 11 Oct 2023 19:21:48 +0000 (13:21 -0600)]
Revert "drm/amd/display: Return drm_connector from find_first_crtc_matching_connector"

This reverts commit ca2b37a1c249d05f21eeb7522489036efbc6c7f8.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Use drm_connector in create_stream_for_sink"
Alex Hung [Wed, 11 Oct 2023 19:21:47 +0000 (13:21 -0600)]
Revert "drm/amd/display: Use drm_connector in create_stream_for_sink"

This reverts commit 5d91801870ba0ba23d90885edf0821634ecd405d.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: drop most smu_cmn_get_smc_version in smu
Yifan Zhang [Tue, 10 Oct 2023 13:43:40 +0000 (21:43 +0800)]
drm/amd/pm: drop most smu_cmn_get_smc_version in smu

smu_check_fw_version is called in smu hw init, thus smu if version
and version are garenteed to be stored in smu context. No need to
call smu_cmn_get_smc_version again after system boot up.

Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Add reset option for fan_ctrl on smu 13.0.7
Ma Jun [Wed, 13 Sep 2023 08:54:58 +0000 (16:54 +0800)]
drm/amd/pm: Add reset option for fan_ctrl on smu 13.0.7

Add reset option for fan_ctrl interfaces on the smu v13.0.7
User can use command "echo r > interface_name" to reset the
interface to boot value

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Add reset option for fan_ctrl interfaces
Ma Jun [Wed, 13 Sep 2023 06:25:38 +0000 (14:25 +0800)]
drm/amd/pm: Add reset option for fan_ctrl interfaces

Add reset option for fan_ctrl interfaces.

For example:
User can use the "echo r > acoustic_limit_rpm_threshold" command
to reset acoustic_limit_rpm_threshold to boot value

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Create amdgpu_dm_wb_connector"
Alex Hung [Wed, 11 Oct 2023 19:18:48 +0000 (13:18 -0600)]
Revert "drm/amd/display: Create amdgpu_dm_wb_connector"

This reverts commit a5f9523c9ca352d6454e81ff9e9a4419f457210a.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Create fake sink and stream for writeback connector"
Alex Hung [Wed, 11 Oct 2023 19:18:47 +0000 (13:18 -0600)]
Revert "drm/amd/display: Create fake sink and stream for writeback connector"

This reverts commit 01aaeb8c23301194ee063d89c06eae41599698af.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Hande writeback request from userspace"
Alex Hung [Wed, 11 Oct 2023 19:18:46 +0000 (13:18 -0600)]
Revert "drm/amd/display: Hande writeback request from userspace"

This reverts commit cd1a4bc22821eea9a98f1beddd1a8d789989a720.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Add writeback enable/disable in dc"
Alex Hung [Wed, 11 Oct 2023 19:18:45 +0000 (13:18 -0600)]
Revert "drm/amd/display: Add writeback enable/disable in dc"

This reverts commit c6d3c7b6309726fbe93cf595d6de326fb8295a64.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Fix writeback_info never got updated"
Alex Hung [Wed, 11 Oct 2023 19:18:44 +0000 (13:18 -0600)]
Revert "drm/amd/display: Fix writeback_info never got updated"

This reverts commit 8a307777c36e15f38c9f23778babcd368144c7d8.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Validate hw_points_num before using it"
Alex Hung [Wed, 11 Oct 2023 19:18:38 +0000 (13:18 -0600)]
Revert "drm/amd/display: Validate hw_points_num before using it"

This reverts commit 58c3b3341cea4f75dc8c003b89f8a6dd8ec55e50.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Fix writeback_info is not removed"
Alex Hung [Wed, 11 Oct 2023 19:18:36 +0000 (13:18 -0600)]
Revert "drm/amd/display: Fix writeback_info is not removed"

This reverts commit 5b89d2ccc8466e0445a4994cb288fc009b565de5.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Add writeback enable field (wb_enabled)"
Alex Hung [Wed, 11 Oct 2023 19:18:34 +0000 (13:18 -0600)]
Revert "drm/amd/display: Add writeback enable field (wb_enabled)"

This reverts commit f6893fcb10c7b24526454e465f6ec2563ef044cc.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Setup for mmhubbub3_warmup_mcif with big buffer"
Alex Hung [Wed, 11 Oct 2023 19:18:33 +0000 (13:18 -0600)]
Revert "drm/amd/display: Setup for mmhubbub3_warmup_mcif with big buffer"

This reverts commit 428542d9177286c01ef7a3dbd026eb00567e06b1.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Add new set_fc_enable to struct dwbc_funcs"
Alex Hung [Wed, 11 Oct 2023 19:18:31 +0000 (13:18 -0600)]
Revert "drm/amd/display: Add new set_fc_enable to struct dwbc_funcs"

This reverts commit b79a00a4d4f8fc827ca0fc19e259913a81252f6b.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agoRevert "drm/amd/display: Disable DWB frame capture to emulate oneshot"
Alex Hung [Wed, 11 Oct 2023 19:18:24 +0000 (13:18 -0600)]
Revert "drm/amd/display: Disable DWB frame capture to emulate oneshot"

This reverts commit 77a66faaccc0455fe30e326e9a997aec8d0abed4.

[WHY & HOW]
The writeback series cause a regression in thunderbolt display.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Revert "drm/amd/display: Use drm_connector in create_validate_stream...
Alex Hung [Tue, 10 Oct 2023 22:39:32 +0000 (16:39 -0600)]
drm/amd/display: Revert "drm/amd/display: Use drm_connector in create_validate_stream_for_sink"

This reverts commit c4c182b5488e8d4a48be3327aab14d778cdfe5e7.

After this was commit PCON and USB4 issues were observed. A new fix will
be submitted instead.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Expose ras version & schema info
Asad Kamal [Mon, 2 Oct 2023 06:41:00 +0000 (14:41 +0800)]
drm/amdgpu: Expose ras version & schema info

Expose ras table version & schema info to sysfs

v2: Updated schema to get poison support info
from ras context, removed asic specific checks

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Read PSPv13 OS version from register
Lijo Lazar [Tue, 10 Oct 2023 07:19:25 +0000 (12:49 +0530)]
drm/amdgpu: Read PSPv13 OS version from register

PSP OS updates the version information in register. On APUs with PSPv13,
PSP OS will already be loaded with SBIOS. Hence use the version register
instead of using information in driver binary header.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: add missing NULL check for DML2
Bob Zhou [Tue, 10 Oct 2023 03:02:44 +0000 (11:02 +0800)]
drm/amd/display: add missing NULL check for DML2

Recently, the driver introduce DML2 for future ASIC support.
But, some ASIC's hubbub pointer is null before calling.
It cause the below null pointer issue, so add null check to fix it.

BUG: kernel NULL pointer dereference, address: 0000000000000000
RIP: 0010:dc_create_resource_pool+0xc1/0x2c0 [amdgpu] Call Trace:
 <TASK>
 ? show_regs.cold+0x1a/0x1f
 ? __die_body+0x20/0x70
 ? __die+0x2b/0x37
 ? page_fault_oops+0x136/0x2c0
 ? do_user_addr_fault+0x303/0x660
 ? exc_page_fault+0x77/0x170
 ? asm_exc_page_fault+0x27/0x30
 ? dc_create_resource_pool+0xc1/0x2c0 [amdgpu]  ? dc_create_resource_pool+0x243/0x2c0 [amdgpu]
 dc_create+0x23f/0x6b0 [amdgpu]
 ? dmi_matches+0xa3/0x200
 amdgpu_dm_init+0x2bd/0x22a0 [amdgpu]

Fixes: 7966f319c66d ("drm/amd/display: Introduce DML2")
Signed-off-by: Bob Zhou <bob.zhou@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/umsch: enable doorbell for umsch
Lang Yu [Sun, 1 Oct 2023 16:10:42 +0000 (00:10 +0800)]
drm/amdgpu/umsch: enable doorbell for umsch

Program vcn_doorbell_range with vcn_ring0_1.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: make dc_set_power_state() return type `void` again
Mario Limonciello [Fri, 6 Oct 2023 18:50:26 +0000 (13:50 -0500)]
drm/amd/display: make dc_set_power_state() return type `void` again

As dc_set_power_state() no longer allocates memory, it's not necessary
to have return types and check return code as it can't fail anymore.

Change it back to `void`.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Destroy DC context while keeping DML and DML2
Mario Limonciello [Fri, 6 Oct 2023 18:50:25 +0000 (13:50 -0500)]
drm/amd/display: Destroy DC context while keeping DML and DML2

If there is memory pressure at suspend time then dynamically
allocating a large structure as part of DC suspend code will
fail.

Instead re-use the same structures and clear all members except
those that should be maintained.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/display: Catch errors from drm_atomic_helper_suspend()
Mario Limonciello [Fri, 6 Oct 2023 18:50:24 +0000 (13:50 -0500)]
drm/amd/display: Catch errors from drm_atomic_helper_suspend()

drm_atomic_helper_suspend() can return PTR_ERR(), in which case the
error gets stored into `dm->cached_state`.  This can cause failures
during resume.  Catch the error during suspend and fail the suspend
instead.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd: Split up UVD suspend into prepare and suspend steps
Mario Limonciello [Fri, 6 Oct 2023 18:50:22 +0000 (13:50 -0500)]
drm/amd: Split up UVD suspend into prepare and suspend steps

amdgpu_uvd_suspend() allocates memory and copies objects into that
allocated memory.  This fails under memory pressure.  Instead move
majority of this code into a prepare step when swap can still be
allocated.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd: Add concept of running prepare_suspend() sequence for IP blocks
Mario Limonciello [Fri, 6 Oct 2023 18:50:21 +0000 (13:50 -0500)]
drm/amd: Add concept of running prepare_suspend() sequence for IP blocks

If any IP blocks allocate memory during their hw_fini() sequence
this can cause the suspend to fail under memory pressure.  Introduce
a new phase that IP blocks can use to allocate memory before suspend
starts so that it can potentially be evicted into swap instead.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd: Evict resources during PM ops prepare() callback
Mario Limonciello [Fri, 6 Oct 2023 18:50:20 +0000 (13:50 -0500)]
drm/amd: Evict resources during PM ops prepare() callback

Linux PM core has a prepare() callback run before suspend.

If the system is under high memory pressure, the resources may need
to be evicted into swap instead.  If the storage backing for swap
is offlined during the suspend() step then such a call may fail.

So move this step into prepare() to move evict majority of
resources and update all non-pmops callers to call the same callback.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: enable GFX IP v11.5.0 CG and PG support
Li Ma [Wed, 2 Aug 2023 08:39:51 +0000 (16:39 +0800)]
drm/amdgpu: enable GFX IP v11.5.0 CG and PG support

Add CG support for GFX/MC/HDP/ATHUB/IH/BIF.
Add PG support for GFX.

Signed-off-by: Li Ma <li.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: add support to power up/down UMSCH by SMU
Lang Yu [Fri, 2 Jun 2023 00:39:36 +0000 (08:39 +0800)]
drm/amdgpu: add support to power up/down UMSCH by SMU

Power up/down UMSCH by SMU.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Acked-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: add power up/down UMSCH ppt callback
Lang Yu [Fri, 2 Jun 2023 00:36:28 +0000 (08:36 +0800)]
drm/amdgpu: add power up/down UMSCH ppt callback

Add ppt callback to power up/down UMSCH.

v2: squash in updates (Alex)

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: add support to powerup VPE by SMU
Lang Yu [Wed, 17 May 2023 06:55:46 +0000 (14:55 +0800)]
drm/amdgpu: add support to powerup VPE by SMU

Powerup VPE by SMU.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/discovery: add SMU 14 support
Li Ma [Fri, 28 Apr 2023 06:08:14 +0000 (14:08 +0800)]
drm/amdgpu/discovery: add SMU 14 support

add smu 14 into the IP discovery list.

Signed-off-by: Li Ma <li.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/swsmu: add smu14 ip support
Kenneth Feng [Wed, 26 Apr 2023 06:02:25 +0000 (14:02 +0800)]
drm/amd/swsmu: add smu14 ip support

Add initial swSMU support for smu 14 series ASIC.

v2: squash in build fixes and updates (Li Ma)
    fix warnings (Alex)
v3: squash in updates (Alex)
v4: squash in updates (Alex)
v5: squash in avg/current power updates (Alex)

Signed-off-by: Li Ma <li.ma@amd.com>
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/swsmu: add smu v14_0_0 pmfw if file
Li Ma [Fri, 28 Apr 2023 05:52:04 +0000 (13:52 +0800)]
drm/amd/swsmu: add smu v14_0_0 pmfw if file

Add initial smu v14_0_0 pmfw if file

v2: squash in updates (Alex)

Signed-off-by: Li Ma <li.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/swsmu: add smu v14_0_0 ppsmc file
Li Ma [Fri, 28 Apr 2023 05:22:06 +0000 (13:22 +0800)]
drm/amd/swsmu: add smu v14_0_0 ppsmc file

Add initial smu v14_0_0 ppsmc file

v2: squash in updates (Alex)
v3: squash in updates (Alex)

Signed-off-by: Li Ma <li.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/swsmu: add smu v14_0_0 driver if file
Li Ma [Fri, 28 Apr 2023 07:33:12 +0000 (15:33 +0800)]
drm/amdgpu/swsmu: add smu v14_0_0 driver if file

Add initial smu v14_0_0 driver if file

v2: squash in updates (Alex)
v3: update interface (Alex)

Signed-off-by: Li Ma <li.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/umsch: power on/off UMSCH by DLDO
Lang Yu [Sat, 30 Sep 2023 06:39:26 +0000 (14:39 +0800)]
drm/amdgpu/umsch: power on/off UMSCH by DLDO

VCN 4.0.5 uses DLDO.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu/umsch: fix psp frontdoor loading
Lang Yu [Sat, 7 Oct 2023 04:43:13 +0000 (12:43 +0800)]
drm/amdgpu/umsch: fix psp frontdoor loading

These changes are missed in rebase.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Increase IP discovery region size
Lijo Lazar [Fri, 6 Oct 2023 04:57:20 +0000 (10:27 +0530)]
drm/amdgpu: Increase IP discovery region size

IP discovery region has increased to > 8K on some SOCs.Maximum reserve
size is upto 12K, but not used. For now increase to 10K.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Use gpu_metrics_v1_4 for SMUv13.0.6
Asad Kamal [Wed, 27 Sep 2023 13:08:13 +0000 (21:08 +0800)]
drm/amd/pm: Use gpu_metrics_v1_4 for SMUv13.0.6

Use gpu_metrics_v1_4 for SMUv13.0.6 to fill
gpu metric info

v3: Removed filling gpu metric instantaneous
pcie bw

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Add gpu_metrics_v1_4
Asad Kamal [Wed, 27 Sep 2023 13:05:37 +0000 (21:05 +0800)]
drm/amd/pm: Add gpu_metrics_v1_4

Add new gpu_metrics_v1_4 to acquire XGMI data transfer,
pcie bandwidth & Clock lock status

v2:
Add pcie error counter to gpu metric table v1_4

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amd/pm: Update metric table for smu v13_0_6
Asad Kamal [Wed, 4 Oct 2023 06:04:57 +0000 (14:04 +0800)]
drm/amd/pm: Update metric table for smu v13_0_6

Update pmfw metric table to include xgmi transfer
data and pci instantaneous bandwidth for smu v13_0_6

v2:
Updated metric table version

v3: Removed inst pcie bw with alignment to metrics table
version 8

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 months agodrm/amdgpu: Return -EINVAL when MMSCH init status incorrect
Lin.Cao [Sun, 8 Oct 2023 09:36:40 +0000 (17:36 +0800)]
drm/amdgpu: Return -EINVAL when MMSCH init status incorrect

Return -EINVAL when MMSCH init fail which can be handle by function
amdgpu_device_reset_sriov correctly.

Signed-off-by: Lin.Cao <lincao12@amd.com>
Reviewed-by: Jingwen Chen <Jingwen.Chen2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>