]> Git Repo - linux.git/log
linux.git
7 months agoMerge tag 'drm-intel-gt-next-2024-07-04' of https://gitlab.freedesktop.org/drm/i915...
Daniel Vetter [Fri, 5 Jul 2024 10:14:58 +0000 (12:14 +0200)]
Merge tag 'drm-intel-gt-next-2024-07-04' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next

Driver Changes:

Fixes/improvements/new stuff:

- Downgrade stolen lmem setup warning [gem] (Jonathan Cavitt)
- Evaluate GuC priority within locks [gt/uc] (Andi Shyti)
- Fix potential UAF by revoke of fence registers [gt] (Janusz Krzysztofik)
- Return NULL instead of '0' [gem] (Andi Shyti)
- Use the correct format specifier for resource_size_t [gem] (Andi Shyti)
- Suppress oom warning in favour of ENOMEM to userspace [gem] (Nirmoy Das)

Miscellaneous:

- Evaluate forcewake usage within locks [gt] (Andi Shyti)
- Fix typo in comment [gt/uc] (Andi Shyti)

Signed-off-by: Daniel Vetter <[email protected]>
From: Tvrtko Ursulin <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/ZoZP6mUSergfzFMh@linux
7 months agoMerge tag 'amd-drm-next-6.11-2024-07-03' of https://gitlab.freedesktop.org/agd5f...
Daniel Vetter [Fri, 5 Jul 2024 10:02:11 +0000 (12:02 +0200)]
Merge tag 'amd-drm-next-6.11-2024-07-03' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.11-2024-07-03:

amdgpu:
- Use vmalloc for dc_state
- Replay fixes
- Freesync fixes
- DCN 4.0.1 fixes
- DML fixes
- DCC updates
- Misc code cleanups and bug fixes
- 8K display fixes
- DCN 3.5 fixes
- Restructure DIO code
- DML1 fixes
- DML2 fixes
- GFX11 fix
- GFX12 updates
- GFX12 modifiers fixes
- RAS fixes
- IP dump fixes
- Add some updated IP version checks
_ Silence UBSAN warning

radeon:
- GPUVM fix

Signed-off-by: Daniel Vetter <[email protected]>
From: Alex Deucher <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 months agoMerge tag 'amd-drm-next-6.11-2024-06-28' of https://gitlab.freedesktop.org/agd5f...
Daniel Vetter [Fri, 5 Jul 2024 09:39:22 +0000 (11:39 +0200)]
Merge tag 'amd-drm-next-6.11-2024-06-28' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.11-2024-06-28:

amdgpu:
- JPEG 5.x fixes
- More FW loading cleanups
- Misc code cleanups
- GC 12.x fixes
- ASPM fix
- DCN 4.0.1 updates
- SR-IOV fixes
- HDCP fix
- USB4 fixes
- Silence UBSAN warnings
- MES submission fixes
- Update documentation for new products
- DCC updates
- Initial ISP 4.x plumbing
- RAS fixes
- Misc small fixes

amdkfd:
- Fix missing unlock in error path for adding queues

Signed-off-by: Daniel Vetter <[email protected]>
From: Alex Deucher <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 months agoMerge tag 'mediatek-drm-next-6.11' of https://git.kernel.org/pub/scm/linux/kernel...
Daniel Vetter [Fri, 5 Jul 2024 09:36:24 +0000 (11:36 +0200)]
Merge tag 'mediatek-drm-next-6.11' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next

Mediatek DRM Next for Linux 6.11

1. Convert to platform remove callback returning void
2. Drop chain_mode_fixup call in mode_valid()
3. Fixes the errors of MediaTek display driver found by IGT.
4. Add display support for the MT8365-EVK board
5. Fix bit depth overwritten for mtk_ovl_set bit_depth()
6. Remove less-than-zero comparison of an unsigned value
7. Call drm_atomic_helper_shutdown() at shutdown time
8. Log errors in probe with dev_err_probe()
9. Fix possible_crtcs calculation
10. Fix spurious kfree()

Signed-off-by: Daniel Vetter <[email protected]>
From: Chun-Kuang Hu <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 months agoMerge tag 'drm-etnaviv-next-2024-06-28' of https://git.pengutronix.de/git/lst/linux...
Daniel Vetter [Fri, 5 Jul 2024 09:29:59 +0000 (11:29 +0200)]
Merge tag 'drm-etnaviv-next-2024-06-28' of https://git.pengutronix.de/git/lst/linux into drm-next

- fix i.MX8MP NPU clock gating
- workaround FE register cdc issues on some cores
- fix DMA sync handling for cached buffers
- fix job timeout handling
- keep TS enabled on MMUv2 cores for improved performance

Signed-off-by: Daniel Vetter <[email protected]>
From: Lucas Stach <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 months agoMerge tag 'exynos-drm-next-for-v6.11' of git://git.kernel.org/pub/scm/linux/kernel...
Daniel Vetter [Fri, 5 Jul 2024 09:21:34 +0000 (11:21 +0200)]
Merge tag 'exynos-drm-next-for-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next

Some cleanups to Exynos Virtual Display driver
- Use drm_edid_duplicate() instead of kmemdup().
- Replace existing EDID handling with struct drm_edid functions
  for improved management.
- Keep an allocated raw_edid or NULL and handle fake_edid_info in get_modes().

Signed-off-by: Daniel Vetter <[email protected]>
From: Inki Dae <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 months agoMerge v6.10-rc6 into drm-next
Daniel Vetter [Fri, 5 Jul 2024 08:35:14 +0000 (10:35 +0200)]
Merge v6.10-rc6 into drm-next

The exynos-next pull is based on a newer -rc than drm-next. hence
backmerge first to make sure the unrelated conflicts we accumulated
don't end up randomly in the exynos merge pull, but are separated out.

Conflicts are all benign: Adjacent changes in amdgpu and fbdev-dma
code, and cherry-pick conflict in xe.

Signed-off-by: Daniel Vetter <[email protected]>
7 months agoMerge tag 'drm-xe-next-2024-07-02' of https://gitlab.freedesktop.org/drm/xe/kernel...
Daniel Vetter [Fri, 5 Jul 2024 07:12:19 +0000 (09:12 +0200)]
Merge tag 'drm-xe-next-2024-07-02' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next

