Re: [PATCH 0/6] Enable KFD to use render node BO mappings

2023-01-11 Thread Christian König
Am 12.01.23 um 02:31 schrieb Felix Kuehling: Rebased on latest amd-staging-drm-next. This is meant to be the final review of this series, assuming no more issues are found. This patch series enables KFD to interoperate more closely with DRM render nodes. ROCm user mode already uses DRM render

RE: [PATCH] drm/amd/display: fix possible buffer overflow relating to secure display

2023-01-11 Thread Liu, HaoPing (Alan)
[AMD Official Use Only - General] Reviewed-by: Alan Liu Thanks, Alan -Original Message- From: Mahfooz, Hamza Sent: Thursday, January 12, 2023 2:17 AM To: amd-gfx@lists.freedesktop.org Cc: Mahfooz, Hamza ; Wentland, Harry ; Li, Sun peng (Leo) ; Siqueira, Rodrigo ; Deucher, Alexander

[PATCH] drm/amd/display: Remove useless else if

2023-01-11 Thread Jiapeng Chong
The assignment of the else and if branches is the same, so the if else here is redundant, so we remove it. ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1951:2-4: WARNING: possible condition with no effect (if == else). Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3719

[pull] amdgpu, amdkfd drm-fixes-6.2

2023-01-11 Thread Alex Deucher
Hi Dave, Daniel, Fixes for 6.2. The following changes since commit 93235bfd5a9c3329df31d1a4d7a93d138b3138c2: Merge tag 'amd-drm-fixes-6.2-2023-01-04' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes (2023-01-05 12:13:51 +0100) are available in the Git repository at:

[PATCH v2 12/14] drm/amd/display: Do not add '-mhard-float' to dml_ccflags for clang

2023-01-11 Thread Nathan Chancellor
When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, it warns: clang-16: error: argument unused during compilation: '-mhard-float' [-Werror,-Wunused-command-line-argument] Similar to commit 84edc2eff827 ("selftest/fpu: avoid clang warning"), just add this flag to GCC builds.

