[PATCH] drm/amdgpu: Check num_gfx_rings for gfx v9_0 rb setup.

2022-08-17 Thread Candice Li
No need to set up rb when no gfx rings. Signed-off-by: Candice Li --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 7f187558220e9a..1d6d3a852a0b3d 10

[pull] amdgpu, amdkfd drm-fixes-6.0

2022-08-17 Thread Alex Deucher
Hi Dave, Daniel, A bit bigger than normal, but this is several weeks of fixes since I was out of the office and then digging out once I got back. Mainly fixes for new IPs that were added in 6.0. The following changes since commit 5493ee1919eae4f49d62276cf5986b7f7c7aa8f6: Merge tag 'amd-drm-ne

[PATCH 3/3] drm/amdgpu: enable NBIO IP v7.7.0 Clock Gating

2022-08-17 Thread Tim Huang
Enable AMD_CG_SUPPORT_BIF_MGCG and AMD_CG_SUPPORT_BIF_LS support. Signed-off-by: Tim Huang --- drivers/gpu/drm/amd/amdgpu/soc21.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c index 1ff7fc7bb340

[PATCH 2/3] drm/amdgpu: add NBIO IP v7.7.0 Clock Gating support

2022-08-17 Thread Tim Huang
Add BIF Clock Gating MGCG and LS support for NBIO IP v7.7.0. Signed-off-by: Tim Huang --- drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c | 78 ++ 1 file changed, 78 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c index

[PATCH 1/3] drm/amdgpu: add TX_POWER_CTRL_1 macro definitions for NBIO IP v7.7.0

2022-08-17 Thread Tim Huang
Add the BIF0_PCIE_TX_POWER_CTRL_1 register offset and mask macro definitions for AMD_CG_SUPPORT_BIF_LS. Signed-off-by: Tim Huang --- .../amd/include/asic_reg/nbio/nbio_7_7_0_offset.h | 2 ++ .../amd/include/asic_reg/nbio/nbio_7_7_0_sh_mask.h | 13 + 2 files changed, 15 insertions

build failure of next-20220817 for amdgpu

2022-08-17 Thread Sudip Mukherjee (Codethink)
Hi All, Not sure if it has been reported, build of next-20220817 fails with the error: ERROR: modpost: "cpu_smallcore_map" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! Trying to do a git bisect to find out the offending commit. I will be happy to test any patch or provide any

Re: build failure of next-20220817 for amdgpu

2022-08-17 Thread Randy Dunlap
On 8/17/22 19:01, Alex Deucher wrote: > On Wed, Aug 17, 2022 at 6:03 PM Sudip Mukherjee (Codethink) > wrote: >> >> Hi All, >> >> Not sure if it has been reported, build of next-20220817 fails with the >> error: >> >> ERROR: modpost: "cpu

Re: build failure of next-20220811 due to b1a63a0b48ad ("drm/amd/display: consider DSC pass-through during mode validation")

2022-08-17 Thread Stephen Rothwell
failure. > > > > > > > > I will be happy to test any patch or provide any extra log if needed. > > > > > > I have reverted that commit in today's linux-next. > > > > I have removed that revert. Sudip, can you recheck when linux-next is > > released, please? > > The build failure is not seen with next-20220817. Excellent, thanks. -- Cheers, Stephen Rothwell pgpFiWk6JIXYG.pgp Description: OpenPGP digital signature

Re: build failure of next-20220817 for amdgpu

2022-08-17 Thread Alex Deucher
On Wed, Aug 17, 2022 at 6:03 PM Sudip Mukherjee (Codethink) wrote: > > Hi All, > > Not sure if it has been reported, build of next-20220817 fails with the > error: > > ERROR: modpost: "cpu_smallcore_map" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] > undefined! >

Re: [PATCH 1/6] drm/ttm: Add usage to ttm_validate_buffer.

2022-08-17 Thread Bas Nieuwenhuizen
On Thu, Aug 18, 2022 at 12:04 AM Felix Kuehling wrote: > > Am 2022-08-12 um 21:27 schrieb Bas Nieuwenhuizen: > > This way callsites can choose between READ/BOOKKEEP reservations. > > > > Signed-off-by: Bas Nieuwenhuizen > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 5 + > >