Driver Changes:
- Fix in migration code (Auld)
- Simplification in HWMon related code (Karthik)
- Fix in forcewake logic (Nirmoy)
- Fix engine utilization information (umesh)
- Clean up on MOCS related code (Roper)
- Fix on multicast register (Roper)
- Fix TLB invalidation timeout (Nirmoy)
- More SRIOV preparation (Michal)
- Fix out-of-bounds array access (Lucas)
- Fixes around some mutex utilization (Ashutosh, Vinay)
- Expand LNL workaround to BMG (Vinay)

Signed-off-by: Daniel Vetter <[email protected]>
From: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 months agodrm/exynos/vidi: convert to struct drm_edid
Jani Nikula [Thu, 30 May 2024 10:01:54 +0000 (13:01 +0300)]
drm/exynos/vidi: convert to struct drm_edid

Prefer the struct drm_edid based functions for storing the EDID and
updating the connector.

It would be better if the vidi connection ioctl passed in the EDID size
separately instead of relying on the extension count specified in the
EDID, but that's what we have to rely on.

Signed-off-by: Jani Nikula <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
7 months agodrm/exynos/vidi: simplify fake edid handling
Jani Nikula [Thu, 30 May 2024 10:01:53 +0000 (13:01 +0300)]
drm/exynos/vidi: simplify fake edid handling

Avoid assigning fake_edid_info to ctx->raw_edid. Always keep
ctx->raw_edid either an allocated pointer or NULL. Defer fake_edid_info
handling to .get_modes().

This should be functionally equivalent but slightly easier to follow.

Signed-off-by: Jani Nikula <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
7 months agodrm/exynos/vidi: use drm_edid_duplicate()
Jani Nikula [Thu, 30 May 2024 10:01:52 +0000 (13:01 +0300)]
drm/exynos/vidi: use drm_edid_duplicate()

Don't open code drm_edid_duplicate(). While at it, drop the error
message on allocation failure.

Signed-off-by: Jani Nikula <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
7 months agoMerge tag 'exynos-drm-fixes-for-v6.10-rc4' of git://git.kernel.org/pub/scm/linux...
Inki Dae [Wed, 3 Jul 2024 04:00:01 +0000 (13:00 +0900)]
Merge tag 'exynos-drm-fixes-for-v6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into exynos-drm-next

Regression fix
- Fix an regression issue by adding 640x480 fallback mode
  for Exynos HDMI driver.

Bug fix
- Fix a memory leak by ensuring the duplicated EDID is properly freed in the get_modes function.

Code cleanup
- Remove redundant driver owner initialization since platform_driver_register() sets it automatically.

7 months agodrm/amdgpu/atomfirmware: silence UBSAN warning
Alex Deucher [Mon, 1 Jul 2024 16:50:10 +0000 (12:50 -0400)]
drm/amdgpu/atomfirmware: silence UBSAN warning

This is a variable sized array.

Link: https://lists.freedesktop.org/archives/amd-gfx/2024-June/110420.html
Tested-by: Jeff Layton <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: fix out of bounds access in gfx11 during ip dump
Sunil Khatri [Tue, 2 Jul 2024 08:19:20 +0000 (13:49 +0530)]
drm/amdgpu: fix out of bounds access in gfx11 during ip dump

During ip dump in gfx11 the index variable is reused but is
not reinitialized to 0 and this causes the index calculation
to be wrong and access out of bound access.

Acked-by: Christian König <[email protected]>
Signed-off-by: Sunil Khatri <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add firmware for PSP IP v14.0.4
Tim Huang [Tue, 4 Jun 2024 05:33:05 +0000 (13:33 +0800)]
drm/amdgpu: add firmware for PSP IP v14.0.4

This patch is to add firmware for PSP 14.0.4.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: enable mode2 reset for SMU IP v14.0.4
Tim Huang [Tue, 14 May 2024 08:41:48 +0000 (16:41 +0800)]
drm/amdgpu: enable mode2 reset for SMU IP v14.0.4

Set the default reset method to mode2 for SMU 14.0.4.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add SMU IP v14.0.4 discovery support
Tim Huang [Tue, 14 May 2024 08:38:48 +0000 (16:38 +0800)]
drm/amdgpu: add SMU IP v14.0.4 discovery support

This patch is to add SMU 14.0.4 support

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/pm: add SMU IP v14.0.4 support
Tim Huang [Wed, 15 May 2024 04:57:02 +0000 (12:57 +0800)]
drm/amd/pm: add SMU IP v14.0.4 support

This patch is to add SMU 14.0.4 support.

Signed-off-by: Li Ma <[email protected]>
Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/pm: smu v14.0.4 reuse smu v14.0.0 dpmtable
Li Ma [Tue, 28 May 2024 08:30:56 +0000 (16:30 +0800)]
drm/amd/pm: smu v14.0.4 reuse smu v14.0.0 dpmtable

Replace IP VERSION with smu->is_apu in if condition.
And the dpmtable of smu v14.0.4 is same as smu v14.0.0.

Signed-off-by: Li Ma <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add PSP IP v14.0.4 discovery support
Tim Huang [Tue, 14 May 2024 07:56:37 +0000 (15:56 +0800)]
drm/amdgpu: add PSP IP v14.0.4 discovery support

This patch is to add PSP 14.0.4 support.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add PSP IP v14.0.4 support
Tim Huang [Tue, 14 May 2024 07:53:25 +0000 (15:53 +0800)]
drm/amdgpu: add PSP IP v14.0.4 support

This patch is to add PSP 14.0.4 support.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add firmware for VPE IP v6.1.3
Tim Huang [Tue, 4 Jun 2024 05:51:30 +0000 (13:51 +0800)]
drm/amdgpu: add firmware for VPE IP v6.1.3

This patch is to add firmware for VPE 6.1.3.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add VPE IP v6.1.3 discovery support
Tim Huang [Wed, 15 May 2024 08:32:28 +0000 (16:32 +0800)]
drm/amdgpu: add VPE IP v6.1.3 discovery support

This patch is to add VPE 6.1.3 support.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add VPE IP v6.1.3 support
Tim Huang [Wed, 15 May 2024 08:27:06 +0000 (16:27 +0800)]
drm/amdgpu: add VPE IP v6.1.3 support

This patch is to add VPE 6.1.3 support.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: Add NBIO IP v7.11.3 support
Tim Huang [Tue, 14 May 2024 07:04:02 +0000 (15:04 +0800)]
drm/amdgpu: Add NBIO IP v7.11.3 support

Enable setting soc21 common clockgating for NBIO 7.11.3.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add NBIO IP v7.11.3 discovery support
Tim Huang [Tue, 14 May 2024 07:01:42 +0000 (15:01 +0800)]
drm/amdgpu: add NBIO IP v7.11.3 discovery support

