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

2022-08-16 Thread Lang Yu
Then we can remove the burden of maintaining codes to
parse family_id from gfx version in rocr,
i.e., remove DevIDToAddrLibFamily().

Signed-off-by: Lang Yu 
---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 3 +++
 drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index 3f0a4a415907..7e0331e853d5 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -507,6 +507,8 @@ static ssize_t node_show(struct kobject *kobj, struct 
attribute *attr,
  dev->node_props.vendor_id);
sysfs_show_32bit_prop(buffer, offs, "device_id",
  dev->node_props.device_id);
+   sysfs_show_32bit_prop(buffer, offs, "family_id",
+ dev->node_props.family_id);
sysfs_show_32bit_prop(buffer, offs, "location_id",
  dev->node_props.location_id);
sysfs_show_32bit_prop(buffer, offs, "domain",
@@ -1690,6 +1692,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
dev->node_props.gfx_target_version = 
gpu->device_info.gfx_target_version;
dev->node_props.vendor_id = gpu->pdev->vendor;
dev->node_props.device_id = gpu->pdev->device;
+   dev->node_props.family_id = gpu->adev->family;
dev->node_props.capability |=
((dev->gpu->adev->rev_id << HSA_CAP_ASIC_REVISION_SHIFT) &
HSA_CAP_ASIC_REVISION_MASK);
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.h 
b/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
index 9f6c949186c1..4ff8dd2c9549 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
@@ -56,6 +56,7 @@ struct kfd_node_properties {
uint32_t gfx_target_version;
uint32_t vendor_id;
uint32_t device_id;
+   uint32_t family_id;
uint32_t location_id;
uint32_t domain;
uint32_t max_engine_clk_fcompute;
-- 
2.25.1



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

2022-08-16 Thread Chai, Thomas
[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,  which makes the gpu device inaccessible for userspace operations.  
If the call to psp_hw_fini was moved before drm_dev_unplug,  userspace could 
access the gpu device but the psp might be removing. It has unknown issues.

2. psp_hw_fini is called by the .hw_fini iterator in 
amdgpu_device_ip_fini_early, referring to the code starting from 
amdgpu_pci_remove to .hw_fini is called,
   there are many preparatory operations before calling .hw_fini,  which makes 
it very difficult to change the order of psp_hw_fini or all block .hw_fini.
   
   So can we do a workaround in psp_cmd_submit_buf when removing amdgpu device?

-Original Message-
From: Alex Deucher  
Sent: Monday, August 15, 2022 10:22 PM
To: Chai, Thomas 
Cc: amd-gfx@lists.freedesktop.org; Zhang, Hawking ; 
Chen, Guchun ; Chai, Thomas 
Subject: Re: [PATCH] drm/amdgpu: TA unload messages are not actually sent to 
psp when amdgpu is uninstalled

On Mon, Aug 15, 2022 at 3:06 AM YiPeng Chai  wrote:
>
> The psp_cmd_submit_buf function is called by psp_hw_fini to send TA 
> unload messages to psp to terminate ras, asd and tmr.
> But when amdgpu is uninstalled, drm_dev_unplug is called earlier than 
> psp_hw_fini in amdgpu_pci_remove, the calling order as follows:
> static void amdgpu_pci_remove(struct pci_dev *pdev) {
> drm_dev_unplug
> ..
> amdgpu_driver_unload_kms->amdgpu_device_fini_hw->...
> ->.hw_fini->psp_hw_fini->...
> ->psp_ta_unload->psp_cmd_submit_buf
> ..
> }
> The program will return when calling drm_dev_enter in 
> psp_cmd_submit_buf.
>
> So the call to drm_dev_enter in psp_cmd_submit_buf should be removed, 
> so that the TA unload messages can be sent to the psp when amdgpu is 
> uninstalled.
>
> Signed-off-by: YiPeng Chai 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 4 
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index b067ce45d226..0578d8d094a7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -585,9 +585,6 @@ psp_cmd_submit_buf(struct psp_context *psp,
> if (psp->adev->no_hw_access)
> return 0;
>
> -   if (!drm_dev_enter(adev_to_drm(psp->adev), ))
> -   return 0;
> -

This check is to prevent the hardware from being accessed if the card is 
removed.  I think we need to fix the ordering elsewhere.

Alex

> memset(psp->cmd_buf_mem, 0, PSP_CMD_BUFFER_SIZE);
>
> memcpy(psp->cmd_buf_mem, cmd, sizeof(struct 
> psp_gfx_cmd_resp)); @@ -651,7 +648,6 @@ psp_cmd_submit_buf(struct psp_context 
> *psp,
> }
>
>  exit:
> -   drm_dev_exit(idx);
> return ret;
>  }
>
> --
> 2.25.1
>


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

2022-08-16 Thread Stephen Rothwell
Hi all,

On Fri, 12 Aug 2022 09:07:31 +1000 Stephen Rothwell  wrote:
>
> On Thu, 11 Aug 2022 18:10:48 +0100 "Sudip Mukherjee (Codethink)" 
>  wrote:
> >
> > Not sure if it has been reported, builds of riscv, alpha, s390, arm,
> > arm64, xtensa, mips, csky allmodconfig have failed to build next-20220811
> > with the error:
> > 
> > ERROR: modpost: "dc_dsc_compute_bandwidth_range" 
> > [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
> > ERROR: modpost: "dc_dsc_get_policy_for_timing" 
> > [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
> > 
> > git bisect pointed to b1a63a0b48ad ("drm/amd/display: consider DSC 
> > 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?

-- 
Cheers,
Stephen Rothwell


pgph6Q7cvMmL3.pgp
Description: OpenPGP digital signature


Re: [PATCH] Revert "drm/amd/amdgpu: add pipe1 hardware support"

2022-08-16 Thread Alex Deucher
On Tue, Aug 16, 2022 at 5:12 AM Michel Dänzer  wrote:
>
> On 2022-08-16 10:44, Michel Dänzer wrote:
> > From: Michel Dänzer 
> >
> > This reverts commit 4c7631800e6bf0eced08dd7b4f793fcd972f597d.
> >
> > Triggered GFX hangs with GNOME Wayland on Navi 21.
> >
> > Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2117
>
> Don't get me wrong, I'm really looking forward to this functionality, as it's 
> required for reaping the full benefit of 
> https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1880 . But it has to 
> actually work. :)
>

Applied.  Arun is looking into this.  We can re-enable it once it's
working in this use case.

Thanks,

Alex

>
> --
> Earthling Michel Dänzer|  https://redhat.com
> Libre software enthusiast  | Mesa and Xwayland developer
>


Re: [PATCH] drm/amdgpu: Fix use-after-free on amdgpu_bo_list mutex

2022-08-16 Thread Alex Deucher
Applied.  Thanks!

Alex

On Mon, Aug 15, 2022 at 10:56 AM Melissa Wen  wrote:
>
> On 08/15, Maíra Canal wrote:
> > If amdgpu_cs_vm_handling returns r != 0, then it will unlock the
> > bo_list_mutex inside the function amdgpu_cs_vm_handling and again on
> > amdgpu_cs_parser_fini. This problem results in the following
> > use-after-free problem:
> >
> > [ 220.280990] [ cut here ]
> > [ 220.281000] refcount_t: underflow; use-after-free.
> > [ 220.281019] WARNING: CPU: 1 PID: 3746 at lib/refcount.c:28 
> > refcount_warn_saturate+0xba/0x110
> > [ 220.281029] [ cut here ]
> > [ 220.281415] CPU: 1 PID: 3746 Comm: chrome:cs0 Tainted: G W L --- --- 
> > 5.20.0-0.rc0.20220812git7ebfc85e2cd7.10.fc38.x86_64 #1
> > [ 220.281421] Hardware name: System manufacturer System Product Name/ROG 
> > STRIX X570-I GAMING, BIOS 4403 04/27/2022
> > [ 220.281426] RIP: 0010:refcount_warn_saturate+0xba/0x110
> > [ 220.281431] Code: 01 01 e8 79 4a 6f 00 0f 0b e9 42 47 a5 00 80 3d de
> > 7e be 01 00 75 85 48 c7 c7 f8 98 8e 98 c6 05 ce 7e be 01 01 e8 56 4a
> > 6f 00 <0f> 0b e9 1f 47 a5 00 80 3d b9 7e be 01 00 0f 85 5e ff ff ff 48
> > c7
> > [ 220.281437] RSP: 0018:b4b0d18d7a80 EFLAGS: 00010282
> > [ 220.281443] RAX: 0026 RBX: 0003 RCX: 
> > 
> > [ 220.281448] RDX: 0001 RSI: 988d06dc RDI: 
> > 
> > [ 220.281452] RBP:  R08:  R09: 
> > b4b0d18d7930
> > [ 220.281457] R10: 0003 R11: a0672e2fffe8 R12: 
> > a058ca360400
> > [ 220.281461] R13: a05846c50a18 R14: fe00 R15: 
> > 0003
> > [ 220.281465] FS: 7f82683e06c0() GS:a066e2e0() 
> > knlGS:
> > [ 220.281470] CS: 0010 DS:  ES:  CR0: 80050033
> > [ 220.281475] CR2: 3590005cc000 CR3: 0001fca46000 CR4: 
> > 00350ee0
> > [ 220.281480] Call Trace:
> > [ 220.281485] 
> > [ 220.281490] amdgpu_cs_ioctl+0x4e2/0x2070 [amdgpu]
> > [ 220.281806] ? amdgpu_cs_find_mapping+0xe0/0xe0 [amdgpu]
> > [ 220.282028] drm_ioctl_kernel+0xa4/0x150
> > [ 220.282043] drm_ioctl+0x21f/0x420
> > [ 220.282053] ? amdgpu_cs_find_mapping+0xe0/0xe0 [amdgpu]
> > [ 220.282275] ? lock_release+0x14f/0x460
> > [ 220.282282] ? _raw_spin_unlock_irqrestore+0x30/0x60
> > [ 220.282290] ? _raw_spin_unlock_irqrestore+0x30/0x60
> > [ 220.282297] ? lockdep_hardirqs_on+0x7d/0x100
> > [ 220.282305] ? _raw_spin_unlock_irqrestore+0x40/0x60
> > [ 220.282317] amdgpu_drm_ioctl+0x4a/0x80 [amdgpu]
> > [ 220.282534] __x64_sys_ioctl+0x90/0xd0
> > [ 220.282545] do_syscall_64+0x5b/0x80
> > [ 220.282551] ? futex_wake+0x6c/0x150
> > [ 220.282568] ? lock_is_held_type+0xe8/0x140
> > [ 220.282580] ? do_syscall_64+0x67/0x80
> > [ 220.282585] ? lockdep_hardirqs_on+0x7d/0x100
> > [ 220.282592] ? do_syscall_64+0x67/0x80
> > [ 220.282597] ? do_syscall_64+0x67/0x80
> > [ 220.282602] ? lockdep_hardirqs_on+0x7d/0x100
> > [ 220.282609] entry_SYSCALL_64_after_hwframe+0x63/0xcd
> > [ 220.282616] RIP: 0033:0x7f8282a4f8bf
> > [ 220.282639] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10
> > 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00
> > 0f 05 <89> c2 3d 00 f0 ff ff 77 18 48 8b 44 24 18 64 48 2b 04 25 28 00
> > 00
> > [ 220.282644] RSP: 002b:7f82683df410 EFLAGS: 0246 ORIG_RAX: 
> > 0010
> > [ 220.282651] RAX: ffda RBX: 7f82683df588 RCX: 
> > 7f8282a4f8bf
> > [ 220.282655] RDX: 7f82683df4d0 RSI: c0186444 RDI: 
> > 0018
> > [ 220.282659] RBP: 7f82683df4d0 R08: 7f82683df5e0 R09: 
> > 7f82683df4b0
> > [ 220.282663] R10: 1d04000a0600 R11: 0246 R12: 
> > c0186444
> > [ 220.282667] R13: 0018 R14: 7f82683df588 R15: 
> > 0003
> > [ 220.282689] 
> > [ 220.282693] irq event stamp: 6232311
> > [ 220.282697] hardirqs last enabled at (6232319): [] 
> > __up_console_sem+0x5e/0x70
> > [ 220.282704] hardirqs last disabled at (6232326): [] 
> > __up_console_sem+0x43/0x70
> > [ 220.282709] softirqs last enabled at (6232072): [] 
> > __irq_exit_rcu+0xf9/0x170
> > [ 220.282716] softirqs last disabled at (6232061): [] 
> > __irq_exit_rcu+0xf9/0x170
> > [ 220.282722] ---[ end trace  ]---
> >
> > Therefore, remove the mutex_unlock from the amdgpu_cs_vm_handling
> > function, so that amdgpu_cs_submit and amdgpu_cs_parser_fini can handle
> > the unlock.
> >
> > Fixes: 90af0ca047f3 ("drm/amdgpu: Protect the amdgpu_bo_list list with a 
> > mutex v2")
> > Reported-by: Mikhail Gavrilov 
> > Signed-off-by: Maíra Canal 
> > ---
> > Thanks Melissa and Christian for the feedback on mutex_unlock.
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 8 ++--
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > index d8f1335bc68f..b7bae833c804 

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

2022-08-16 Thread Mikhail Gavrilov
On Mon, Aug 15, 2022 at 3:37 PM Mikhail Gavrilov
 wrote:
>
> Thanks, I tested this patch.
> But with this patch use-after-free problem happening in another place:

Does anyone have an idea why the second use-after-free happened?
>From the trace I don't understand which code is related.
I don't quite understand what the "Workqueue" entry in the trace means.

[ 408.358737] [ cut here ]
[ 408.358743] refcount_t: underflow; use-after-free.
[ 408.358760] WARNING: CPU: 9 PID: 62 at lib/refcount.c:28
refcount_warn_saturate+0xba/0x110
[ 408.358769] Modules linked in: uinput snd_seq_dummy rfcomm
snd_hrtimer nft_objref nf_conntrack_netbios_ns nf_conntrack_broadcast
nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet
nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat
nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nf_tables nfnetlink
qrtr bnep sunrpc binfmt_misc snd_seq_midi snd_seq_midi_event mt76x2u
mt76x2_common snd_hda_codec_realtek mt76x02_usb snd_hda_codec_generic
iwlmvm snd_hda_codec_hdmi mt76_usb intel_rapl_msr snd_hda_intel
mt76x02_lib intel_rapl_common snd_intel_dspcfg snd_intel_sdw_acpi mt76
snd_hda_codec vfat fat snd_usb_audio snd_hda_core edac_mce_amd
mac80211 snd_usbmidi_lib snd_hwdep snd_rawmidi mc snd_seq btusb
kvm_amd iwlwifi snd_seq_device btrtl btbcm libarc4 btintel eeepc_wmi
snd_pcm iwlmei kvm btmtk asus_wmi ledtrig_audio irqbypass joydev
snd_timer sparse_keymap bluetooth platform_profile rapl cfg80211 snd
video wmi_bmof soundcore i2c_piix4 k10temp rfkill mei
[ 408.358853] asus_ec_sensors acpi_cpufreq zram hid_logitech_hidpp
amdgpu igb dca drm_ttm_helper ttm iommu_v2 crct10dif_pclmul gpu_sched
crc32_pclmul ucsi_ccg crc32c_intel drm_buddy nvme typec_ucsi
drm_display_helper ghash_clmulni_intel ccp typec nvme_core sp5100_tco
cec wmi ip6_tables ip_tables fuse
[ 408.358880] Unloaded tainted modules: amd64_edac():1 amd64_edac():1
amd64_edac():1 amd64_edac():1 amd64_edac():1 amd64_edac():1
amd64_edac():1 amd64_edac():1 amd64_edac():1 amd64_edac():1
pcc_cpufreq():1 amd64_edac():1 pcc_cpufreq():1 pcc_cpufreq():1
amd64_edac():1 amd64_edac():1 pcc_cpufreq():1 amd64_edac():1
pcc_cpufreq():1 amd64_edac():1 pcc_cpufreq():1 amd64_edac():1
pcc_cpufreq():1 pcc_cpufreq():1 amd64_edac():1 pcc_cpufreq():1
amd64_edac():1 pcc_cpufreq():1 amd64_edac():1 pcc_cpufreq():1
pcc_cpufreq():1 amd64_edac():1 amd64_edac():1 pcc_cpufreq():1
pcc_cpufreq():1 amd64_edac():1 pcc_cpufreq():1 amd64_edac():1
pcc_cpufreq():1 amd64_edac():1 pcc_cpufreq():1 pcc_cpufreq():1
amd64_edac():1 pcc_cpufreq():1 amd64_edac():1 pcc_cpufreq():1
amd64_edac():1 pcc_cpufreq():1 pcc_cpufreq():1 amd64_edac():1
pcc_cpufreq():1 amd64_edac():1 amd64_edac():1 pcc_cpufreq():1
amd64_edac():1 pcc_cpufreq():1 amd64_edac():1 pcc_cpufreq():1
pcc_cpufreq():1 pcc_cpufreq():1 fjes():1 pcc_cpufreq():1 fjes():1
[ 408.358953] pcc_cpufreq():1 pcc_cpufreq():1 fjes():1 pcc_cpufreq():1
fjes():1 fjes():1 fjes():1 fjes():1 fjes():1
[ 408.358967] CPU: 9 PID: 62 Comm: kworker/9:0 Tainted: G W L ---
--- 6.0.0-0.rc1.13.fc38.x86_64+debug #1
[ 408.358971] Hardware name: System manufacturer System Product
Name/ROG STRIX X570-I GAMING, BIOS 4403 04/27/2022
[ 408.358974] Workqueue: events drm_sched_entity_kill_jobs_work [gpu_sched]
[ 408.358982] RIP: 0010:refcount_warn_saturate+0xba/0x110
[ 408.358987] Code: 01 01 e8 d9 59 6f 00 0f 0b e9 a2 46 a5 00 80 3d 3e
7e be 01 00 75 85 48 c7 c7 70 99 8e 92 c6 05 2e 7e be 01 01 e8 b6 59
6f 00 <0f> 0b e9 7f 46 a5 00 80 3d 19 7e be 01 00 0f 85 5e ff ff ff 48
c7
[ 408.358990] RSP: 0018:b124003efe60 EFLAGS: 00010286
[ 408.358994] RAX: 0026 RBX: 9987a025d428 RCX: 
[ 408.358997] RDX: 0001 RSI: 928d0754 RDI: 
[ 408.358999] RBP: 9994e4ff5600 R08:  R09: b124003efd10
[ 408.359001] R10: 0003 R11: 99952e2fffe8 R12: 9994e4ffc800
[ 408.359004] R13: 998600228cc0 R14: 9994e4ffc805 R15: 9987a025d430
[ 408.359006] FS: () GS:9994e4e0()
knlGS:
[ 408.359009] CS: 0010 DS:  ES:  CR0: 80050033
[ 408.359012] CR2: 27ac39e78000 CR3: 0001a66d8000 CR4: 00350ee0
[ 408.359015] Call Trace:
[ 408.359017] 
[ 408.359020] process_one_work+0x2a0/0x600
[ 408.359032] worker_thread+0x4f/0x3a0
[ 408.359036] ? process_one_work+0x600/0x600
[ 408.359039] kthread+0xf5/0x120
[ 408.359044] ? kthread_complete_and_exit+0x20/0x20
[ 408.359049] ret_from_fork+0x22/0x30
[ 408.359061] 
[ 408.359063] irq event stamp: 5468
[ 408.359064] hardirqs last enabled at (5467): []
_raw_spin_unlock_irq+0x24/0x50
[ 408.359071] hardirqs last disabled at (5468): []
__schedule+0xe2c/0x16d0
[ 408.359076] softirqs last enabled at (2482): []
rht_deferred_worker+0x708/0xc00
[ 408.359079] softirqs last disabled at (2480): []
rht_deferred_worker+0x1f7/0xc00
[ 408.359082] ---[ end trace  ]---


Full kernel log is here: 

[linux-next:master] BUILD REGRESSION e1084bacab44f570691c0fdaa1259acf93ed0098

2022-08-16 Thread kernel test robot
tree/branch: 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
branch HEAD: e1084bacab44f570691c0fdaa1259acf93ed0098  Add linux-next specific 
files for 20220816

Error/Warning reports:

https://lore.kernel.org/linux-doc/202208162058.7appivkl-...@intel.com

Error/Warning: (recently discovered and may have been fixed)

Warning: MAINTAINERS references a file that doesn't exist: 
Documentation/devicetree/bindings/gpio/gpio-xilinx.txt
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:1046:5: 
warning: no previous prototype for 'fill_dc_scaling_info' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:1222:6: 
warning: no previous prototype for 'handle_cursor_update' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:152:6: 
warning: no previous prototype for 'modifier_has_dcc' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:1576:5: 
warning: no previous prototype for 'amdgpu_dm_plane_init' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:157:10: 
warning: no previous prototype for 'modifier_gfx9_swizzle_mode' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:752:5: 
warning: no previous prototype for 'fill_plane_buffer_attributes' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:83:31: 
warning: no previous prototype for 'amd_get_format_info' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:88:6: 
warning: no previous prototype for 'fill_blending_from_plane_state' 
[-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:992:5: 
warning: no previous prototype for 'dm_plane_helper_check_state' 
[-Wmissing-prototypes]
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c:905:28: warning: variable 'top' set but 
not used [-Wunused-but-set-variable]
include/linux/random.h:25:46: error: 'latent_entropy' undeclared (first use in 
this function); did you mean 'add_latent_entropy'?

Error/Warning ids grouped by kconfigs:

gcc_recent_errors
|-- alpha-allyesconfig
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-amd_get_format_info
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-amdgpu_dm_plane_init
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-dm_plane_helper_check_state
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-fill_blending_from_plane_state
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-fill_dc_scaling_info
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-fill_plane_buffer_attributes
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-handle_cursor_update
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-modifier_gfx9_swizzle_mode
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-modifier_has_dcc
|   `-- 
drivers-gpu-drm-msm-disp-dpu1-dpu_kms.c:warning:variable-top-set-but-not-used
|-- arc-allyesconfig
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-amd_get_format_info
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-amdgpu_dm_plane_init
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-dm_plane_helper_check_state
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-fill_blending_from_plane_state
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-fill_dc_scaling_info
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-fill_plane_buffer_attributes
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-handle_cursor_update
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-modifier_gfx9_swizzle_mode
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-modifier_has_dcc
|   `-- 
drivers-gpu-drm-msm-disp-dpu1-dpu_kms.c:warning:variable-top-set-but-not-used
|-- arm-allyesconfig
|   |-- 
drivers-gpu-drm-amd-amdgpu-..-display-amdgpu_dm-amdgpu_dm_plane.c:warning:no-previous-prototype-for-amd_get_format_info
|   |-- 
drivers-gpu-drm-amd-amdgpu

Re: [PATCHv2] drm/amdgpu: Fix interrupt handling on ih_soft ring

2022-08-16 Thread Felix Kuehling

Am 2022-08-15 um 15:25 schrieb Mukul Joshi:

There are no backing hardware registers for ih_soft ring.
As a result, don't try to access hardware registers for read
and write pointers when processing interrupts on the IH soft
ring.

Signed-off-by: Mukul Joshi 


Reviewed-by: Felix Kuehling 



---
  drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 7 ++-
  drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 7 ++-
  drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 7 ++-
  3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c 
b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
index 4b5396d3e60f..eec13cb5bf75 100644
--- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
@@ -409,9 +409,11 @@ static u32 navi10_ih_get_wptr(struct amdgpu_device *adev,
u32 wptr, tmp;
struct amdgpu_ih_regs *ih_regs;
  
-	if (ih == >irq.ih) {

+   if (ih == >irq.ih || ih == >irq.ih_soft) {
/* Only ring0 supports writeback. On other rings fall back
 * to register-based code with overflow checking below.
+* ih_soft ring doesn't have any backing hardware registers,
+* update wptr and return.
 */
wptr = le32_to_cpu(*ih->wptr_cpu);
  
@@ -483,6 +485,9 @@ static void navi10_ih_set_rptr(struct amdgpu_device *adev,

  {
struct amdgpu_ih_regs *ih_regs;
  
+	if (ih == >irq.ih_soft)

+   return;
+
if (ih->use_doorbell) {
/* XXX check if swapping is necessary on BE */
*ih->rptr_cpu = ih->rptr;
diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c 
b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
index cdd599a08125..03b7066471f9 100644
--- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
@@ -334,9 +334,11 @@ static u32 vega10_ih_get_wptr(struct amdgpu_device *adev,
u32 wptr, tmp;
struct amdgpu_ih_regs *ih_regs;
  
-	if (ih == >irq.ih) {

+   if (ih == >irq.ih || ih == >irq.ih_soft) {
/* Only ring0 supports writeback. On other rings fall back
 * to register-based code with overflow checking below.
+* ih_soft ring doesn't have any backing hardware registers,
+* update wptr and return.
 */
wptr = le32_to_cpu(*ih->wptr_cpu);
  
@@ -409,6 +411,9 @@ static void vega10_ih_set_rptr(struct amdgpu_device *adev,

  {
struct amdgpu_ih_regs *ih_regs;
  
+	if (ih == >irq.ih_soft)

+   return;
+
if (ih->use_doorbell) {
/* XXX check if swapping is necessary on BE */
*ih->rptr_cpu = ih->rptr;
diff --git a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c 
b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
index 3b4eb8285943..2022ffbb8dba 100644
--- a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
@@ -385,9 +385,11 @@ static u32 vega20_ih_get_wptr(struct amdgpu_device *adev,
u32 wptr, tmp;
struct amdgpu_ih_regs *ih_regs;
  
-	if (ih == >irq.ih) {

+   if (ih == >irq.ih || ih == >irq.ih_soft) {
/* Only ring0 supports writeback. On other rings fall back
 * to register-based code with overflow checking below.
+* ih_soft ring doesn't have any backing hardware registers,
+* update wptr and return.
 */
wptr = le32_to_cpu(*ih->wptr_cpu);
  
@@ -461,6 +463,9 @@ static void vega20_ih_set_rptr(struct amdgpu_device *adev,

  {
struct amdgpu_ih_regs *ih_regs;
  
+	if (ih == >irq.ih_soft)

+   return;
+
if (ih->use_doorbell) {
/* XXX check if swapping is necessary on BE */
*ih->rptr_cpu = ih->rptr;


Re: [PATCH v2 1/3] Documentation/gpu: Add info table for ASICs

2022-08-16 Thread Alex Deucher
On Thu, Aug 11, 2022 at 3:45 PM Rodrigo Siqueira Jordao
 wrote:
>
> Hi Kent,
>
> First of all, thanks for your feedback.
> See my comments inline.
>
> On 2022-08-11 12:02, Russell, Kent wrote:
> > [AMD Official Use Only - General]
> >
> > I noticed that you added DCE and VCE/UVD prefixes in the columns, but not 
> > GC or SDMA.
> > E.g.
> > CHIP  DCE  GC VCE   
> > SDMA
> >   BONAIRE  DCE 8  7VCE 2 / UVD 4.21
> >
>
> Are you referencing when I added it in some specific lines? If so, I
> added it because we may have a different architecture for the same area.
> For example, DCE is our old display architecture, and we replaced it
> with DCN. That's why I added DCE/DCN in the label, and in the ASIC
> description, I specify if it is a DCE or DCN.
>
> > For consistency, should we drop the DCE/VCE/UVD prefixes and add a separate 
> > UVD column, so it's just:
>
> Iirc UVD is the previous version of VCE; in that case, I think they
> should be grouped. Or is UVD a different component?

DCE was the old display IP and it was replaced with DCN.  UVD/VCE
where the old video decode/encode IPs and they were replaced with VCN.

>
> > CHIP  DCE  GC   VCEUVDSDMA
> >   BONAIRE  8  7   VCE 2   4.2 1
> > ? I know that from a compute perspective, I'd like to have the columns 
> > represent the fields, so there's less to parse through, but I am not a 
> > display guy so the DCE/VCE/UVD relationship is a mystery to me.
> >
> > Also, for VG10 you have SDMA 4.0.0, but Polaris it's SDMA 3 . Again, just 
> > consistency with trailing decimals. I don't know if that's just because we 
> > didn't do point releases on SDMA <4 or whatnot, but it's something I 
> > observed.
>
> I also don't know if we have a good reason for not using the decimal
> part, but I can add it to all components if it makes sense. Maybe Alex know?

The old parts didn't really have well enumerated IP minor versions
like we do today.  We could make up minor/rev numbers, but we don't
really have them in most cases.  We could do something like 8.x or 7.x
if you think that is clearer.

Alex

>
> Thanks
> Siqueira
>
> >
> > I am not staunchly steadfast one way or another, I just wanted to hear 
> > rationale for it. Especially if we're maintaining it going forward, and for 
> > when someone inevitably starts parsing it via automated script and needs 
> > consistency. If you're confident in the format and can justify it, then 
> > that's sufficient for me.
> >
> >   Kent
> >
> >> -Original Message-
> >> From: Siqueira, Rodrigo 
> >> Sent: Thursday, August 11, 2022 11:48 AM
> >> To: amd-gfx@lists.freedesktop.org
> >> Cc: Wentland, Harry ; Kazlauskas, Nicholas
> >> ; Lakha, Bhawanpreet
> >> ; Wu, Hersen ;
> >> Hung, Alex ; Pelloux-Prayer, Pierre-Eric  >> eric.pelloux-pra...@amd.com>; Li, Sun peng (Leo) ;
> >> Simon Ser ; Pekka Paalanen
> >> ; Sean Paul ; Mark
> >> Yacoub ; Pierre-Loup
> >> ; Michel Dänzer
> >> ; Russell, Kent 
> >> Subject: [PATCH v2 1/3] Documentation/gpu: Add info table for ASICs
> >>
> >> Amdgpu driver is used in an extensive range of devices, and each ASIC
> >> has some specific configuration. As a result of this variety, sometimes
> >> it is hard to identify the correct block that might cause the issue.
> >> This commit expands the amdgpu kernel-doc to alleviate this issue by
> >> introducing one ASIC table that describes dGPU and another one that
> >> shares the APU info.
> >>
> >> Cc: Harry Wentland 
> >> Cc: Nicholas Kazlauskas 
> >> Cc: Bhawanpreet Lakha 
> >> Cc: Hersen Wu 
> >> Cc: Alex Hung 
> >> Cc: Pierre-Eric Pelloux-Prayer 
> >> Cc: Leo Li 
> >> Cc: Simon Ser 
> >> Cc: Pekka Paalanen 
> >> Cc: Sean Paul 
> >> Cc: Mark Yacoub 
> >> Cc: Pierre-Loup 
> >> Cc: Michel Dänzer 
> >> Cc: Kent Russell 
> >> Signed-off-by: Rodrigo Siqueira 
> >> ---
> >>   .../gpu/amdgpu/apu-asic-info-table.csv|  8 +++
> >>   .../gpu/amdgpu/dgpu-asic-info-table.csv   | 24 +++
> >>   Documentation/gpu/amdgpu/driver-misc.rst  | 17 +
> >>   3 files changed, 49 insertions(+)
> >>   create mode 100644 Documentation/gpu/amdgpu/apu-asic-info-table.csv
> >>   create mode 100644 Documentation/gpu/amdgpu/dgpu-asic-info-table.csv
> >>
> >> diff --git a/Documentation/gpu/amdgpu/apu-asic-info-table.csv
> >> b/Documentation/gpu/amdgpu/apu-asic-info-table.csv
> >> new file mode 100644
> >> index ..98c6988e424e
> >> --- /dev/null
> >> +++ b/Documentation/gpu/amdgpu/apu-asic-info-table.csv
> >> @@ -0,0 +1,8 @@
> >> +Product Name, Code Reference, DCN/DCE version, GC version, VCE/UVD/VCN
> >> version, SDMA version
> >> +Radeon R* Graphics, CARRIZO/STONEY, DCE 11, 8, VCE 3 / UVD 6, 3
> >> +Ryzen 3000 series / AMD Ryzen Embedded V1*/R1* with Radeon Vega Gfx,
> >> RAVEN/PICASSO, DCN 1.0, 9.1.0, VCN 1.0, 4.1.0
> >> +Ryzen 4000 series, RENOIR, DCN 2.1, 9.3, VCN 2.2, 4.1.2
> >> +Ryzen 

Re: [PATCH] Revert "drm/amd/amdgpu: add pipe1 hardware support"

2022-08-16 Thread Michel Dänzer
On 2022-08-16 10:44, Michel Dänzer wrote:
> From: Michel Dänzer 
> 
> This reverts commit 4c7631800e6bf0eced08dd7b4f793fcd972f597d.
> 
> Triggered GFX hangs with GNOME Wayland on Navi 21.
> 
> Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2117

Don't get me wrong, I'm really looking forward to this functionality, as it's 
required for reaping the full benefit of 
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1880 . But it has to 
actually work. :)


-- 
Earthling Michel Dänzer|  https://redhat.com
Libre software enthusiast  | Mesa and Xwayland developer



Re: Radeon HD 2600 XT, DVI outputs

2022-08-16 Thread Christian König

Hi Andriy,

well first of all can you please test that with Linux? If this works on 
Linux then there is probably just something missing on the FreeBSD port.


Regards,
Christian.

Am 16.08.22 um 10:48 schrieb Andriy Gapon:


Out of necessity I had to use an ancient Radeon HD 2600 XT card.
It has two DVI outputs (and one S-video).

I noticed a curious problem, if I attach a monitor to either of the 
DVI outputs, then initially there is video output but as soon as 
radeonkms driver attaches the monitor goes blank.

But if I attach the same monitor to either of the outputs using its VGA
input and DVI->VGA converter, then the video works fine all the time.

I tested the monitor's DVI input with a different machine and there it 
works just fine (and, as I said, it also works fine before radeonkms 
is loaded).


Here is a piece of output from the driver with the direct DVI attachment:
[drm] Radeon Display Connectors
[drm] Connector 0:
[drm]   DVI-I-1
[drm]   HPD1
[drm]   DDC: 0x7e50 0x7e50 0x7e54 0x7e54 0x7e58 0x7e58 0x7e5c 0x7e5c
[drm]   Encoders:
[drm] DFP1: INTERNAL_KLDSCP_TMDS1
[drm] CRT2: INTERNAL_KLDSCP_DAC2
[drm] Connector 1:
[drm]   DIN-1
[drm]   Encoders:
[drm] TV1: INTERNAL_KLDSCP_DAC2
[drm] Connector 2:
[drm]   DVI-I-2
[drm]   HPD2
[drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c
[drm]   Encoders:
[drm] CRT1: INTERNAL_KLDSCP_DAC1
[drm] DFP2: INTERNAL_LVTM1
drmn0: [drm] Cannot find any crtc or sizes

The same scenario with additional diagnostics: 
https://people.freebsd.org/~avg/radeon-2600-dvi-dvi.txt



And here is with the DVI->VGA configuration:
[drm] Radeon Display Connectors
[drm] Connector 0:
[drm]   DVI-I-1
[drm]   HPD1
[drm]   DDC: 0x7e50 0x7e50 0x7e54 0x7e54 0x7e58 0x7e58 0x7e5c 0x7e5c
[drm]   Encoders:
[drm] DFP1: INTERNAL_KLDSCP_TMDS1
[drm] CRT2: INTERNAL_KLDSCP_DAC2
[drm] Connector 1:
[drm]   DIN-1
[drm]   Encoders:
[drm] TV1: INTERNAL_KLDSCP_DAC2
[drm] Connector 2:
[drm]   DVI-I-2
[drm]   HPD2
[drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c
[drm]   Encoders:
[drm] CRT1: INTERNAL_KLDSCP_DAC1
[drm] DFP2: INTERNAL_LVTM1
[drm] fb mappable at 0xE0243000
[drm] vram apper at 0xE000
[drm] size 3145728
[drm] fb depth is 24
[drm]    pitch is 4096

The same scenario with additional diagnostics: 
https://people.freebsd.org/~avg/radeon-2600-dvi-vga.txt



Not sure if this is something with the hardware...

Thanks!




Radeon HD 2600 XT, DVI outputs

2022-08-16 Thread Andriy Gapon



Out of necessity I had to use an ancient Radeon HD 2600 XT card.
It has two DVI outputs (and one S-video).

I noticed a curious problem, if I attach a monitor to either of the DVI 
outputs, then initially there is video output but as soon as radeonkms 
driver attaches the monitor goes blank.

But if I attach the same monitor to either of the outputs using its VGA
input and DVI->VGA converter, then the video works fine all the time.

I tested the monitor's DVI input with a different machine and there it 
works just fine (and, as I said, it also works fine before radeonkms is 
loaded).


Here is a piece of output from the driver with the direct DVI attachment:
[drm] Radeon Display Connectors
[drm] Connector 0:
[drm]   DVI-I-1
[drm]   HPD1
[drm]   DDC: 0x7e50 0x7e50 0x7e54 0x7e54 0x7e58 0x7e58 0x7e5c 0x7e5c
[drm]   Encoders:
[drm] DFP1: INTERNAL_KLDSCP_TMDS1
[drm] CRT2: INTERNAL_KLDSCP_DAC2
[drm] Connector 1:
[drm]   DIN-1
[drm]   Encoders:
[drm] TV1: INTERNAL_KLDSCP_DAC2
[drm] Connector 2:
[drm]   DVI-I-2
[drm]   HPD2
[drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c
[drm]   Encoders:
[drm] CRT1: INTERNAL_KLDSCP_DAC1
[drm] DFP2: INTERNAL_LVTM1
drmn0: [drm] Cannot find any crtc or sizes

The same scenario with additional diagnostics: 
https://people.freebsd.org/~avg/radeon-2600-dvi-dvi.txt



And here is with the DVI->VGA configuration:
[drm] Radeon Display Connectors
[drm] Connector 0:
[drm]   DVI-I-1
[drm]   HPD1
[drm]   DDC: 0x7e50 0x7e50 0x7e54 0x7e54 0x7e58 0x7e58 0x7e5c 0x7e5c
[drm]   Encoders:
[drm] DFP1: INTERNAL_KLDSCP_TMDS1
[drm] CRT2: INTERNAL_KLDSCP_DAC2
[drm] Connector 1:
[drm]   DIN-1
[drm]   Encoders:
[drm] TV1: INTERNAL_KLDSCP_DAC2
[drm] Connector 2:
[drm]   DVI-I-2
[drm]   HPD2
[drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c
[drm]   Encoders:
[drm] CRT1: INTERNAL_KLDSCP_DAC1
[drm] DFP2: INTERNAL_LVTM1
[drm] fb mappable at 0xE0243000
[drm] vram apper at 0xE000
[drm] size 3145728
[drm] fb depth is 24
[drm]pitch is 4096

The same scenario with additional diagnostics: 
https://people.freebsd.org/~avg/radeon-2600-dvi-vga.txt



Not sure if this is something with the hardware...

Thanks!
--
Andriy Gapon


https://standforukraine.com
https://razomforukraine.org


[PATCH] Revert "drm/amd/amdgpu: add pipe1 hardware support"

2022-08-16 Thread Michel Dänzer
From: Michel Dänzer 

This reverts commit 4c7631800e6bf0eced08dd7b4f793fcd972f597d.

Triggered GFX hangs with GNOME Wayland on Navi 21.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2117
Signed-off-by: Michel Dänzer 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index fafbad3cf08d..a2a4dc1844c0 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -4846,7 +4846,7 @@ static int gfx_v10_0_sw_init(void *handle)
case IP_VERSION(10, 3, 3):
case IP_VERSION(10, 3, 7):
adev->gfx.me.num_me = 1;
-   adev->gfx.me.num_pipe_per_me = 2;
+   adev->gfx.me.num_pipe_per_me = 1;
adev->gfx.me.num_queue_per_pipe = 1;
adev->gfx.mec.num_mec = 2;
adev->gfx.mec.num_pipe_per_mec = 4;
-- 
2.36.1