Re: [PATCH 1/6] drm/ttm: Add usage to ttm_validate_buffer.

2022-08-17 Thread Felix Kuehling
Am 2022-08-12 um 21:27 schrieb Bas Nieuwenhuizen: This way callsites can choose between READ/BOOKKEEP reservations. Signed-off-by: Bas Nieuwenhuizen --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 9 +++-- drivers/gpu/dr

Re: [BUG][5.20] refcount_t: underflow; use-after-free

2022-08-17 Thread Mikhail Gavrilov
On Wed, Aug 17, 2022 at 11:43 PM Maíra Canal wrote: > > Hi Mikhail, > > Looks like 45ecaea738830b9d521c93520c8f201359dcbd95 ("drm/sched: Partial > revert of 'drm/sched: Keep s_fence->parent pointer'") introduced the > error. Try reverting it and check if the use-after-free still happens. Thanks,

Re: build failure of next-20220811 due to b1a63a0b48ad ("drm/amd/display: consider DSC pass-through during mode validation")

2022-08-17 Thread Sudip Mukherjee
t; pass-through during mode validation") > > > And, reverting that commit has fixed the build failure. > > > > > > I will be happy to test any patch or provide any extra log if needed. > > > > I have reverted that commit in today's linux-next. > > I have removed that revert. Sudip, can you recheck when linux-next is > released, please? The build failure is not seen with next-20220817. -- Regards Sudip

Re: [PATCH v2 16/29] ACPI: video: Add Nvidia WMI EC brightness control detection

2022-08-17 Thread Daniel Dadap
On 8/17/22 7:22 AM, Hans de Goede wrote: Hi Daniel, On 7/15/22 13:59, Hans de Goede wrote: Hi Daniel, On 7/12/22 22:13, Daniel Dadap wrote: Thanks, Hans: On 7/12/22 14:38, Hans de Goede wrote: On some new laptop designs a new Nvidia specific WMI interface is present which gives info about p

Re: [PATCH v2 01/29] ACPI: video: Add acpi_video_backlight_use_native() helper

2022-08-17 Thread Daniel Dadap
On 8/17/22 10:05 AM, Hans de Goede wrote: Hi Daniel, On 8/2/22 18:49, Daniel Dadap wrote: On 8/2/22 06:31, Hans de Goede wrote: Hi Daniel, On 7/21/22 23:30, Daniel Dadap wrote: On 7/21/22 16:24, Daniel Dadap wrote: On 7/12/22 14:38, Hans de Goede wrote: ATM on x86 laptops where we want use

[RFC v4 17/17] drm/display/dp_mst: Move all payload info into the atomic state

2022-08-17 Thread Lyude Paul
Now that we've finally gotten rid of the non-atomic MST users leftover in the kernel, we can finally get rid of all of the legacy payload code we have and move as much as possible into the MST atomic state structs. The main purpose of this is to make the MST code a lot less confusing to work on, as

[RFC v4 16/17] drm/radeon: Drop legacy MST support

2022-08-17 Thread Lyude Paul
Right now, radeon is technically the only non-atomic driver still making use of the MST helpers - and thus the final user of all of the legacy MST helpers. Originally I was going to look into seeing if we could move legacy MST into the radeon driver itself, however: * SI and CIK both can use amdgp

[RFC v4 14/17] drm/display/dp_mst: Drop all ports from topology on CSNs before queueing link address work

2022-08-17 Thread Lyude Paul
We want to start cutting down on all of the places that we use port validation, so that ports may be removed from the topology as quickly as possible to minimize the number of errors we run into as a result of being out of sync with the current topology status. This isn't a very typical scenario an

[RFC v4 13/17] drm/display/dp_mst: Add helpers for serializing SST <-> MST transitions

2022-08-17 Thread Lyude Paul
There's another kind of situation where we could potentially race with nonblocking modesets and MST, especially if we were to only use the locking provided by atomic modesetting: * Display 1 begins as enabled on DP-1 in SST mode * Display 1 switches to MST mode, exposes one sink in MST mode * User