This patch is to add NBIO 7.11.3 support.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add firmware for SDMA IP v6.1.2
Tim Huang [Tue, 4 Jun 2024 05:27:23 +0000 (13:27 +0800)]
drm/amdgpu: add firmware for SDMA IP v6.1.2

This patch is to add firmware for SDMA 6.1.2.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdkfd: add KFD support for SDMA IP v6.1.2
Tim Huang [Tue, 14 May 2024 06:50:12 +0000 (14:50 +0800)]
drm/amdkfd: add KFD support for SDMA IP v6.1.2

Enable KFD setting SDMA info for SDMA 6.1.2.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add SDMA IP v6.1.2 discovery support
Tim Huang [Tue, 14 May 2024 06:48:01 +0000 (14:48 +0800)]
drm/amdgpu: add SDMA IP v6.1.2 discovery support

This patch is to add SDMA 6.1.2 support.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add firmware for GC IP v11.5.2
Tim Huang [Tue, 4 Jun 2024 05:22:39 +0000 (13:22 +0800)]
drm/amdgpu: add firmware for GC IP v11.5.2

This patch is to add firmware for GC 11.5.2.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdkfd: add KFD support for GC IP v11.5.2
Tim Huang [Tue, 14 May 2024 06:24:44 +0000 (14:24 +0800)]
drm/amdkfd: add KFD support for GC IP v11.5.2

Enable KFD for GC 11.5.2.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add GC IP v11.5.2 to GC 11.5.0 family
Tim Huang [Tue, 14 May 2024 06:22:09 +0000 (14:22 +0800)]
drm/amdgpu: add GC IP v11.5.2 to GC 11.5.0 family

This patch is to add GC 11.5.2 to GC 11.5.0 family.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Veerabadhran Gopalakrishnan <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add GC IP v11.5.2 soc21 support
Tim Huang [Tue, 14 May 2024 06:17:13 +0000 (14:17 +0800)]
drm/amdgpu: add GC IP v11.5.2 soc21 support

Add CG and PG flags for GFX IP v11.5.2 and
PG flags for VCN IP v4.0.5.

Signed-off-by: Saleemkhan Jamadar <[email protected]>
Signed-off-by: Li Ma <[email protected]>
Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Veerabadhran Gopalakrishnan <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add tmz support for GC IP v11.5.2
Tim Huang [Tue, 14 May 2024 06:14:17 +0000 (14:14 +0800)]
drm/amdgpu: add tmz support for GC IP v11.5.2

Add tmz support for GC 11.5.2.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add GFXHUB IP v11.5.2 support
Tim Huang [Tue, 14 May 2024 06:11:22 +0000 (14:11 +0800)]
drm/amdgpu: add GFXHUB IP v11.5.2 support

This patch is to add GFXHUB 11.5.2 support.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: initialize GC IP v11.5.2
Tim Huang [Tue, 14 May 2024 06:06:03 +0000 (14:06 +0800)]
drm/amdgpu: initialize GC IP v11.5.2

Initialize GC 11.5.2 and set gfx hw configuration.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: fix out of bounds access in gfx10 during ip dump
Sunil Khatri [Tue, 2 Jul 2024 08:16:50 +0000 (13:46 +0530)]
drm/amdgpu: fix out of bounds access in gfx10 during ip dump

During ip dump in gfx10 the index variable is reused but is
not reinitialized to 0 and this causes the index calculation
to be wrong and access out of bound access.

Acked-by: Christian König <[email protected]>
Signed-off-by: Sunil Khatri <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Fix warning comparing pointer to 0
Jiapeng Chong [Mon, 1 Jul 2024 07:04:51 +0000 (15:04 +0800)]
drm/amd/display: Fix warning comparing pointer to 0

Avoid pointer type value compared with 0 to make code clear.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_factory.c:14:12-13: WARNING comparing pointer to 0.

Reported-by: Abaci Robot <[email protected]>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9458
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Fix warning comparing pointer to 0
Jiapeng Chong [Mon, 1 Jul 2024 07:04:52 +0000 (15:04 +0800)]
drm/amd/display: Fix warning comparing pointer to 0

Avoid pointer type value compared with 0 to make code clear.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_factory.c:24:12-13: WARNING comparing pointer to 0.

Reported-by: Abaci Robot <[email protected]>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9458
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Fix warning comparing pointer to 0
Jiapeng Chong [Mon, 1 Jul 2024 07:04:53 +0000 (15:04 +0800)]
drm/amd/display: Fix warning comparing pointer to 0

Avoid pointer type value compared with 0 to make code clear.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_mcg/dml2_mcg_factory.c:19:12-13: WARNING comparing pointer to 0.

Reported-by: Abaci Robot <[email protected]>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9458
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Fix warning comparing pointer to 0
Jiapeng Chong [Mon, 1 Jul 2024 07:04:54 +0000 (15:04 +0800)]
drm/amd/display: Fix warning comparing pointer to 0

Avoid pointer type value compared with 0 to make code clear.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_factory.c:31:12-13: WARNING comparing pointer to 0.

Reported-by: Abaci Robot <[email protected]>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9458
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Fix unsigned comparison with less than zero
Jiapeng Chong [Mon, 1 Jul 2024 02:50:28 +0000 (10:50 +0800)]
drm/amd/display: Fix unsigned comparison with less than zero

The return value from the call to dml21_find_dc_pipes_for_plane() is int.
However, the return value is being assigned to an unsigned int variable
'num_pipes', the condition if(num_pipes <= 0) is not rigorous enough,
so making 'num_pipes' an int.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c:318:6-15: WARNING: Unsigned expression compared with zero: num_pipes <= 0.
./drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c:360:6-15: WARNING: Unsigned expression compared with zero: num_pipes <= 0.

Reported-by: Abaci Robot <[email protected]>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9454
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/xe/bmg: Apply Wa_22019338487
Vinay Belgaumkar [Mon, 1 Jul 2024 23:15:29 +0000 (16:15 -0700)]
drm/xe/bmg: Apply Wa_22019338487

Extend this WA to BMG GT as well. In this case media GT is
not affected. The cap frequencies and max allowed ggtt writes
are different as well. On BMG, we need to do a flush after 1100
GGTT writes, and we need to limit the GT frequency request
to 2133 Mhz during driver load and leave it at that value after
driver unloads.

v3: Fix checkpatch issue