[PATCH v2 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS

2023-01-11 Thread Nathan Chancellor
Hi all, Clang can emit a few different warnings when it encounters a flag that it recognizes but does not support internally. These warnings are elevated to errors within {as,cc}-option via -Werror to catch unsupported flags that should not be added to KBUILD_{A,C}FLAGS; see commit c3f0d0bc5b01

Re: [PATCH 1/2] drm/amdgpu: return the PCIe gen and lanes from the INFO

2023-01-11 Thread Marek Olšák
On Wed, Jan 11, 2023, 15:50 Alex Deucher wrote: > On Wed, Jan 11, 2023 at 3:48 PM Alex Deucher > wrote: > > > > On Wed, Jan 4, 2023 at 3:17 PM Marek Olšák wrote: > > > > > > Yes, it's meant to be like a spec sheet. We are not interested in the > current bandwidth utilization. > > > > After

[PATCH 6/6] drm/amdgpu: Do bo_va ref counting for KFD BOs

2023-01-11 Thread Felix Kuehling
This is needed to correctly handle BOs imported into the GEM API, which would otherwise get added twice to the same VM. Signed-off-by: Felix Kuehling --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 28 +++ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git

[PATCH 5/6] drm/amdgpu: update mappings not managed by KFD

2023-01-11 Thread Felix Kuehling
When restoring after an eviction, use amdgpu_vm_handle_moved to update BO VA mappings in KFD VMs that are not managed through the KFD API. This should allow using the render node API to create more flexible memory mappings in KFD VMs. v2: Sync with pd fence after all page table updates v3: Update

[PATCH 4/6] drm/amdgpu: Attach eviction fence on alloc

2023-01-11 Thread Felix Kuehling
Instead of attaching the eviction fence when a KFD BO is first mapped, attach it when it is allocated or imported. This in preparation to allow KFD BOs to be mapped using the render node API. Signed-off-by: Felix Kuehling --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 63

[PATCH 3/6] drm/amdkfd: Improve amdgpu_vm_handle_moved

2023-01-11 Thread Felix Kuehling
Let amdgpu_vm_handle_moved update all BO VA mappings of BOs reserved by the caller. This will be useful for handling extra BO VA mappings in KFD VMs that are managed through the render node API. Signed-off-by: Felix Kuehling Reviewed-by: Christian König ---

[PATCH 2/6] drm/amdkfd: Implement DMA buf fd export from KFD

2023-01-11 Thread Felix Kuehling
Exports a DMA buf fd of a given KFD buffer handle. This is intended for being able to import KFD BOs into GEM contexts to leverage the amdgpu_bo_va API for more flexible virtual address mappings. It will also be used for the new upstreamable RDMA solution coming to UCX and RCCL. The corresponding

[PATCH 0/6] Enable KFD to use render node BO mappings

2023-01-11 Thread Felix Kuehling
Rebased on latest amd-staging-drm-next. This is meant to be the final review of this series, assuming no more issues are found. This patch series enables KFD to interoperate more closely with DRM render nodes. ROCm user mode already uses DRM render nodes to create its GPU VM contexts and to

[PATCH 1/6] drm/amdgpu: Generalize KFD dmabuf import

2023-01-11 Thread Felix Kuehling
Use proper amdgpu_gem_prime_import function to handle all kinds of imports. Remember the dmabuf reference to enable proper multi-GPU attachment to multiple VMs without erroneously re-exporting the underlying BO multiple times. Signed-off-by: Felix Kuehling ---

Re: [RFC PATCH 00/17] DRM_USE_DYNAMIC_DEBUG regression

2023-01-11 Thread Daniel Vetter
On Mon, Dec 05, 2022 at 05:34:07PM -0700, Jim Cromie wrote: > Hi everyone, > > DRM_USE_DYNAMIC_DEBUG=y has a regression on rc-* > > Regression is due to a chicken-egg problem loading modules; on > `modprobe i915`, drm is loaded 1st, and drm.debug is set. When > drm_debug_enabled() tested

Re: [RFC PATCH 13/17] drm_print: fix stale macro-name in comment

2023-01-11 Thread Daniel Vetter
On Mon, Dec 05, 2022 at 05:34:20PM -0700, Jim Cromie wrote: > Cited commit uses stale macro name, fix this, and explain better. > > When DRM_USE_DYNAMIC_DEBUG=y, DYNDBG_CLASSMAP_DEFINE() maps DRM_UT_* > onto BITs in drm.debug. This still uses enum drm_debug_category, but > it is somewhat

[PATCH] drm/amd: Avoid ASSERT for some message failures

2023-01-11 Thread Mario Limonciello
On DCN314 when resuming from s0i3 an ASSERT is shown indicating that `VBIOSSMC_MSG_SetHardMinDcfclkByFreq` returned `VBIOSSMC_Result_Failed`. This isn't a driver bug; it's a BIOS/configuration bug. To make this easier to triage, add an explicit warning when this issue happens. This matches the

Re: [PATCH 1/2] drm/amdgpu: return the PCIe gen and lanes from the INFO

2023-01-11 Thread Alex Deucher
On Wed, Jan 11, 2023 at 3:48 PM Alex Deucher wrote: > > On Wed, Jan 4, 2023 at 3:17 PM Marek Olšák wrote: > > > > Yes, it's meant to be like a spec sheet. We are not interested in the > > current bandwidth utilization. > > After chatting with Marek on IRC and thinking about this more, I think >

Re: [PATCH 1/2] drm/amdgpu: return the PCIe gen and lanes from the INFO

2023-01-11 Thread Alex Deucher
On Wed, Jan 4, 2023 at 3:17 PM Marek Olšák wrote: > > Yes, it's meant to be like a spec sheet. We are not interested in the current > bandwidth utilization. After chatting with Marek on IRC and thinking about this more, I think this patch is fine. It's not really meant for bandwidth per se,

[PATCH] drm/amd/display: fix possible buffer overflow relating to secure display

2023-01-11 Thread Hamza Mahfooz
It is possible that adev->dm.dc->caps.max_links is greater than AMDGPU_MAX_CRTCS. So, to not potentially access unallocated memory use adev->mode_info.num_crtc to do the bounds check instead of adev->dm.dc->caps.max_links. Fixes: 278b2b5ba2f2 ("drm/amd/display: Implement multiple secure display")

Re: [PATCH] drm/fb-helper: Set framebuffer for vga-switcheroo clients

2023-01-11 Thread Thomas Zimmermann
Hi Am 11.01.23 um 16:38 schrieb Thomas Zimmermann: Set the framebuffer info for drivers that support VGA switcheroo. Only affects the amdgpu driver, which uses VGA switcheroo and generic fbdev emulation. For other drivers, this does nothing. Amdgpu's lastclose helper called

Re: [PATCH] drm/fb-helper: Set framebuffer for vga-switcheroo clients

2023-01-11 Thread Alex Deucher
On Wed, Jan 11, 2023 at 10:38 AM Thomas Zimmermann wrote: > > Set the framebuffer info for drivers that support VGA switcheroo. Only > affects the amdgpu driver, which uses VGA switcheroo and generic fbdev > emulation. For other drivers, this does nothing. > > Amdgpu's lastclose helper called

Re: [PATCH] drm/fb-helper: Set framebuffer for vga-switcheroo clients

2023-01-11 Thread Daniel Vetter
On Wed, Jan 11, 2023 at 04:38:13PM +0100, Thomas Zimmermann wrote: > Set the framebuffer info for drivers that support VGA switcheroo. Only > affects the amdgpu driver, which uses VGA switcheroo and generic fbdev > emulation. For other drivers, this does nothing. > > Amdgpu's lastclose helper

Re: [PATCH v2 02/10] drm: Include where needed

2023-01-11 Thread Ville Syrjälä
On Wed, Jan 11, 2023 at 02:01:58PM +0100, Thomas Zimmermann wrote: > Include in source files that need it. Some of DRM's > source code gets OF header via drm_crtc_helper.h and , > which can leed to unnecessary recompilation. > > In drm_modes.c, add a comment on the reason for still including > .

Re: [PATCH v2 06/10] drm: Define enum mode_set_atomic in drm_modeset_helper_tables.h

2023-01-11 Thread Ville Syrjälä
On Wed, Jan 11, 2023 at 02:02:02PM +0100, Thomas Zimmermann wrote: > Define enum mode_set_atomic next to the only interface that uses > the type. This will allow for removing several include statements > for drm_fb_helper.h. No functional changes. > > Signed-off-by: Thomas Zimmermann

Re: [PATCH v2 03/10] drm: Don't include in drm_crtc_helper.h

2023-01-11 Thread Ville Syrjälä
On Wed, Jan 11, 2023 at 02:01:59PM +0100, Thomas Zimmermann wrote: > Including in drm_crtc_helper.h is not required. Remove > the include statement and avoid rebuilding DRM whenever the fbdev > header changes. > > Signed-off-by: Thomas Zimmermann > --- > include/drm/drm_crtc_helper.h | 2 -- >

[PATCH] drm/fb-helper: Set framebuffer for vga-switcheroo clients

2023-01-11 Thread Thomas Zimmermann
Set the framebuffer info for drivers that support VGA switcheroo. Only affects the amdgpu driver, which uses VGA switcheroo and generic fbdev emulation. For other drivers, this does nothing. Amdgpu's lastclose helper called vga_switcheroo_process_delayed_switch(). But as amdgpu uses generic fbdev

Re: [PATCH] drm/amd/display: Fix set scaling doesn's work

2023-01-11 Thread Harry Wentland
On 1/10/23 10:58, Rodrigo Siqueira Jordao wrote: > > > On 11/22/22 06:20, hongao wrote: >> [Why] >> Setting scaling does not correctly update CRTC state. As a result >> dc stream state's src (composition area) && dest (addressable area) >> was not calculated as expected. This causes set scaling

Re: [PATCH 8/8] drm/amd/pm: drop the support for manual fan speed setting on SMU13.0.7

2023-01-11 Thread Alex Deucher
On Wed, Jan 11, 2023 at 8:23 AM Quan, Evan wrote: > > [AMD Official Use Only - General] > > Hi Matt, > > The problem with the approach(removal of interface functions from the > ppt_funcs) is: > 1. If to drop support for some sysfs interface, you need to know the internal > implementation

Re: [PATCH 1/9] drm/amd/display: Introduce UseMinimumDCFCLK_vars to reduce stack size in DML

2023-01-11 Thread Alex Deucher
On Tue, Jan 10, 2023 at 10:44 AM Rodrigo Siqueira wrote: > > It was reported that on kernel v6.2-rc1, we have the following stack > size issue: > > make[3]: *** [/kisskb/src/scripts/Makefile.build:504: drivers/media] > Error 2 > [...]/display/dc/dml/dcn31/display_mode_vba_31.c: In function >

Re: Wrong revert commit in stable channel

2023-01-11 Thread Alex Deucher
Yes, the revert was reverted. Alex On Wed, Jan 11, 2023 at 3:35 AM Chen, Guchun wrote: > > Hi Yury, > > > > My understanding is though that’s a revert of your original patch, we did a > revert again on top of the reverted patch later on. Can you please sync to > below commit to check again?

Re: [regression, bisected, pci/iommu] Bug 216865 - Black screen when amdgpu started during 6.2-rc1 boot with AMD IOMMU enabled

2023-01-11 Thread Jason Gunthorpe
On Wed, Jan 11, 2023 at 11:16:32AM +0800, Baolu Lu wrote: > On 2023/1/10 21:25, Jason Gunthorpe wrote: > > > + } else { > > > + if (!pdev->bus->self || > > > + !pci_acs_path_enabled(pdev->bus->self, NULL, > > > +

Re: [PATCH v2 07/10] drm/amdgpu: Do not include

2023-01-11 Thread Thomas Zimmermann
Hi Am 11.01.23 um 14:21 schrieb Christian König: Am 11.01.23 um 14:02 schrieb Thomas Zimmermann: Including is not required, so remove the include statements. No functional changes. Reviewed-by: Christian König for this one and the radeon patches #9 and #10 in this set. Do you want to

RE: [PATCH 8/8] drm/amd/pm: drop the support for manual fan speed setting on SMU13.0.7

2023-01-11 Thread Quan, Evan
[AMD Official Use Only - General] Hi Matt, The problem with the approach(removal of interface functions from the ppt_funcs) is: 1. If to drop support for some sysfs interface, you need to know the internal implementation details to mask out the corresponding function. That's not

Re: [PATCH v2 07/10] drm/amdgpu: Do not include

2023-01-11 Thread Christian König
Am 11.01.23 um 14:02 schrieb Thomas Zimmermann: Including is not required, so remove the include statements. No functional changes. Reviewed-by: Christian König for this one and the radeon patches #9 and #10 in this set. Do you want to push them to drm-misc-next because of some

Re: [PATCH v2 02/10] drm: Include where needed

2023-01-11 Thread Liviu Dudau
On Wed, Jan 11, 2023 at 02:01:58PM +0100, Thomas Zimmermann wrote: > Include in source files that need it. Some of DRM's > source code gets OF header via drm_crtc_helper.h and , > which can leed to unnecessary recompilation. > > In drm_modes.c, add a comment on the reason for still including > .

[PATCH v2 10/10] drm/radeon: Do not include

2023-01-11 Thread Thomas Zimmermann
Including is not required, so remove the include statements. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/radeon/atombios_crtc.c | 1 - drivers/gpu/drm/radeon/radeon_connectors.c | 1 - drivers/gpu/drm/radeon/radeon_drv.c | 1 -

[PATCH v2 08/10] drm/nouveau: Do not include

2023-01-11 Thread Thomas Zimmermann
Including is not required, so remove the include statement. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 1 - drivers/gpu/drm/nouveau/nouveau_drm.c | 1 - 2 files changed, 2 deletions(-) diff --git

[PATCH v2 06/10] drm: Define enum mode_set_atomic in drm_modeset_helper_tables.h

2023-01-11 Thread Thomas Zimmermann
Define enum mode_set_atomic next to the only interface that uses the type. This will allow for removing several include statements for drm_fb_helper.h. No functional changes. Signed-off-by: Thomas Zimmermann --- include/drm/drm_fb_helper.h | 5 -

[PATCH v2 00/10] drm: Do not include unnecessarily

2023-01-11 Thread Thomas Zimmermann
Remove unnecessary include statements for . I recently changed this header and had to rebuild a good part of DRM. So avoid this by removing the dependency. Several files include via drm_fb_helper.h. So in v2 I added additional patches that remove some of those include statements as well. Some

[PATCH v2 05/10] drm/panel: Do not include

2023-01-11 Thread Thomas Zimmermann
Remove unnecessary include statements for . No functional changes. Include where the driver got the header file via . Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 1 - drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 1 -

[PATCH v2 04/10] drm/amdgpu: Do not include

2023-01-11 Thread Thomas Zimmermann
Remove unnecessary include statements for . No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 - drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 1 -

[PATCH v2 09/10] drm/radeon: Remove trailing whitespaces

2023-01-11 Thread Thomas Zimmermann
Fix coding style. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c index

[PATCH v2 07/10] drm/amdgpu: Do not include

2023-01-11 Thread Thomas Zimmermann
Including is not required, so remove the include statements. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 1 - drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 1 - drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 1 -

[PATCH v2 02/10] drm: Include where needed

2023-01-11 Thread Thomas Zimmermann
Include in source files that need it. Some of DRM's source code gets OF header via drm_crtc_helper.h and , which can leed to unnecessary recompilation. In drm_modes.c, add a comment on the reason for still including . The header file is required to get KHZ2PICOS(). The macro is part of the UAPI

[PATCH v2 01/10] drm: Include where needed

2023-01-11 Thread Thomas Zimmermann
Include in source files that need it. Some of DRM's source code gets the backlight header via drm_crtc_helper.h and , which can leed to unnecessary recompilation. If possible, do not include drm_crtc_helper.h any longer. Signed-off-by: Thomas Zimmermann Acked-by: Christian König # amd ---

[PATCH v2 03/10] drm: Don't include in drm_crtc_helper.h

2023-01-11 Thread Thomas Zimmermann
Including in drm_crtc_helper.h is not required. Remove the include statement and avoid rebuilding DRM whenever the fbdev header changes. Signed-off-by: Thomas Zimmermann --- include/drm/drm_crtc_helper.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/drm/drm_crtc_helper.h

Re: [PATCH v3 1/4] drm/ttm: Clean up page shift operation

2023-01-11 Thread Christian König
This needs to be squashed together with patch #3 and #4, otherwise you would break the drivers in between. What you can do is to separate the GDS/GWS/OA changes out of patch #3. Christian. Am 11.01.23 um 07:35 schrieb Somalapuram Amaranath: Remove page shift operations as ttm_resource moved

Re: [PATCH v3 2/4] drm/gem: Remove BUG_ON in drm_gem_private_object_init

2023-01-11 Thread Christian König
This patch here needs to come first, otherwise changing the TTM/AMDGPU internals to allow byte sized BOs for GDS would trigger this BUG_ON(). Christian. Am 11.01.23 um 07:35 schrieb Somalapuram Amaranath: ttm_resource allocate size in bytes to support less than page size Signed-off-by:

Re: [PATCH v3 3/4] drm/amdgpu: Clean up page shift operation and GWS and OA

2023-01-11 Thread Christian König
Am 11.01.23 um 07:35 schrieb Somalapuram Amaranath: Remove page shift operations as ttm_resource moved from num_pages to size_t size in bytes. This patch here is at least missing to remove the shifts in amdgpu_job_set_resources():     if (gds) {     job->gds_base =

Re: [regression, bisected, pci/iommu] Bug 216865 - Black screen when amdgpu started during 6.2-rc1 boot with AMD IOMMU enabled

2023-01-11 Thread Christian König
Hi Matt, after reading a bit into the topic I think I know what's going on here. The assumption that you need ACS to enable PASID handling is simply incorrect. Going to send a revert of the offending patch with an in deep description of the problem. Thanks, Christian. Am 10.01.23 um

RE: Wrong revert commit in stable channel

2023-01-11 Thread Chen, Guchun
Hi Yury, My understanding is though that's a revert of your original patch, we did a revert again on top of the reverted patch later on. Can you please sync to below commit to check again? Or do I understand wrong?

Re: [regression, bisected, pci/iommu] Bug 216865 - Black screen when amdgpu started during 6.2-rc1 boot with AMD IOMMU enabled

2023-01-11 Thread Baolu Lu
On 2023/1/10 21:25, Jason Gunthorpe wrote: + } else { + if (!pdev->bus->self || + !pci_acs_path_enabled(pdev->bus->self, NULL, + PCI_ACS_RR | PCI_ACS_UF)) + return -EINVAL; + } Why would

Wrong revert commit in stable channel

2023-01-11 Thread Yury Zhuravlev
Hello, Something went wrong, and we commited what we diced not commit. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.2-rc3=e5b781c56d46c44c52caa915f1b65064f2f7c1ba and