[RFC v4 10/17] drm/display/dp_mst: Fix modeset tracking in drm_dp_atomic_release_vcpi_slots()

2022-08-17 Thread Lyude Paul
Currently with the MST helpers we avoid releasing payloads _and_ avoid pulling in the MST state if there aren't any actual payload changes. While we want to keep the first step, we need to now make sure that we're always pulling in the MST state on all modesets that can modify payloads - even if th

[RFC v4 12/17] drm/nouveau/kms: Pull mst state in for all modesets

2022-08-17 Thread Lyude Paul
Since we're going to be relying on atomic locking for payloads now (and the MST mgr needs to track CRTCs), pull in the topology state for all modesets in nv50_msto_atomic_check(). Signed-off-by: Lyude Paul Acked-by: Jani Nikula --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- 1 file changed,

[RFC v4 09/17] drm/display/dp_mst: Don't open code modeset checks for releasing time slots

2022-08-17 Thread Lyude Paul
I'm not sure why, but at the time I originally wrote the find/release time slot helpers I thought we should avoid keeping modeset tracking out of the MST helpers. In retrospect though there's no actual good reason to do this, and the logic has ended up being identical across all the drivers using t

[RFC v4 11/17] drm/nouveau/kms: Cache DP encoders in nouveau_connector

2022-08-17 Thread Lyude Paul
Post-NV50, the only kind of encoder you'll find for DP connectors on Nvidia GPUs are SORs (serial output resources). Because SORs have fixed associations with their connectors, we can correctly assume that any DP connector on a nvidia GPU will have exactly one SOR encoder routed to it for DisplayPo

[RFC v4 06/17] drm/display/dp_mst: Add some missing kdocs for atomic MST structs

2022-08-17 Thread Lyude Paul
Since we're about to start adding some stuff here, we may as well fill in any missing documentation that we forgot to write. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre Deak Cc: Daniel Vetter Cc: Sean Paul Acked-by: Jani Nikula --- i

[RFC v4 08/17] drm/display/dp_mst: Add nonblocking helpers for DP MST

2022-08-17 Thread Lyude Paul
As Daniel Vetter pointed out, if we only use the atomic modesetting locks with MST it's technically possible for a driver with non-blocking modesets to race when it comes to MST displays - as we make the mistake of not doing our own CRTC commit tracking in the topology_state object. This could pot

[RFC v4 07/17] drm/display/dp_mst: Add helper for finding payloads in atomic MST state

2022-08-17 Thread Lyude Paul
We already open-code this quite often, and will be iterating through payloads even more once we've moved all of the payload tracking into the atomic state. So, let's add a helper for doing this. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Ville Syrjälä Cc: Fangzhi Zuo Cc: Jani Nikula Cc: Imre

[RFC v4 05/17] drm/display/dp_mst: Fix confusing docs for drm_dp_atomic_release_time_slots()

2022-08-17 Thread Lyude Paul
For some reason we mention returning 0 if "slots have been added back to drm_dp_mst_topology_state->avail_slots". This is totally misleading, avail_slots is simply for figuring out the total number of slots available in total on the topology and has no relation to the current payload allocations.

[RFC v4 04/17] drm/display/dp_mst: Call them time slots, not VCPI slots

2022-08-17 Thread Lyude Paul
VCPI is only sort of the correct term here, originally the majority of this code simply referred to timeslots vaguely as "slots" - and since I started working on it and adding atomic functionality, the name "VCPI slots" has been used to represent time slots. Now that we actually have consistent ac

[RFC v4 03/17] drm/display/dp_mst: Rename drm_dp_mst_vcpi_allocation

2022-08-17 Thread Lyude Paul
In retrospect, the name I chose for this originally is confusing, as there's a lot more info in here then just the VCPI. This really should be called a payload. Let's make it more obvious that this is meant to be related to the atomic state and is about payloads by renaming it to drm_dp_mst_atomic_

[RFC v4 01/17] drm/amdgpu/dc/mst: Rename dp_mst_stream_allocation(_table)