Reviewed-by: Rodrigo Vivi <[email protected]>
Signed-off-by: Vinay Belgaumkar <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Rodrigo Vivi <[email protected]>
7 months agodrm/xe/guc: Prevent use of uninitialized mutex
Vinay Belgaumkar [Mon, 1 Jul 2024 23:15:28 +0000 (16:15 -0700)]
drm/xe/guc: Prevent use of uninitialized mutex

When skip_guc_pc is set and/or this is for a VF.

Fixes: 3b1592fb7835 ("drm/xe/lnl: Apply Wa_22019338487")
Signed-off-by: Vinay Belgaumkar <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Rodrigo Vivi <[email protected]>
7 months agodrm/amdgpu: rewrite convert_tiling_flags_to_modifier_gfx12
Marek Olšák [Sat, 1 Jun 2024 18:31:39 +0000 (14:31 -0400)]
drm/amdgpu: rewrite convert_tiling_flags_to_modifier_gfx12

There were multiple bugs, like checking SWIZZLE_MODE before checking
GFX12_SWIZZLE_MODE, which has undefined behavior.

The function had no effect before (it always returned -EINVAL).

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Reviewed-by: Aurabindo Pillai <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/radeon: check bo_va->bo is non-NULL before using it
Pierre-Eric Pelloux-Prayer [Tue, 25 Jun 2024 12:31:34 +0000 (14:31 +0200)]
drm/radeon: check bo_va->bo is non-NULL before using it

The call to radeon_vm_clear_freed might clear bo_va->bo, so
we have to check it before dereferencing it.

Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdkfd: Use device based logging for errors
Lijo Lazar [Mon, 24 Jun 2024 08:03:16 +0000 (13:33 +0530)]
drm/amdkfd: Use device based logging for errors

Convert some pr_* to some dev_* APIs to identify the device.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: Fix hbm stack id in boot error report
Hawking Zhang [Fri, 28 Jun 2024 08:50:56 +0000 (16:50 +0800)]
drm/amdgpu: Fix hbm stack id in boot error report

To align with firmware, hbm id field 0x1 refers to
hbm stack 0, 0x2 refers to hbm statck 1.

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Tao Zhou <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: add amdgpu_framebuffer::gfx12_dcc
Marek Olšák [Sat, 1 Jun 2024 19:05:20 +0000 (15:05 -0400)]
drm/amdgpu: add amdgpu_framebuffer::gfx12_dcc

amdgpu_framebuffer doesn't have tiling_flags, so we need this.

amdgpu_display_get_fb_info never gets NULL parameters, so checking for NULL
was useless.

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu/display: add all gfx12 modifiers
Marek Olšák [Wed, 26 Jun 2024 18:01:33 +0000 (14:01 -0400)]
drm/amdgpu/display: add all gfx12 modifiers

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Reviewed-by: Aurabindo Pillai <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu/display: set plane attributes for gfx12 correctly
Marek Olšák [Sat, 1 Jun 2024 20:37:22 +0000 (16:37 -0400)]
drm/amdgpu/display: set plane attributes for gfx12 correctly

It used gfx9 flags, which has undefined behavior on gfx12.

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Reviewed-by: Aurabindo Pillai <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu/display: handle gfx12 in amdgpu_dm_plane_format_mod_supported
Marek Olšák [Sat, 1 Jun 2024 23:59:34 +0000 (19:59 -0400)]
drm/amdgpu/display: handle gfx12 in amdgpu_dm_plane_format_mod_supported

All this code has undefined behavior on GFX12 and shouldn't be executed.

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Reviewed-by: Aurabindo Pillai <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: handle gfx12 in amdgpu_display_verify_sizes
Marek Olšák [Sat, 1 Jun 2024 23:53:01 +0000 (19:53 -0400)]
drm/amdgpu: handle gfx12 in amdgpu_display_verify_sizes

It verified GFX9-11 swizzle modes on GFX12, which has undefined behavior.

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: Correct register used to clear fault status
Hawking Zhang [Fri, 28 Jun 2024 08:47:36 +0000 (16:47 +0800)]
drm/amdgpu: Correct register used to clear fault status

Driver should write to fault_cntl registers to do
one-shot address/status clear.

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Tao Zhou <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: don't use amdgpu_lookup_format_info on gfx12
Marek Olšák [Sat, 1 Jun 2024 21:25:51 +0000 (17:25 -0400)]
drm/amdgpu: don't use amdgpu_lookup_format_info on gfx12

It only uses fields for GFX9-11 related to the separate DCC buffer,
which doesn't exist in GFX12.

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu/display: handle gfx12 in dm_check_cursor_fb
Marek Olšák [Sat, 1 Jun 2024 18:36:41 +0000 (14:36 -0400)]
drm/amdgpu/display: handle gfx12 in dm_check_cursor_fb

Checking SWIZZLE_MODE has undefined behavior on gfx12.

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Reviewed-by: Aurabindo Pillai <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: remove AMD_FMT_MOD_GFX12_DCC_MAX_COMPRESSED_BLOCK_* definitions
Marek Olšák [Sat, 1 Jun 2024 18:56:16 +0000 (14:56 -0400)]
drm/amdgpu: remove AMD_FMT_MOD_GFX12_DCC_MAX_COMPRESSED_BLOCK_* definitions

They were added accidentally.

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Reviewed-by: Aurabindo Pillai <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu/gfx12: remove GDS leftovers
Marek Olšák [Fri, 31 May 2024 23:48:05 +0000 (19:48 -0400)]
drm/amdgpu/gfx12: remove GDS leftovers

GDS doesn't exist in gfx12. The incomplete packet allows userspace to hang
the hw from the kernel.

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Christian König <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu/gfx12: remove superfluous cache flags
Marek Olšák [Fri, 31 May 2024 23:38:18 +0000 (19:38 -0400)]
drm/amdgpu/gfx12: remove superfluous cache flags

If any INV flags are needed, they should be executed via ACQUIRE_MEM
before INDIRECT_BUFFER.

GLM flags are also removed because the hw ignores them.

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Christian König <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu/gfx11: remove superfluous cache flags
Marek Olšák [Fri, 31 May 2024 23:38:18 +0000 (19:38 -0400)]
drm/amdgpu/gfx11: remove superfluous cache flags

If any INV flags are needed, they should be executed via ACQUIRE_MEM
before INDIRECT_BUFFER.

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Christian König <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amdgpu: check for LINEAR_ALIGNED correctly in check_tiling_flags_gfx6
Marek Olšák [Sat, 1 Jun 2024 20:36:27 +0000 (16:36 -0400)]
drm/amdgpu: check for LINEAR_ALIGNED correctly in check_tiling_flags_gfx6

Fix incorrect check.

Signed-off-by: Marek Olšák <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: 3.2.291
Aric Cyr [Sun, 23 Jun 2024 20:45:28 +0000 (16:45 -0400)]
drm/amd/display: 3.2.291

* FW Release 0.0.224.0
* Fix bw issue for dcn351
* Fix FAMS2 logic issue for dcn401
* Fix Coverity issues
* Fix cursor issues
* Refactor dio sources

Acked-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Aric Cyr <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Fix array-index-out-of-bounds in dml2/FCLKChangeSupport
Roman Li [Wed, 26 Jun 2024 18:08:41 +0000 (14:08 -0400)]
drm/amd/display: Fix array-index-out-of-bounds in dml2/FCLKChangeSupport

[Why]
Potential out of bounds access in dml2_calculate_rq_and_dlg_params()
because the value of out_lowest_state_idx used as an index for FCLKChangeSupport
array can be greater than 1.

[How]
Currently dml2 core specifies identical values for all FCLKChangeSupport
elements. Always use index 0 in the condition to avoid out of bounds access.

Acked-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Roman Li <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Update efficiency bandwidth for dcn351
Fangzhi Zuo [Wed, 26 Jun 2024 18:07:49 +0000 (14:07 -0400)]
drm/amd/display: Update efficiency bandwidth for dcn351

Fix 4k240 underflow on dcn351

Acked-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Fix refresh rate range for some panel
Tom Chung [Fri, 14 Jun 2024 07:38:56 +0000 (15:38 +0800)]
drm/amd/display: Fix refresh rate range for some panel

[Why]
Some of the panels does not have the refresh rate range info
in base EDID and only have the refresh rate range info in
DisplayID block.
It will cause the max/min freesync refresh rate set to 0.

[How]
Try to parse the refresh rate range info from DisplayID if the
max/min refresh rate is 0.

Reviewed-by: Sun peng Li <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Tom Chung <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: replace CRTC disable function call
Xi (Alex) Liu [Wed, 12 Jun 2024 16:45:19 +0000 (12:45 -0400)]
drm/amd/display: replace CRTC disable function call

[Why]

In OTG disable workarund, CRTC is disabled immediately
to improve performance, but this may cause timing issue
in DP HPO encoder FIFO and result in blank CRCs.

[How]

Replace the immediate CRTC disable call with normal disable call

Reviewed-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Xi (Alex) Liu <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Move dio files into dio folder
Bhuvanachandra Pinninti [Thu, 20 Jun 2024 12:24:23 +0000 (17:54 +0530)]
drm/amd/display: Move dio files into dio folder

[why]
Refactor the code of dio to unit test.

[how]
Moved files to respective folders and changed cMakeLists and makefiles.

Acked-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Bhuvanachandra Pinninti <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Account for cursor prefetch BW in DML1 mode support
Alvin Lee [Thu, 20 Jun 2024 19:11:38 +0000 (15:11 -0400)]
drm/amd/display: Account for cursor prefetch BW in DML1 mode support

[Description]
We need to ensure to take into account cursor prefetch BW in
mode support or we may pass ModeQuery but fail an actual flip
which will cause a hang. Flip may fail because the cursor_pre_bw
is populated during mode programming (and mode programming is
never called prior to ModeQuery).

Reviewed-by: Chaitanya Dhere <[email protected]>
Reviewed-by: Nevenko Stupar <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: fix a crash when clock source is reference for non otg master pipe
Wenjing Liu [Mon, 17 Jun 2024 16:58:35 +0000 (12:58 -0400)]
drm/amd/display: fix a crash when clock source is reference for non otg master pipe

[why]
The function enumerates all pipes without checking pipe type. It is only
supposed to call program pixel clock for OTG master pipe only.

Reviewed-by: Alvin Lee <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Wenjing Liu <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Fix dmub timeout after fams2 enabled
Fangzhi Zuo [Thu, 20 Jun 2024 15:27:39 +0000 (11:27 -0400)]
drm/amd/display: Fix dmub timeout after fams2 enabled

Reset fams stream count upon stream removal, otherwise
fams2 state machine in dmub will get corrupted.

Reviewed-by: Dillon Varone <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Add debug option for disabling SLDO optimizations
Nicholas Kazlauskas [Mon, 17 Jun 2024 19:45:51 +0000 (15:45 -0400)]
drm/amd/display: Add debug option for disabling SLDO optimizations

[Why]
DM can hook this up to disable SLDO optimizations in firmware during
DMCUB initialization for debug purposes.

[How]
Add the option and pass it through dmub_srv.

Reviewed-by: Hansen Dsouza <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: un-block 8k with single dimm
Paul Hsieh [Thu, 20 Jun 2024 09:09:25 +0000 (17:09 +0800)]
drm/amd/display: un-block 8k with single dimm

[Why]
Driver doesn't validate multi-display with scaling when OS calls DDI.
This behavior causes the validated result to be a mismatch
between some automated test cases.
To address this issue, some workaround was added that caused issues in 8k.

[How]
Since the origin issue had been root caused,
revert the previous workaround and unblock 8k with a single dimm.

Reviewed-by: Aric Cyr <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Paul Hsieh <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Add available bandwidth calculation for audio
Ryan Seto [Thu, 20 Jun 2024 17:40:43 +0000 (13:40 -0400)]
drm/amd/display: Add available bandwidth calculation for audio

[Why]
Audio for 8K 240Hz monitor was not available when it should be

[How]
Added calculation based on stream state

Co-developed-by: Ryan Seto <[email protected]>
Reviewed-by: George Shen <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Ryan Seto <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Add refresh rate range check
Tom Chung [Wed, 19 Jun 2024 06:03:55 +0000 (14:03 +0800)]
drm/amd/display: Add refresh rate range check

[Why]
We only enable the VRR while monitor usable refresh rate range
is greater than 10 Hz.
But we did not check the range in DRM_EDID_FEATURE_CONTINUOUS_FREQ
case.

[How]
Add a refresh rate range check before set the freesync_capable flag
in DRM_EDID_FEATURE_CONTINUOUS_FREQ case.

Reviewed-by: Mario Limonciello <[email protected]>
Reviewed-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Tom Chung <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Cleanup dce_get_dp_ref_freq_khz
Dillon Varone [Wed, 19 Jun 2024 14:05:12 +0000 (10:05 -0400)]
drm/amd/display: Cleanup dce_get_dp_ref_freq_khz