2022-08-17 Thread Lyude Paul
Just to make this more clear to outside contributors that these are DC-specific structs, as this also threw me into a loop a number of times before I figured out the purpose of this. Signed-off-by: Lyude Paul Cc: Wayne Lin Cc: Fangzhi Zuo Acked-by: Jani Nikula --- .../gpu/drm/amd/display/amdg

[RFC v4 00/17] drm/display/dp_mst: Drop Radeon MST support, make MST atomic-only

2022-08-17 Thread Lyude Paul
For quite a while we've been carrying around a lot of legacy modesetting code in the MST helpers that has been rather annoying to keep around, and very often gets in the way of trying to implement additional functionality in MST such as fallback link rate retraining, dynamic BPC management and DSC

[RFC v4 02/17] drm/amdgpu/dm/mst: Rename get_payload_table()

2022-08-17 Thread Lyude Paul
This function isn't too confusing if you see the comment around the call-site for it, but if you don't then it's not at all obvious this is meant to copy DRM's payload table over to DC's internal state structs. Seeing this function before finding that comment definitely threw me into a loop a few t

Re: [BUG][5.20] refcount_t: underflow; use-after-free

2022-08-17 Thread Maíra Canal
On 8/17/22 14:44, Mikhail Gavrilov wrote: On Wed, Aug 17, 2022 at 9:08 PM Melissa Wen wrote: Hi Mikhail, IIUC, you got this second user-after-free by applying the first version of Maíra's patch, right? So, that version was adding another unbalanced unlock to the cs ioctl flow, but it was s

Re: [BUG][5.20] refcount_t: underflow; use-after-free

2022-08-17 Thread Mikhail Gavrilov
On Wed, Aug 17, 2022 at 9:08 PM Melissa Wen wrote: > > Hi Mikhail, > > IIUC, you got this second user-after-free by applying the first version > of Maíra's patch, right? So, that version was adding another unbalanced > unlock to the cs ioctl flow, but it was solved in the latest version, > that yo

[linux-next:master] BUILD SUCCESS WITH WARNING 95d10484d66e54d5c01e36389e9318221fb8f60b

2022-08-17 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master branch HEAD: 95d10484d66e54d5c01e36389e9318221fb8f60b Add linux-next specific files for 20220817 Warning reports: https://lore.kernel.org/linux-doc/202208162058.7appivkl-...@intel.com https

Re: [PATCH] drm/amdkfd: add family_id property for kfd_node

2022-08-17 Thread Felix Kuehling
Am 2022-08-17 um 11:04 schrieb Felix Kuehling: Am 2022-08-16 um 23:09 schrieb Lang Yu: Then we can remove the burden of maintaining codes to parse family_id from gfx version in rocr, i.e., remove DevIDToAddrLibFamily(). I'm OK with the change. But you won't be able to remove DevIDToAddrLibFam

Re: [PATCH v2 01/29] ACPI: video: Add acpi_video_backlight_use_native() helper

2022-08-17 Thread Hans de Goede
Hi Daniel, On 8/2/22 18:49, Daniel Dadap wrote: > On 8/2/22 06:31, Hans de Goede wrote: >> Hi Daniel, >> >> On 7/21/22 23:30, Daniel Dadap wrote: >>> On 7/21/22 16:24, Daniel Dadap wrote: On 7/12/22 14:38, Hans de Goede wrote: > ATM on x86 laptops where we want userspace to use the acpi_v

Re: [PATCH] drm/amdkfd: add family_id property for kfd_node

2022-08-17 Thread Felix Kuehling
Am 2022-08-16 um 23:09 schrieb Lang Yu: Then we can remove the burden of maintaining codes to parse family_id from gfx version in rocr, i.e., remove DevIDToAddrLibFamily(). I'm OK with the change. But you won't be able to remove DevIDToAddrLibFamily as long as ROCr needs to support older kerne

Re: [PATCH V2 2/2] drm/amdgpu: fix hive reference leak when adding xgmi device