[WHY&HOW]
Cleanup unnecessary code pathes as compile guards were added and removed
overtime.

Reviewed-by: Alvin Lee <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Dillon Varone <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Check denominator crb_pipes before used
Alex Hung [Tue, 18 Jun 2024 22:19:48 +0000 (16:19 -0600)]
drm/amd/display: Check denominator crb_pipes before used

[WHAT & HOW]
A denominator cannot be 0, and is checked before used.

This fixes 2 DIVIDE_BY_ZERO issues reported by Coverity.

Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Check denominator pbn_div before used
Alex Hung [Tue, 18 Jun 2024 22:21:20 +0000 (16:21 -0600)]
drm/amd/display: Check denominator pbn_div before used

[WHAT & HOW]
A denominator cannot be 0, and is checked before used.

This fixes 1 DIVIDE_BY_ZERO issue reported by Coverity.

Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Adjust cursor visibility between MPC slices
Nevenko Stupar [Wed, 19 Jun 2024 20:08:41 +0000 (16:08 -0400)]
drm/amd/display: Adjust cursor visibility between MPC slices

[Why & How]
When MPC enabled, need to adjust x and hot spot x
position on one pipe when the cursor is between
MPC slices i.e. when the cursor is moving from one
MPC slice to next slice, while whole cursor size is not
contained within one pipe, to make part of the cursor
to be visible on the other pipe.

Reviewed-by: Sridevi Arvindekar <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Nevenko Stupar <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Skip unnecessary abm disable
Sherry Wang [Thu, 6 Jun 2024 08:51:43 +0000 (16:51 +0800)]
drm/amd/display: Skip unnecessary abm disable

[Why]
We try to disable abm immediately when it's being gradually
disabled, which causes backlight ramping being paused in the
middle

[How]
Don't disable abm immediately if abm has been or is being
disabled through set_abm_level path

Reviewed-by: Anthony Koo <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Sherry Wang <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Fix possible overflow in integer multiplication
Alex Hung [Sat, 8 Jun 2024 04:09:53 +0000 (22:09 -0600)]
drm/amd/display: Fix possible overflow in integer multiplication

[WHAT & HOW]
Integer multiplies integer may overflow in context that expects an
expression of unsigned/siged long long (64 bits). This can be fixed
by casting integer to unsigned/siged long long to force 64 bits results.

This fixes 26 OVERFLOW_BEFORE_WIDEN issues reported by Coverity.

Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Add ASIC cap to limit DCC surface width
George Shen [Mon, 17 Jun 2024 20:32:15 +0000 (16:32 -0400)]
drm/amd/display: Add ASIC cap to limit DCC surface width

[Why]
Certain configurations of DCN401 require ODM4:1 to support DCC for 10K
surfaces. DCC should be conservatively disabled in those cases.

The issue is that current logic limits 10K surface DCC for all
configurations of DCN401.

[How]
Add DC ASIC cap to indicate max surface width that can support DCC.
Disable DCC if this ASIC cap is non-zero and surface width exceeds it.

Reviewed-by: Jun Lei <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: George Shen <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Revert Add workaround to restrict max frac urgent for DPM0
Teeger [Wed, 19 Jun 2024 13:26:40 +0000 (09:26 -0400)]
drm/amd/display: Revert Add workaround to restrict max frac urgent for DPM0

This reverts commit 871512e36f9c1c2cb4e62eb860ca0438800e4d63
due to multiple issues found.

Reviewed-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Teeger <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Choose HUBP unbounded request based on DML output
Sung Joon Kim [Fri, 14 Jun 2024 23:14:31 +0000 (19:14 -0400)]
drm/amd/display: Choose HUBP unbounded request based on DML output

[why]
Previously, we decide on the unbounded request
purely based on pipe_cnt which is a wrong variable
to use to determine how many pipes are in "use".
DML already accounts for number of pipes in use
along with other various factors and is a more reliable
method of determination.

[how]
Use UnboundedRequestEnabledThisState to decide
on unbounbded_req_enabled.

Reviewed-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Sung Joon Kim <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Remove unnecessary error message
Joshua Aberback [Mon, 17 Jun 2024 19:22:44 +0000 (15:22 -0400)]
drm/amd/display: Remove unnecessary error message

[Why]
This error message is unnecessary because returning when aconnector is
uninitialized is the desired outcome during initialization. As well, there
is no equivalent error message for read_dpcd.

Reviewed-by: Aurabindo Pillai <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Joshua Aberback <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Fix divide by zero in CURSOR_DST_X_OFFSET calculation
George Shen [Sat, 15 Jun 2024 01:13:43 +0000 (21:13 -0400)]
drm/amd/display: Fix divide by zero in CURSOR_DST_X_OFFSET calculation

[Why]
Certain situations cause pipes to have a recout of 0, such as when the
dst_rect lies completely outside of a given ODM slice.

[How]
Skip calculation that transforms cursor coordinates to viewport space.

Reviewed-by: Alvin Lee <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: George Shen <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Reset freesync config before update new state
Tom Chung [Mon, 17 Jun 2024 07:59:06 +0000 (15:59 +0800)]
drm/amd/display: Reset freesync config before update new state

[Why]
Sometimes the new_crtc_state->vrr_infopacket did not sync up with the
current state.
It will affect the update_freesync_state_on_stream() does not update
the state correctly.

[How]
Reset the freesync config before get_freesync_config_for_crtc() to
make sure we have the correct new_crtc_state for VRR.

Reviewed-by: Sun peng Li <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Tom Chung <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: Add replay state entry to replay_state
Anthony Koo [Sat, 15 Jun 2024 16:51:44 +0000 (12:51 -0400)]
drm/amd/display: Add replay state entry to replay_state

 - Add new Replay states 2A (initial Replay entry) and 4E (frame update)
   to check is there is new frame update before sending

Acked-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Jerry Zuo <[email protected]>
Signed-off-by: Anthony Koo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/amd/display: use vmalloc for struct dc_state
Alex Deucher [Wed, 26 Jun 2024 21:35:41 +0000 (17:35 -0400)]
drm/amd/display: use vmalloc for struct dc_state

This is a big structure so use vmalloc as malloc can
fail when there is memory pressure.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3454
Reviewed-by: Mario Limonciello <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
7 months agodrm/xe/oa: Destroy the stream_lock mutex
Ashutosh Dixit [Fri, 28 Jun 2024 05:21:25 +0000 (22:21 -0700)]
drm/xe/oa: Destroy the stream_lock mutex

The mutex allocated in xe_oa_stream_init() was never previously
destroyed. Do so now.

Fixes: e936f885f1e9 ("drm/xe/oa/uapi: Expose OA stream fd")
Cc: Michal Wajdeczko <[email protected]>
Signed-off-by: Ashutosh Dixit <[email protected]>
Reviewed-by: Umesh Nerlige Ramappa <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 months agodrm/xe/rtp: Fix out-of-bounds array access
Lucas De Marchi [Fri, 28 Jun 2024 16:17:26 +0000 (09:17 -0700)]
drm/xe/rtp: Fix out-of-bounds array access

Increment the counter before checking for number of rules, otherwise
when there's no XE_RTP_MATCH_OR an out-of-bounds access is done, as
reported by kasan:

BUG: KASAN: global-out-of-bounds in rule_matches+0xb6d/0x11c0 [xe]
Read of size 1 at addr ffffffffa0a50b70 by task systemd-udevd/243

Fixes: dc72c52a42e0 ("drm/xe/rtp: Allow to OR rules")
Cc: Mika Kuoppala <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Nirmoy Das <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Lucas De Marchi <[email protected]>
7 months agodrm/xe/pf: Restart VFs provisioning after GT reset
Michal Wajdeczko [Mon, 1 Jul 2024 10:27:37 +0000 (12:27 +0200)]
drm/xe/pf: Restart VFs provisioning after GT reset

Any prior configurations pushed to the GuC are lost when the GT
is reset. Push again all non-empty VF configurations to the GuC
as part of the GuC reset procedure.

This will also help restore early manual provisioning, when the
PF was in the meantime suspended and then resumed.

Signed-off-by: Michal Wajdeczko <[email protected]>
Reviewed-by: Piotr Piórkowski <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 months agodrm/xe/pf: Skip fair VFs provisioning if already provisioned
Michal Wajdeczko [Mon, 1 Jul 2024 10:27:36 +0000 (12:27 +0200)]
drm/xe/pf: Skip fair VFs provisioning if already provisioned

Our debugfs allows to view and change VFs' provisioning configs.

If we attempt to experiment with VFs provisioning before enabling
them, this early config will affect fair provisioning calculations,
and will also be overwritten, which is undesirable behavior.

To improve this, check if the VFs configs are empty (unprovisioned)
before starting the fair provisioning procedure.

Signed-off-by: Michal Wajdeczko <[email protected]>
Reviewed-by: Piotr Piórkowski <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 months agodrm/xe/pf: Remove inlined #ifdef CONFIG_PCI_IOV
Michal Wajdeczko [Thu, 27 Jun 2024 10:43:05 +0000 (12:43 +0200)]
drm/xe/pf: Remove inlined #ifdef CONFIG_PCI_IOV

We can remove #ifdef CONFIG_PCI_IOV in .c files if we provide
dummy replacement of the xe_pci_sriov_configure() function.

Suggested-by: Jani Nikula <[email protected]>
Signed-off-by: Michal Wajdeczko <[email protected]>
Reviewed-by: Francois Dugast <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
7 months agodrm/xe/guc: Configure TLB timeout based on CT buffer size
Nirmoy Das [Fri, 28 Jun 2024 08:58:45 +0000 (10:58 +0200)]
drm/xe/guc: Configure TLB timeout based on CT buffer size

GuC TLB invalidation depends on GuC to process the request from the CT
queue and then the real time to invalidate TLB. Add a function to return
overestimated possible time a TLB inval H2G might take which can be used
as timeout value for TLB invalidation wait time.

v4: Make sure CTB is in 4K blocks(Michal) and other doc fixes
v3: Pass CT to xe_guc_ct_queue_proc_time_jiffies() (Michal)
    Add tlb_timeout_jiffies() that replaces TLB_TIMEOUT(Michal)
v2: Address reviews from Michal.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1622
Cc: Matthew Brost <[email protected]>
Cc: Michal Wajdeczko <[email protected]>
Suggested-by: Daniele Ceraolo Spurio <[email protected]>
Acked-by: Matthew Brost <[email protected]>
Reviewed-by: Michal Wajdeczko <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Nirmoy Das <[email protected]>
7 months agoLinux 6.10-rc6 v6.10-rc6
Linus Torvalds [Sun, 30 Jun 2024 21:40:44 +0000 (14:40 -0700)]
Linux 6.10-rc6

7 months agoMerge tag 'ata-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/libata...
Linus Torvalds [Sun, 30 Jun 2024 21:32:24 +0000 (14:32 -0700)]
Merge tag 'ata-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux

Pull ata fixes from Niklas Cassel:

 - Add NOLPM quirk for for all Crucial BX SSD1 models.

   Considering that we now have had bug reports for 3 different BX SSD1
   variants from Crucial with the same product name, make the quirk more
   inclusive, to catch more device models from the same generation.

 - Fix a trivial NULL pointer dereference in the error path for
   ata_host_release().

 - Create a ata_port_free(), so that we don't miss freeing ata_port
   struct members when freeing a struct ata_port.

 - Fix a trivial double free in the error path for ata_host_alloc().

 - Ensure that we remove the libata "remapped NVMe device count" sysfs
   entry on .probe() error.

* tag 'ata-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux:
  ata: ahci: Clean up sysfs file on error
  ata: libata-core: Fix double free on error
  ata,scsi: libata-core: Do not leak memory for ata_port struct members
  ata: libata-core: Fix null pointer dereference on error
  ata: libata-core: Add ATA_HORKAGE_NOLPM for all Crucial BX SSD1 models

7 months agoata: ahci: Clean up sysfs file on error
Niklas Cassel [Sat, 29 Jun 2024 12:42:14 +0000 (14:42 +0200)]
ata: ahci: Clean up sysfs file on error

.probe() (ahci_init_one()) calls sysfs_add_file_to_group(), however,
if probe() fails after this call, we currently never call
sysfs_remove_file_from_group().

(The sysfs_remove_file_from_group() call in .remove() (ahci_remove_one())
does not help, as .remove() is not called on .probe() error.)

Thus, if probe() fails after the sysfs_add_file_to_group() call, the next
time we insmod the module we will get:

sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:04.0/remapped_nvme'
CPU: 11 PID: 954 Comm: modprobe Not tainted 6.10.0-rc5 #43
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0x5d/0x80
 sysfs_warn_dup.cold+0x17/0x23
 sysfs_add_file_mode_ns+0x11a/0x130
 sysfs_add_file_to_group+0x7e/0xc0
 ahci_init_one+0x31f/0xd40 [ahci]