2022-08-17 Thread Zhang, Hawking
[AMD Official Use Only - General] Series is Reviewed-by: Hawking Zhang Regards, Hawking From: Chai, Thomas Date: Wednesday, August 17, 2022 at 14:20 To: amd-gfx@lists.freedesktop.org Cc: Chai, Thomas , Zhang, Hawking , Zhou1, Tao , Clements, John , Li, Candice , Chai, Thomas Subject: [PATC

Re: [PATCH] drm/amdgpu: TA unload messages are not actually sent to psp when amdgpu is uninstalled

2022-08-17 Thread Andrey Grodzovsky
On 2022-08-17 09:44, Alex Deucher wrote: On Tue, Aug 16, 2022 at 10:54 PM Chai, Thomas wrote: [AMD Official Use Only - General] Hi Alex: When removing an amdgpu device, it may be difficult to change the order of psp_hw_fini calls. 1. The drm_dev_unplug call is at the beginning in the am

[PATCH] drm/amdgpu: Update mes_v11_api_def.h

2022-08-17 Thread Graham Sider
New GFX11 MES FW adds the trap_en bit. For now hardcode to 1 (traps enabled). Signed-off-by: Graham Sider Acked-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c| 1 + drivers/gpu/drm/amd/include/mes_v11_api_def.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) dif

Re: [PATCH] drm/amdgpu: TA unload messages are not actually sent to psp when amdgpu is uninstalled

2022-08-17 Thread Alex Deucher
On Tue, Aug 16, 2022 at 10:54 PM Chai, Thomas wrote: > > [AMD Official Use Only - General] > > Hi Alex: > When removing an amdgpu device, it may be difficult to change the order of > psp_hw_fini calls. > > 1. The drm_dev_unplug call is at the beginning in the amdgpu_pci_remove > function, whi

Re: [PATCH] drm/radeon: add a force flush to delay work when radeon

2022-08-17 Thread 李真能
在 2022/8/15 21:12, Christian König 写道: Am 15.08.22 um 09:34 schrieb 李真能: 在 2022/8/12 18:55, Christian König 写道: Am 11.08.22 um 09:25 schrieb Zhenneng Li: Although radeon card fence and wait for gpu to finish processing current batch rings, there is still a corner case that radeon lockup wor

Re: [PATCH v2 03/29] drm/amdgpu: Don't register backlight when another backlight should be used

2022-08-17 Thread Hans de Goede
Hi, On 7/20/22 18:46, Alex Deucher wrote: > On Wed, Jul 20, 2022 at 12:44 PM Alex Deucher wrote: >> >> On Tue, Jul 12, 2022 at 3:39 PM Hans de Goede wrote: >>> >>> Before this commit when we want userspace to use the acpi_video backlight >>> device we register both the GPU's native backlight dev

Re: [PATCH v2 16/29] ACPI: video: Add Nvidia WMI EC brightness control detection

2022-08-17 Thread Hans de Goede
Hi Daniel, On 7/15/22 13:59, Hans de Goede wrote: > Hi Daniel, > > On 7/12/22 22:13, Daniel Dadap wrote: >> Thanks, Hans: >> >> On 7/12/22 14:38, Hans de Goede wrote: >>> On some new laptop designs a new Nvidia specific WMI interface is present >>> which gives info about panel brightness control

Re: [PATCH] drm/radeon: add a force flush to delay work when radeon

2022-08-17 Thread Christian König
Am 17.08.22 um 09:31 schrieb 李真能: 在 2022/8/15 21:12, Christian König 写道: Am 15.08.22 um 09:34 schrieb 李真能: 在 2022/8/12 18:55, Christian König 写道: Am 11.08.22 um 09:25 schrieb Zhenneng Li: Although radeon card fence and wait for gpu to finish processing current batch rings, there is still a

RE: [PATCH] drm/amdgpu: enable GFXOFF allow control for GC IP v11.0.1

2022-08-17 Thread Zhang, Yifan
[Public] This patch is Reviewed-by: Yifan Zhang -Original Message- From: Huang, Tim Sent: Wednesday, August 17, 2022 2:14 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Zhang, Yifan ; Du, Xiaojian ; Huang, Tim Subject: [PATCH] drm/amdgpu: enable GFXOFF allow control