Fixes: 894fba7f434a ("ata: ahci: Add sysfs attribute to show remapped NVMe device count")
Cc: [email protected]
Reviewed-by: Damien Le Moal <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Niklas Cassel <[email protected]>
7 months agoata: libata-core: Fix double free on error
Niklas Cassel [Sat, 29 Jun 2024 12:42:13 +0000 (14:42 +0200)]
ata: libata-core: Fix double free on error

If e.g. the ata_port_alloc() call in ata_host_alloc() fails, we will jump
to the err_out label, which will call devres_release_group().
devres_release_group() will trigger a call to ata_host_release().
ata_host_release() calls kfree(host), so executing the kfree(host) in
ata_host_alloc() will lead to a double free:

kernel BUG at mm/slub.c:553!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
CPU: 11 PID: 599 Comm: (udev-worker) Not tainted 6.10.0-rc5 #47
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014
RIP: 0010:kfree+0x2cf/0x2f0
Code: 5d 41 5e 41 5f 5d e9 80 d6 ff ff 4d 89 f1 41 b8 01 00 00 00 48 89 d9 48 89 da
RSP: 0018:ffffc90000f377f0 EFLAGS: 00010246
RAX: ffff888112b1f2c0 RBX: ffff888112b1f2c0 RCX: ffff888112b1f320
RDX: 000000000000400b RSI: ffffffffc02c9de5 RDI: ffff888112b1f2c0
RBP: ffffc90000f37830 R08: 0000000000000000 R09: 0000000000000000
R10: ffffc90000f37610 R11: 617461203a736b6e R12: ffffea00044ac780
R13: ffff888100046400 R14: ffffffffc02c9de5 R15: 0000000000000006
FS:  00007f2f1cabe980(0000) GS:ffff88813b380000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f2f1c3acf75 CR3: 0000000111724000 CR4: 0000000000750ef0
PKRU: 55555554
Call Trace:
 <TASK>
 ? __die_body.cold+0x19/0x27
 ? die+0x2e/0x50
 ? do_trap+0xca/0x110
 ? do_error_trap+0x6a/0x90
 ? kfree+0x2cf/0x2f0
 ? exc_invalid_op+0x50/0x70
 ? kfree+0x2cf/0x2f0
 ? asm_exc_invalid_op+0x1a/0x20
 ? ata_host_alloc+0xf5/0x120 [libata]
 ? ata_host_alloc+0xf5/0x120 [libata]
 ? kfree+0x2cf/0x2f0
 ata_host_alloc+0xf5/0x120 [libata]
 ata_host_alloc_pinfo+0x14/0xa0 [libata]
 ahci_init_one+0x6c9/0xd20 [ahci]

Ensure that we will not call kfree(host) twice, by performing the kfree()
only if the devres_open_group() call failed.

Fixes: dafd6c496381 ("libata: ensure host is free'd on error exit paths")
Cc: [email protected]
Reviewed-by: Damien Le Moal <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Niklas Cassel <[email protected]>
7 months agoata,scsi: libata-core: Do not leak memory for ata_port struct members
Niklas Cassel [Sat, 29 Jun 2024 12:42:12 +0000 (14:42 +0200)]
ata,scsi: libata-core: Do not leak memory for ata_port struct members

libsas is currently not freeing all the struct ata_port struct members,
e.g. ncq_sense_buf for a driver supporting Command Duration Limits (CDL).

Add a function, ata_port_free(), that is used to free a ata_port,
including its struct members. It makes sense to keep the code related to
freeing a ata_port in its own function, which will also free all the
struct members of struct ata_port.

Fixes: 18bd7718b5c4 ("scsi: ata: libata: Handle completion of CDL commands using policy 0xD")
Reviewed-by: John Garry <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Niklas Cassel <[email protected]>
7 months agoata: libata-core: Fix null pointer dereference on error
Niklas Cassel [Sat, 29 Jun 2024 12:42:11 +0000 (14:42 +0200)]
ata: libata-core: Fix null pointer dereference on error

If the ata_port_alloc() call in ata_host_alloc() fails,
ata_host_release() will get called.

However, the code in ata_host_release() tries to free ata_port struct
members unconditionally, which can lead to the following:

BUG: unable to handle page fault for address: 0000000000003990
PGD 0 P4D 0
Oops: Oops: 0000 [#1] PREEMPT SMP NOPTI
CPU: 10 PID: 594 Comm: (udev-worker) Not tainted 6.10.0-rc5 #44
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014
RIP: 0010:ata_host_release.cold+0x2f/0x6e [libata]
Code: e4 4d 63 f4 44 89 e2 48 c7 c6 90 ad 32 c0 48 c7 c7 d0 70 33 c0 49 83 c6 0e 41
RSP: 0018:ffffc90000ebb968 EFLAGS: 00010246
RAX: 0000000000000041 RBX: ffff88810fb52e78 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff88813b3218c0 RDI: ffff88813b3218c0
RBP: ffff88810fb52e40 R08: 0000000000000000 R09: 6c65725f74736f68
R10: ffffc90000ebb738 R11: 73692033203a746e R12: 0000000000000004
R13: 0000000000000000 R14: 0000000000000011 R15: 0000000000000006
FS:  00007f6cc55b9980(0000) GS:ffff88813b300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000003990 CR3: 00000001122a2000 CR4: 0000000000750ef0
PKRU: 55555554
Call Trace:
 <TASK>
 ? __die_body.cold+0x19/0x27
 ? page_fault_oops+0x15a/0x2f0
 ? exc_page_fault+0x7e/0x180
 ? asm_exc_page_fault+0x26/0x30
 ? ata_host_release.cold+0x2f/0x6e [libata]
 ? ata_host_release.cold+0x2f/0x6e [libata]
 release_nodes+0x35/0xb0
 devres_release_group+0x113/0x140
 ata_host_alloc+0xed/0x120 [libata]
 ata_host_alloc_pinfo+0x14/0xa0 [libata]
 ahci_init_one+0x6c9/0xd20 [ahci]

Do not access ata_port struct members unconditionally.

Fixes: 633273a3ed1c ("libata-pmp: hook PMP support and enable it")
Cc: [email protected]
Reviewed-by: Damien Le Moal <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: John Garry <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Niklas Cassel <[email protected]>
This page took 0.109738 seconds and 4 git commands to generate.