Re: [PATCH] drm/amd/display: fix sysfs amdgpu_current_backlight_pwm NULL pointer issue
[AMD Public Use] Acked-by: Alex Deucher From: Wang, Kevin(Yang) Sent: Tuesday, December 29, 2020 1:21 AM To: amd-gfx@lists.freedesktop.org ; Wentland, Harry Cc: Deucher, Alexander ; Wang, Kevin(Yang) Subject: [PATCH] drm/amd/display: fix sysfs amdgpu_current_backlight_pwm NULL pointer issue fix NULL pointer issue when read sysfs amdgpu_current_backlight_pwm sysfs node. calltrace: [ 248.273833] BUG: kernel NULL pointer dereference, address: 0130 [ 248.273930] #PF: supervisor read access in kernel mode [ 248.273993] #PF: error_code(0x) - not-present page [ 248.274054] PGD 0 P4D 0 [ 248.274092] Oops: [#1] SMP PTI [ 248.274138] CPU: 2 PID: 1377 Comm: cat Tainted: G OE 5.9.0-rc5-drm-next-5.9+ #1 [ 248.274233] Hardware name: System manufacturer System Product Name/Z170-A, BIOS 3802 03/15/2018 [ 248.274641] RIP: 0010:dc_link_get_backlight_level+0x5/0x70 [amdgpu] [ 248.274718] Code: 67 ff ff ff 41 b9 03 00 00 00 e9 45 ff ff ff d1 ea e9 55 ff ff ff 0f 1f 44 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 <48> 8b 87 30 01 00 00 48 8b 00 48 8b 88 88 03 00 00 48 8d 81 e8 01 [ 248.274919] RSP: 0018:b5ad809b3df0 EFLAGS: 00010203 [ 248.274982] RAX: a0f77d1c0010 RBX: a0f793ae9168 RCX: 0001 [ 248.275064] RDX: a0f79753db00 RSI: 0001 RDI: [ 248.275145] RBP: b5ad809b3e00 R08: b5ad809b3da0 R09: [ 248.275225] R10: b5ad809b3e68 R11: R12: a0f793ae9190 [ 248.275306] R13: b5ad809b3ef0 R14: 0001 R15: a0f793ae9168 [ 248.275388] FS: 7f5f1ec4d540() GS:a0f79ec8() knlGS: [ 248.275480] CS: 0010 DS: ES: CR0: 80050033 [ 248.275547] CR2: 0130 CR3: 00042a03c005 CR4: 003706e0 [ 248.275628] DR0: DR1: DR2: [ 248.275708] DR3: DR6: fffe0ff0 DR7: 0400 [ 248.275789] Call Trace: [ 248.276124] ? current_backlight_read+0x24/0x40 [amdgpu] [ 248.276194] seq_read+0xc3/0x3f0 [ 248.276240] full_proxy_read+0x5c/0x90 [ 248.276290] vfs_read+0xa7/0x190 [ 248.276334] ksys_read+0xa7/0xe0 [ 248.276379] __x64_sys_read+0x1a/0x20 [ 248.276429] do_syscall_64+0x37/0x80 [ 248.276477] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 248.276538] RIP: 0033:0x7f5f1e75c191 [ 248.276585] Code: fe ff ff 48 8d 3d b7 9d 0a 00 48 83 ec 08 e8 46 4d 02 00 66 0f 1f 44 00 00 48 8d 05 71 07 2e 00 8b 00 85 c0 75 13 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 57 f3 c3 0f 1f 44 00 00 41 54 55 49 89 d4 53Hw [ 248.276784] RSP: 002b:7ffcb1fc3f38 EFLAGS: 0246 ORIG_RAX: [ 248.276872] RAX: ffda RBX: 0002 RCX: 7f5f1e75c191 [ 248.276953] RDX: 0002 RSI: 7f5f1ec2b000 RDI: 0003 [ 248.277034] RBP: 0002 R08: R09: [ 248.277115] R10: 0022 R11: 0246 R12: 7f5f1ec2b000 [ 248.277195] R13: 0003 R14: 7f5f1ec2b00f R15: 0002 [ 248.277279] Modules linked in: amdgpu(OE) iommu_v2 gpu_sched ttm(OE) drm_kms_helper cec drm i2c_algo_bit fb_sys_fops syscopyarea sysfillrect sysimgblt rpcsec_gss_krb5 auth_rpcgss nfsv4 nfs lockd grace fscache nls_iso8859_1 snd_hda_codec_realtek snd_hda_codec_hdmi snd_hda_codec_generic ledtrig_audio intel_rapl_msr intel_rapl_common snd_hda_intel snd_intel_dspcfg x86_pkg_temp_thermal intel_powerclamp snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_seq_midi snd_seq_midi_event mei_hdcp coretemp snd_rawmidi snd_seq kvm_intel kvm snd_seq_device snd_timer irqbypass joydev snd input_leds soundcore crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd glue_helper rapl intel_cstate mac_hid mei_me serio_raw mei eeepc_wmi wmi_bmof asus_wmi mxm_wmi intel_wmi_thunderbolt acpi_pad sparse_keymap efi_pstore sch_fq_codel parport_pc ppdev lp parport sunrpc ip_tables x_tables autofs4 hid_logitech_hidpp hid_logitech_dj hid_generic usbhid hid e1000e psmouse ahci libahci wmi video [ 248.278211] CR2: 0130 [ 248.278221] ---[ end trace 1fbe72fe6f91091d ]--- [ 248.357226] RIP: 0010:dc_link_get_backlight_level+0x5/0x70 [amdgpu] [ 248.357272] Code: 67 ff ff ff 41 b9 03 00 00 00 e9 45 ff ff ff d1 ea e9 55 ff ff ff 0f 1f 44 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 <48> 8b 87 30 01 00 00 48 8b 00 48 8b 88 88 03 00 00 48 8d 81 e8 01 Signed-off-by: Kevin Wang --- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index 9e1071b2181f..f4a2088ab179 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c @@ -2487,9 +2487,14
Re: [bug] Radeon 3900XT not switch to graphic mode on kernel 5.10
[AMD Public Use] It looks like the driver is not able to access the firmware for some reason. Please make sure it is available in your initrd or compiled into the kernel depending on your config. Alex From: amd-gfx on behalf of Mikhail Gavrilov Sent: Sunday, December 27, 2020 11:58 AM To: amd-gfx list ; Linux List Kernel Mailing ; dri-devel Subject: Re: [bug] Radeon 3900XT not switch to graphic mode on kernel 5.10 On Sun, 27 Dec 2020 at 21:39, Mikhail Gavrilov wrote: > I suppose the root of cause my problem here: > > [3.961326] amdgpu :0b:00.0: Direct firmware load for > amdgpu/sienna_cichlid_sos.bin failed with error -2 > [3.961359] amdgpu :0b:00.0: amdgpu: failed to init sos firmware > [3.961433] [drm:psp_sw_init [amdgpu]] *ERROR* Failed to load psp firmware! > [3.961529] [drm:amdgpu_device_init.cold [amdgpu]] *ERROR* sw_init > of IP block failed -2 > [3.961549] amdgpu :0b:00.0: amdgpu: amdgpu_device_ip_init failed > [3.961569] amdgpu :0b:00.0: amdgpu: Fatal error during GPU init > [3.961911] amdgpu: probe of :0b:00.0 failed with error -2 > # dnf provides */sienna_cichlid_sos.bin Last metadata expiration check: 3:01:27 ago on Sun 27 Dec 2020 06:53:25 PM +05. linux-firmware-20201218-116.fc34.noarch : Firmware files used by the Linux kernel Repo: @System Matched from: Filename: /usr/lib/firmware/amdgpu/sienna_cichlid_sos.bin linux-firmware-20201218-116.fc34.noarch : Firmware files used by the Linux kernel Repo: rawhide Matched from: Filename: /usr/lib/firmware/amdgpu/sienna_cichlid_sos.bin # dnf install linux-firmware-20201218-116.fc34.noarch Last metadata expiration check: 3:02:11 ago on Sun 27 Dec 2020 06:53:25 PM +05. Package linux-firmware-20201218-116.fc34.noarch is already installed. Dependencies resolved. Nothing to do. Complete! Looks like firmware is present. So I didn't understand why the kernel cannot read firmware. -- Best Regards, Mike Gavrilov. ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Cf76668be26de4be7d0af08d8aa88a8dc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637446851228684932%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=NOQO9oeX9gOmM7aOThep5kjURTTn14N5nNkhGx7rofQ%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH AUTOSEL 5.4 006/130] drm/amd/display: Do not silently accept DCC for multiplane formats.
[AMD Public Use] I don't know if these fixes related to modifiers make sense in the pre-modifier code base. Bas, Nick? Alex From: amd-gfx on behalf of Sasha Levin Sent: Tuesday, December 22, 2020 9:16 PM To: linux-ker...@vger.kernel.org ; sta...@vger.kernel.org Cc: Sasha Levin ; dri-de...@lists.freedesktop.org ; amd-gfx@lists.freedesktop.org ; Bas Nieuwenhuizen ; Deucher, Alexander ; Kazlauskas, Nicholas Subject: [PATCH AUTOSEL 5.4 006/130] drm/amd/display: Do not silently accept DCC for multiplane formats. From: Bas Nieuwenhuizen [ Upstream commit b35ce7b364ec80b54f48a8fdf9fb74667774d2da ] Silently accepting it could result in corruption. Signed-off-by: Bas Nieuwenhuizen Reviewed-by: Alex Deucher Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index d2dd387c95d86..ce70c42a2c3ec 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2734,7 +2734,7 @@ fill_plane_dcc_attributes(struct amdgpu_device *adev, return 0; if (format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN) - return 0; + return -EINVAL; if (!dc->cap_funcs.get_dcc_compression_cap) return -EINVAL; -- 2.27.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Cfb9f2581393f494acd1708d8a6e905fc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C63744286704415%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ZYz1FjTl6SoWX1B91t0McdUai%2FzRF9C8uBmE%2BNQNod4%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: drop psp ih programming for sriov guest on navi
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: amd-gfx on behalf of Hawking Zhang Sent: Tuesday, December 22, 2020 6:10 AM To: amd-gfx@lists.freedesktop.org ; Sierra Guiza, Alejandro (Alex) ; Jian, Jane Cc: Zhang, Hawking Subject: [PATCH] drm/amdgpu: drop psp ih programming for sriov guest on navi the psp access ih path is not needed in navi Signed-off-by: Hawking Zhang Change-Id: Ib68bfb1b13e1cec03ec27bc9a867e2b37fc2fc8a --- drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c index 060357625504..f4e4040bbd25 100644 --- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c +++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c @@ -151,14 +151,7 @@ static int navi10_ih_toggle_ring_interrupts(struct amdgpu_device *adev, /* enable_intr field is only valid in ring0 */ if (ih == &adev->irq.ih) tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, ENABLE_INTR, (enable ? 1 : 0)); - if (amdgpu_sriov_vf(adev)) { - if (psp_reg_program(&adev->psp, ih_regs->psp_reg_id, tmp)) { - dev_err(adev->dev, "PSP program IH_RB_CNTL failed!\n"); - return -ETIMEDOUT; - } - } else { - WREG32(ih_regs->ih_rb_cntl, tmp); - } + WREG32(ih_regs->ih_rb_cntl, tmp); if (enable) { ih->enabled = true; @@ -268,14 +261,7 @@ static int navi10_ih_enable_ring(struct amdgpu_device *adev, tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_ENABLE, 0); tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, RB_FULL_DRAIN_ENABLE, 1); } - if (amdgpu_sriov_vf(adev)) { - if (psp_reg_program(&adev->psp, ih_regs->psp_reg_id, tmp)) { - dev_err(adev->dev, "PSP program IH_RB_CNTL failed!\n"); - return -ETIMEDOUT; - } - } else { - WREG32(ih_regs->ih_rb_cntl, tmp); - } + WREG32(ih_regs->ih_rb_cntl, tmp); if (ih == &adev->irq.ih) { /* set the ih ring 0 writeback address whether it's enabled or not */ -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C5cf4dad458df44a5212e08d8a66a3f36%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637442322548665184%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=sadpoKT2ULD1eTcp8%2Bd3UCklVDIEji07YXGokQAlkaM%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/display: Fix memory leaks in S3 resume
[AMD Official Use Only - Internal Distribution Only] This leak is still present. Can we get this applied? Acked-by: Alex Deucher From: Wang, Chao-kai (Stylon) Sent: Tuesday, November 10, 2020 2:49 AM To: amd-gfx@lists.freedesktop.org Cc: Wang, Chao-kai (Stylon) ; Kazlauskas, Nicholas ; Deucher, Alexander ; Wentland, Harry Subject: [PATCH] drm/amd/display: Fix memory leaks in S3 resume EDID parsing in S3 resume pushes new display modes to probed_modes list but doesn't consolidate to actual mode list. This creates a race condition when amdgpu_dm_connector_ddc_get_modes() re-initializes the list head without walking the list and results in memory leak. Signed-off-by: Stylon Wang --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 0b6adf23d316..715e0bd489f8 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2337,7 +2337,8 @@ void amdgpu_dm_update_connector_after_detect( drm_connector_update_edid_property(connector, aconnector->edid); - drm_add_edid_modes(connector, aconnector->edid); + aconnector->num_modes = drm_add_edid_modes(connector, aconnector->edid); + drm_connector_list_update(connector); if (aconnector->dc_link->aux_mode) drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux, -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/2] drm/amd/display: enable idle optimizations for linux (MALL stutter)
[AMD Public Use] Can we drop the Kconfig? With that, the series is: Acked-by: Alex Deucher From: Bhawanpreet Lakha Sent: Thursday, December 17, 2020 11:54 AM To: Kazlauskas, Nicholas ; Deucher, Alexander Cc: amd-gfx@lists.freedesktop.org ; Lakha, Bhawanpreet ; Kazlauskas, Nicholas Subject: [PATCH 2/2] drm/amd/display: enable idle optimizations for linux (MALL stutter) [Why] We can only use this feature when the display is idle. When active vblank irq count is 0 we know all the displays are idle. [How] -Add a active vblank irq counter -Update the counter when we enable/disable vblank irq -if vblank irq count is 0 we can consider mall stutter Change-Id: Ib1e14a84ee2e8c6e057072128693449665012584 Signed-off-by: Bhawanpreet Lakha Acked-by: Alex Deucher Reviewed-by: Nick Kazlauskas --- drivers/gpu/drm/amd/display/Kconfig | 6 + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 22 +++ .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 9 drivers/gpu/drm/amd/display/dc/dc.h | 3 +++ 4 files changed, 40 insertions(+) diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig index 797b5d4b43e5..2444e664c7ee 100644 --- a/drivers/gpu/drm/amd/display/Kconfig +++ b/drivers/gpu/drm/amd/display/Kconfig @@ -23,6 +23,12 @@ config DRM_AMD_DC_HDCP help Choose this option if you want to support HDCP authentication. +config DRM_AMD_DC_MALL + bool "Enable MALL support" + depends on DRM_AMD_DC + help + Choose this option if you want to support MALL + config DRM_AMD_DC_SI bool "AMD DC support for Southern Islands ASICs" default n diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index a78ec16418b3..080f2a52cfed 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5479,6 +5479,7 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable) struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); struct amdgpu_device *adev = drm_to_adev(crtc->dev); struct dm_crtc_state *acrtc_state = to_dm_crtc_state(crtc->state); + struct amdgpu_display_manager *dm = &adev->dm; int rc = 0; if (enable) { @@ -5494,7 +5495,28 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable) return rc; irq_source = IRQ_TYPE_VBLANK + acrtc->otg_inst; +#if defined(CONFIG_DRM_AMD_DC_MALL) + + if (!dc_interrupt_set(adev->dm.dc, irq_source, enable)) + return -EBUSY; + + mutex_lock(&dm->dc_lock); + + if (enable) + dm->active_vblank_irq_count++; + else + dm->active_vblank_irq_count--; + + dc_allow_idle_optimizations( + adev->dm.dc, dm->active_vblank_irq_count == 0 ? true : false); + + DRM_DEBUG_DRIVER("Allow idle optimizations (MALL): %d\n", dm->active_vblank_irq_count == 0); + mutex_unlock(&dm->dc_lock); + + return 0; +#else return dc_interrupt_set(adev->dm.dc, irq_source, enable) ? 0 : -EBUSY; +#endif } static int dm_enable_vblank(struct drm_crtc *crtc) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h index 251af783f6b1..cab44bbd2e35 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h @@ -336,6 +336,15 @@ struct amdgpu_display_manager { */ const struct gpu_info_soc_bounding_box_v1_0 *soc_bounding_box; +#if defined(CONFIG_DRM_AMD_DC_MALL) + /** +* @active_vblank_irq_count +* +* number of currently active vblank irqs +*/ + uint32_t active_vblank_irq_count; +#endif + #ifdef CONFIG_DEBUG_FS /* set the crc calculation window*/ struct drm_property *crc_win_x_start_property; diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index 33642566bcb2..9d245033eb3d 100644 --- a/drivers/gpu/drm/amd/display/dc/dc.h +++ b/drivers/gpu/drm/amd/display/dc/dc.h @@ -504,6 +504,9 @@ struct dc_debug_options { bool dmcub_emulation; #if defined(CONFIG_DRM_AMD_DC_DCN) bool disable_idle_power_optimizations; +#endif +#ifdef CONFIG_DRM_AMD_DC_MALL + unsigned int mall_size_override; #endif bool dmub_command_table; /* for testing only */ struct dc_bw_validation_profile bw_val_profile; -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: set mode1 reset as default for dimgrey_cavefish
[AMD Official Use Only - Internal Distribution Only] You will also need to add the asic_type to amdgpu_device_should_recover_gpu() if you the driver to actually use GPU reset when it encounters a hang. Alex From: amd-gfx on behalf of Chen, Jiansong (Simon) Sent: Tuesday, December 15, 2020 5:33 AM To: Zhou1, Tao ; Gui, Jack ; Zhang, Hawking ; amd-gfx@lists.freedesktop.org Subject: RE: [PATCH] drm/amdgpu: set mode1 reset as default for dimgrey_cavefish [AMD Official Use Only - Internal Distribution Only] [AMD Official Use Only - Internal Distribution Only] Reviewed-by: Jiansong Chen -Original Message- From: Zhou1, Tao Sent: Tuesday, December 15, 2020 6:23 PM To: Chen, Jiansong (Simon) ; Gui, Jack ; Zhang, Hawking ; amd-gfx@lists.freedesktop.org Cc: Zhou1, Tao Subject: [PATCH] drm/amdgpu: set mode1 reset as default for dimgrey_cavefish Use mode1 reset for dimgrey_cavefish by default. Signed-off-by: Tao Zhou --- drivers/gpu/drm/amd/amdgpu/nv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index ac02dd707c44..6bee3677394a 100644 --- a/drivers/gpu/drm/amd/amdgpu/nv.c +++ b/drivers/gpu/drm/amd/amdgpu/nv.c @@ -362,6 +362,7 @@ nv_asic_reset_method(struct amdgpu_device *adev) switch (adev->asic_type) { case CHIP_SIENNA_CICHLID: case CHIP_NAVY_FLOUNDER: +case CHIP_DIMGREY_CAVEFISH: return AMD_RESET_METHOD_MODE1; default: if (smu_baco_is_support(smu)) -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Cb3da8467a171425a6cf208d8a0e4d612%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637436252010819826%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=fr8uXVyoVz5WlYtYPRbKm1%2BN0ROBWuLuqPOuL3%2BHC0E%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: skip vram operation for BAMACO runtime
[AMD Public Use] Instead of checking the global parameters everywhere, let's check the runtime pm parameter and then set a local adev variable per device. That way we can have a mix of devices that support different runtime pm modes in the same system and everything works. Alex From: amd-gfx on behalf of Likun Gao Sent: Friday, December 11, 2020 4:04 AM To: amd-gfx@lists.freedesktop.org Cc: Gao, Likun ; Feng, Kenneth ; Zhang, Hawking Subject: [PATCH] drm/amdgpu: skip vram operation for BAMACO runtime From: Likun Gao Skip vram related operation for bamaco rumtime suspend and resume as vram is alive when BAMACO. It can save about 32ms when suspend and about 15ms when resume. Signed-off-by: Likun Gao Change-Id: I6ad39765de5ed1aac2dc51e96ed7a21a727272cd --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c| 72 +- 2 files changed, 50 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 0ec7c28c4d5a..66b790dfb151 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2464,7 +2464,8 @@ static int amdgpu_device_ip_late_init(struct amdgpu_device *adev) amdgpu_device_set_cg_state(adev, AMD_CG_STATE_GATE); amdgpu_device_set_pg_state(adev, AMD_PG_STATE_GATE); - amdgpu_device_fill_reset_magic(adev); + if ((amdgpu_runtime_pm != 2) || !adev->in_runpm) + amdgpu_device_fill_reset_magic(adev); r = amdgpu_device_enable_mgpu_fan_boost(); if (r) @@ -3706,7 +3707,8 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) amdgpu_amdkfd_suspend(adev, !fbcon); /* evict vram memory */ - amdgpu_bo_evict_vram(adev); + if ((amdgpu_runtime_pm != 2) || !adev->in_runpm) + amdgpu_bo_evict_vram(adev); amdgpu_fence_driver_suspend(adev); @@ -3718,7 +3720,8 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) * This second call to evict vram is to evict the gart page table * using the CPU. */ - amdgpu_bo_evict_vram(adev); + if ((amdgpu_runtime_pm != 2) || !adev->in_runpm) + amdgpu_bo_evict_vram(adev); return 0; } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 523d22db094b..67e74b43a1ab 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -397,10 +397,12 @@ static int psp_tmr_init(struct psp_context *psp) } } - pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL; - ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE, + if ((amdgpu_runtime_pm != 2) || !psp->adev->in_runpm) { + pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL; + ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE, AMDGPU_GEM_DOMAIN_VRAM, &psp->tmr_bo, &psp->tmr_mc_addr, pptr); + } return ret; } @@ -504,8 +506,10 @@ static int psp_tmr_terminate(struct psp_context *psp) return ret; /* free TMR memory buffer */ - pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL; - amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, pptr); + if ((amdgpu_runtime_pm != 2) || !psp->adev->in_runpm) { + pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL; + amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, pptr); + } return 0; } @@ -795,9 +799,10 @@ int psp_xgmi_terminate(struct psp_context *psp) psp->xgmi_context.initialized = 0; /* free xgmi shared memory */ - amdgpu_bo_free_kernel(&psp->xgmi_context.xgmi_shared_bo, - &psp->xgmi_context.xgmi_shared_mc_addr, - &psp->xgmi_context.xgmi_shared_buf); + if ((amdgpu_runtime_pm != 2) || !psp->adev->in_runpm) + amdgpu_bo_free_kernel(&psp->xgmi_context.xgmi_shared_bo, + &psp->xgmi_context.xgmi_shared_mc_addr, + &psp->xgmi_context.xgmi_shared_buf); return 0; } @@ -812,7 +817,8 @@ int psp_xgmi_initialize(struct psp_context *psp) !psp->adev->psp.ta_xgmi_start_addr) return -ENOENT; - if (!psp->xgmi_context.initialized) { + if (!psp->xgmi_context.initialized && + ((amdgpu_runtime_pm != 2) || !psp->adev->in_runpm)) { ret = psp_xgmi_init_shared_buf(psp); if (ret) return ret; @@ -1122,9 +1128,10 @@ static int psp_ras_terminate(struct psp_context *psp) psp->ras.ras_initialized = false; /* free ras shared memory */ - amdgpu_bo
Re: [V2] drm/amdgpu: add judgement for suspend/resume sequence
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Likun Gao Sent: Friday, December 11, 2020 4:01 AM To: amd-gfx@lists.freedesktop.org Cc: Gao, Likun ; Feng, Kenneth ; Zhang, Hawking Subject: [V2] drm/amdgpu: add judgement for suspend/resume sequence From: Likun Gao S0ix only makes sense on APUs since they are part of the platform, so only when the ASIC is APU should set amdgpu_acpi_is_s0ix_supported flag to deal with the related situation. Signed-off-by: Likun Gao Change-Id: Ic89df206734fa7e6ce3e5a784171f149a07edc80 --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 8 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 83ac06a3ec05..eed5410947e9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1314,11 +1314,11 @@ int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev); void amdgpu_acpi_get_backlight_caps(struct amdgpu_device *adev, struct amdgpu_dm_backlight_caps *caps); -bool amdgpu_acpi_is_s0ix_supported(void); +bool amdgpu_acpi_is_s0ix_supported(struct amdgpu_device *adev); #else static inline int amdgpu_acpi_init(struct amdgpu_device *adev) { return 0; } static inline void amdgpu_acpi_fini(struct amdgpu_device *adev) { } -static inline bool amdgpu_acpi_is_s0ix_supported(void) { return false; } +static inline bool amdgpu_acpi_is_s0ix_supported(struct amdgpu_device *adev) { return false; } #endif int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index fd66ac00c7f5..8155c54392c8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -901,10 +901,12 @@ void amdgpu_acpi_fini(struct amdgpu_device *adev) * * returns true if supported, false if not. */ -bool amdgpu_acpi_is_s0ix_supported() +bool amdgpu_acpi_is_s0ix_supported(struct amdgpu_device *adev) { - if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) - return true; + if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) { + if (adev->flags & AMD_IS_APU) + return true; + } return false; } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 52d6f1fbe890..66b790dfb151 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2651,7 +2651,7 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev) { int i, r; - if (!amdgpu_acpi_is_s0ix_supported() || amdgpu_in_reset(adev)) { + if (!amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev)) { amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE); amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE); } @@ -3712,7 +3712,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) amdgpu_fence_driver_suspend(adev); - if (!amdgpu_acpi_is_s0ix_supported() || amdgpu_in_reset(adev)) + if (!amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev)) r = amdgpu_device_ip_suspend_phase2(adev); else amdgpu_gfx_state_change_set(adev, sGpuChangeState_D3Entry); @@ -3747,7 +3747,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon) if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) return 0; - if (amdgpu_acpi_is_s0ix_supported()) + if (amdgpu_acpi_is_s0ix_supported(adev)) amdgpu_gfx_state_change_set(adev, sGpuChangeState_D0Entry); /* post card */ -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Cf91d4568bfcc442e773808d89db36073%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637432741044140311%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=sxM%2BF4tq7x73lRdc%2FftMGE8yrN%2BoBgs3syxFoK0q8Cc%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu/sdma5.2: soft reset sdma blocks before setup and start sdma
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: amd-gfx on behalf of Xiaomeng Hou Sent: Thursday, December 10, 2020 7:59 AM To: amd-gfx@lists.freedesktop.org Cc: Gao, Likun ; Huang, Ray ; Hou, Xiaomeng (Matthew) Subject: [PATCH] drm/amdgpu/sdma5.2: soft reset sdma blocks before setup and start sdma Without doing the soft reset, register mmSDMA0_GFX_RB_WPTR's value could not be reset to 0 when sdma block resumes. That would cause the ring buffer's read and write pointers not equal and ring test fail. So add the soft reset step. Signed-off-by: Xiaomeng Hou --- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 39 +- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c index 39e17aae655f..5acc1e589672 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c @@ -807,6 +807,37 @@ static int sdma_v5_2_load_microcode(struct amdgpu_device *adev) return 0; } +static int sdma_v5_2_soft_reset(void *handle) +{ + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + u32 grbm_soft_reset = 0; + u32 tmp; + int i; + + for (i = 0; i < adev->sdma.num_instances; i++) { + grbm_soft_reset = REG_SET_FIELD(grbm_soft_reset, + GRBM_SOFT_RESET, SOFT_RESET_SDMA0, + 1); + grbm_soft_reset <<= i; + + tmp = RREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET); + tmp |= grbm_soft_reset; + DRM_DEBUG("GRBM_SOFT_RESET=0x%08X\n", tmp); + WREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET, tmp); + tmp = RREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET); + + udelay(50); + + tmp &= ~grbm_soft_reset; + WREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET, tmp); + tmp = RREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET); + + udelay(50); + } + + return 0; +} + /** * sdma_v5_2_start - setup and start the async dma engines * @@ -838,6 +869,7 @@ static int sdma_v5_2_start(struct amdgpu_device *adev) msleep(1000); } + sdma_v5_2_soft_reset(adev); /* unhalt the MEs */ sdma_v5_2_enable(adev, true); /* enable sdma ring preemption */ @@ -1366,13 +1398,6 @@ static int sdma_v5_2_wait_for_idle(void *handle) return -ETIMEDOUT; } -static int sdma_v5_2_soft_reset(void *handle) -{ - /* todo */ - - return 0; -} - static int sdma_v5_2_ring_preempt_ib(struct amdgpu_ring *ring) { int i, r = 0; -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Cc7ed271775544123bb2208d89d0b9af3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637432020727843101%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=JueaOw9nYtG2XJj1se7uYlKZomuBTa8NnGeVVZzC9Tw%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/pm: add deep sleep control for uclk and fclk
[AMD Public Use] Reviewed-by: Alex Deucher From: Quan, Evan Sent: Thursday, December 10, 2020 3:44 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH] drm/amd/pm: add deep sleep control for uclk and fclk These are supported by Sienna Cichlid and should be taken into consideration during DS control. Change-Id: I93ed67ae863a91b75d6dfecd87e74029ffafd302 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c index 45ecd0386e9f..0372cb83cdd9 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c @@ -2087,6 +2087,22 @@ int smu_v11_0_deep_sleep_control(struct smu_context *smu, } } + if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_DS_UCLK_BIT)) { + ret = smu_cmn_feature_set_enabled(smu, SMU_FEATURE_DS_UCLK_BIT, enablement); + if (ret) { + dev_err(adev->dev, "Failed to %s UCLK DS!\n", enablement ? "enable" : "disable"); + return ret; + } + } + + if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_DS_FCLK_BIT)) { + ret = smu_cmn_feature_set_enabled(smu, SMU_FEATURE_DS_FCLK_BIT, enablement); + if (ret) { + dev_err(adev->dev, "Failed to %s FCLK DS!\n", enablement ? "enable" : "disable"); + return ret; + } + } + if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_DS_SOCCLK_BIT)) { ret = smu_cmn_feature_set_enabled(smu, SMU_FEATURE_DS_SOCCLK_BIT, enablement); if (ret) { -- 2.29.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/2] drm/amd/pm: update the data strucutre for SMU metrics exchange
[AMD Public Use] Series is: Reviewed-by: Alex Deucher From: Quan, Evan Sent: Thursday, December 10, 2020 2:10 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH 2/2] drm/amd/pm: update the data strucutre for SMU metrics exchange This is needed for Sienna Cichlid. Change-Id: I57aa099cd1b2020cf0c8b05d8463239ec33790cf Signed-off-by: Evan Quan --- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 75 ++- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c index acbf6e97ffd0..0c4885273291 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c @@ -515,7 +515,7 @@ static int sienna_cichlid_tables_init(struct smu_context *smu) PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); SMU_TABLE_INIT(tables, SMU_TABLE_WATERMARKS, sizeof(Watermarks_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), + SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetricsExternal_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); SMU_TABLE_INIT(tables, SMU_TABLE_I2C_COMMANDS, sizeof(SwI2cRequest_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); @@ -527,7 +527,7 @@ static int sienna_cichlid_tables_init(struct smu_context *smu) sizeof(DpmActivityMonitorCoeffIntExternal_t), PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); - smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL); + smu_table->metrics_table = kzalloc(sizeof(SmuMetricsExternal_t), GFP_KERNEL); if (!smu_table->metrics_table) goto err0_out; smu_table->metrics_time = 0; @@ -556,7 +556,8 @@ static int sienna_cichlid_get_smu_metrics_data(struct smu_context *smu, uint32_t *value) { struct smu_table_context *smu_table= &smu->smu_table; - SmuMetrics_t *metrics = (SmuMetrics_t *)smu_table->metrics_table; + SmuMetrics_t *metrics = + &(((SmuMetricsExternal_t *)(smu_table->metrics_table))->SmuMetrics); int ret = 0; mutex_lock(&smu->metrics_lock); @@ -3152,52 +3153,54 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu, struct smu_table_context *smu_table = &smu->smu_table; struct gpu_metrics_v1_0 *gpu_metrics = (struct gpu_metrics_v1_0 *)smu_table->gpu_metrics_table; - SmuMetrics_t metrics; + SmuMetricsExternal_t metrics_external; + SmuMetrics_t *metrics = + &(metrics_external.SmuMetrics); int ret = 0; ret = smu_cmn_get_metrics_table(smu, - &metrics, + &metrics_external, true); if (ret) return ret; smu_v11_0_init_gpu_metrics_v1_0(gpu_metrics); - gpu_metrics->temperature_edge = metrics.TemperatureEdge; - gpu_metrics->temperature_hotspot = metrics.TemperatureHotspot; - gpu_metrics->temperature_mem = metrics.TemperatureMem; - gpu_metrics->temperature_vrgfx = metrics.TemperatureVrGfx; - gpu_metrics->temperature_vrsoc = metrics.TemperatureVrSoc; - gpu_metrics->temperature_vrmem = metrics.TemperatureVrMem0; + gpu_metrics->temperature_edge = metrics->TemperatureEdge; + gpu_metrics->temperature_hotspot = metrics->TemperatureHotspot; + gpu_metrics->temperature_mem = metrics->TemperatureMem; + gpu_metrics->temperature_vrgfx = metrics->TemperatureVrGfx; + gpu_metrics->temperature_vrsoc = metrics->TemperatureVrSoc; + gpu_metrics->temperature_vrmem = metrics->TemperatureVrMem0; - gpu_metrics->average_gfx_activity = metrics.AverageGfxActivity; - gpu_metrics->average_umc_activity = metrics.AverageUclkActivity; - gpu_metrics->average_mm_activity = metrics.VcnActivityPercentage; + gpu_metrics->average_gfx_activity = metrics->AverageGfxActivity; + gpu_metrics->average_umc_activity = metrics->AverageUclkActivity; + gpu_metrics->average_mm_activity = metrics->VcnActivityPercentage; - gpu_metrics->average_socket_power = metrics.AverageSocketPower; - gpu_metrics->energy_accumulator = metrics.EnergyAccumulator; + gpu_metrics->average_socket_power = metrics->AverageSocketPower; + gpu_metrics->energy_accumulator = metrics->EnergyAccumulator; - if (metrics.AverageGfxActivity <= SM
Re: [PATCH] drm/amd/pm: typo fix (CUSTOM -> COMPUTE)
[AMD Public Use] Reviewed-by: Alex Deucher From: Quan, Evan Sent: Wednesday, December 9, 2020 3:37 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH] drm/amd/pm: typo fix (CUSTOM -> COMPUTE) The "COMPUTE" was wrongly spelled as "CUSTOM". Change-Id: I44a6c93ea8badec2af883eb5b39261789baba036 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c index 3fb70cac72ea..23d0dc31789f 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c @@ -220,7 +220,7 @@ static struct cmn2asic_mapping sienna_cichlid_workload_map[PP_SMC_POWER_PROFILE_ WORKLOAD_MAP(PP_SMC_POWER_PROFILE_POWERSAVING, WORKLOAD_PPLIB_POWER_SAVING_BIT), WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VIDEO, WORKLOAD_PPLIB_VIDEO_BIT), WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VR, WORKLOAD_PPLIB_VR_BIT), - WORKLOAD_MAP(PP_SMC_POWER_PROFILE_COMPUTE, WORKLOAD_PPLIB_CUSTOM_BIT), + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_COMPUTE, WORKLOAD_PPLIB_COMPUTE_BIT), WORKLOAD_MAP(PP_SMC_POWER_PROFILE_CUSTOM, WORKLOAD_PPLIB_CUSTOM_BIT), }; -- 2.29.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/pm: fulfill the sienna cichlid UMD PSTATE profiling clocks
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: Quan, Evan Sent: Wednesday, December 9, 2020 1:35 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH] drm/amd/pm: fulfill the sienna cichlid UMD PSTATE profiling clocks Fulfill the UMD PSTATE profiling clocks of sienna cichlid. Change-Id: Ib9078c73d3fbd786080449255645ae8b9f879092 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 6 ++ drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.h | 4 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c index 74cf027e4a41..3fb70cac72ea 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c @@ -1341,12 +1341,18 @@ static int sienna_cichlid_populate_umd_state_clk(struct smu_context *smu) pstate_table->gfxclk_pstate.min = gfx_table->min; pstate_table->gfxclk_pstate.peak = gfx_table->max; + if (gfx_table->max >= SIENNA_CICHLID_UMD_PSTATE_PROFILING_GFXCLK) + pstate_table->gfxclk_pstate.standard = SIENNA_CICHLID_UMD_PSTATE_PROFILING_GFXCLK; pstate_table->uclk_pstate.min = mem_table->min; pstate_table->uclk_pstate.peak = mem_table->max; + if (mem_table->max >= SIENNA_CICHLID_UMD_PSTATE_PROFILING_MEMCLK) + pstate_table->uclk_pstate.standard = SIENNA_CICHLID_UMD_PSTATE_PROFILING_MEMCLK; pstate_table->socclk_pstate.min = soc_table->min; pstate_table->socclk_pstate.peak = soc_table->max; + if (soc_table->max >= SIENNA_CICHLID_UMD_PSTATE_PROFILING_SOCCLK) + pstate_table->socclk_pstate.standard = SIENNA_CICHLID_UMD_PSTATE_PROFILING_SOCCLK; return 0; } diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.h b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.h index 57e120c440ea..38cd0ece24f6 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.h +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.h @@ -29,6 +29,10 @@ typedef enum { POWER_SOURCE_COUNT, } POWER_SOURCE_e; +#define SIENNA_CICHLID_UMD_PSTATE_PROFILING_GFXCLK1825 +#define SIENNA_CICHLID_UMD_PSTATE_PROFILING_SOCCLK960 +#define SIENNA_CICHLID_UMD_PSTATE_PROFILING_MEMCLK1000 + extern void sienna_cichlid_set_ppt_funcs(struct smu_context *smu); #endif -- 2.29.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/pm: update smu10.h WORKLOAD_PPLIB setting for raven
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: amd-gfx on behalf of Changfeng.Zhu Sent: Tuesday, December 8, 2020 9:06 PM To: amd-gfx@lists.freedesktop.org ; Huang, Ray Cc: Zhu, Changfeng Subject: [PATCH] drm/amd/pm: update smu10.h WORKLOAD_PPLIB setting for raven From: changzhu From: Changfeng When using old WORKLOAD_PPLIB setting in smu10.h, there is problem that it can't be able to switch to mak gpu clk during compute workload. It needs to update WORKLOAD_PPLIB setting to fix this issue. Change-Id: Id2160a7b4a6cb8808d100de25e999714a7ccaebd Signed-off-by: Changfeng --- drivers/gpu/drm/amd/pm/inc/smu10.h | 14 ++ .../gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 9 +++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/inc/smu10.h b/drivers/gpu/drm/amd/pm/inc/smu10.h index b96520528240..9e837a5014c5 100644 --- a/drivers/gpu/drm/amd/pm/inc/smu10.h +++ b/drivers/gpu/drm/amd/pm/inc/smu10.h @@ -136,14 +136,12 @@ #define FEATURE_CORE_CSTATES_MASK (1 << FEATURE_CORE_CSTATES_BIT) /* Workload bits */ -#define WORKLOAD_DEFAULT_BIT 0 -#define WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT 1 -#define WORKLOAD_PPLIB_POWER_SAVING_BIT 2 -#define WORKLOAD_PPLIB_VIDEO_BIT 3 -#define WORKLOAD_PPLIB_VR_BIT 4 -#define WORKLOAD_PPLIB_COMPUTE_BIT5 -#define WORKLOAD_PPLIB_CUSTOM_BIT 6 -#define WORKLOAD_PPLIB_COUNT 7 +#define WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT 0 +#define WORKLOAD_PPLIB_VIDEO_BIT 2 +#define WORKLOAD_PPLIB_VR_BIT 3 +#define WORKLOAD_PPLIB_COMPUTE_BIT4 +#define WORKLOAD_PPLIB_CUSTOM_BIT 5 +#define WORKLOAD_PPLIB_COUNT 6 typedef struct { /* MP1_EXT_SCRATCH0 */ diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c index 04226b1544e4..e57e64bbacdc 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c @@ -1298,15 +1298,9 @@ static int conv_power_profile_to_pplib_workload(int power_profile) int pplib_workload = 0; switch (power_profile) { - case PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT: - pplib_workload = WORKLOAD_DEFAULT_BIT; - break; case PP_SMC_POWER_PROFILE_FULLSCREEN3D: pplib_workload = WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT; break; - case PP_SMC_POWER_PROFILE_POWERSAVING: - pplib_workload = WORKLOAD_PPLIB_POWER_SAVING_BIT; - break; case PP_SMC_POWER_PROFILE_VIDEO: pplib_workload = WORKLOAD_PPLIB_VIDEO_BIT; break; @@ -1316,6 +1310,9 @@ static int conv_power_profile_to_pplib_workload(int power_profile) case PP_SMC_POWER_PROFILE_COMPUTE: pplib_workload = WORKLOAD_PPLIB_COMPUTE_BIT; break; + case PP_SMC_POWER_PROFILE_CUSTOM: + pplib_workload = WORKLOAD_PPLIB_CUSTOM_BIT; + break; } return pplib_workload; -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C2f57b9a4012a424d574908d89be7299b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637430764514589029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=OWntFjcijTjJa0Qrsi7YTvrEWQcIXM8dHsXxhOaKsng%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/display: Drop unnecessary function call
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Rodrigo Siqueira Sent: Monday, December 7, 2020 5:55 PM To: Wentland, Harry ; Kazlauskas, Nicholas ; Pillai, Aurabindo Cc: amd-gfx@lists.freedesktop.org Subject: [PATCH] drm/amd/display: Drop unnecessary function call After refactor our amdgpu_dm_atomic_commit, this function only invoke drm_atomic_helper_commit. For this reason, this commit drops amdgpu_dm_atomic_commit and add drm_atomic_helper_commit directly in the atomic_commit hook. Signed-off-by: Rodrigo Siqueira --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c| 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index a37948f2e596..c89066b1c471 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2212,7 +2212,7 @@ static const struct drm_mode_config_funcs amdgpu_dm_mode_funcs = { .get_format_info = amd_get_format_info, .output_poll_changed = drm_fb_helper_output_poll_changed, .atomic_check = amdgpu_dm_atomic_check, - .atomic_commit = amdgpu_dm_atomic_commit, + .atomic_commit = drm_atomic_helper_commit, }; static struct drm_mode_config_helper_funcs amdgpu_dm_mode_config_helperfuncs = { @@ -8158,20 +8158,6 @@ static void amdgpu_dm_crtc_copy_transient_flags(struct drm_crtc_state *crtc_stat stream_state->mode_changed = drm_atomic_crtc_needs_modeset(crtc_state); } -static int amdgpu_dm_atomic_commit(struct drm_device *dev, - struct drm_atomic_state *state, - bool nonblock) -{ - /* -* Add check here for SoC's that support hardware cursor plane, to -* unset legacy_cursor_update -*/ - - return drm_atomic_helper_commit(dev, state, nonblock); - - /*TODO Handle EINTR, reenable IRQ*/ -} - /** * amdgpu_dm_atomic_commit_tail() - AMDgpu DM's commit tail implementation. * @state: The atomic state to commit -- 2.29.2 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Cbbf5c6ea7e2f4e32d50d08d89b033b75%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637429785490973923%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=V5Wg2XgI9zUCTH0OhTSr3Oky8PTvy8XYIa3eAhVDnlk%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 14/17] drm/amd/display: Enable gpu_vm_support for dcn3.01
[AMD Official Use Only - Internal Distribution Only] We've dropped the CONFIG_DRM_AMD_DC_DCN3* kconfig options recently. Alex From: amd-gfx on behalf of Eryk Brol Sent: Friday, December 4, 2020 4:28 PM To: amd-gfx@lists.freedesktop.org Cc: Liu, Charlene ; Brol, Eryk ; Li, Sun peng (Leo) ; Wentland, Harry ; Zhuo, Qingqing ; Siqueira, Rodrigo ; Pillai, Aurabindo ; Sun, Yongqiang ; Lakha, Bhawanpreet ; R, Bindu Subject: [PATCH 14/17] drm/amd/display: Enable gpu_vm_support for dcn3.01 From: Charlene Liu [Why] dcn3_01 supports gpu_vm, but this is not enabled in amdgpu_dm Signed-off-by: Charlene Liu Reviewed-by: Yongqiang Sun Acked-by: Eryk Brol --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 59f738008734..53a7cb21f603 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1035,6 +1035,11 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) if (ASICREV_IS_GREEN_SARDINE(adev->external_rev_id)) init_data.flags.disable_dmcu = true; break; +#if defined(CONFIG_DRM_AMD_DC_DCN3_01) + case CHIP_VANGOGH: + init_data.flags.gpu_vm_support = true; + break; +#endif default: break; } -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C93575bd3247e42f848bc08d8989bee3e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637427142787650359%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wf2Tl4Qz9IzTZVvfBRYcFHZ8Cr464ZEZ%2B1Pb1GP5W9E%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] tests/amdgpu: Fix a typo
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Alex Deucher libdrm uses gitlab MRs now: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests Alex From: Tuikov, Luben Sent: Monday, November 30, 2020 5:12 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Tuikov, Luben Subject: [PATCH] tests/amdgpu: Fix a typo Fix a typo: "TZM" --> "TMZ" Signed-off-by: Luben Tuikov --- tests/amdgpu/security_tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/amdgpu/security_tests.c b/tests/amdgpu/security_tests.c index 9b39e167..351eac82 100644 --- a/tests/amdgpu/security_tests.c +++ b/tests/amdgpu/security_tests.c @@ -172,7 +172,7 @@ static void amdgpu_sdma_nop(uint32_t *packet, uint32_t nop_count) } /** - * amdgpu_bo_lcopy -- linear copy with TZM set, using sDMA + * amdgpu_bo_lcopy -- linear copy with TMZ set, using sDMA * @dev: AMDGPU device to which both buffer objects belong to * @dst: destination buffer object * @src: source buffer object -- 2.29.2.404.ge67fbf927d ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH v3] drm/amd/amdgpu: set the default value of noretry to 1 for some dGPUs
[AMD Public Use] We need to figure out what the root cause is then. If we can't figure it out soon, we should revert the change for navi1x and continue to debug it until we can find the root cause and we can safely re-enable it. Alex From: Chen, Guchun Sent: Sunday, November 29, 2020 2:22 AM To: Bas Nieuwenhuizen ; Kuehling, Felix Cc: Gui, Jack ; Zhou1, Tao ; amd-gfx mailing list ; Huang, Ray ; Deucher, Alexander ; Zhang, Hawking Subject: RE: [PATCH v3] drm/amd/amdgpu: set the default value of noretry to 1 for some dGPUs [AMD Public Use] Hi Bas Nieuwenhuizen, I don't think direct revert is one right approach, though it's able to fix your problem. noretry=0 will cause other test failure on several ASICs. Regards, Guchun -Original Message- From: amd-gfx On Behalf Of Bas Nieuwenhuizen Sent: Sunday, November 29, 2020 8:38 AM To: Kuehling, Felix Cc: Gui, Jack ; Chen, Guchun ; Zhou1, Tao ; amd-gfx mailing list ; Huang, Ray ; Deucher, Alexander ; Zhang, Hawking Subject: Re: [PATCH v3] drm/amd/amdgpu: set the default value of noretry to 1 for some dGPUs Can we revert this patch to fix https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1374&data=04%7C01%7Cguchun.chen%40amd.com%7C6d626e2a3bae4877024f08d893ff15db%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637422071085800476%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Jxa2V1TuszoBKtF%2FPbIA3YwOrXHgLreBY%2FXej1HTZ4k%3D&reserved=0 ? On Thu, Oct 15, 2020 at 4:30 PM Felix Kuehling wrote: > > Am 2020-10-14 um 11:35 p.m. schrieb Chengming Gui: > > noretry = 0 cause some dGPU's kfd page fault tests fail, so set > > noretry to 1 for these special ASICs: > > vega20/navi10/navi14/ARCTURUS > > > > v2: merge raven and default case due to the same setting > > v3: remove ARCTURUS > > > > Signed-off-by: Chengming Gui > > Change-Id: I3be70f463a49b0cd5c56456431d6c2cb98b13872 > > Acked-by: Felix Kuhling > > > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 23 > > +++ > > 1 file changed, 15 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c > > index 36604d751d62..f26eb4e54b12 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c > > @@ -425,20 +425,27 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device > > *adev) > > struct amdgpu_gmc *gmc = &adev->gmc; > > > > switch (adev->asic_type) { > > - case CHIP_RAVEN: > > - /* Raven currently has issues with noretry > > - * regardless of what we decide for other > > - * asics, we should leave raven with > > - * noretry = 0 until we root cause the > > - * issues. > > + case CHIP_VEGA20: > > + case CHIP_NAVI10: > > + case CHIP_NAVI14: > > + /* > > + * noretry = 0 will cause kfd page fault tests fail > > + * for some ASICs, so set default to 1 for these ASICs. > >*/ > > if (amdgpu_noretry == -1) > > - gmc->noretry = 0; > > + gmc->noretry = 1; > > else > > gmc->noretry = amdgpu_noretry; > > break; > > + case CHIP_RAVEN: > > default: > > - /* default this to 0 for now, but we may want > > + /* Raven currently has issues with noretry > > + * regardless of what we decide for other > > + * asics, we should leave raven with > > + * noretry = 0 until we root cause the > > + * issues. > > + * > > + * default this to 0 for now, but we may want > >* to change this in the future for certain > >* GPUs as it can increase performance in > >* certain cases. > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist > s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cgu > chun.chen%40amd.com%7C6d626e2a3bae4877024f08d893ff15db%7C3dd8961fe4884 > e608e11a82d994e183d%7C0%7C0%7C637422071085800476%7CUnknown%7CTWFpbGZsb > 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D% > 7C1
Re: [PATCH] drm/amd/display: Avoid HDCP initialization in devices without output
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: Siqueira, Rodrigo Sent: Friday, November 20, 2020 8:59 AM To: amd-gfx@lists.freedesktop.org Cc: Wentland, Harry ; Deucher, Alexander Subject: [PATCH] drm/amd/display: Avoid HDCP initialization in devices without output The HDCP feature requires at least one connector attached to the device; however, some GPUs do not have a physical output, making the HDCP initialization irrelevant. This patch disables HDCP initialization when the graphic card does not have output. Signed-off-by: Rodrigo Siqueira --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 1da4ad529309..e213246e3f04 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1109,7 +1109,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) amdgpu_dm_init_color_mod(); #ifdef CONFIG_DRM_AMD_DC_HDCP - if (adev->asic_type >= CHIP_RAVEN) { + if (adev->dm.dc->caps.max_links > 0 && adev->asic_type >= CHIP_RAVEN) { adev->dm.hdcp_workqueue = hdcp_create_workqueue(adev, &init_params.cp_psp, adev->dm.dc); if (!adev->dm.hdcp_workqueue) -- 2.29.2 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/pm: support runtime PPTable update for dimgrey_cavefish
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: amd-gfx on behalf of Tao Zhou Sent: Tuesday, November 17, 2020 2:32 AM To: Chen, Jiansong (Simon) ; Gui, Jack ; Zhang, Hawking ; amd-gfx@lists.freedesktop.org Cc: Zhou1, Tao Subject: [PATCH] drm/amd/pm: support runtime PPTable update for dimgrey_cavefish There is no need to reset DPM for PPTable uploading on dimgrey_cavefish and PMFW can handle it, same as navy_flounder. Signed-off-by: Tao Zhou --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 1904df5a3e20..8e3e7a5bbffe 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -1183,7 +1183,7 @@ static int smu_disable_dpms(struct smu_context *smu) */ if (smu->uploading_custom_pp_table && (adev->asic_type >= CHIP_NAVI10) && - (adev->asic_type <= CHIP_NAVY_FLOUNDER)) + (adev->asic_type <= CHIP_DIMGREY_CAVEFISH)) return 0; /* -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C8cf0d1af536d4d6349bc08d88acb08f2%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637411951942273028%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=UuQ66twRM2QL%2FTXOhEmkjfHH28p96lfLfL5qxJeQG9s%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume
[AMD Official Use Only - Internal Distribution Only] Series is: Reviewed-by: Alex Deucher Does the same thing need to be applied to navy flounder and dimgrey cavefish? Alex From: amd-gfx on behalf of Kenneth Feng Sent: Tuesday, November 17, 2020 8:30 AM To: amd-gfx@lists.freedesktop.org Cc: Feng, Kenneth Subject: [PATCH 2/2] drm/amd/pm: fix the crash after runtime pm resume Some features are still disabled after runtime pm resume. This can take the hardware back. Unlike other projects, this doesn't need pptable retransfer. Signed-off-by: Kenneth Feng --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 39990790ed67..ebd50f144c5d 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -914,11 +914,14 @@ static int smu_smc_hw_setup(struct smu_context *smu) { struct amdgpu_device *adev = smu->adev; uint32_t pcie_gen = 0, pcie_width = 0; - int ret; + int ret = 0; if (adev->in_suspend && smu_is_dpm_running(smu)) { dev_info(adev->dev, "dpm has been enabled\n"); - return 0; + /* this is needed specifically */ + if (adev->asic_type == CHIP_SIENNA_CICHLID) + ret = smu_system_features_control(smu, true); + return ret; } ret = smu_init_display_count(smu, 0); -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Cdd553fd04f0f44ebf3ca08d88afd11ad%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637412166838877500%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=swZeNMubEey64ZdWb7W5sTg88as3VNS9ILwmLb08GHY%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/pm: retire dimgrey_cavefish hardcode for the use of soft PTable
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: amd-gfx on behalf of Tao Zhou Sent: Monday, November 16, 2020 10:31 PM To: Chen, Jiansong (Simon) ; Gui, Jack ; Zhang, Hawking ; amd-gfx@lists.freedesktop.org Cc: Zhou1, Tao Subject: [PATCH] drm/amd/pm: retire dimgrey_cavefish hardcode for the use of soft PTable The PPTable provided by VBIOS can be used. Signed-off-by: Tao Zhou --- drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c index b23311096467..d5fa0d9dd7eb 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c @@ -339,8 +339,7 @@ int smu_v11_0_setup_pptable(struct smu_context *smu) hdr = (const struct smc_firmware_header_v1_0 *) adev->pm.fw->data; version_major = le16_to_cpu(hdr->header.header_version_major); version_minor = le16_to_cpu(hdr->header.header_version_minor); - if ((version_major == 2 && smu->smu_table.boot_values.pp_table_id > 0) || - adev->asic_type == CHIP_DIMGREY_CAVEFISH) { + if (version_major == 2 && smu->smu_table.boot_values.pp_table_id > 0) { dev_info(adev->dev, "use driver provided pptable %d\n", smu->smu_table.boot_values.pp_table_id); switch (version_minor) { case 0: -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Cccfce44c5e5843177c7a08d88aa95ec3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637411807349472302%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8bUpARFZbEDD9hF2ksu32HtFV6BdQTkPcYxMlFR33rM%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/2] drm/amdgpu: Enable TA firmware loading for dimgrey_cavefish
[AMD Official Use Only - Internal Distribution Only] Series is: Reviewed-by: Alex Deucher From: Bhawanpreet Lakha Sent: Wednesday, November 11, 2020 6:04 PM To: Deucher, Alexander ; Clements, John Cc: Kazlauskas, Nicholas ; amd-gfx@lists.freedesktop.org ; Lakha, Bhawanpreet Subject: [PATCH 2/2] drm/amdgpu: Enable TA firmware loading for dimgrey_cavefish Signed-off-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c index 03e88dbf92be..edd2d6bd1d86 100644 --- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c @@ -62,7 +62,7 @@ MODULE_FIRMWARE("amdgpu/navy_flounder_ta.bin"); MODULE_FIRMWARE("amdgpu/vangogh_asd.bin"); MODULE_FIRMWARE("amdgpu/vangogh_toc.bin"); MODULE_FIRMWARE("amdgpu/dimgrey_cavefish_sos.bin"); -MODULE_FIRMWARE("amdgpu/dimgrey_cavefish_asd.bin"); +MODULE_FIRMWARE("amdgpu/dimgrey_cavefish_ta.bin"); /* address block */ #define smnMP1_FIRMWARE_FLAGS 0x3010024 @@ -192,15 +192,11 @@ static int psp_v11_0_init_microcode(struct psp_context *psp) break; case CHIP_SIENNA_CICHLID: case CHIP_NAVY_FLOUNDER: + case CHIP_DIMGREY_CAVEFISH: err = psp_init_sos_microcode(psp, chip_name); if (err) return err; - err = psp_init_ta_microcode(&adev->psp, chip_name); - if (err) - return err; - break; - case CHIP_DIMGREY_CAVEFISH: - err = psp_init_sos_microcode(psp, chip_name); + err = psp_init_ta_microcode(psp, chip_name); if (err) return err; break; -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: add UMC to ip discovery map
[AMD Official Use Only - Internal Distribution Only] Are there any other IP mappings that are missing? Maybe just add them all to avoid problems if there are other IPs we need to access in the future. Alex From: amd-gfx on behalf of Clements, John Sent: Wednesday, November 11, 2020 3:53 AM To: amd-gfx@lists.freedesktop.org ; Zhang, Hawking Subject: [PATCH] drm/amdgpu: add UMC to ip discovery map [AMD Official Use Only - Internal Distribution Only] Submitting patch to add UMC into IP discovery mapping. Thank you, John Clements ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/2] drm/amd/pm: update the swSMU headers for vangogh
[AMD Official Use Only - Internal Distribution Only] Series is: Reviewed-by: Alex Deucher From: Du, Xiaojian Sent: Tuesday, November 10, 2020 10:04 PM To: amd-gfx@lists.freedesktop.org Cc: Huang, Ray ; Huang, Shimmer ; Quan, Evan ; Deucher, Alexander ; Du, Xiaojian Subject: [PATCH 2/2] drm/amd/pm: update the swSMU headers for vangogh This patch is to update the swSMU headers for vangogh. Signed-off-by: Xiaojian Du Reviewed-by: Huang Rui Reviewed-by: Evan Quan --- drivers/gpu/drm/amd/pm/inc/smu11_driver_if_vangogh.h | 6 ++ drivers/gpu/drm/amd/pm/inc/smu_v11_5_pmfw.h | 11 +++ drivers/gpu/drm/amd/pm/inc/smu_v11_5_ppsmc.h | 11 +-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/inc/smu11_driver_if_vangogh.h b/drivers/gpu/drm/amd/pm/inc/smu11_driver_if_vangogh.h index 8f438c80132e..1c19eae93ff1 100644 --- a/drivers/gpu/drm/amd/pm/inc/smu11_driver_if_vangogh.h +++ b/drivers/gpu/drm/amd/pm/inc/smu11_driver_if_vangogh.h @@ -142,6 +142,12 @@ typedef struct { uint8_t NumDfPstatesEnabled; uint8_t NumDpmLevelsEnabled; + uint8_t NumDcfclkLevelsEnabled; + uint8_t NumDispClkLevelsEnabled; //applies to both dispclk and dppclk + uint8_t NumSocClkLevelsEnabled; + + uint8_t IspClkLevelsEnabled; //applies to both ispiclk and ispxclk + uint8_t VcnClkLevelsEnabled; //applies to both vclk/dclk uint8_t spare[2]; } DpmClocks_t; diff --git a/drivers/gpu/drm/amd/pm/inc/smu_v11_5_pmfw.h b/drivers/gpu/drm/amd/pm/inc/smu_v11_5_pmfw.h index 99a406984135..22edd88b8117 100644 --- a/drivers/gpu/drm/amd/pm/inc/smu_v11_5_pmfw.h +++ b/drivers/gpu/drm/amd/pm/inc/smu_v11_5_pmfw.h @@ -90,14 +90,16 @@ #define FEATURE_ATHUB_PG_BIT 56 #define FEATURE_ECO_DEEPCSTATE_BIT57 #define FEATURE_CC6_BIT 58 -#define NUM_FEATURES 59 +#define FEATURE_GFX_EDC_BIT 59 +#define NUM_FEATURES 60 typedef struct { // MP1_EXT_SCRATCH0 uint32_t DpmHandlerID : 8; uint32_t ActivityMonitorID: 8; uint32_t DpmTimerID : 8; - uint32_t spare0 : 8; + uint32_t DpmHubID : 4; + uint32_t DpmHubTask : 4; // MP1_EXT_SCRATCH1 uint32_t GfxStatus: 2; uint32_t GfxoffStatus : 8; @@ -109,9 +111,10 @@ typedef struct { uint32_t spare1 : 16; // MP1_EXT_SCRATCH2 uint32_t P2JobHandler: 32; - // MP1_EXT_SCRATCH3 -// uint32_t spare2 : 32; + // MP1_EXT_SCRATCH3: used for postcodes + // MP1_EXT_SCRATCH4:6 are used by Kernel + // MP1_EXT_SCRATCH7: used by HW } FwStatus_t; diff --git a/drivers/gpu/drm/amd/pm/inc/smu_v11_5_ppsmc.h b/drivers/gpu/drm/amd/pm/inc/smu_v11_5_ppsmc.h index 1ada0eb64663..7e69b3bd311b 100644 --- a/drivers/gpu/drm/amd/pm/inc/smu_v11_5_ppsmc.h +++ b/drivers/gpu/drm/amd/pm/inc/smu_v11_5_ppsmc.h @@ -97,9 +97,16 @@ #define PPSMC_MSG_StopDramLogging 0x3F #define PPSMC_MSG_SetSoftMinCclk 0x40 #define PPSMC_MSG_SetSoftMaxCclk 0x41 -#define PPSMC_Message_Count0x42 +#define PPSMC_MSG_SetDfPstateActiveLevel 0x42 +#define PPSMC_MSG_SetDfPstateSoftMinLevel 0x43 +#define PPSMC_MSG_SetCclkPolicy0x44 +#define PPSMC_MSG_DramLogSetDramAddrHigh 0x45 +#define PPSMC_MSG_DramLogSetDramBufferSize 0x46 +#define PPSMC_MSG_RequestActiveWgp 0x47 +#define PPSMC_MSG_QueryActiveWgp 0x48 +#define PPSMC_Message_Count0x49 -//Argument for PPSMC_MSG_GpuChangeState +//Argument for PPSMC_MSG_GfxDeviceDriverReset enum { MODE1_RESET = 1, MODE2_RESET = 2 -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/display: Fix memory leaks in S3 resume
[AMD Official Use Only - Internal Distribution Only] Ah, sorry, I missed that part of the patch. Alex From: Wentland, Harry Sent: Tuesday, November 10, 2020 11:42 AM To: Deucher, Alexander ; Wang, Chao-kai (Stylon) ; amd-gfx@lists.freedesktop.org Cc: Kazlauskas, Nicholas Subject: Re: [PATCH] drm/amd/display: Fix memory leaks in S3 resume It's missing the "drm_connector_list_update" call which I assume is important. Stylon, can you review Lee Starnes's patch? Is the drm_connector_list_update call maybe not needed? Thanks, Harry On 2020-11-10 11:26 a.m., Deucher, Alexander wrote: [AMD Official Use Only - Internal Distribution Only] Lee Starnes just sent the exact same patch yesterday. Please review that one: https://patchwork.freedesktop.org/patch/399497/ Alex From: Wentland, Harry <mailto:harry.wentl...@amd.com> Sent: Tuesday, November 10, 2020 9:27 AM To: Wang, Chao-kai (Stylon) <mailto:stylon.w...@amd.com>; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> <mailto:amd-gfx@lists.freedesktop.org> Cc: Kazlauskas, Nicholas <mailto:nicholas.kazlaus...@amd.com>; Deucher, Alexander <mailto:alexander.deuc...@amd.com> Subject: Re: [PATCH] drm/amd/display: Fix memory leaks in S3 resume On 2020-11-10 2:49 a.m., Stylon Wang wrote: > EDID parsing in S3 resume pushes new display modes > to probed_modes list but doesn't consolidate to actual > mode list. This creates a race condition when > amdgpu_dm_connector_ddc_get_modes() re-initializes the > list head without walking the list and results in memory leak. > > Signed-off-by: Stylon Wang <mailto:stylon.w...@amd.com> Looks reasonable to me but haven't had a chance to understand whether this is the best solution. Acked-by: Harry Wentland <mailto:harry.wentl...@amd.com> Harry > --- > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > index 0b6adf23d316..715e0bd489f8 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > @@ -2337,7 +2337,8 @@ void amdgpu_dm_update_connector_after_detect( > >drm_connector_update_edid_property(connector, > aconnector->edid); > - drm_add_edid_modes(connector, aconnector->edid); > + aconnector->num_modes = drm_add_edid_modes(connector, > aconnector->edid); > + drm_connector_list_update(connector); > >if (aconnector->dc_link->aux_mode) >drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux, > ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/display: Fix memory leaks in S3 resume
[AMD Official Use Only - Internal Distribution Only] Lee Starnes just sent the exact same patch yesterday. Please review that one: https://patchwork.freedesktop.org/patch/399497/ Alex From: Wentland, Harry Sent: Tuesday, November 10, 2020 9:27 AM To: Wang, Chao-kai (Stylon) ; amd-gfx@lists.freedesktop.org Cc: Kazlauskas, Nicholas ; Deucher, Alexander Subject: Re: [PATCH] drm/amd/display: Fix memory leaks in S3 resume On 2020-11-10 2:49 a.m., Stylon Wang wrote: > EDID parsing in S3 resume pushes new display modes > to probed_modes list but doesn't consolidate to actual > mode list. This creates a race condition when > amdgpu_dm_connector_ddc_get_modes() re-initializes the > list head without walking the list and results in memory leak. > > Signed-off-by: Stylon Wang Looks reasonable to me but haven't had a chance to understand whether this is the best solution. Acked-by: Harry Wentland Harry > --- > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > index 0b6adf23d316..715e0bd489f8 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > @@ -2337,7 +2337,8 @@ void amdgpu_dm_update_connector_after_detect( > >drm_connector_update_edid_property(connector, > aconnector->edid); > - drm_add_edid_modes(connector, aconnector->edid); > + aconnector->num_modes = drm_add_edid_modes(connector, > aconnector->edid); > + drm_connector_list_update(connector); > >if (aconnector->dc_link->aux_mode) >drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux, > ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: enable DCN for navi10 headless SKU
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Tianci Yin Sent: Friday, November 6, 2020 2:36 AM To: amd-gfx@lists.freedesktop.org Cc: Long, Gang ; Chen, Guchun ; Xu, Feifei ; Yin, Tianci (Rico) ; Tuikov, Luben ; Deucher, Alexander ; Cui, Flora ; Zhang, Hawking Subject: [PATCH] drm/amdgpu: enable DCN for navi10 headless SKU From: "Tianci.Yin" There is a NULL pointer crash when DCN disabled on headless SKU. On normal SKU, the variable adev->ddev.mode_config.funcs is initialized in dm_hw_init(), and it is fine to access it in amdgpu_device_resume(). But on headless SKU, DCN is disabled, the funcs variable is not initialized, then crash arises. Enable DCN to fix this issue. Change-Id: I33bc30210e3420e60ceb59175e39855d00b05b06 Signed-off-by: Tianci.Yin --- drivers/gpu/drm/amd/amdgpu/nv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index e33d8022cc32..67375b2948f5 100644 --- a/drivers/gpu/drm/amd/amdgpu/nv.c +++ b/drivers/gpu/drm/amd/amdgpu/nv.c @@ -535,8 +535,7 @@ int nv_set_ip_blocks(struct amdgpu_device *adev) if (adev->enable_virtual_display || amdgpu_sriov_vf(adev)) amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block); #if defined(CONFIG_DRM_AMD_DC) - else if (amdgpu_device_has_dc_support(adev) && -!nv_is_headless_sku(adev->pdev)) + else if (amdgpu_device_has_dc_support(adev)) amdgpu_device_ip_block_add(adev, &dm_ip_block); #endif amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block); -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C516e3593f84a45811bd908d88226c8e8%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637402450426333203%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=RzbVAu02p9LVSSOXx3M0QwQztABgpf8FRiWhDyU6BOY%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: Fix Arcturus fan speed reporting
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: amd-gfx on behalf of Kent Russell Sent: Thursday, November 5, 2020 10:20 AM To: amd-gfx@lists.freedesktop.org Cc: Russell, Kent Subject: [PATCH] drm/amdgpu: Fix Arcturus fan speed reporting Arcturus doesn't have a fan. The assumption of "if the manual fan control bit isn't set, it's on automatic mode" does not hold true if the fan is missing, and results in exposing an invalid value for fan speed. The SMU metrics table accurately reflects the lack of fan and will return 0 for the fan speed. Trying to use the smu_v11_0_get_fan_speed_rpm function will return invalid data, so just stick with the SMU metrics for Arcturus Signed-off-by: Kent Russell --- drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c index d96048e98237..4fd850e58004 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c @@ -1139,14 +1139,9 @@ static int arcturus_get_fan_speed_rpm(struct smu_context *smu, if (!speed) return -EINVAL; - switch (smu_v11_0_get_fan_control_mode(smu)) { - case AMD_FAN_CTRL_AUTO: - return arcturus_get_smu_metrics_data(smu, -METRICS_CURR_FANSPEED, -speed); - default: - return smu_v11_0_get_fan_speed_rpm(smu, speed); - } + return arcturus_get_smu_metrics_data(smu, +METRICS_CURR_FANSPEED, +speed); } static int arcturus_get_fan_parameters(struct smu_context *smu) -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Cc266d21dcb5e4d84073808d8819e9820%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637401865460755885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=O8kmXHVEGi01B7S0gk5MPafIEiuBC9v7catH%2FASo6iQ%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
yeah, ideally. Just need to get support for analog encoders. Alex From: Koenig, Christian Sent: Wednesday, November 4, 2020 9:31 AM To: Deucher, Alexander ; Sharma, Shashank ; amd-gfx@lists.freedesktop.org Cc: Qin, Eddy Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 In the long term we probably want to nuke this code anyway and switch to the DC code, don't we? Christian. Am 04.11.20 um 15:23 schrieb Deucher, Alexander: You might want to talk to the DAL team, they may have some advice. In general, I would say test it as well as you can. It's probably safe as radeon is still the default driver for SI parts and generally seems to be working well there. Alex From: Sharma, Shashank <mailto:shashank.sha...@amd.com> Sent: Wednesday, November 4, 2020 9:11 AM To: Deucher, Alexander <mailto:alexander.deuc...@amd.com>; Koenig, Christian <mailto:christian.koe...@amd.com>; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> <mailto:amd-gfx@lists.freedesktop.org> Cc: Qin, Eddy <mailto:eddy@amd.com> Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 Thanks Alex, Same question here, Should we go through some extensive test routine due to change in PLL values, or is it OK to go ahead based on our experience from Radeon values ? Regards Shashank On 04/11/20 7:36 pm, Deucher, Alexander wrote: Acked-by: Alex Deucher <mailto:alexander.deuc...@amd.com> From: Koenig, Christian <mailto:christian.koe...@amd.com> Sent: Wednesday, November 4, 2020 6:54 AM To: Sharma, Shashank <mailto:shashank.sha...@amd.com>; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> <mailto:amd-gfx@lists.freedesktop.org> Cc: Deucher, Alexander <mailto:alexander.deuc...@amd.com>; Qin, Eddy <mailto:eddy@amd.com> Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 Am 04.11.20 um 11:40 schrieb Sharma, Shashank: > [AMD Public Use] > > Hello Christian, > Yes, that 100 is hardcoded in Radeon, and git blame says it was one of your > patches which made it 100 from 128 😊. > Would you mind having a look at commit id: > 4b21ce1b4b5d262e7d4656b8ececc891fc3cb806 ? Ah, yes that one :) Yeah the background is that this was just an educated guess because I couldn't find anybody which could tell me what the real limits of the PLL is. Looks like we just forgot to apply that patch to amdgpu. Regards, Christian. > > Regards > Shashank > -Original Message- > From: Koenig, Christian > <mailto:christian.koe...@amd.com> > Sent: Wednesday, November 4, 2020 3:35 PM > To: Sharma, Shashank > <mailto:shashank.sha...@amd.com>; > amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> > Cc: Deucher, Alexander > <mailto:alexander.deuc...@amd.com>; Qin, Eddy > <mailto:eddy@amd.com> > Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 > > Am 03.11.20 um 18:13 schrieb Shashank Sharma: >> This patch limits the ref_div_max value to 100, during the calculation >> of PLL feedback reference divider. With current value (128), the >> produced fb_ref_div value generates unstable output at particular >> frequencies. Radeon driver limits this value at 100. > Mhm, is that 100 hard coded in radeon? I have no idea where that is coming > from. > > Best would probably to grab a hardware engineer and try to figure out what > the real maximums for the PLL is to still produce a stable signal. > > Christian. > >> On Oland, when we try to setup mode 2048x1280@60 (a bit weird, I >> know), it demands a clock of 221270 Khz. It's been observed that the >> PLL calculations using values 128 and 100 are vastly different, and >> look like this: >> >> +--+ >> |Parameter|AMDGPU|Radeon | >> | | | | >> +-++ >> |Clock feedback | | >> |divider max | 128 | 100 | >> |cap value| | | >> | | | | >> | | | | >> +--+ >> |ref_div_max | | | >> | | 42 | 20 | >> | | | | >> | | | | >> +--+ >> |ref_div | 42
Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
You might want to talk to the DAL team, they may have some advice. In general, I would say test it as well as you can. It's probably safe as radeon is still the default driver for SI parts and generally seems to be working well there. Alex From: Sharma, Shashank Sent: Wednesday, November 4, 2020 9:11 AM To: Deucher, Alexander ; Koenig, Christian ; amd-gfx@lists.freedesktop.org Cc: Qin, Eddy Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 Thanks Alex, Same question here, Should we go through some extensive test routine due to change in PLL values, or is it OK to go ahead based on our experience from Radeon values ? Regards Shashank On 04/11/20 7:36 pm, Deucher, Alexander wrote: Acked-by: Alex Deucher <mailto:alexander.deuc...@amd.com> From: Koenig, Christian <mailto:christian.koe...@amd.com> Sent: Wednesday, November 4, 2020 6:54 AM To: Sharma, Shashank <mailto:shashank.sha...@amd.com>; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> <mailto:amd-gfx@lists.freedesktop.org> Cc: Deucher, Alexander <mailto:alexander.deuc...@amd.com>; Qin, Eddy <mailto:eddy@amd.com> Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 Am 04.11.20 um 11:40 schrieb Sharma, Shashank: > [AMD Public Use] > > Hello Christian, > Yes, that 100 is hardcoded in Radeon, and git blame says it was one of your > patches which made it 100 from 128 😊. > Would you mind having a look at commit id: > 4b21ce1b4b5d262e7d4656b8ececc891fc3cb806 ? Ah, yes that one :) Yeah the background is that this was just an educated guess because I couldn't find anybody which could tell me what the real limits of the PLL is. Looks like we just forgot to apply that patch to amdgpu. Regards, Christian. > > Regards > Shashank > -Original Message- > From: Koenig, Christian > <mailto:christian.koe...@amd.com> > Sent: Wednesday, November 4, 2020 3:35 PM > To: Sharma, Shashank > <mailto:shashank.sha...@amd.com>; > amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> > Cc: Deucher, Alexander > <mailto:alexander.deuc...@amd.com>; Qin, Eddy > <mailto:eddy@amd.com> > Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 > > Am 03.11.20 um 18:13 schrieb Shashank Sharma: >> This patch limits the ref_div_max value to 100, during the calculation >> of PLL feedback reference divider. With current value (128), the >> produced fb_ref_div value generates unstable output at particular >> frequencies. Radeon driver limits this value at 100. > Mhm, is that 100 hard coded in radeon? I have no idea where that is coming > from. > > Best would probably to grab a hardware engineer and try to figure out what > the real maximums for the PLL is to still produce a stable signal. > > Christian. > >> On Oland, when we try to setup mode 2048x1280@60 (a bit weird, I >> know), it demands a clock of 221270 Khz. It's been observed that the >> PLL calculations using values 128 and 100 are vastly different, and >> look like this: >> >> +--+ >> |Parameter|AMDGPU|Radeon | >> | | | | >> +-++ >> |Clock feedback | | >> |divider max | 128 | 100 | >> |cap value| | | >> | | | | >> | | | | >> +--+ >> |ref_div_max | | | >> | | 42 | 20 | >> | | | | >> | | | | >> +--+ >> |ref_div | 42 | 20 | >> | | | | >> +--+ >> |fb_div | 10326 | 8195 | >> +--+ >> |fb_div | 1024| 163| >> +--+ >> |fb_dev_p | 4 | 9 | >> |frac fb_de^_p| | | >> ++-+ >> >> With ref_div_max value clipped at 100, AMDGPU driver can also drive >> videmode 2048x1280@60 (221Mhz) and produce proper output without any >> blanking and distortion on the screen. >> >> PS: This value was changed from 128 to 100 in Radeon driver also, here: >&g
Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100
Acked-by: Alex Deucher From: Koenig, Christian Sent: Wednesday, November 4, 2020 6:54 AM To: Sharma, Shashank ; amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Qin, Eddy Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 Am 04.11.20 um 11:40 schrieb Sharma, Shashank: > [AMD Public Use] > > Hello Christian, > Yes, that 100 is hardcoded in Radeon, and git blame says it was one of your > patches which made it 100 from 128 😊. > Would you mind having a look at commit id: > 4b21ce1b4b5d262e7d4656b8ececc891fc3cb806 ? Ah, yes that one :) Yeah the background is that this was just an educated guess because I couldn't find anybody which could tell me what the real limits of the PLL is. Looks like we just forgot to apply that patch to amdgpu. Regards, Christian. > > Regards > Shashank > -Original Message- > From: Koenig, Christian > Sent: Wednesday, November 4, 2020 3:35 PM > To: Sharma, Shashank ; amd-gfx@lists.freedesktop.org > Cc: Deucher, Alexander ; Qin, Eddy > > Subject: Re: [PATCH] drm/amdgpu: clip the ref divider max value at 100 > > Am 03.11.20 um 18:13 schrieb Shashank Sharma: >> This patch limits the ref_div_max value to 100, during the calculation >> of PLL feedback reference divider. With current value (128), the >> produced fb_ref_div value generates unstable output at particular >> frequencies. Radeon driver limits this value at 100. > Mhm, is that 100 hard coded in radeon? I have no idea where that is coming > from. > > Best would probably to grab a hardware engineer and try to figure out what > the real maximums for the PLL is to still produce a stable signal. > > Christian. > >> On Oland, when we try to setup mode 2048x1280@60 (a bit weird, I >> know), it demands a clock of 221270 Khz. It's been observed that the >> PLL calculations using values 128 and 100 are vastly different, and >> look like this: >> >> +--+ >> |Parameter|AMDGPU|Radeon | >> | | | | >> +-++ >> |Clock feedback | | >> |divider max | 128 | 100 | >> |cap value| | | >> | | | | >> | | | | >> +--+ >> |ref_div_max | | | >> | | 42 | 20 | >> | | | | >> | | | | >> +--+ >> |ref_div | 42 | 20 | >> | | | | >> +--+ >> |fb_div | 10326 | 8195 | >> +--+ >> |fb_div | 1024| 163| >> +--+ >> |fb_dev_p | 4 | 9 | >> |frac fb_de^_p| | | >> ++-+ >> >> With ref_div_max value clipped at 100, AMDGPU driver can also drive >> videmode 2048x1280@60 (221Mhz) and produce proper output without any >> blanking and distortion on the screen. >> >> PS: This value was changed from 128 to 100 in Radeon driver also, here: >> https://github.com/freedesktop/drm-tip/commit/4b21ce1b4b5d262e7d4656b8 >> ececc891fc3cb806 >> >> Cc: Alex Deucher >> Cc: Christian König >> Cc: Eddy Qin >> >> Signed-off-by: Shashank Sharma >> --- >>drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- >>1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c >> index 1f2305b7bd13..23a2e1ebf78a 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c >> @@ -85,7 +85,7 @@ static void amdgpu_pll_get_fb_ref_div(unsigned nom, >> unsigned den, unsigned post_ >> unsigned *fb_div, unsigned *ref_div) >>{ >> /* limit reference * post divider to a maximum */ >> -ref_div_max = min(128 / post_div, ref_div_max); >> +ref_div_max = min(100 / post_div, ref_div_max); >> >> /* get matching reference and feedback divider */ >> *ref_div = min(max(DIV_ROUND_CLOSEST(den, post_div), 1u), >> ref_div_max); ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/display: fix psr panel lightup
Reviewed-by: Alex Deucher From: roman...@amd.com Sent: Tuesday, November 3, 2020 6:12 PM To: amd-gfx@lists.freedesktop.org ; Deucher, Alexander ; Quan, Evan ; Siqueira, Rodrigo ; Pillai, Aurabindo Cc: Li, Roman Subject: [PATCH] drm/amd/display: fix psr panel lightup From: Roman Li [Why] The change for correct asic type check caused a psr regression due to incorrect chip family id for Raven. [How] Use correct family id. Signed-off-by: Roman Li --- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index 6b8bc8dde6ea..09b51fca3d44 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c @@ -2740,7 +2740,7 @@ bool dc_link_setup_psr(struct dc_link *link, #if defined(CONFIG_DRM_AMD_DC_DCN) /*skip power down the single pipe since it blocks the cstate*/ - if ((link->ctx->asic_id.chip_family == FAMILY_AI) && + if ((link->ctx->asic_id.chip_family == FAMILY_RV) && ASICREV_IS_RAVEN(link->ctx->asic_id.hw_internal_rev)) psr_context->psr_level.bits.SKIP_CRTC_DISABLE = true; #endif -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH] drm/amdgpu: do not initialise global variables to 0 or NULL
[AMD Public Use] > -Original Message- > From: Greg KH > Sent: Tuesday, November 3, 2020 1:53 AM > To: Koenig, Christian > Cc: Alex Deucher ; Deepak R Varma > ; David Airlie ; LKML ker...@vger.kernel.org>; Maling list - DRI developers de...@lists.freedesktop.org>; Melissa Wen ; > amd-gfx list ; Daniel Vetter > ; Daniel Vetter ; Deucher, > Alexander > Subject: Re: [PATCH] drm/amdgpu: do not initialise global variables to 0 or > NULL > > On Mon, Nov 02, 2020 at 09:06:21PM +0100, Christian König wrote: > > Am 02.11.20 um 20:43 schrieb Alex Deucher: > > > On Mon, Nov 2, 2020 at 1:42 PM Deepak R Varma > wrote: > > > > Initializing global variable to 0 or NULL is not necessary and > > > > should be avoided. Issue reported by checkpatch script as: > > > > ERROR: do not initialise globals to 0 (or NULL). > > > I agree that this is technically correct, but a lot of people don't > > > seem to know that so we get a lot of comments about this code for > > > the variables that are not explicitly set. Seems less confusing to > > > initialize them even if it not necessary. I don't have a > > > particularly strong opinion on it however. > > > > Agree with Alex. > > > > Especially for the module parameters we should have a explicit init > > value for documentation purposes, even when it is 0. > > Why is this one tiny driver somehow special compared to the entire rest of > the kernel? (hint, it isn't...) > > Please follow the normal coding style rules, there's no reason to ignore them > unless you like to constantly reject patches like this that get sent to you. > I'll apply the patch, but as a data point, this is the first time I've gotten a patch to make this change. I get several bug reports or patches every year to explicitly set values to global variables because users assume they are not initialized. So it will always be a trade off as to which patches you want to NACK. Alex ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: update module paramter doc of amdgpu_dpm
Reviewed-by: Alex Deucher From: amd-gfx on behalf of Kevin Wang Sent: Tuesday, November 3, 2020 12:54 AM To: amd-gfx@lists.freedesktop.org Cc: Wang, Kevin(Yang) ; Feng, Kenneth Subject: [PATCH] drm/amdgpu: update module paramter doc of amdgpu_dpm the vega20 isn't supported swsmu. Signed-off-by: Kevin Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 03f4aab1fe99..9d28054b8aae 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -279,7 +279,7 @@ module_param_string(lockup_timeout, amdgpu_lockup_timeout, sizeof(amdgpu_lockup_ /** * DOC: dpm (int) * Override for dynamic power management setting - * (0 = disable, 1 = enable, 2 = enable sw smu driver for vega20) + * (0 = disable, 1 = enable) * The default is -1 (auto). */ MODULE_PARM_DESC(dpm, "DPM support (1 = enable, 0 = disable, -1 = auto)"); -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C4ae8b1a81d21425639d008d87fbcf7a4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637399796905142189%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=fuXa0uSIEISgNh%2FUxxU3HlEDJDb9E41UGW7EouDVm5k%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU
That should be harmless and we can fix that up. Does everything work as expected other than the error message? Alex From: Yin, Tianci (Rico) Sent: Monday, November 2, 2020 9:51 PM To: Alex Deucher ; Deucher, Alexander Cc: Zhang, Hawking ; amd-gfx@lists.freedesktop.org ; Cui, Flora ; Xu, Feifei ; Tuikov, Luben ; Chen, Guchun ; Long, Gang Subject: Re: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU [AMD Official Use Only - Internal Distribution Only] Hi Alex, If we don't skip DCN in nv_set_ip_blocks, I find below error, [ 103.949926] [drm:amdgpu_dm_init.cold [amdgpu]] *ERROR* amdgpu: failed to initialize hdcp_workqueue. Thanks! Rico From: Alex Deucher Sent: Tuesday, November 3, 2020 1:49 To: Deucher, Alexander Cc: Yin, Tianci (Rico) ; Zhang, Hawking ; amd-gfx@lists.freedesktop.org ; Cui, Flora ; Xu, Feifei ; Tuikov, Luben ; Chen, Guchun ; Long, Gang Subject: Re: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU Does everything work as expected if we don't skip DCN in nv_set_ip_blocks? Alex On Mon, Nov 2, 2020 at 10:38 AM Deucher, Alexander wrote: > > [AMD Public Use] > > > That's the IP discovery table. The Object header is part of atombios. Do > you have an vbios image from that system? > > Alex > > > > From: Yin, Tianci (Rico) > Sent: Sunday, November 1, 2020 10:46 PM > To: Deucher, Alexander ; Zhang, Hawking > ; amd-gfx@lists.freedesktop.org > > Cc: Tuikov, Luben ; Chen, Guchun ; > Cui, Flora ; Xu, Feifei ; Long, Gang > > Subject: Re: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU > > > [AMD Public Use] > > > Thanks very much Hawking! > > > Hi Alex, > > The amdgpu_device_ip_get_ip_block() depends on the adev->ip_blocks that > initialized by nv_set_ip_blocks(). > In nv_set_ip_blocks(), whether add dm_ip_block depends on > amdgpu_device_has_dc_support(). > And amdgpu_device_has_dc_support() depends on > amdgpu_device_asic_has_dc_support(), > So amdgpu_device_asic_has_dc_support() can't conditional on > amdgpu_device_ip_get_ip_block(), it makes a dependency loop. > > I have just checked the atombios object table in the headless VBIOS, and find > DCN and VCN are still there. > [ 174.815714] [drm:amdgpu_discovery_reg_base_init [amdgpu]] DMU(271) #0 > v2.0.2: > [ 174.815771] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x0012 > [ 174.815829] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x00c0 > [ 174.815887] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x34c0 > [ 174.815945] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x9000 > [ 174.816002] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x02403c00 > [ 174.821854] [drm:amdgpu_discovery_reg_base_init [amdgpu]] UVD(12) #0 > v2.0.0: > [ 174.821908] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x7800 > [ 174.821962] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x7e00 > [ 174.822017] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x02403000 > So I think DAL driver can't tell it's a normal ASIC or headless ASIC. > > Thanks! > Rico > > > From: Deucher, Alexander > Sent: Friday, October 30, 2020 22:18 > To: Zhang, Hawking ; Yin, Tianci (Rico) > ; amd-gfx@lists.freedesktop.org > > Cc: Tuikov, Luben ; Chen, Guchun ; > Cui, Flora ; Xu, Feifei ; Long, Gang > > Subject: Re: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU > > > [AMD Public Use] > > > Maybe it would be easier to check if the DCE IP exists? E.g., > if (!amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE) || > (!amdgpu_device_has_dc_support(adev)) > ... > > Also do we even need to skip DCN init for these cards, or will the display > code handle it automatically since there will be no displays in the atombios > object table. We didn't do anything special for display with the polaris > blockchain cards. > > Alex > > > From: Zhang, Hawking > Sent: Friday, October 30, 2020 9:00 AM > To: Yin, Tianci (Rico) ; amd-gfx@lists.freedesktop.org > > Cc: Tuikov, Luben ; Deucher, Alexander > ; Chen, Guchun ; Cui, Flora > ; Xu, Feifei ; Long, Gang > > Subject: RE: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU > > > [AMD Public Use] > > > [AMD Public Use] > > > > I see, thanks for the clarifying. The patch is > > > > Reviewed-by: Hawking Zhang > > > > I was thinking to have a new flag like AMD_IS_HEADLESS in amd_chip_flag, but > after think it a bit more, that’s just complicated the
Re: [PATCH] amdkfd: Check kvmalloc return before memcpy
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Kent Russell Sent: Monday, November 2, 2020 11:27 AM To: amd-gfx@lists.freedesktop.org Cc: Russell, Kent Subject: [PATCH] amdkfd: Check kvmalloc return before memcpy If we can't kvmalloc the pcrat_image, then we shouldn't memcpy Signed-off-by: Kent Russell Reported-by: kernel test robot --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c index cdd5032d5c0e..a0acf2310357 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c @@ -804,10 +804,10 @@ int kfd_create_crat_image_acpi(void **crat_image, size_t *size) } pcrat_image = kvmalloc(crat_table->length, GFP_KERNEL); - memcpy(pcrat_image, crat_table, crat_table->length); if (!pcrat_image) return -ENOMEM; + memcpy(pcrat_image, crat_table, crat_table->length); *crat_image = pcrat_image; *size = crat_table->length; -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C20c8797c2a6d4fb8bf5a08d87f4c3732%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637399312636837144%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=84VCnd9ugeRKlAyqOYpXHm2PvPXUhM0gQjJd9AR95mA%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU
[AMD Public Use] That's the IP discovery table. The Object header is part of atombios. Do you have an vbios image from that system? Alex From: Yin, Tianci (Rico) Sent: Sunday, November 1, 2020 10:46 PM To: Deucher, Alexander ; Zhang, Hawking ; amd-gfx@lists.freedesktop.org Cc: Tuikov, Luben ; Chen, Guchun ; Cui, Flora ; Xu, Feifei ; Long, Gang Subject: Re: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU [AMD Public Use] Thanks very much Hawking! Hi Alex, The amdgpu_device_ip_get_ip_block() depends on the adev->ip_blocks that initialized by nv_set_ip_blocks(). In nv_set_ip_blocks(), whether add dm_ip_block depends on amdgpu_device_has_dc_support(). And amdgpu_device_has_dc_support() depends on amdgpu_device_asic_has_dc_support(), So amdgpu_device_asic_has_dc_support() can't conditional on amdgpu_device_ip_get_ip_block(), it makes a dependency loop. I have just checked the atombios object table in the headless VBIOS, and find DCN and VCN are still there. [ 174.815714] [drm:amdgpu_discovery_reg_base_init [amdgpu]] DMU(271) #0 v2.0.2: [ 174.815771] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x0012 [ 174.815829] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x00c0 [ 174.815887] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x34c0 [ 174.815945] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x9000 [ 174.816002] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x02403c00 [ 174.821854] [drm:amdgpu_discovery_reg_base_init [amdgpu]] UVD(12) #0 v2.0.0: [ 174.821908] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x7800 [ 174.821962] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x7e00 [ 174.822017] [drm:amdgpu_discovery_reg_base_init [amdgpu]] 0x02403000 So I think DAL driver can't tell it's a normal ASIC or headless ASIC. Thanks! Rico ________ From: Deucher, Alexander Sent: Friday, October 30, 2020 22:18 To: Zhang, Hawking ; Yin, Tianci (Rico) ; amd-gfx@lists.freedesktop.org Cc: Tuikov, Luben ; Chen, Guchun ; Cui, Flora ; Xu, Feifei ; Long, Gang Subject: Re: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU [AMD Public Use] Maybe it would be easier to check if the DCE IP exists? E.g., if (!amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE) || (!amdgpu_device_has_dc_support(adev)) ... Also do we even need to skip DCN init for these cards, or will the display code handle it automatically since there will be no displays in the atombios object table. We didn't do anything special for display with the polaris blockchain cards. Alex From: Zhang, Hawking Sent: Friday, October 30, 2020 9:00 AM To: Yin, Tianci (Rico) ; amd-gfx@lists.freedesktop.org Cc: Tuikov, Luben ; Deucher, Alexander ; Chen, Guchun ; Cui, Flora ; Xu, Feifei ; Long, Gang Subject: RE: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU [AMD Public Use] [AMD Public Use] I see, thanks for the clarifying. The patch is Reviewed-by: Hawking Zhang I was thinking to have a new flag like AMD_IS_HEADLESS in amd_chip_flag, but after think it a bit more, that’s just complicated the case, I agree with your current approach. Regards, Hawking From: Yin, Tianci (Rico) Sent: Friday, October 30, 2020 20:05 To: Zhang, Hawking ; amd-gfx@lists.freedesktop.org Cc: Tuikov, Luben ; Deucher, Alexander ; Chen, Guchun ; Cui, Flora ; Xu, Feifei ; Long, Gang Subject: Re: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU [AMD Public Use] Hi Hawking, amdgpu_device_asic_has_dc_support() is referrenced by amdgpu_pci_probe(), at that point, adev has not been allocated yet. My change can make it to right code path. int amdgpu_device_resume(struct drm_device *dev, bool fbcon) { ... if (!amdgpu_device_has_dc_support(adev)) drm_helper_hpd_irq_event(dev); //right path for headless SKU else drm_kms_helper_hotplug_event(dev); //wrong path for headless SKU ... } Thanks! Rico From: Zhang, Hawking mailto:hawking.zh...@amd.com>> Sent: Friday, October 30, 2020 19:48 To: Yin, Tianci (Rico) mailto:tianci@amd.com>>; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> mailto:amd-gfx@lists.freedesktop.org>> Cc: Tuikov, Luben mailto:luben.tui...@amd.com>>; Deucher, Alexander mailto:alexander.deuc...@amd.com>>; Chen, Guchun mailto:guchun.c...@amd.com>>; Cui, Flora mailto:flora@amd.com>>; Xu, Feifei mailto:feifei...@amd.com>>; Long, Gang mailto:gang.l...@amd.com>>; Yin, Tianci (Rico) mailto:tianci@amd.com>> Subject: RE: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU [AMD Public Use] I'm not sure I get your point on changing amdgpu_device_has_dc_support() interface by adding new parameter. but it seems to me
Re: [PATCH] drm/amdgpu: replace ih ip block for vega20 and arcturus
[AMD Public Use] It might be cleaner to just split out vega20 into a separate switch case in that function. Alex From: amd-gfx on behalf of Alex Sierra Sent: Friday, October 30, 2020 11:06 PM To: amd-gfx@lists.freedesktop.org Cc: Sierra Guiza, Alejandro (Alex) Subject: [PATCH] drm/amdgpu: replace ih ip block for vega20 and arcturus [Why] Vega20 and Arcturus asics use oss 5.0 version. [How] Replace ih ip block by navi10 for vega20 and arcturus. Signed-off-by: Alex Sierra --- drivers/gpu/drm/amd/amdgpu/soc15.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index f57c5f57efa8..fc5b11752931 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc15.c +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c @@ -62,6 +62,7 @@ #include "nbio_v7_0.h" #include "nbio_v7_4.h" #include "vega10_ih.h" +#include "navi10_ih.h" #include "sdma_v4_0.h" #include "uvd_v7_0.h" #include "vce_v4_0.h" @@ -734,9 +735,15 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev) else amdgpu_device_ip_block_add(adev, &psp_v3_1_ip_block); } - amdgpu_device_ip_block_add(adev, &vega10_ih_ip_block); + if (adev->asic_type == CHIP_VEGA20) + amdgpu_device_ip_block_add(adev, &navi10_ih_ip_block); + else + amdgpu_device_ip_block_add(adev, &vega10_ih_ip_block); } else { - amdgpu_device_ip_block_add(adev, &vega10_ih_ip_block); + if (adev->asic_type == CHIP_VEGA20) + amdgpu_device_ip_block_add(adev, &navi10_ih_ip_block); + else + amdgpu_device_ip_block_add(adev, &vega10_ih_ip_block); if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)) { if (adev->asic_type == CHIP_VEGA20) amdgpu_device_ip_block_add(adev, &psp_v11_0_ip_block); @@ -787,9 +794,9 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev) if (amdgpu_sriov_vf(adev)) { if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)) amdgpu_device_ip_block_add(adev, &psp_v11_0_ip_block); - amdgpu_device_ip_block_add(adev, &vega10_ih_ip_block); + amdgpu_device_ip_block_add(adev, &navi10_ih_ip_block); } else { - amdgpu_device_ip_block_add(adev, &vega10_ih_ip_block); + amdgpu_device_ip_block_add(adev, &navi10_ih_ip_block); if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)) amdgpu_device_ip_block_add(adev, &psp_v11_0_ip_block); } -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C1f54f989cd9641c49c9708d87d4a000e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637397104709391689%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=fe%2FU57bvUywZ57162F0sTzo%2FDaYGtX62J0MJf36Nxfo%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU
[AMD Public Use] Maybe it would be easier to check if the DCE IP exists? E.g., if (!amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE) || (!amdgpu_device_has_dc_support(adev)) ... Also do we even need to skip DCN init for these cards, or will the display code handle it automatically since there will be no displays in the atombios object table. We didn't do anything special for display with the polaris blockchain cards. Alex From: Zhang, Hawking Sent: Friday, October 30, 2020 9:00 AM To: Yin, Tianci (Rico) ; amd-gfx@lists.freedesktop.org Cc: Tuikov, Luben ; Deucher, Alexander ; Chen, Guchun ; Cui, Flora ; Xu, Feifei ; Long, Gang Subject: RE: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU [AMD Public Use] [AMD Public Use] I see, thanks for the clarifying. The patch is Reviewed-by: Hawking Zhang I was thinking to have a new flag like AMD_IS_HEADLESS in amd_chip_flag, but after think it a bit more, that’s just complicated the case, I agree with your current approach. Regards, Hawking From: Yin, Tianci (Rico) Sent: Friday, October 30, 2020 20:05 To: Zhang, Hawking ; amd-gfx@lists.freedesktop.org Cc: Tuikov, Luben ; Deucher, Alexander ; Chen, Guchun ; Cui, Flora ; Xu, Feifei ; Long, Gang Subject: Re: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU [AMD Public Use] Hi Hawking, amdgpu_device_asic_has_dc_support() is referrenced by amdgpu_pci_probe(), at that point, adev has not been allocated yet. My change can make it to right code path. int amdgpu_device_resume(struct drm_device *dev, bool fbcon) { ... if (!amdgpu_device_has_dc_support(adev)) drm_helper_hpd_irq_event(dev); //right path for headless SKU else drm_kms_helper_hotplug_event(dev); //wrong path for headless SKU ... } Thanks! Rico From: Zhang, Hawking mailto:hawking.zh...@amd.com>> Sent: Friday, October 30, 2020 19:48 To: Yin, Tianci (Rico) mailto:tianci@amd.com>>; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> mailto:amd-gfx@lists.freedesktop.org>> Cc: Tuikov, Luben mailto:luben.tui...@amd.com>>; Deucher, Alexander mailto:alexander.deuc...@amd.com>>; Chen, Guchun mailto:guchun.c...@amd.com>>; Cui, Flora mailto:flora@amd.com>>; Xu, Feifei mailto:feifei...@amd.com>>; Long, Gang mailto:gang.l...@amd.com>>; Yin, Tianci (Rico) mailto:tianci@amd.com>> Subject: RE: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU [AMD Public Use] I'm not sure I get your point on changing amdgpu_device_has_dc_support() interface by adding new parameter. but it seems to me change input parameter from pdev to adev for nv_is_headless_sku is more straightforward. Regards, Hawking -Original Message- From: Tianci Yin mailto:tianci@amd.com>> Sent: Friday, October 30, 2020 19:32 To: amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> Cc: Tuikov, Luben mailto:luben.tui...@amd.com>>; Deucher, Alexander mailto:alexander.deuc...@amd.com>>; Zhang, Hawking mailto:hawking.zh...@amd.com>>; Chen, Guchun mailto:guchun.c...@amd.com>>; Cui, Flora mailto:flora@amd.com>>; Xu, Feifei mailto:feifei...@amd.com>>; Long, Gang mailto:gang.l...@amd.com>>; Yin, Tianci (Rico) mailto:tianci@amd.com>> Subject: [PATCH] drm/amdgpu: fix NULL pointer crash on navi10 headless SKU From: "Tianci.Yin" mailto:tianci@amd.com>> The crash caused by the NULL pointer of adev->ddev.mode_config.funcs in drm_kms_helper_hotplug_event(), but this function should not be called on headless SKU. Fix the mismatch between the return value of amdgpu_device_has_dc_support() and the real DCN supporting state to avoid calling to drm_kms_helper_hotplug_event() in amdgpu_device_resume(). Change-Id: I3a3d387e6ab5b774abb3911ea1bf6de60797759d Signed-off-by: Tianci.Yin mailto:tianci@amd.com>> --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 -- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- drivers/gpu/drm/amd/amdgpu/nv.c | 2 +- drivers/gpu/drm/amd/amdgpu/nv.h | 1 + 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index ba65d4f2ab67..f0183271456f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1090,7 +1090,7 @@ void amdgpu_device_indirect_wreg64(struct amdgpu_device *adev, u32 pcie_index, u32 pcie_data, u32 reg_addr, u64 reg_data); -bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type); +b
Re: [PATCH] drm/amdgpu: cleanup gmc_v9_0_process_interrupt
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Christian König Sent: Wednesday, October 28, 2020 9:49 AM To: amd-gfx@lists.freedesktop.org Subject: [PATCH] drm/amdgpu: cleanup gmc_v9_0_process_interrupt First of all don't snprintf into a char buffer allocated on the stack with a constant hubname. Then cleanup to exit the function early in case of a ratelimit or SRIOV. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 183 +- 1 file changed, 91 insertions(+), 92 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index a9929d1b6b3d..0c3421d587e8 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c @@ -510,15 +510,16 @@ static int gmc_v9_0_vm_fault_interrupt_state(struct amdgpu_device *adev, } static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev, - struct amdgpu_irq_src *source, - struct amdgpu_iv_entry *entry) + struct amdgpu_irq_src *source, + struct amdgpu_iv_entry *entry) { - struct amdgpu_vmhub *hub; bool retry_fault = !!(entry->src_data[1] & 0x80); uint32_t status = 0, cid = 0, rw = 0; - u64 addr; - char hub_name[10]; + struct amdgpu_task_info task_info; + struct amdgpu_vmhub *hub; const char *mmhub_cid; + const char *hub_name; + u64 addr; addr = (u64)entry->src_data[0] << 12; addr |= ((u64)entry->src_data[1] & 0xf) << 44; @@ -527,105 +528,103 @@ static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev, entry->timestamp)) return 1; /* This also prevents sending it to KFD */ + /* If it's the first fault for this address, process it normally */ + if (retry_fault && !in_interrupt() && + amdgpu_vm_handle_fault(adev, entry->pasid, addr)) + return 1; /* This also prevents sending it to KFD */ + + if (!printk_ratelimit()) + return 0; + if (entry->client_id == SOC15_IH_CLIENTID_VMC) { - snprintf(hub_name, sizeof(hub_name), "mmhub0"); + hub_name = "mmhub0"; hub = &adev->vmhub[AMDGPU_MMHUB_0]; } else if (entry->client_id == SOC15_IH_CLIENTID_VMC1) { - snprintf(hub_name, sizeof(hub_name), "mmhub1"); + hub_name = "mmhub1"; hub = &adev->vmhub[AMDGPU_MMHUB_1]; } else { - snprintf(hub_name, sizeof(hub_name), "gfxhub0"); + hub_name = "gfxhub0"; hub = &adev->vmhub[AMDGPU_GFXHUB_0]; } - /* If it's the first fault for this address, process it normally */ - if (retry_fault && !in_interrupt() && - amdgpu_vm_handle_fault(adev, entry->pasid, addr)) - return 1; /* This also prevents sending it to KFD */ + memset(&task_info, 0, sizeof(struct amdgpu_task_info)); + amdgpu_vm_get_task_info(adev, entry->pasid, &task_info); - if (!amdgpu_sriov_vf(adev)) { - /* -* Issue a dummy read to wait for the status register to -* be updated to avoid reading an incorrect value due to -* the new fast GRBM interface. -*/ - if (entry->vmid_src == AMDGPU_GFXHUB_0) - RREG32(hub->vm_l2_pro_fault_status); - - status = RREG32(hub->vm_l2_pro_fault_status); - cid = REG_GET_FIELD(status, - VM_L2_PROTECTION_FAULT_STATUS, CID); - rw = REG_GET_FIELD(status, - VM_L2_PROTECTION_FAULT_STATUS, RW); - WREG32_P(hub->vm_l2_pro_fault_cntl, 1, ~1); - } + dev_err(adev->dev, + "[%s] %s page fault (src_id:%u ring:%u vmid:%u " + "pasid:%u, for process %s pid %d thread %s pid %d)\n", + hub_name, retry_fault ? "retry" : "no-retry", + entry->src_id, entry->ring_id, entry->vmid, + entry->pasid, task_info.process_name, task_info.tgid, + task_info.task_name, task_info.pid); + dev_err(adev->dev, " in page starting at address 0x%016llx from client %d\n", + addr, entry->client_id); - if (printk_ratelimit()) { - struct amdgpu_task_info task_info; - - memset(&task_info, 0, sizeof(struct amdgpu_task_info)); - amdgpu_vm_get_task_info(adev, entry->pasid, &task_info); - - dev_err(adev->dev, - "[%s] %s page fault (src_id:%u ring:%u vmid:%u " - "pasid:%u, for process %s pid %d thread %s pid %d)\n", -
Re: [PATCH 5/5] drm/amd/pm: do not use ixFEATURE_STATUS for checking smc running
[AMD Public Use] Series is: Reviewed-by: Alex Deucher From: Quan, Evan Sent: Wednesday, October 28, 2020 4:30 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; sandy.8...@gmail.com ; Quan, Evan Subject: [PATCH 5/5] drm/amd/pm: do not use ixFEATURE_STATUS for checking smc running This reverts commit f87812284172a9809820d10143b573d833cd3f75 "drm/amdgpu: Fix bug where DPM is not enabled after hibernate and resume". It was intended to fix Hawaii S4(hibernation) issue but break S3. As ixFEATURE_STATUS is filled with garbage data on resume which can be only cleared by reloading smc firmware(but that will involve many changes). So, we will revert this S4 fix and seek a new way. Change-Id: If9eed2f5a9c1168fb20be92057b583d854ad779e Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c index 09128122b493..329bf4d44bbc 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c @@ -2726,10 +2726,7 @@ static int ci_initialize_mc_reg_table(struct pp_hwmgr *hwmgr) static bool ci_is_dpm_running(struct pp_hwmgr *hwmgr) { - return (1 == PHM_READ_INDIRECT_FIELD(hwmgr->device, -CGS_IND_REG__SMC, FEATURE_STATUS, -VOLTAGE_CONTROLLER_ON)) - ? true : false; + return ci_is_smc_ram_running(hwmgr); } static int ci_smu_init(struct pp_hwmgr *hwmgr) -- 2.29.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/2] drm/amd/pm: fix compile warnings about variable used uninitialized
[AMD Official Use Only - Internal Distribution Only] Series is: Reviewed-by: Alex Deucher From: Quan, Evan Sent: Tuesday, October 27, 2020 10:45 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan ; kernel test robot Subject: [PATCH 2/2] drm/amd/pm: fix compile warnings about variable used uninitialized Fix the compile warnings below: >> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: >> warning: variable 'min' is used uninitialized whenever 'if' condition is >> false [-Wsometimes-uninitialized] >> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:1743:13: >> warning: variable 'max' is used uninitialized whenever 'if' condition is >> false [-Wsometimes-uninitialized] Change-Id: Id2dece80162cd10f004abbf3b62cba0c84e988f2 Signed-off-by: Evan Quan Reported-by: kernel test robot --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c index 49db61a89505..5937150e6b37 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c @@ -1856,7 +1856,7 @@ static int smu7_calculate_ro_range(struct pp_hwmgr *hwmgr) { struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); struct amdgpu_device *adev = hwmgr->adev; - uint32_t asicrev1, evv_revision, max, min; + uint32_t asicrev1, evv_revision, max = 0, min = 0; atomctrl_read_efuse(hwmgr, STRAP_EVV_REVISION_LSB, STRAP_EVV_REVISION_MSB, &evv_revision); @@ -1893,8 +1893,7 @@ static int smu7_calculate_ro_range(struct pp_hwmgr *hwmgr) max = 2500; } } - } else if ((hwmgr->chip_id == CHIP_POLARIS11) || - (hwmgr->chip_id == CHIP_POLARIS12)) { + } else { min = 1100; max = 2100; } -- 2.29.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: add vangogh apu flag
[AMD Public Use] Acked-by: Alex Deucher From: amd-gfx on behalf of Huang Rui Sent: Monday, October 26, 2020 8:51 AM To: amd-gfx@lists.freedesktop.org Cc: Huang, Ray Subject: [PATCH] drm/amdgpu: add vangogh apu flag This patch is to add vangogh apu flag to support more kickers that belongs vangogh series. Signed-off-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/nv.c | 4 +++- drivers/gpu/drm/amd/include/amd_shared.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index 30ec826c8760..b7fc9ebdf1c1 100644 --- a/drivers/gpu/drm/amd/amdgpu/nv.c +++ b/drivers/gpu/drm/amd/amdgpu/nv.c @@ -941,6 +941,7 @@ static int nv_common_early_init(void *handle) break; case CHIP_VANGOGH: + adev->apu_flags |= AMD_APU_IS_VANGOGH; adev->cg_flags = AMD_CG_SUPPORT_GFX_CGCG | AMD_CG_SUPPORT_GFX_CGLS | AMD_CG_SUPPORT_GFX_3D_CGCG | @@ -951,7 +952,8 @@ static int nv_common_early_init(void *handle) AMD_PG_SUPPORT_VCN | AMD_PG_SUPPORT_VCN_DPG | AMD_PG_SUPPORT_JPEG; - adev->external_rev_id = adev->rev_id + 0x01; + if (adev->apu_flags & AMD_APU_IS_VANGOGH) + adev->external_rev_id = adev->rev_id + 0x01; break; case CHIP_DIMGREY_CAVEFISH: adev->cg_flags = AMD_CG_SUPPORT_GFX_MGCG | diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h index 06c1aabf10ce..412602d84f71 100644 --- a/drivers/gpu/drm/amd/include/amd_shared.h +++ b/drivers/gpu/drm/amd/include/amd_shared.h @@ -46,6 +46,7 @@ enum amd_apu_flags { AMD_APU_IS_PICASSO = 0x0004UL, AMD_APU_IS_RENOIR = 0x0008UL, AMD_APU_IS_GREEN_SARDINE = 0x0010UL, + AMD_APU_IS_VANGOGH = 0x0020UL, }; /** -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C997d0fa293f94eec44b008d879adfbcd%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637393135475905040%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=4zu%2FHsq0nTrx7NL4Dkqupaaet%2Fwzc40zzlXcYQXXbZU%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: amdgpu crashes on OOM
[AMD Public Use] > -Original Message- > From: Michel Dänzer > Sent: Monday, October 26, 2020 7:04 AM > To: Alex Xu (Hello71) ; Kazlauskas, Nicholas > ; Deucher, Alexander > ; Wentland, Harry > ; Li, Sun peng (Leo) ; > amd-gfx@lists.freedesktop.org > Cc: linux-ker...@vger.kernel.org > Subject: Re: amdgpu crashes on OOM > > On 2020-10-26 5:29 a.m., Alex Xu (Hello71) wrote: > > Hi, > > > > I frequently encounter OOM on my system, mostly due to my own fault. > > Recently, I noticed that not only does a swap storm happen and OOM > > killer gets invoked, but the graphics output freezes permanently. > > Checking the kernel messages, I see: > > > > kworker/u24:4: page allocation failure: order:5, > mode:0x40dc0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), > nodemask=(null) > > CPU: 6 PID: 279469 Comm: kworker/u24:4 Tainted: GW > > 5.9.0-14732- > g20b1adb60cf6 #2 > > Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./B450 > > Pro4, BIOS P4.20 06/18/2020 > > Workqueue: events_unbound commit_work > > Call Trace: > > ? dump_stack+0x57/0x6a > > ? warn_alloc.cold+0x69/0xcd > > ? __alloc_pages_direct_compact+0xfb/0x116 > > ? __alloc_pages_slowpath.constprop.0+0x9c2/0xc14 > > ? __alloc_pages_nodemask+0x143/0x167 > > ? kmalloc_order+0x24/0x64 > > ? dc_create_state+0x1a/0x4d > > ? amdgpu_dm_atomic_commit_tail+0x1b19/0x227d > > Looks like dc_create_state should use kvzalloc instead of kzalloc > (dc_state_free already uses kvfree). > > order:5 means it's trying to allocate 32 physically contiguous pages, which > can > be hard to fulfill even with lower memory pressure. > It was using kvzalloc, but was accidently dropped when that code was refactored. I just sent a patch to fix it. Alex > > -- > Earthling Michel Dänzer | > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredh > at.com%2F&data=04%7C01%7Calexander.deucher%40amd.com%7Cc60 > 56551dd4d423bdc0508d8799ed189%7C3dd8961fe4884e608e11a82d994e183d > %7C0%7C0%7C637393070333648663%7CUnknown%7CTWFpbGZsb3d8eyJWIj > oiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1 > 000&sdata=a7Lpu04KnpsFQpCO7y5WOLJSMPpA%2Be1s%2FufgYTDHs2k > %3D&reserved=0 > Libre software enthusiast | Mesa and X developer ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: drop mem_global_referenced
[AMD Public Use] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Christian König Sent: Monday, October 26, 2020 5:29 AM To: amd-gfx@lists.freedesktop.org Subject: [PATCH] drm/amdgpu: drop mem_global_referenced Not used any more. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h index 68c5e3662b87..d808b2a58b28 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h @@ -58,7 +58,6 @@ struct amdgpu_gtt_mgr { struct amdgpu_mman { struct ttm_bo_devicebdev; - boolmem_global_referenced; boolinitialized; void __iomem*aper_base_kaddr; -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7Ccd8ff5e90c384fadb84308d879919c44%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637393013597084067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WaPRmdfK6tnkLkM2PqpEeTv86hilcxdSklXb%2FeloGso%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: enable VCN PG and CG for vangogh
[AMD Public Use] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Zhang, Boyuan Sent: Friday, October 16, 2020 7:28 PM To: amd-gfx@lists.freedesktop.org Subject: [PATCH] drm/amdgpu: enable VCN PG and CG for vangogh [AMD Official Use Only - Internal Distribution Only] [AMD Official Use Only - Internal Distribution Only] Enable VCN 3.0 PG and CG for Vangogh by setting up flags. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/nv.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index 4b1a4acb60d9..ce787489aaeb 100644 --- a/drivers/gpu/drm/amd/amdgpu/nv.c +++ b/drivers/gpu/drm/amd/amdgpu/nv.c @@ -938,8 +938,13 @@ static int nv_common_early_init(void *handle) adev->cg_flags = AMD_CG_SUPPORT_GFX_CGCG | AMD_CG_SUPPORT_GFX_CGLS | AMD_CG_SUPPORT_GFX_3D_CGCG | - AMD_CG_SUPPORT_GFX_3D_CGLS; - adev->pg_flags = AMD_PG_SUPPORT_GFX_PG; + AMD_CG_SUPPORT_GFX_3D_CGLS | + AMD_CG_SUPPORT_VCN_MGCG | + AMD_CG_SUPPORT_JPEG_MGCG; + adev->pg_flags = AMD_PG_SUPPORT_GFX_PG | + AMD_PG_SUPPORT_VCN | + AMD_PG_SUPPORT_VCN_DPG | + AMD_PG_SUPPORT_JPEG; adev->external_rev_id = adev->rev_id + 0x01; break; -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/psp: Fix sysfs: cannot create duplicate filename
[AMD Public Use] Reviewed-by: Alex Deucher Want to add a Fixes: tag? From: amd-gfx on behalf of Andrey Grodzovsky Sent: Friday, October 16, 2020 10:52 AM To: amd-gfx@lists.freedesktop.org Cc: Grodzovsky, Andrey ; Zhang, Jack (Jian) Subject: [PATCH] drm/amd/psp: Fix sysfs: cannot create duplicate filename psp sysfs not cleaned up on driver unload for sienna_cichlid Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 803b3ab..675b14a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -210,7 +210,8 @@ static int psp_sw_fini(void *handle) adev->psp.ta_fw = NULL; } - if (adev->asic_type == CHIP_NAVI10) + if (adev->asic_type == CHIP_NAVI10 || + adev->asic_type == CHIP_SIENNA_CICHLID) psp_sysfs_fini(adev); return 0; -- 2.7.4 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C4b9827047c1f4f1a535908d871e3193a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637384567500193749%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=klYQ7ZzcmrPbXDeEARNHMTjJMUyZWPSn7N3KTQZ2%2FMc%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/2] drm/amd/display: Fix DCN302 makefile
[AMD Public Use] Series is: Reviewed-by: Alex Deucher From: Bhawanpreet Lakha Sent: Thursday, October 15, 2020 2:20 PM To: Kazlauskas, Nicholas ; Deucher, Alexander Cc: rodrigo.siqofue...@amd.com ; amd-gfx@lists.freedesktop.org ; Lakha, Bhawanpreet Subject: [PATCH 2/2] drm/amd/display: Fix DCN302 makefile Some setups will fail to build. So copy dcn301 makefile setup which is known to work Signed-off-by: Bhawanpreet Lakha --- .../gpu/drm/amd/display/dc/dcn302/Makefile| 29 +++ 1 file changed, 29 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/dcn302/Makefile b/drivers/gpu/drm/amd/display/dc/dcn302/Makefile index 3ea9bff27912..36e44e1b07fa 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn302/Makefile +++ b/drivers/gpu/drm/amd/display/dc/dcn302/Makefile @@ -12,6 +12,35 @@ DCN3_02 = dcn302_init.o dcn302_hwseq.o dcn302_resource.o +ifdef CONFIG_X86 +CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -msse +endif + +ifdef CONFIG_PPC64 +CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -maltivec +endif + +ifdef CONFIG_ARM64 +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mgeneral-regs-only +endif + +ifdef CONFIG_CC_IS_GCC +ifeq ($(call cc-ifversion, -lt, 0701, y), y) +IS_OLD_GCC = 1 +endif +endif + +ifdef CONFIG_X86 +ifdef IS_OLD_GCC +# Stack alignment mismatch, proceed with caution. +# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 +# (8B stack alignment). +CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o += -mpreferred-stack-boundary=4 +else +CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o += -msse2 +endif +endif + AMD_DAL_DCN3_02 = $(addprefix $(AMDDALPATH)/dc/dcn302/,$(DCN3_02)) AMD_DISPLAY_FILES += $(AMD_DAL_DCN3_02) -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/2] drm/amdgpu/display: enable display ip block for vangogh
[AMD Official Use Only - Internal Distribution Only] Series is: Reviewed-by: Alex Deucher From: Huang, Ray Sent: Thursday, October 15, 2020 4:28 AM To: amd-gfx@lists.freedesktop.org Cc: Wentland, Harry ; Li, Roman ; Deucher, Alexander ; Huang, Ray Subject: [PATCH 2/2] drm/amdgpu/display: enable display ip block for vangogh This patch is to enable display IP block for vangogh platforms. Signed-off-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 + drivers/gpu/drm/amd/amdgpu/nv.c| 4 2 files changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index a2f0ce854160..15ffb47bd1f0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3014,6 +3014,7 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) case CHIP_SIENNA_CICHLID: case CHIP_NAVY_FLOUNDER: case CHIP_DIMGREY_CAVEFISH: + case CHIP_VANGOGH: #endif return amdgpu_dc != 0; #endif diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index 47bd79c9e6ea..217533e2f181 100644 --- a/drivers/gpu/drm/amd/amdgpu/nv.c +++ b/drivers/gpu/drm/amd/amdgpu/nv.c @@ -621,6 +621,10 @@ int nv_set_ip_blocks(struct amdgpu_device *adev) amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block); if (adev->enable_virtual_display || amdgpu_sriov_vf(adev)) amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block); +#if defined(CONFIG_DRM_AMD_DC) + else if (amdgpu_device_has_dc_support(adev)) + amdgpu_device_ip_block_add(adev, &dm_ip_block); +#endif amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block); amdgpu_device_ip_block_add(adev, &sdma_v5_2_ip_block); amdgpu_device_ip_block_add(adev, &vcn_v3_0_ip_block); -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: update golden setting for sienna_cichlid
[AMD Public Use] Acked-by: Alex Deucher From: amd-gfx on behalf of Likun Gao Sent: Wednesday, October 14, 2020 10:57 PM To: amd-gfx@lists.freedesktop.org Cc: Gao, Likun ; Zhang, Hawking Subject: [PATCH] drm/amdgpu: update golden setting for sienna_cichlid From: Likun Gao Update golden setting for sienna_cichlid. Signed-off-by: Likun Gao Change-Id: I9a1ad84c22748fc100a3327487c6287e237df490 --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index c4e9db3be39a..69e995155594 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -3138,6 +3138,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_3[] = SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2C_ADDR_MATCH_MASK, 0x, 0xffcf), SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2C_CM_CTRL1, 0xff8fff0f, 0x580f1008), SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2C_CTRL3, 0xf7ff, 0x10f80988), + SOC15_REG_GOLDEN_VALUE(GC, 0, mmLDS_CONFIG, 0x0020, 0x0020), SOC15_REG_GOLDEN_VALUE(GC, 0, mmPA_CL_ENHANCE, 0xf17f, 0x0127), SOC15_REG_GOLDEN_VALUE(GC, 0, mmPA_SC_BINNER_TIMEOUT_COUNTER, 0x, 0x0800), SOC15_REG_GOLDEN_VALUE(GC, 0, mmPA_SC_ENHANCE_2, 0xffbf, 0x0820), -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7C1c27e62b5c5343737d4808d870b62790%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637383274974363126&sdata=9HWTZz2G%2B2vTyLoQp9DuFltve2bSs2HFYai072wZB8A%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] Revert "drm/amdgpu: disable gfxoff temporarily for navy_flounder"
[AMD Public Use] Acked-by: Alex Deucher From: amd-gfx on behalf of Jiansong Chen Sent: Wednesday, October 14, 2020 10:46 PM To: amd-gfx@lists.freedesktop.org Cc: Chen, Jiansong (Simon) ; Zhou1, Tao ; Zhang, Hawking Subject: [PATCH] Revert "drm/amdgpu: disable gfxoff temporarily for navy_flounder" This reverts commit 7e59138e97574e8dbecd1f259581277fff555d00. TDR issue has been resovled by pmfw update. Change-Id: Ia04709c4ba13835abfdec56558738bf6fbfac20d --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 - 1 file changed, 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 8fc69c208adb..be13495b97f1 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -3723,7 +3723,6 @@ static void gfx_v10_0_check_gfxoff_flag(struct amdgpu_device *adev) if (!gfx_v10_0_navi10_gfxoff_should_enable(adev)) adev->pm.pp_feature &= ~PP_GFXOFF_MASK; break; - case CHIP_NAVY_FLOUNDER: case CHIP_VANGOGH: adev->pm.pp_feature &= ~PP_GFXOFF_MASK; break; -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7C567c2489998d4d6b96f208d870b49e3a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637383268948419311&sdata=g6fKcr%2BozqHqtFzIdvv5R9ZzuOWj5sRrTqZ%2Bbhn9ruM%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdkfd: Use kvfree in destroy_crat_image
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Kent Russell Sent: Wednesday, October 14, 2020 7:51 AM To: amd-gfx@lists.freedesktop.org Cc: Russell, Kent Subject: [PATCH] drm/amdkfd: Use kvfree in destroy_crat_image Now that we use kvmalloc for the crat_image, we need to use kvfree when we destroy this. Fixes: a522a06f8044 ("drm/amdkfd: Use kvmalloc instead of kmalloc for VCRAT") Reported-by: Morris Zhang Signed-off-by: Kent Russell --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c index 7a071b4f76a7..cdd5032d5c0e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c @@ -1432,5 +1432,5 @@ int kfd_create_crat_image_virtual(void **crat_image, size_t *size, */ void kfd_destroy_crat_image(void *crat_image) { - kfree(crat_image); + kvfree(crat_image); } -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Cf0637add750e4736c8ec08d87037885d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637382731137392526&sdata=oIKYRCK86ld1JxjEsd1EyGsSlskNVyQogIO3spENv0M%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/pm: increase mclk switch threshold to 200 us
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: Quan, Evan Sent: Tuesday, October 13, 2020 2:45 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH] drm/amd/pm: increase mclk switch threshold to 200 us To avoid underflow seen on Polaris10 with some 3440x1440 144Hz displays. As the threshold of 190 us cuts too close to minVBlankTime of 192 us. Change-Id: Ieca0dc900f0b5764dc661e397e41e8c277ff13de Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c index 3bf8be4d107b..1e8919b0acdb 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c @@ -2883,7 +2883,7 @@ static int smu7_vblank_too_short(struct pp_hwmgr *hwmgr, if (hwmgr->is_kicker) switch_limit_us = data->is_memory_gddr5 ? 450 : 150; else - switch_limit_us = data->is_memory_gddr5 ? 190 : 150; + switch_limit_us = data->is_memory_gddr5 ? 200 : 150; break; case CHIP_VEGAM: switch_limit_us = 30; -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH] PCI/ACPI: Whitelist hotplug ports for D3 if power managed by ACPI
[AMD Public Use] > -Original Message- > From: Rafael J. Wysocki > Sent: Friday, October 2, 2020 10:25 AM > To: Deucher, Alexander > Cc: Rafael J. Wysocki ; Lukas Wunner > ; Aaron Zakhrov ; Michal > Rostecki ; Linux PCI ; > Rafael J. Wysocki ; amd-gfx list g...@lists.freedesktop.org>; ACPI Devel Maling List a...@vger.kernel.org>; Shai Coleman ; Bjorn > Helgaas ; Arthur Borsboom > ; matoro ; Mika > Westerberg ; Len Brown > > Subject: Re: [PATCH] PCI/ACPI: Whitelist hotplug ports for D3 if power > managed by ACPI > > On Fri, Oct 2, 2020 at 4:20 PM Deucher, Alexander > wrote: > > > > [AMD Public Use] > > > > > -Original Message- > > > From: amd-gfx On Behalf Of > > > Rafael J. Wysocki > > > Sent: Friday, October 2, 2020 10:17 AM > > > To: Lukas Wunner > > > Cc: Aaron Zakhrov ; Michal Rostecki > > > ; Linux PCI ; Rafael J. > > > Wysocki ; amd-gfx list > > g...@lists.freedesktop.org>; ACPI Devel Maling List > > a...@vger.kernel.org>; Shai Coleman ; Bjorn > > > Helgaas ; Arthur Borsboom > > > ; matoro ; Deucher, > > > Alexander ; Mika Westerberg > > > ; Len Brown > > > Subject: Re: [PATCH] PCI/ACPI: Whitelist hotplug ports for D3 if > > > power managed by ACPI > > > > > > On Fri, Oct 2, 2020 at 7:17 AM Lukas Wunner wrote: > > > > > > > > Recent laptops with dual AMD GPUs fail to suspend the discrete > > > > GPU, thus causing lockups on system sleep and high power > > > > consumption at > > > runtime. > > > > The discrete GPU would normally be suspended to D3cold by turning > > > > off ACPI _PR3 Power Resources of the Root Port above the GPU. > > > > > > > > However on affected systems, the Root Port is hotplug-capable and > > > > pci_bridge_d3_possible() only allows hotplug ports to go to D3 if > > > > they belong to a Thunderbolt device or if the Root Port possesses > > > > a "HotPlugSupportInD3" ACPI property. Neither is the case on > > > > affected laptops. The reason for whitelisting only specific, > > > > known to work hotplug ports for D3 is that there have been reports > > > > of SkyLake Xeon-SP systems raising Hardware Error NMIs upon > > > > suspending their > > > hotplug ports: > > > > > > > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flo > > > re > > > > .kernel.org%2Flinux-pci%2F20170503180426.GA4058%40otc-nc- > > > 03%2F&dat > > > > > > > > a=02%7C01%7Calexander.deucher%40amd.com%7C99ec20b6d4dc410baf800 > > > 8d866dd > > > > > > > > e688%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6373724505855 > > > 84491&a > > > > > > > > mp;sdata=EPFyxPA0MDBuAkvH7bbp2wHYnpos8p%2BoZmzlUvvdAek%3D&a > > > mp;reserved > > > > =0 > > > > > > > > But if a hotplug port is power manageable by ACPI (as can be > > > > detected through presence of Power Resources and corresponding > > > > _PS0 and _PS3 > > > > methods) then it ought to be safe to suspend it to D3. To this > > > > end, amend acpi_pci_bridge_d3() to whitelist such ports for D3. > > > > > > > > Link: > > > > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2F > > > > gitl > > > > ab.freedesktop.org%2Fdrm%2Famd%2F- > > > %2Fissues%2F1222&data=02%7C01%7C > > > > > > > > alexander.deucher%40amd.com%7C99ec20b6d4dc410baf8008d866dde688% > > > 7C3dd89 > > > > > > > > 61fe4884e608e11a82d994e183d%7C0%7C0%7C637372450585584491&sd > > > ata=cMj > > > > > > > > LDIbjp8RQiWX8pgK2bDUH%2B0u3oquy3TqeT9QjZGE%3D&reserved=0 > > > > Link: > > > > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2F > > > > gitl > > > > ab.freedesktop.org%2Fdrm%2Famd%2F- > > > %2Fissues%2F1252&data=02%7C01%7C > > > > > > > > alexander.deucher%40amd.com%7C99ec20b6d4dc410baf8008d866dde688% > > > 7C3dd89 > > > > > > > > 61fe4884e608e11a82d994e183d%7C0%7C0%7C637372450585584491&sd > > > ata=iP9 > > > > > > > > EqNcM15Dj4Ax%2BE6e2HaMWHEX%2B0IO3cMoi0NXWGzM%3D&reser > > > ved=0 > > > > Link: > > > > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2F &
RE: [PATCH] PCI/ACPI: Whitelist hotplug ports for D3 if power managed by ACPI
[AMD Public Use] > -Original Message- > From: amd-gfx On Behalf Of > Rafael J. Wysocki > Sent: Friday, October 2, 2020 10:17 AM > To: Lukas Wunner > Cc: Aaron Zakhrov ; Michal Rostecki > ; Linux PCI ; Rafael J. > Wysocki ; amd-gfx list g...@lists.freedesktop.org>; ACPI Devel Maling List a...@vger.kernel.org>; Shai Coleman ; Bjorn > Helgaas ; Arthur Borsboom > ; matoro ; Deucher, > Alexander ; Mika Westerberg > ; Len Brown > Subject: Re: [PATCH] PCI/ACPI: Whitelist hotplug ports for D3 if power > managed by ACPI > > On Fri, Oct 2, 2020 at 7:17 AM Lukas Wunner wrote: > > > > Recent laptops with dual AMD GPUs fail to suspend the discrete GPU, > > thus causing lockups on system sleep and high power consumption at > runtime. > > The discrete GPU would normally be suspended to D3cold by turning off > > ACPI _PR3 Power Resources of the Root Port above the GPU. > > > > However on affected systems, the Root Port is hotplug-capable and > > pci_bridge_d3_possible() only allows hotplug ports to go to D3 if they > > belong to a Thunderbolt device or if the Root Port possesses a > > "HotPlugSupportInD3" ACPI property. Neither is the case on affected > > laptops. The reason for whitelisting only specific, known to work > > hotplug ports for D3 is that there have been reports of SkyLake > > Xeon-SP systems raising Hardware Error NMIs upon suspending their > hotplug ports: > > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore > > .kernel.org%2Flinux-pci%2F20170503180426.GA4058%40otc-nc- > 03%2F&dat > > > a=02%7C01%7Calexander.deucher%40amd.com%7C99ec20b6d4dc410baf800 > 8d866dd > > > e688%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6373724505855 > 84491&a > > > mp;sdata=EPFyxPA0MDBuAkvH7bbp2wHYnpos8p%2BoZmzlUvvdAek%3D&a > mp;reserved > > =0 > > > > But if a hotplug port is power manageable by ACPI (as can be detected > > through presence of Power Resources and corresponding _PS0 and _PS3 > > methods) then it ought to be safe to suspend it to D3. To this end, > > amend acpi_pci_bridge_d3() to whitelist such ports for D3. > > > > Link: > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitl > > ab.freedesktop.org%2Fdrm%2Famd%2F- > %2Fissues%2F1222&data=02%7C01%7C > > > alexander.deucher%40amd.com%7C99ec20b6d4dc410baf8008d866dde688% > 7C3dd89 > > > 61fe4884e608e11a82d994e183d%7C0%7C0%7C637372450585584491&sd > ata=cMj > > > LDIbjp8RQiWX8pgK2bDUH%2B0u3oquy3TqeT9QjZGE%3D&reserved=0 > > Link: > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitl > > ab.freedesktop.org%2Fdrm%2Famd%2F- > %2Fissues%2F1252&data=02%7C01%7C > > > alexander.deucher%40amd.com%7C99ec20b6d4dc410baf8008d866dde688% > 7C3dd89 > > > 61fe4884e608e11a82d994e183d%7C0%7C0%7C637372450585584491&sd > ata=iP9 > > > EqNcM15Dj4Ax%2BE6e2HaMWHEX%2B0IO3cMoi0NXWGzM%3D&reser > ved=0 > > Link: > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitl > > ab.freedesktop.org%2Fdrm%2Famd%2F- > %2Fissues%2F1304&data=02%7C01%7C > > > alexander.deucher%40amd.com%7C99ec20b6d4dc410baf8008d866dde688% > 7C3dd89 > > > 61fe4884e608e11a82d994e183d%7C0%7C0%7C637372450585584491&sd > ata=VlT > > UV2UCH4RvKgTXZcpGOpkjZpfijmPgwtvKx6HRT04%3D&reserved=0 > > Reported-and-tested-by: Arthur Borsboom > > Reported-and-tested-by: matoro > > Reported-by: Aaron Zakhrov > > Reported-by: Michal Rostecki > > Reported-by: Shai Coleman > > Signed-off-by: Lukas Wunner > > Cc: sta...@vger.kernel.org > > Cc: Alex Deucher > > Cc: Rafael J. Wysocki > > Cc: Mika Westerberg > > --- > > drivers/pci/pci-acpi.c | 10 ++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index > > d5869a0..d9aa551 100644 > > --- a/drivers/pci/pci-acpi.c > > +++ b/drivers/pci/pci-acpi.c > > @@ -944,6 +944,16 @@ static bool acpi_pci_bridge_d3(struct pci_dev > *dev) > > if (!dev->is_hotplug_bridge) > > return false; > > > > + /* Assume D3 support if the bridge is power-manageable by ACPI. */ > > + adev = ACPI_COMPANION(&dev->dev); > > + if (!adev && !pci_dev_is_added(dev)) { > > + adev = acpi_pci_find_companion(&dev->dev); > > + ACPI_COMPANION_SET(&dev->dev, adev); > > + } > > + > > + if (adev && acpi_device_power_manageable(adev)) > > + return true; > > + > > /* > > * Look for a special _DSD property for the root port and if it > > * is set we know the hierarchy behind it supports D3 just fine. > > -- > > I'm going to apply this patch for 5.10 unless Bjorn would rather route it > through the PCI tree. Any chance we can get this into stable at some point as well? It would be nice to fix the laptops out there in the wild running older kernels. Alex ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH] PCI/ACPI: Whitelist hotplug ports for D3 if power managed by ACPI
[AMD Public Use] > -Original Message- > From: Lukas Wunner > Sent: Friday, October 2, 2020 1:10 AM > To: Bjorn Helgaas ; Rafael J. Wysocki > ; Len Brown > Cc: Deucher, Alexander ; Mika Westerberg > ; linux-...@vger.kernel.org; linux- > a...@vger.kernel.org; amd-gfx@lists.freedesktop.org; Arthur Borsboom > ; matoro ; Aaron > Zakhrov ; Michal Rostecki > ; Shai Coleman > Subject: [PATCH] PCI/ACPI: Whitelist hotplug ports for D3 if power managed > by ACPI > > Recent laptops with dual AMD GPUs fail to suspend the discrete GPU, thus > causing lockups on system sleep and high power consumption at runtime. > The discrete GPU would normally be suspended to D3cold by turning off > ACPI _PR3 Power Resources of the Root Port above the GPU. > > However on affected systems, the Root Port is hotplug-capable and > pci_bridge_d3_possible() only allows hotplug ports to go to D3 if they belong > to a Thunderbolt device or if the Root Port possesses a > "HotPlugSupportInD3" ACPI property. Neither is the case on affected > laptops. The reason for whitelisting only specific, known to work hotplug > ports for D3 is that there have been reports of SkyLake Xeon-SP systems > raising Hardware Error NMIs upon suspending their hotplug ports: > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore. > kernel.org%2Flinux-pci%2F20170503180426.GA4058%40otc-nc- > 03%2F&data=02%7C01%7Calexander.deucher%40amd.com%7C712c82d > abd82477e540408d8669172c3%7C3dd8961fe4884e608e11a82d994e183d%7C0 > %7C0%7C637372123238938344&sdata=S1%2ByqWpkuZcilrl7kRXQyodrN > P66MAjcECRDd7tEjpE%3D&reserved=0 > > But if a hotplug port is power manageable by ACPI (as can be detected > through presence of Power Resources and corresponding _PS0 and _PS3 > methods) then it ought to be safe to suspend it to D3. To this end, amend > acpi_pci_bridge_d3() to whitelist such ports for D3. > > Link: > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitla > b.freedesktop.org%2Fdrm%2Famd%2F- > %2Fissues%2F1222&data=02%7C01%7Calexander.deucher%40amd.com > %7C712c82dabd82477e540408d8669172c3%7C3dd8961fe4884e608e11a82d99 > 4e183d%7C0%7C0%7C637372123238938344&sdata=k%2FRI8kSJclwhzYuc > WSjAZNzNEaaU9JgIYNjJsV0dAWo%3D&reserved=0 > Link: > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitla > b.freedesktop.org%2Fdrm%2Famd%2F- > %2Fissues%2F1252&data=02%7C01%7Calexander.deucher%40amd.com > %7C712c82dabd82477e540408d8669172c3%7C3dd8961fe4884e608e11a82d99 > 4e183d%7C0%7C0%7C637372123238938344&sdata=JvakgHaQNI6XMaM > eTHqtPJ5ooZP83lN%2F6wcdHyt53yA%3D&reserved=0 > Link: > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitla > b.freedesktop.org%2Fdrm%2Famd%2F- > %2Fissues%2F1304&data=02%7C01%7Calexander.deucher%40amd.com > %7C712c82dabd82477e540408d8669172c3%7C3dd8961fe4884e608e11a82d99 > 4e183d%7C0%7C0%7C637372123238938344&sdata=8clLa%2BCnwH4xtK > Dc7F9%2FqPBSMFygpjP8EiPgVIz9LiE%3D&reserved=0 > Reported-and-tested-by: Arthur Borsboom > Reported-and-tested-by: matoro > Reported-by: Aaron Zakhrov > Reported-by: Michal Rostecki > Reported-by: Shai Coleman > Signed-off-by: Lukas Wunner > Cc: sta...@vger.kernel.org > Cc: Alex Deucher > Cc: Rafael J. Wysocki > Cc: Mika Westerberg Thanks for sorting this out. Acked-by: Alex Deucher > --- > drivers/pci/pci-acpi.c | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index > d5869a0..d9aa551 100644 > --- a/drivers/pci/pci-acpi.c > +++ b/drivers/pci/pci-acpi.c > @@ -944,6 +944,16 @@ static bool acpi_pci_bridge_d3(struct pci_dev *dev) > if (!dev->is_hotplug_bridge) > return false; > > + /* Assume D3 support if the bridge is power-manageable by ACPI. */ > + adev = ACPI_COMPANION(&dev->dev); > + if (!adev && !pci_dev_is_added(dev)) { > + adev = acpi_pci_find_companion(&dev->dev); > + ACPI_COMPANION_SET(&dev->dev, adev); > + } > + > + if (adev && acpi_device_power_manageable(adev)) > + return true; > + > /* >* Look for a special _DSD property for the root port and if it >* is set we know the hierarchy behind it supports D3 just fine. > -- > 2.27.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/pm: fix screen flicker seen on Navi14 with 2*4K monitors
[AMD Official Use Only - Internal Distribution Only] Thanks. Acked-by: Alex Deucher From: Quan, Evan Sent: Thursday, September 24, 2020 11:38 PM To: Alex Deucher Cc: amd-gfx list ; Deucher, Alexander Subject: RE: [PATCH] drm/amd/pm: fix screen flicker seen on Navi14 with 2*4K monitors [AMD Official Use Only - Internal Distribution Only] That(postpone SOCCLK/UCLK enablement) will be revised and added back after confirmed with DAL team. For now, we just revert it to get around the screen flicker issue introduced. BR Evan -Original Message- From: Alex Deucher Sent: Thursday, September 24, 2020 9:01 PM To: Quan, Evan Cc: amd-gfx list ; Deucher, Alexander Subject: Re: [PATCH] drm/amd/pm: fix screen flicker seen on Navi14 with 2*4K monitors On Thu, Sep 24, 2020 at 6:10 AM Evan Quan wrote: > > Revert the guilty change introduced by the commit below: > drm/amd/pm: postpone SOCCLK/UCLK enablement after DAL > initialization(V2) > > Change-Id: I0cab619ffdf0f83b14ba5d2907e1b9c02a984e2f > Signed-off-by: Evan Quan Won't this effectively disable the potential fix for multiple monitors at boot time? Acked-by: Alex Deucher > --- > .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 43 ++- > 1 file changed, 12 insertions(+), 31 deletions(-) > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c > b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c > index 1695b36dc23c..be44cb941e73 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c > @@ -316,6 +316,18 @@ navi10_get_allowed_feature_mask(struct smu_context *smu, > if (smu->dc_controlled_by_gpio) > *(uint64_t *)feature_mask |= > FEATURE_MASK(FEATURE_ACDC_BIT); > > + if (adev->pm.pp_feature & PP_SOCCLK_DPM_MASK) > + *(uint64_t *)feature_mask |= > + FEATURE_MASK(FEATURE_DPM_SOCCLK_BIT); > + > + /* DPM UCLK enablement should be skipped for navi10 A0 secure board */ > + if (!(is_asic_secure(smu) && > +(adev->asic_type == CHIP_NAVI10) && > +(adev->rev_id == 0)) && > + (adev->pm.pp_feature & PP_MCLK_DPM_MASK)) > + *(uint64_t *)feature_mask |= > FEATURE_MASK(FEATURE_DPM_UCLK_BIT) > + | FEATURE_MASK(FEATURE_MEM_VDDCI_SCALING_BIT) > + | > + FEATURE_MASK(FEATURE_MEM_MVDD_SCALING_BIT); > + > /* DS SOCCLK enablement should be skipped for navi10 A0 secure board > */ > if (is_asic_secure(smu) && > (adev->asic_type == CHIP_NAVI10) && @@ -2629,43 +2641,12 > @@ static int navi10_enable_mgpu_fan_boost(struct smu_context *smu) > > static int navi10_post_smu_init(struct smu_context *smu) { > - struct smu_feature *feature = &smu->smu_feature; > struct amdgpu_device *adev = smu->adev; > - uint64_t feature_mask = 0; > int ret = 0; > > if (amdgpu_sriov_vf(adev)) > return 0; > > - /* For Naiv1x, enable these features only after DAL initialization */ > - if (adev->pm.pp_feature & PP_SOCCLK_DPM_MASK) > - feature_mask |= FEATURE_MASK(FEATURE_DPM_SOCCLK_BIT); > - > - /* DPM UCLK enablement should be skipped for navi10 A0 secure board */ > - if (!(is_asic_secure(smu) && > -(adev->asic_type == CHIP_NAVI10) && > -(adev->rev_id == 0)) && > - (adev->pm.pp_feature & PP_MCLK_DPM_MASK)) > - feature_mask |= FEATURE_MASK(FEATURE_DPM_UCLK_BIT) > - | FEATURE_MASK(FEATURE_MEM_VDDCI_SCALING_BIT) > - | FEATURE_MASK(FEATURE_MEM_MVDD_SCALING_BIT); > - > - if (!feature_mask) > - return 0; > - > - bitmap_or(feature->allowed, > - feature->allowed, > - (unsigned long *)(&feature_mask), > - SMU_FEATURE_MAX); > - > - ret = smu_cmn_feature_update_enable_state(smu, > - feature_mask, > - true); > - if (ret) { > - dev_err(adev->dev, "Failed to post uclk/socclk dpm > enablement!\n"); > - return ret; > - } > - > ret = navi10_run_umc_cdr_workaround(smu); > if (ret) { > dev_err(adev->dev, "Failed to apply umc cdr > workaround!\n"); > -- > 2.28.0 > > ___ > amd-gfx mailing list > amd-g
Re: [PATCH] drm/amd/pm: correct the pmfw version check for Navi14
[AMD Public Use] Reviewed-by: Alex Deucher From: Quan, Evan Sent: Sunday, September 20, 2020 10:47 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH] drm/amd/pm: correct the pmfw version check for Navi14 Otherwise, that will be always true for Navi14. Change-Id: Ief94150d10e4987e405d97674d9ae4efe89246fb Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c index e729337e84d0..b9e522ed499a 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c @@ -2279,13 +2279,14 @@ static int navi10_run_umc_cdr_workaround(struct smu_context *smu) } /* -* The messages below are only supported by 42.53.0 and later -* PMFWs. +* The messages below are only supported by Navi10 42.53.0 and later +* PMFWs and Navi14 53.29.0 and later PMFWs. * - PPSMC_MSG_SetDriverDummyTableDramAddrHigh * - PPSMC_MSG_SetDriverDummyTableDramAddrLow * - PPSMC_MSG_GetUMCFWWA */ - if (pmfw_version >= 0x2a3500) { + if (((adev->asic_type == CHIP_NAVI10) && (pmfw_version >= 0x2a3500)) || + ((adev->asic_type == CHIP_NAVI14) && (pmfw_version >= 0x351D00))) { ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GET_UMC_FW_WA, 0, -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/2] drm/amd/pm: drop redundant watermarks bitmap setting
[AMD Public Use] Series is: Reviewed-by: Alex Deucher From: Quan, Evan Sent: Sunday, September 20, 2020 10:49 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH 2/2] drm/amd/pm: drop redundant watermarks bitmap setting As this is already set inside the implementation of smu_set_watermarks_table(). Change-Id: I4d4d40855f0aad43f6d21d471b64f1c7e696f0e7 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 002bae81b856..ef10be599d37 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -1838,11 +1838,6 @@ int smu_set_watermarks_for_clock_ranges(struct smu_context *smu, ret = smu_set_watermarks_table(smu, clock_ranges); - if (!(smu->watermarks_bitmap & WATERMARKS_EXIST)) { - smu->watermarks_bitmap |= WATERMARKS_EXIST; - smu->watermarks_bitmap &= ~WATERMARKS_LOADED; - } - mutex_unlock(&smu->mutex); return ret; -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdkfd: Use kvmalloc instead of kmalloc for VCRAT
[AMD Public Use] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Kent Russell Sent: Monday, September 21, 2020 10:27 AM To: amd-gfx@lists.freedesktop.org Cc: Russell, Kent Subject: [PATCH] drm/amdkfd: Use kvmalloc instead of kmalloc for VCRAT Since we're dynamically allocating the CPU VCRAT, use kvmalloc in case the allocation size is huge. Signed-off-by: Kent Russell --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c index 99182b8e9152..c50e9f634d6c 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c @@ -797,7 +797,8 @@ int kfd_create_crat_image_acpi(void **crat_image, size_t *size) return -ENODATA; } - pcrat_image = kmemdup(crat_table, crat_table->length, GFP_KERNEL); + pcrat_image = kvmalloc(crat_table->length, GFP_KERNEL); + memcpy(pcrat_image, crat_table, crat_table->length); if (!pcrat_image) return -ENOMEM; @@ -1383,7 +1384,7 @@ int kfd_create_crat_image_virtual(void **crat_image, size_t *size, num_nodes * (sizeof(struct crat_subtype_computeunit) + sizeof(struct crat_subtype_memory) + (num_nodes - 1) * sizeof(struct crat_subtype_iolink)); - pcrat_image = kmalloc(dyn_size, GFP_KERNEL); + pcrat_image = kvmalloc(dyn_size, GFP_KERNEL); if (!pcrat_image) return -ENOMEM; *size = dyn_size; @@ -1393,7 +1394,7 @@ int kfd_create_crat_image_virtual(void **crat_image, size_t *size, case COMPUTE_UNIT_GPU: if (!kdev) return -EINVAL; - pcrat_image = kmalloc(VCRAT_SIZE_FOR_GPU, GFP_KERNEL); + pcrat_image = kvmalloc(VCRAT_SIZE_FOR_GPU, GFP_KERNEL); if (!pcrat_image) return -ENOMEM; *size = VCRAT_SIZE_FOR_GPU; @@ -1412,7 +1413,7 @@ int kfd_create_crat_image_virtual(void **crat_image, size_t *size, if (!ret) *crat_image = pcrat_image; else - kfree(pcrat_image); + kvfree(pcrat_image); return ret; } -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7C2c0550686c55482e784108d85e3a79b9%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637362952855598708&sdata=juwKVfB3gvGU5TkLKf9KYPdy90sgT80810dh91hpZSw%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/pm: apply dummy reads workaround for CDR enabled only
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: Quan, Evan Sent: Thursday, September 17, 2020 10:36 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH] drm/amd/pm: apply dummy reads workaround for CDR enabled only For CDR disabled case, the dummy reads workaround is not needed. Change-Id: I474619b3d82792151870811c289ab311028de211 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c index 338a9fdeef6e..5b87690c1e61 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c @@ -2303,10 +2303,12 @@ static int navi10_run_umc_cdr_workaround(struct smu_context *smu) if (umc_fw_greater_than_v136) return 0; - if (umc_fw_disable_cdr && adev->asic_type == CHIP_NAVI10) - return navi10_umc_hybrid_cdr_workaround(smu); - else + if (umc_fw_disable_cdr) { + if (adev->asic_type == CHIP_NAVI10) + return navi10_umc_hybrid_cdr_workaround(smu); + } else { return navi10_set_dummy_pstates_table_location(smu); + } } else { if (adev->asic_type == CHIP_NAVI10) return navi10_umc_hybrid_cdr_workaround(smu); -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/display: Don't log hdcp module warnings in dmesg
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: Bhawanpreet Lakha Sent: Tuesday, September 15, 2020 5:38 PM To: Deucher, Alexander Cc: Siqueira, Rodrigo ; Kazlauskas, Nicholas ; amd-gfx@lists.freedesktop.org ; Lakha, Bhawanpreet Subject: [PATCH] drm/amd/display: Don't log hdcp module warnings in dmesg [Why] DTM topology updates happens by default now. This results in DTM warnings when hdcp is not even being enabled. This spams the dmesg and doesn't effect normal display functionality so it is better to log it using DRM_DEBUG_KMS() [How] Change the DRM_WARN() to DRM_DEBUG_KMS() Signed-off-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/display/modules/hdcp/hdcp_log.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_log.h b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_log.h index d3192b9d0c3d..47f8ee2832ff 100644 --- a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_log.h +++ b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_log.h @@ -27,7 +27,7 @@ #define MOD_HDCP_LOG_H_ #ifdef CONFIG_DRM_AMD_DC_HDCP -#define HDCP_LOG_ERR(hdcp, ...) DRM_WARN(__VA_ARGS__) +#define HDCP_LOG_ERR(hdcp, ...) DRM_DEBUG_KMS(__VA_ARGS__) #define HDCP_LOG_VER(hdcp, ...) DRM_DEBUG_KMS(__VA_ARGS__) #define HDCP_LOG_FSM(hdcp, ...) DRM_DEBUG_KMS(__VA_ARGS__) #define HDCP_LOG_TOP(hdcp, ...) pr_debug("[HDCP_TOP]:"__VA_ARGS__) -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: Update RAS init handling
[AMD Public Use] Also, general nit, per kernel coding style, braces should be on the same line as the if or else, E.g., } else { Alex From: amd-gfx on behalf of Zhang, Hawking Sent: Friday, September 11, 2020 2:02 AM To: Clements, John ; amd-gfx list ; Chen, Guchun Subject: RE: [PATCH] drm/amdgpu: Update RAS init handling [AMD Public Use] + { + dev_warn(psp->adev->dev, "RAS Init Status: 0x%X\n", ras_cmd->ras_status); + } Please remove the redundant bracket. Other than that, the patch is Reviewed-by: Hawking Zhang In addition, please create another patch to move the nbio ras controller irq source registry to sw_init, which is the consistent as what we did for other ip blocks, register the irq source in IP sw_init funcs. Regards, Hawking From: Clements, John Sent: Friday, September 11, 2020 12:03 To: amd-gfx list ; Chen, Guchun ; Zhang, Hawking Subject: [PATCH] drm/amdgpu: Update RAS init handling [AMD Official Use Only - Internal Distribution Only] Added RAS status check and tear down RAS context if RAS init fails ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/1] drm/amdgpu: fix a typo
[AMD Public Use] This is not upstream, but Acked-by: Alex Deucher From: amd-gfx on behalf of Nirmoy Das Sent: Tuesday, September 8, 2020 11:57 AM To: amd-gfx@lists.freedesktop.org Cc: Das, Nirmoy ; Kazlauskas, Nicholas Subject: [PATCH 1/1] drm/amdgpu: fix a typo Fixes: 9a0154630e958a2f (drm/amdgpu: Bring back support for non-upstream FreeSync) Signed-off-by: Nirmoy Das --- include/uapi/drm/amdgpu_drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h index b826f2d6efe1..d3dadf10b13d 100644 --- a/include/uapi/drm/amdgpu_drm.h +++ b/include/uapi/drm/amdgpu_drm.h @@ -1096,7 +1096,7 @@ struct drm_amdgpu_info_vce_clock_table { struct drm_amdgpu_freesync { __u32 op; /* AMDGPU_FREESYNC_FULLSCREEN_ENTER or */ - /* AMDGPU_FREESYNC_FULLSCREEN_ENTER */ + /* AMDGPU_FREESYNC_FULLSCREEN_EXIT */ __u32 spare[7]; }; -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7C7f09b7d46fde47c781cf08d8540f3bb0%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637351771962233619&sdata=t9hpqDYdTNU2bKoOTiGOi3bJvRhYZqCdzVdQ3Xv8dUk%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: Include sienna_cichlid in USBC PD FW support.
[AMD Public Use] Reviewed-by: Alex Deucher From: Grodzovsky, Andrey Sent: Monday, September 14, 2020 10:32 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander Subject: Re: [PATCH] drm/amdgpu: Include sienna_cichlid in USBC PD FW support. Ping Andrey On 9/10/20 2:05 PM, Andrey Grodzovsky wrote: > Create sysfs interface also for sienna_cichlid. > > Signed-off-by: Andrey Grodzovsky > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c > index a7771aa..600015e 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c > @@ -178,7 +178,7 @@ static int psp_sw_init(void *handle) >return ret; >} > > - if (adev->asic_type == CHIP_NAVI10) { > + if (adev->asic_type == CHIP_NAVI10 || adev->asic_type == > CHIP_SIENNA_CICHLID) { >ret= psp_sysfs_init(adev); >if (ret) { >return ret; ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH v3 6/7] drm: Validate encoder->possible_crtcs
[AMD Public Use] > -Original Message- > From: amd-gfx On Behalf Of > Daniel Vetter > Sent: Monday, September 7, 2020 3:15 AM > To: Jan Kiszka ; amd-gfx list g...@lists.freedesktop.org>; Wentland, Harry ; > Kazlauskas, Nicholas > Cc: dri-devel ; intel-gfx g...@lists.freedesktop.org>; Thomas Zimmermann > ; Ville Syrjala > Subject: Re: [PATCH v3 6/7] drm: Validate encoder->possible_crtcs > > On Sun, Sep 6, 2020 at 1:19 PM Jan Kiszka wrote: > > > > On 11.02.20 18:04, Daniel Vetter wrote: > > > On Tue, Feb 11, 2020 at 06:22:07PM +0200, Ville Syrjala wrote: > > >> From: Ville Syrjälä > > >> > > >> WARN if the encoder possible_crtcs is effectively empty or contains > > >> bits for non-existing crtcs. > > >> > > >> v2: Move to drm_mode_config_validate() (Daniel) > > >> Make the docs say we WARN when this is wrong (Daniel) > > >> Extract full_crtc_mask() > > >> > > >> Cc: Thomas Zimmermann > > >> Cc: Daniel Vetter > > >> Signed-off-by: Ville Syrjälä > > > > > > When pushing the fixup needs to be applied before the validation > > > patch here, because we don't want to anger the bisect gods. > > > > > > Reviewed-by: Daniel Vetter > > > > > > I think with the fixup we should be good enough with the existing > > > nonsense in drivers. Fingers crossed. > > > -Daniel > > > > > > > > >> --- > > >> drivers/gpu/drm/drm_mode_config.c | 27 > ++- > > >> include/drm/drm_encoder.h | 2 +- > > >> 2 files changed, 27 insertions(+), 2 deletions(-) > > >> > > >> diff --git a/drivers/gpu/drm/drm_mode_config.c > > >> b/drivers/gpu/drm/drm_mode_config.c > > >> index afc91447293a..4c1b350ddb95 100644 > > >> --- a/drivers/gpu/drm/drm_mode_config.c > > >> +++ b/drivers/gpu/drm/drm_mode_config.c > > >> @@ -581,6 +581,29 @@ static void > validate_encoder_possible_clones(struct drm_encoder *encoder) > > >> encoder->possible_clones, encoder_mask); } > > >> > > >> +static u32 full_crtc_mask(struct drm_device *dev) { > > >> +struct drm_crtc *crtc; > > >> +u32 crtc_mask = 0; > > >> + > > >> +drm_for_each_crtc(crtc, dev) > > >> +crtc_mask |= drm_crtc_mask(crtc); > > >> + > > >> +return crtc_mask; > > >> +} > > >> + > > >> +static void validate_encoder_possible_crtcs(struct drm_encoder > > >> +*encoder) { > > >> +u32 crtc_mask = full_crtc_mask(encoder->dev); > > >> + > > >> +WARN((encoder->possible_crtcs & crtc_mask) == 0 || > > >> + (encoder->possible_crtcs & ~crtc_mask) != 0, > > >> + "Bogus possible_crtcs: " > > >> + "[ENCODER:%d:%s] possible_crtcs=0x%x (full crtc mask=0x%x)\n", > > >> + encoder->base.id, encoder->name, > > >> + encoder->possible_crtcs, crtc_mask); } > > >> + > > >> void drm_mode_config_validate(struct drm_device *dev) { > > >> struct drm_encoder *encoder; > > >> @@ -588,6 +611,8 @@ void drm_mode_config_validate(struct > drm_device *dev) > > >> drm_for_each_encoder(encoder, dev) > > >> fixup_encoder_possible_clones(encoder); > > >> > > >> -drm_for_each_encoder(encoder, dev) > > >> +drm_for_each_encoder(encoder, dev) { > > >> validate_encoder_possible_clones(encoder); > > >> +validate_encoder_possible_crtcs(encoder); > > >> +} > > >> } > > >> diff --git a/include/drm/drm_encoder.h b/include/drm/drm_encoder.h > > >> index 3741963b9587..b236269f41ac 100644 > > >> --- a/include/drm/drm_encoder.h > > >> +++ b/include/drm/drm_encoder.h > > >> @@ -142,7 +142,7 @@ struct drm_encoder { > > >> * the bits for all &drm_crtc objects this encoder can be connected > > >> to > > >> * before calling drm_dev_register(). > > >> * > > >> - * In reality almost every driver gets this wrong. > > >> + * You will get a WARN if you get this wrong in the driver. > > >> * > > >> * Note that since CRTC objects can't be hotplugged the assigned > indices > > >> * are stable and hence known before registering all objects. > > >> -- > > >> 2.24.1 > > >> > > > > > > > Triggers on an Advantech AIMB-228 (R1505G, 3 DP outputs): > > Adding amdgpu display folks. I took a quick look at this and it looks like we limit the number of crtcs later in the mode init process if the number of physical displays can't actually use more crtcs. E.g., the physical board configuration would only allow for 3 active displays even if the hardware technically supports 4 crtcs. I presume that way we can just leave the additional hardware power gated all the time. Alex > -Daniel > > > > > [ 14.033246] [ cut here ] > > [ 14.033248] Bogus possible_crtcs: [ENCODER:65:TMDS-65] > possible_crtcs=0xf (full crtc mask=0x7) > > [ 14.033279] WARNING: CPU: 0 PID: 282 at > ../drivers/gpu/drm/drm_mode_config.c:622 > drm_mode_config_validate+0x17d/0x200 [drm] > > [ 14.033279] Modules linked in: amdgpu(E+) mfd_core(E) > snd_hda_codec_realtek(E) kvm_amd(E) gpu_sched(E) i2c_algo_bit(E) ttm(E) > snd_hda_co
Re: [PATCH] drm/amdgpu: add ta firmware load in psp_v12_0 for renoir
Reviewed-by: Alex Deucher From: Zhu, Changfeng Sent: Thursday, September 3, 2020 11:19 AM To: Lakha, Bhawanpreet ; Deucher, Alexander ; amd-gfx@lists.freedesktop.org ; Huang, Ray Subject: RE: [PATCH] drm/amdgpu: add ta firmware load in psp_v12_0 for renoir [AMD Public Use] [AMD Public Use] Thanks, Lakha. BR, Changfeng. From: Lakha, Bhawanpreet Sent: Thursday, September 3, 2020 11:07 PM To: Deucher, Alexander ; Zhu, Changfeng ; amd-gfx@lists.freedesktop.org; Huang, Ray Subject: Re: [PATCH] drm/amdgpu: add ta firmware load in psp_v12_0 for renoir [AMD Public Use] Hi Alex, psp_sw_fini() releases the ta firmware Reviewed-by: Bhawanpreet Lakha mailto:bhawanpreet.la...@amd.com>> From: Deucher, Alexander mailto:alexander.deuc...@amd.com>> Sent: September 2, 2020 10:18 AM To: Zhu, Changfeng mailto:changfeng@amd.com>>; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> mailto:amd-gfx@lists.freedesktop.org>>; Huang, Ray mailto:ray.hu...@amd.com>>; Lakha, Bhawanpreet mailto:bhawanpreet.la...@amd.com>> Subject: Re: [PATCH] drm/amdgpu: add ta firmware load in psp_v12_0 for renoir [AMD Public Use] We also need to release the firmware when the driver unloads or is that already handled in some common path? Alex From: amd-gfx mailto:amd-gfx-boun...@lists.freedesktop.org>> on behalf of Changfeng.Zhu mailto:changfeng@amd.com>> Sent: Tuesday, September 1, 2020 10:25 PM To: amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> mailto:amd-gfx@lists.freedesktop.org>>; Huang, Ray mailto:ray.hu...@amd.com>>; Lakha, Bhawanpreet mailto:bhawanpreet.la...@amd.com>> Cc: Zhu, Changfeng mailto:changfeng@amd.com>> Subject: [PATCH] drm/amdgpu: add ta firmware load in psp_v12_0 for renoir From: changzhu mailto:changfeng@amd.com>> From: Changfeng mailto:changfeng@amd.com>> It needs to load renoir_ta firmware because hdcp is enabled by default for renoir now. This can avoid error:DTM TA is not initialized Change-Id: Ib2f03a531013e4b432c2e9d4ec3dc021b4f8da7d Signed-off-by: Changfeng mailto:changfeng@amd.com>> --- drivers/gpu/drm/amd/amdgpu/psp_v12_0.c | 54 ++ 1 file changed, 54 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c index 6c9614f77d33..75489313dbad 100644 --- a/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c +++ b/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c @@ -38,6 +38,8 @@ #include "oss/osssys_4_0_sh_mask.h" MODULE_FIRMWARE("amdgpu/renoir_asd.bin"); +MODULE_FIRMWARE("amdgpu/renoir_ta.bin"); + /* address block */ #define smnMP1_FIRMWARE_FLAGS 0x3010024 @@ -45,7 +47,10 @@ static int psp_v12_0_init_microcode(struct psp_context *psp) { struct amdgpu_device *adev = psp->adev; const char *chip_name; + char fw_name[30]; int err = 0; + const struct ta_firmware_header_v1_0 *ta_hdr; + DRM_DEBUG("\n"); switch (adev->asic_type) { case CHIP_RENOIR: @@ -56,6 +61,55 @@ static int psp_v12_0_init_microcode(struct psp_context *psp) } err = psp_init_asd_microcode(psp, chip_name); + if (err) + goto out; + + snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name); + err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev); + if (err) { + release_firmware(adev->psp.ta_fw); + adev->psp.ta_fw = NULL; + dev_info(adev->dev, +"psp v12.0: Failed to load firmware \"%s\"\n", +fw_name); + } else { + err = amdgpu_ucode_validate(adev->psp.ta_fw); + if (err) + goto out2; + + ta_hdr = (const struct ta_firmware_header_v1_0 *) +adev->psp.ta_fw->data; + adev->psp.ta_hdcp_ucode_version = + le32_to_cpu(ta_hdr->ta_hdcp_ucode_version); + adev->psp.ta_hdcp_ucode_size = + le32_to_cpu(ta_hdr->ta_hdcp_size_bytes); + adev->psp.ta_hdcp_start_addr = + (uint8_t *)ta_hdr + + le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes); + + adev->psp.ta_fw_version = le32_to_cpu(ta_hdr->header.ucode_version); + + adev->psp.ta_dtm_ucode_version = + le32_to_cpu(ta_hdr->ta_dtm_ucode_version); + adev->psp.ta_dtm_ucode_size = + le32_to_cpu(ta_hdr->ta_dtm_size_bytes); + adev->psp.t
Re: [PATCH v4 0/8] Implement PCI Error Recovery on Navi12
[AMD Official Use Only - Internal Distribution Only] I'll push an updated branch shortly. Alex From: Grodzovsky, Andrey Sent: Thursday, September 3, 2020 11:01 AM To: Bjorn Helgaas Cc: amd-gfx@lists.freedesktop.org ; sathyanarayanan.kuppusw...@linux.intel.com ; linux-...@vger.kernel.org ; Deucher, Alexander ; Das, Nirmoy ; Li, Dennis ; Koenig, Christian ; Tuikov, Luben ; bhelg...@google.com Subject: Re: [PATCH v4 0/8] Implement PCI Error Recovery on Navi12 This one is very close - https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-drm-next Andrey On 9/2/20 8:41 PM, Bjorn Helgaas wrote: > On Wed, Sep 02, 2020 at 11:43:41PM +, Grodzovsky, Andrey wrote: >> It's based on v5.9-rc2 but won't apply cleanly since there is a >> significant amount of amd-staging-drm-next patches which this was >> applied on top of. > Is there a git branch published somewhere? It'd be nice to be able to > see the whole thing, including the bits that this depends on from > amd-staging-drm-next. ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/2] drm/amdgpu/gmc10: print client id string for gfxhub
[AMD Official Use Only - Internal Distribution Only] I'm working on the mmhub clients list. Will send out patches for them soon. Alex From: Christian König Sent: Wednesday, September 2, 2020 3:17 AM To: Kuehling, Felix ; Alex Deucher ; amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander Subject: Re: [PATCH 2/2] drm/amdgpu/gmc10: print client id string for gfxhub Am 02.09.20 um 04:32 schrieb Felix Kuehling: > Should there a corresponding change in mmhub_v2_0.c? It would be at least nice to have. Maybe we should put a pointer to the array and its size into the hub structure instead? Anyway Reviewed-by: Christian König for now. Christian. > > Other than that, the series is > > Reviewed-by: Felix Kuehling > > On 2020-09-01 5:51 p.m., Alex Deucher wrote: >> Print the name of the client rather than the number. This >> makes it easier to debug what block is causing the fault. >> >> Signed-off-by: Alex Deucher >> --- >> drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c | 30 +--- >> drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c | 30 +--- >> 2 files changed, 54 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c >> b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c >> index 76acd7f7723e..b882ac59879a 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c >> +++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c >> @@ -31,6 +31,27 @@ >> #include "soc15_common.h" >> +static const char *gfxhub_client_ids[] = { >> +"CB/DB", >> +"Reserved", >> +"GE1", >> +"GE2", >> +"CPF", >> +"CPC", >> +"CPG", >> +"RLC", >> +"TCP", >> +"SQC (inst)", >> +"SQC (data)", >> +"SQG", >> +"Reserved", >> +"SDMA0", >> +"SDMA1", >> +"GCR", >> +"SDMA2", >> +"SDMA3", >> +}; >> + >> static uint32_t gfxhub_v2_0_get_invalidate_req(unsigned int vmid, >> uint32_t flush_type) >> { >> @@ -55,12 +76,15 @@ static void >> gfxhub_v2_0_print_l2_protection_fault_status(struct amdgpu_device >> *adev, >>uint32_t status) >> { >> +u32 cid = REG_GET_FIELD(status, >> +GCVM_L2_PROTECTION_FAULT_STATUS, CID); >> + >> dev_err(adev->dev, >> "GCVM_L2_PROTECTION_FAULT_STATUS:0x%08X\n", >> status); >> -dev_err(adev->dev, "\t Faulty UTCL2 client ID: 0x%lx\n", >> -REG_GET_FIELD(status, >> -GCVM_L2_PROTECTION_FAULT_STATUS, CID)); >> +dev_err(adev->dev, "\t Faulty UTCL2 client ID: %s (0x%x)\n", >> +cid >= ARRAY_SIZE(gfxhub_client_ids) ? "unknown" : >> gfxhub_client_ids[cid], >> +cid); >> dev_err(adev->dev, "\t MORE_FAULTS: 0x%lx\n", >> REG_GET_FIELD(status, >> GCVM_L2_PROTECTION_FAULT_STATUS, MORE_FAULTS)); >> diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c >> b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c >> index 80c906a0383f..237a9ff5afa0 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c >> +++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c >> @@ -31,6 +31,27 @@ >> #include "soc15_common.h" >> +static const char *gfxhub_client_ids[] = { >> +"CB/DB", >> +"Reserved", >> +"GE1", >> +"GE2", >> +"CPF", >> +"CPC", >> +"CPG", >> +"RLC", >> +"TCP", >> +"SQC (inst)", >> +"SQC (data)", >> +"SQG", >> +"Reserved", >> +"SDMA0", >> +"SDMA1", >> +"GCR", >> +"SDMA2", >> +"SDMA3", >> +}; >> + >> static uint32_t gfxhub_v2_1_get_invalidate_req(unsigned int vmid, >> uint32_t flush_type) >> { >> @@ -55,12 +76,15 @@ static void >> gfxhub_v2_1_print_l2_protection_fault_status(struct amdgpu_device >> *adev, >>uint32_t status) >> { >> +u32 cid = REG_GET_FIELD(status, >> +GCVM_L2_PROTECTION_FAULT_STATUS, CID); >> + >>
Re: [PATCH] drm/amdgpu: fix max_entries calculation v2
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: amd-gfx on behalf of Christian König Sent: Wednesday, September 2, 2020 10:05 AM To: Pan, Xinhui ; amd-gfx@lists.freedesktop.org Subject: [PATCH] drm/amdgpu: fix max_entries calculation v2 Calculate the correct value for max_entries or we might run after the page_address array. v2: Xinhui pointed out we don't need the shift Signed-off-by: Christian König Fixes: 1e691e244487 drm/amdgpu: stop allocating dummy GTT nodes --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 8bc2253939be..be886bdca5c6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1697,7 +1697,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, AMDGPU_GPU_PAGES_IN_CPU_PAGE; } else { addr = 0; - max_entries = S64_MAX; + max_entries = mapping->last - mapping->start + 1; } if (pages_addr) { -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Ce5239f6d94a9480e27e008d84f4939b5%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637346523216694548&sdata=OF7UX%2FLbWPJXkymt1QsdVVrQCZxI2Avj%2BBv1HYWPzxo%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: add ta firmware load in psp_v12_0 for renoir
[AMD Public Use] We also need to release the firmware when the driver unloads or is that already handled in some common path? Alex From: amd-gfx on behalf of Changfeng.Zhu Sent: Tuesday, September 1, 2020 10:25 PM To: amd-gfx@lists.freedesktop.org ; Huang, Ray ; Lakha, Bhawanpreet Cc: Zhu, Changfeng Subject: [PATCH] drm/amdgpu: add ta firmware load in psp_v12_0 for renoir From: changzhu From: Changfeng It needs to load renoir_ta firmware because hdcp is enabled by default for renoir now. This can avoid error:DTM TA is not initialized Change-Id: Ib2f03a531013e4b432c2e9d4ec3dc021b4f8da7d Signed-off-by: Changfeng --- drivers/gpu/drm/amd/amdgpu/psp_v12_0.c | 54 ++ 1 file changed, 54 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c index 6c9614f77d33..75489313dbad 100644 --- a/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c +++ b/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c @@ -38,6 +38,8 @@ #include "oss/osssys_4_0_sh_mask.h" MODULE_FIRMWARE("amdgpu/renoir_asd.bin"); +MODULE_FIRMWARE("amdgpu/renoir_ta.bin"); + /* address block */ #define smnMP1_FIRMWARE_FLAGS 0x3010024 @@ -45,7 +47,10 @@ static int psp_v12_0_init_microcode(struct psp_context *psp) { struct amdgpu_device *adev = psp->adev; const char *chip_name; + char fw_name[30]; int err = 0; + const struct ta_firmware_header_v1_0 *ta_hdr; + DRM_DEBUG("\n"); switch (adev->asic_type) { case CHIP_RENOIR: @@ -56,6 +61,55 @@ static int psp_v12_0_init_microcode(struct psp_context *psp) } err = psp_init_asd_microcode(psp, chip_name); + if (err) + goto out; + + snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name); + err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev); + if (err) { + release_firmware(adev->psp.ta_fw); + adev->psp.ta_fw = NULL; + dev_info(adev->dev, +"psp v12.0: Failed to load firmware \"%s\"\n", +fw_name); + } else { + err = amdgpu_ucode_validate(adev->psp.ta_fw); + if (err) + goto out2; + + ta_hdr = (const struct ta_firmware_header_v1_0 *) +adev->psp.ta_fw->data; + adev->psp.ta_hdcp_ucode_version = + le32_to_cpu(ta_hdr->ta_hdcp_ucode_version); + adev->psp.ta_hdcp_ucode_size = + le32_to_cpu(ta_hdr->ta_hdcp_size_bytes); + adev->psp.ta_hdcp_start_addr = + (uint8_t *)ta_hdr + + le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes); + + adev->psp.ta_fw_version = le32_to_cpu(ta_hdr->header.ucode_version); + + adev->psp.ta_dtm_ucode_version = + le32_to_cpu(ta_hdr->ta_dtm_ucode_version); + adev->psp.ta_dtm_ucode_size = + le32_to_cpu(ta_hdr->ta_dtm_size_bytes); + adev->psp.ta_dtm_start_addr = + (uint8_t *)adev->psp.ta_hdcp_start_addr + + le32_to_cpu(ta_hdr->ta_dtm_offset_bytes); + } + + return 0; + +out2: + release_firmware(adev->psp.ta_fw); + adev->psp.ta_fw = NULL; +out: + if (err) { + dev_err(adev->dev, + "psp v12.0: Failed to load firmware \"%s\"\n", + fw_name); + } + return err; } -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7C324a6285d81146a0639b08d84ee78d14%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637346103730596780&sdata=ItQDVbjEzkmKeeEU%2BV01rQb4iGuWvHaqRAFlC4e6oqI%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/4] drm/amd/pm: drop unnecessary feature->mutex lock protections(V2)
[AMD Official Use Only - Internal Distribution Only] This code gets called during suspend and resume and GPU reset as well. Are those cases properly covered? Alex From: amd-gfx on behalf of Christian König Sent: Friday, August 28, 2020 4:16 AM To: Das, Nirmoy ; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH 1/4] drm/amd/pm: drop unnecessary feature->mutex lock protections(V2) The explanation sounds sane, but since I don't know the affected code at all the series is only Acked-by: Christian König Maybe wait for Alex to give you an rb if you are unsure, otherwise feel free to commit. Christian. Am 27.08.20 um 08:39 schrieb Nirmoy: > Series is Acked-by: Nirmoy Das > > > On 8/25/20 9:49 AM, Evan Quan wrote: >> As these operations are performed in hardware setup and there >> is actually no race conditions during this period considering: >> 1. the hardware setup is serial and cannnot be in parallel >> 2. all other operations can be performed only after hardware >> setup complete. >> >> V2: rich the commit log description >> >> Change-Id: I096d7ab0855ff59b0ecb56fd9d6d9946b3605fc8 >> Signed-off-by: Evan Quan >> --- >> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 >> drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 -- >> 2 files changed, 6 deletions(-) >> >> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c >> b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c >> index 09dc5303762b..b7cad8ef6153 100644 >> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c >> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c >> @@ -361,20 +361,16 @@ static int >> smu_get_driver_allowed_feature_mask(struct smu_context *smu) >> int ret = 0; >> uint32_t allowed_feature_mask[SMU_FEATURE_MAX/32]; >> -mutex_lock(&feature->mutex); >> bitmap_zero(feature->allowed, SMU_FEATURE_MAX); >> -mutex_unlock(&feature->mutex); >> ret = smu_get_allowed_feature_mask(smu, allowed_feature_mask, >>SMU_FEATURE_MAX/32); >> if (ret) >> return ret; >> -mutex_lock(&feature->mutex); >> bitmap_or(feature->allowed, feature->allowed, >> (unsigned long *)allowed_feature_mask, >> feature->feature_num); >> -mutex_unlock(&feature->mutex); >> return ret; >> } >> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c >> b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c >> index 548db1edd352..28a19ffd22a1 100644 >> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c >> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c >> @@ -721,7 +721,6 @@ int smu_v11_0_set_allowed_mask(struct smu_context >> *smu) >> int ret = 0; >> uint32_t feature_mask[2]; >> -mutex_lock(&feature->mutex); >> if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) || >> feature->feature_num < 64) >> goto failed; >> @@ -738,7 +737,6 @@ int smu_v11_0_set_allowed_mask(struct >> smu_context *smu) >> goto failed; >> failed: >> -mutex_unlock(&feature->mutex); >> return ret; >> } > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Ccad2767c7837431f94f308d84b2ab750%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637341994162774368&sdata=b8PVt6zfQJXYlVunpFMY12knU8ZlJ7UE0ojZjhAWJdY%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Ccad2767c7837431f94f308d84b2ab750%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637341994162774368&sdata=b8PVt6zfQJXYlVunpFMY12knU8ZlJ7UE0ojZjhAWJdY%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/1] drm/amdgpu: fix compiler warnings
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Alex Deucher From: Das, Nirmoy Sent: Thursday, August 27, 2020 11:58 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Das, Nirmoy Subject: [PATCH 1/1] drm/amdgpu: fix compiler warnings Fixes below compiler warnings: CC [M] drivers/gpu/drm/amd/amdgpu/amdgpu_device.o drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:381:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration] 381 | void static inline amdgpu_mm_wreg_mmio(struct amdgpu_device *adev, uint32_t reg, uint32_t v, uint32_t acc_flags) | ^~~~ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:381:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration] drivers/gpu/drm/amd/amdgpu/amdgpu_device.c: In function ‘amdgpu_device_fini’: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:3381:6: warning: variable ‘r’ set but not used [-Wunused-but-set-variable] 3381 | int r; | ^ Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 696a61cc3ac6..6518e444bead 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -378,7 +378,9 @@ void amdgpu_mm_wreg8(struct amdgpu_device *adev, uint32_t offset, uint8_t value) BUG(); } -void static inline amdgpu_mm_wreg_mmio(struct amdgpu_device *adev, uint32_t reg, uint32_t v, uint32_t acc_flags) +static inline void amdgpu_mm_wreg_mmio(struct amdgpu_device *adev, + uint32_t reg, uint32_t v, + uint32_t acc_flags) { trace_amdgpu_mm_wreg(adev->pdev->device, reg, v); @@ -3378,8 +3380,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, */ void amdgpu_device_fini(struct amdgpu_device *adev) { - int r; - dev_info(adev->dev, "amdgpu: finishing device.\n"); flush_delayed_work(&adev->delayed_init_work); adev->shutdown = true; @@ -3402,7 +3402,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev) if (adev->pm_sysfs_en) amdgpu_pm_sysfs_fini(adev); amdgpu_fbdev_fini(adev); - r = amdgpu_device_ip_fini(adev); + amdgpu_device_ip_fini(adev); release_firmware(adev->firmware.gpu_info_fw); adev->firmware.gpu_info_fw = NULL; adev->accel_working = false; -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/pm: avoid false alarm due to confusing softwareshutdowntemp setting
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: Quan, Evan Sent: Wednesday, August 26, 2020 3:45 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH] drm/amd/pm: avoid false alarm due to confusing softwareshutdowntemp setting Normally softwareshutdowntemp should be greater than Thotspotlimit. However, on some VEGA10 ASIC, the softwareshutdowntemp is 91C while Thotspotlimit is 105C. This seems not right and may trigger some false alarms. Change-Id: I940cc6e450eebccd93ccdc3428187f6b7c09dcda Signed-off-by: Evan Quan --- .../drm/amd/pm/powerplay/hwmgr/vega10_thermal.c| 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c index d572ba4ec9b1..952cd3d7240e 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c @@ -374,8 +374,18 @@ static int vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr, /* compare them in unit celsius degree */ if (low < range->min / PP_TEMPERATURE_UNITS_PER_CENTIGRADES) low = range->min / PP_TEMPERATURE_UNITS_PER_CENTIGRADES; - if (high > tdp_table->usSoftwareShutdownTemp) - high = tdp_table->usSoftwareShutdownTemp; + + /* +* As a common sense, usSoftwareShutdownTemp should be bigger +* than ThotspotLimit. For any invalid usSoftwareShutdownTemp, +* we will just use the max possible setting VEGA10_THERMAL_MAXIMUM_ALERT_TEMP +* to avoid false alarms. +*/ + if ((tdp_table->usSoftwareShutdownTemp > +range->hotspot_crit_max / PP_TEMPERATURE_UNITS_PER_CENTIGRADES)) { + if (high > tdp_table->usSoftwareShutdownTemp) + high = tdp_table->usSoftwareShutdownTemp; + } if (low > high) return -EINVAL; -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/pm: suppress static checker warning
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Alex Deucher From: Quan, Evan Sent: Tuesday, August 25, 2020 11:32 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; dan.carpen...@oracle.com ; Quan, Evan Subject: [PATCH] drm/amd/pm: suppress static checker warning Suppress the warning below: drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/hardwaremanager.c:274 phm_check_smc_update_required_for_display_configuration() warn: signedness bug returning '(-22)' Change-Id: If50e39fe401c16d981d917ef7d8d5ea81d6538df Reported-by: Dan Carpenter Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c index 9454ab50f9a1..1f9b9facdf1f 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c @@ -271,7 +271,10 @@ int phm_start_thermal_controller(struct pp_hwmgr *hwmgr) bool phm_check_smc_update_required_for_display_configuration(struct pp_hwmgr *hwmgr) { - PHM_FUNC_CHECK(hwmgr); + if (hwmgr == NULL || + hwmgr->hwmgr_func == NULL) + return false; + if (hwmgr->pp_one_vf) return false; -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: report DC not supported if virtual display is enabled
[AMD Public Use] I can do that. Alex From: Chen, Guchun Sent: Tuesday, August 25, 2020 10:13 AM To: Alex Deucher ; amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander Subject: RE: [PATCH] drm/amdgpu: report DC not supported if virtual display is enabled [AMD Public Use] Why not merging it to the same line of SRIOV check? if (amdgpu_sriov_vf(adev) || adev->enable_virtual_display ) return false; Regards, Guchun -Original Message- From: amd-gfx On Behalf Of Alex Deucher Sent: Tuesday, August 25, 2020 9:45 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander Subject: [PATCH] drm/amdgpu: report DC not supported if virtual display is enabled virtual display is non-atomic so report false to avoid checking atomic state and other atomic things at runtime. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 5a948edcc93c..19f1e8449986 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2864,6 +2864,9 @@ bool amdgpu_device_has_dc_support(struct amdgpu_device *adev) if (amdgpu_sriov_vf(adev)) return false; + if (adev->enable_virtual_display) + return false; + return amdgpu_device_asic_has_dc_support(adev->asic_type); } -- 2.25.4 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cguchun.chen%40amd.com%7C6679ea962a8a4b5715cf08d848fd2469%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637339599368934081&sdata=WMMrhLJ2qXKEr6gHMn0ydF2%2B3jxzUEZ3azRsjkgOXZI%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/display: Add DPCS regs for dcn3 link encoder
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: Bhawanpreet Lakha Sent: Monday, August 24, 2020 11:11 AM To: Deucher, Alexander Cc: Siqueira, Rodrigo ; Kazlauskas, Nicholas ; amd-gfx@lists.freedesktop.org ; Lakha, Bhawanpreet Subject: [PATCH] drm/amd/display: Add DPCS regs for dcn3 link encoder dpcs reg are missing for dcn3 link encoder regs list, so add them. Also remove DPCSTX_DEBUG_CONFIG and RDPCSTX_DEBUG_CONFIG as they are unused and cause compile errors for dcn3 Signed-off-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_link_encoder.h | 2 -- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_link_encoder.h b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_link_encoder.h index dcbf28dd72d4..864acd695cbb 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_link_encoder.h +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_link_encoder.h @@ -231,8 +231,6 @@ SRI(RDPCSTX_PHY_FUSE3, RDPCSTX, id), \ SRI(DPCSTX_TX_CLOCK_CNTL, DPCSTX, id), \ SRI(DPCSTX_TX_CNTL, DPCSTX, id), \ - SRI(DPCSTX_DEBUG_CONFIG, DPCSTX, id), \ - SRI(RDPCSTX_DEBUG_CONFIG, RDPCSTX, id), \ SR(RDPCSTX0_RDPCSTX_SCRATCH) diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c index 957fc37b971e..8be4f21169d0 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c @@ -491,6 +491,7 @@ static const struct dcn10_link_enc_hpd_registers link_enc_hpd_regs[] = { [id] = {\ LE_DCN3_REG_LIST(id), \ UNIPHY_DCN2_REG_LIST(phyid), \ + DPCS_DCN2_REG_LIST(id), \ SRI(DP_DPHY_INTERNAL_CTRL, DP, id) \ } -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/2] drm/amdkfd: call amdgpu_amdkfd_get_unique_id directly
[AMD Official Use Only - Internal Distribution Only] Series is: Reviewed-by: Alex Deucher From: amd-gfx on behalf of Felix Kuehling Sent: Monday, August 24, 2020 10:21 AM To: amd-gfx@lists.freedesktop.org Cc: Lin, Amber ; Shikre, Divya Subject: [PATCH 1/2] drm/amdkfd: call amdgpu_amdkfd_get_unique_id directly No need to use a function pointer because the implementation is not ASIC-specific. This fixes missing support due to a missing function pointer on Arcturus. Signed-off-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 1 - drivers/gpu/drm/amd/amdkfd/kfd_device.c| 3 +-- drivers/gpu/drm/amd/include/kgd_kfd_interface.h| 4 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c index b872cdb0b705..cef2ed767299 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c @@ -778,5 +778,4 @@ const struct kfd2kgd_calls gfx_v10_kfd2kgd = { get_atc_vmid_pasid_mapping_info, .set_vm_context_page_table_base = set_vm_context_page_table_base, .get_hive_id = amdgpu_amdkfd_get_hive_id, - .get_unique_id = amdgpu_amdkfd_get_unique_id, }; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c index 64fdb6a81c47..e5592548b588 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c @@ -729,5 +729,4 @@ const struct kfd2kgd_calls gfx_v9_kfd2kgd = { kgd_gfx_v9_get_atc_vmid_pasid_mapping_info, .set_vm_context_page_table_base = kgd_gfx_v9_set_vm_context_page_table_base, .get_hive_id = amdgpu_amdkfd_get_hive_id, - .get_unique_id = amdgpu_amdkfd_get_unique_id, }; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index b15b620e731b..5ffd03685722 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c @@ -715,8 +715,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, if (kfd->kfd2kgd->get_hive_id) kfd->hive_id = kfd->kfd2kgd->get_hive_id(kfd->kgd); - if (kfd->kfd2kgd->get_unique_id) - kfd->unique_id = kfd->kfd2kgd->get_unique_id(kfd->kgd); + kfd->unique_id = amdgpu_amdkfd_get_unique_id(kfd->kgd); if (kfd_interrupt_init(kfd)) { dev_err(kfd_device, "Error initializing interrupts\n"); diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h index a3c238c39ef5..017f97394344 100644 --- a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h +++ b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h @@ -214,8 +214,6 @@ struct tile_config { * * @get_hive_id: Returns hive id of current device, 0 if xgmi is not enabled * - * @get_unique_id: Returns uuid id of current device - * * This structure contains function pointers to services that the kgd driver * provides to amdkfd driver. * @@ -291,8 +289,6 @@ struct kfd2kgd_calls { uint32_t vmid, uint64_t page_table_base); uint32_t (*read_vmid_from_vmfault_reg)(struct kgd_dev *kgd); uint64_t (*get_hive_id)(struct kgd_dev *kgd); - uint64_t (*get_unique_id)(struct kgd_dev *kgd); - }; #endif /* KGD_KFD_INTERFACE_H_INCLUDED */ -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Cf72e48fa1b804fd1a9bc08d84839073a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637338757068577923&sdata=GVcMLE70p%2BNa%2BfGIVokWqYOMCa2R3LXEBfoM0DWVC38%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/3] drm/amd/pm: correct Vega10 swctf limit setting
[AMD Official Use Only - Internal Distribution Only] Might want to add: Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1267 with that, the series is: Reviewed-by: Alex Deucher From: Quan, Evan Sent: Friday, August 21, 2020 12:42 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH 1/3] drm/amd/pm: correct Vega10 swctf limit setting Correct the Vega10 thermal swctf limit. Change-Id: I220c18bcb0772bfb8cb674337bac6dccafbd7698 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c index 468bdd6f6697..ce9514c881ec 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c @@ -363,6 +363,9 @@ int vega10_thermal_get_temperature(struct pp_hwmgr *hwmgr) static int vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr, struct PP_TemperatureRange *range) { + struct phm_ppt_v2_information *pp_table_info = + (struct phm_ppt_v2_information *)(hwmgr->pptable); + struct phm_tdp_table *tdp_table = pp_table_info->tdp_table; struct amdgpu_device *adev = hwmgr->adev; int low = VEGA10_THERMAL_MINIMUM_ALERT_TEMP * PP_TEMPERATURE_UNITS_PER_CENTIGRADES; @@ -372,8 +375,8 @@ static int vega10_thermal_set_temperature_range(struct pp_hwmgr *hwmgr, if (low < range->min) low = range->min; - if (high > range->max) - high = range->max; + if (high > tdp_table->usSoftwareShutdownTemp) + high = tdp_table->usSoftwareShutdownTemp; if (low > high) return -EINVAL; -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: TTM/nouveau conflict in drm-misc-next
[AMD Public Use] Double check for mis-merges on patches that went upstream via -fixes and -next. Alex From: Christian König Sent: Tuesday, August 18, 2020 11:06 AM To: Thomas Zimmermann ; Koenig, Christian ; Alex Deucher Cc: Deucher, Alexander ; amd-gfx@lists.freedesktop.org Subject: Re: TTM/nouveau conflict in drm-misc-next Am 17.08.20 um 08:31 schrieb Thomas Zimmermann: Hi Am 14.08.20 um 18:21 schrieb Koenig, Christian: Am 14.08.2020 17:53 schrieb Alex Deucher <mailto:alexdeuc...@gmail.com>: On Fri, Aug 14, 2020 at 11:22 AM Christian König <mailto:christian.koe...@amd.com> wrote: > > Hey Thomas & Alex, > > well the TTM and Nouveau changes look good to me, but this completely > broke amdgpu. > > Alex any idea what is going on here? What's broken in amdgpu? There shouldn't be any ttm changes in amdgpu for drm-next. Those all go through drm-misc. It's not a TTM change. The backmerge of drm-next into drm-misc-next broke amdgpu so that even glxgears doesn't work anymore. But each individual merge head still works fine as far as I can say. Any idea how to track that down? The backmerge brought in Fixes: 16e6eea29d7b ("Merge tag 'amd-drm-fixes-5.9-2020-08-07' ...) which has quite a few commit. Maybe it's in one of them. Nope, I have just double checked that I can revert either parent of the merge and the problem disappears. I somehow need to figure out how to cleanly revert all patches in one branch one by one and then do a reverse bisect. Oh, sometimes I love my job :( If anybody has a good idea how to do this please speak up. Thanks, Christian. Best regards Thomas Christian. Alex > > Regards, > Christian. > > Am 12.08.20 um 21:10 schrieb Thomas Zimmermann: > > Hi Christian and Ben, > > > > I backmerged drm-next into drm-misc-next and had a conflict between ttm > > and nouveau. struct ttm_mem_res got renamed to struct ttm_resource. I > > updated nouveau to the new name, test-built, and pushed the result to > > drm-misc-next. If either of you has a minute, you may want to double > > check the merge. > > > > Best regards > > Thomas > > > > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cchristian.koenig%40amd.com%7Ca1aefc1ee22a4e733df908d8406a395c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637330172275088649&sdata=X2ZJUETwoq884Xtg66sDudjXB%2F3s%2BgRglnh33gpU4Hc%3D&reserved=0<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7CAlexander.Deucher%40amd.com%7Cd4023becdee744c639ae08d843885b15%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637333600213437608&sdata=pbqERBZPwTFVObebH8KIPIxOtDYrjMu4SIaJ%2FF13cXk%3D&reserved=0> ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> https://lists.freedesktop.org/mailman/listinfo/amd-gfx<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7CAlexander.Deucher%40amd.com%7Cd4023becdee744c639ae08d843885b15%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637333600213447604&sdata=r8BFPhKT1KzcpVZQIy0Im4%2Bjb9S75c7doKvtH2FGjA8%3D&reserved=0> ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] Revert "drm/amdgpu: disable gfxoff for navy_flounder"
[AMD Public Use] Acked-by: Alex Deucher From: amd-gfx on behalf of Jiansong Chen Sent: Monday, August 17, 2020 10:45 AM To: amd-gfx@lists.freedesktop.org Cc: Zhou1, Tao ; Feng, Kenneth ; Chen, Jiansong (Simon) Subject: [PATCH] Revert "drm/amdgpu: disable gfxoff for navy_flounder" This reverts commit 6a72ad7e387c6fec821c230fda3460f79fc0f877. Newly released sdma fw (51.52) provides a fix for the issue. --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index e87d43537013..e527be22a3d5 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -3610,9 +3610,6 @@ static void gfx_v10_0_check_gfxoff_flag(struct amdgpu_device *adev) if (!gfx_v10_0_navi10_gfxoff_should_enable(adev)) adev->pm.pp_feature &= ~PP_GFXOFF_MASK; break; - case CHIP_NAVY_FLOUNDER: - adev->pm.pp_feature &= ~PP_GFXOFF_MASK; - break; default: break; } -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Cfe56ae8b28a642d0860008d842bc43e4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637332723663638132&sdata=xMP4WmjGoryNjXtsOAaOe%2FmzdL%2FWe1BEvOJ0DOAUAWo%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/5] drm/amd/pm: disable/enable deep sleep features on UMD pstate enter/exit
[AMD Public Use] You can probably just squash patches 2-5 into one patch. Either way, series is: Reviewed-by: Alex Deucher From: Quan, Evan Sent: Monday, August 17, 2020 4:29 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH 1/5] drm/amd/pm: disable/enable deep sleep features on UMD pstate enter/exit Add deep sleep disablement/enablement on UMD pstate entering/exiting. Change-Id: I4fbc02bb4a390ab82293a5ff9c91f2a8beb0a3c9 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 1 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 ++ drivers/gpu/drm/amd/pm/swsmu/smu_internal.h | 1 + 3 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h index 7cc707ec21c3..4c5c041af4ee 100644 --- a/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h +++ b/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h @@ -597,6 +597,7 @@ struct pptable_funcs { ssize_t (*get_gpu_metrics)(struct smu_context *smu, void **table); int (*enable_mgpu_fan_boost)(struct smu_context *smu); int (*gfx_ulv_control)(struct smu_context *smu, bool enablement); + int (*deep_sleep_control)(struct smu_context *smu, bool enablement); }; typedef enum { diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 221b5c923ce1..8eb5b92903cd 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -1441,6 +1441,7 @@ static int smu_enable_umd_pstate(void *handle, AMD_IP_BLOCK_TYPE_GFX, AMD_CG_STATE_UNGATE); smu_gfx_ulv_control(smu, false); + smu_deep_sleep_control(smu, false); } } else { /* exit umd pstate, restore level, enable gfx cg*/ @@ -1448,6 +1449,7 @@ static int smu_enable_umd_pstate(void *handle, if (*level == AMD_DPM_FORCED_LEVEL_PROFILE_EXIT) *level = smu_dpm_ctx->saved_dpm_level; smu_dpm_ctx->enable_umd_pstate = false; + smu_deep_sleep_control(smu, true); smu_gfx_ulv_control(smu, true); amdgpu_device_ip_set_clockgating_state(smu->adev, AMD_IP_BLOCK_TYPE_GFX, diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h b/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h index 2fe29c6a00ce..c88f8fab1bae 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h +++ b/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h @@ -93,6 +93,7 @@ #define smu_get_pp_feature_mask(smu, buf) smu_ppt_funcs(get_pp_feature_mask, 0, smu, buf) #define smu_set_pp_feature_mask(smu, new_mask) smu_ppt_funcs(set_pp_feature_mask, 0, smu, new_mask) #define smu_gfx_ulv_control(smu, enablement) smu_ppt_funcs(gfx_ulv_control, 0, smu, enablement) +#define smu_deep_sleep_control(smu, enablement) smu_ppt_funcs(deep_sleep_control, 0, smu, enablement) #endif #endif -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/5] drm/amd/pm: disable/enable gfx ulv on UMD pstate enter/exit
[AMD Official Use Only - Internal Distribution Only] You can probably just squash patches 2-5 into one patch. Either way, series is: Reviewed-by: Alex Deucher From: Quan, Evan Sent: Monday, August 17, 2020 3:49 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH 1/5] drm/amd/pm: disable/enable gfx ulv on UMD pstate enter/exit Add gfx ulv disablement/enablement on UMD pstate entering/exiting. Change-Id: Ieb38fdb5975b563f24c0b172fedd01acf99afb10 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 1 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 ++ drivers/gpu/drm/amd/pm/swsmu/smu_internal.h | 1 + 3 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h index bbe4a343e9f1..7cc707ec21c3 100644 --- a/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h +++ b/drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h @@ -596,6 +596,7 @@ struct pptable_funcs { int (*set_pp_feature_mask)(struct smu_context *smu, uint64_t new_mask); ssize_t (*get_gpu_metrics)(struct smu_context *smu, void **table); int (*enable_mgpu_fan_boost)(struct smu_context *smu); + int (*gfx_ulv_control)(struct smu_context *smu, bool enablement); }; typedef enum { diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 7d17c4f1b489..221b5c923ce1 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -1440,6 +1440,7 @@ static int smu_enable_umd_pstate(void *handle, amdgpu_device_ip_set_clockgating_state(smu->adev, AMD_IP_BLOCK_TYPE_GFX, AMD_CG_STATE_UNGATE); + smu_gfx_ulv_control(smu, false); } } else { /* exit umd pstate, restore level, enable gfx cg*/ @@ -1447,6 +1448,7 @@ static int smu_enable_umd_pstate(void *handle, if (*level == AMD_DPM_FORCED_LEVEL_PROFILE_EXIT) *level = smu_dpm_ctx->saved_dpm_level; smu_dpm_ctx->enable_umd_pstate = false; + smu_gfx_ulv_control(smu, true); amdgpu_device_ip_set_clockgating_state(smu->adev, AMD_IP_BLOCK_TYPE_GFX, AMD_CG_STATE_GATE); diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h b/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h index 264073d4e263..2fe29c6a00ce 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h +++ b/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h @@ -92,6 +92,7 @@ #define smu_get_asic_power_limits(smu) smu_ppt_funcs(get_power_limit, 0, smu) #define smu_get_pp_feature_mask(smu, buf) smu_ppt_funcs(get_pp_feature_mask, 0, smu, buf) #define smu_set_pp_feature_mask(smu, new_mask) smu_ppt_funcs(set_pp_feature_mask, 0, smu, new_mask) +#define smu_gfx_ulv_control(smu, enablement) smu_ppt_funcs(gfx_ulv_control, 0, smu, enablement) #endif #endif -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: Fix incorrect return value in sysfs for pp_od_clk_voltage
[AMD Public Use] No need to apologize, it was a good catch. Something to double check in the future if something similar ends up getting applied again. Thanks! Alex From: amd-gfx on behalf of Matt Coffin Sent: Friday, August 14, 2020 3:13 PM To: amd-gfx@lists.freedesktop.org Cc: Quan, Evan ; Koenig, Christian ; Li, Dennis Subject: Re: [PATCH] drm/amdgpu: Fix incorrect return value in sysfs for pp_od_clk_voltage Hi all, As of 026acaeac2d205f22c0f682cc1c7b1a85b9ccd00 ("drm/amdgpu: revert "fix system hang issue during GPU reset""), this patch is no longer needed, and won't apply, because the badly-behaving code was removed; I'll withdraw this patch for now. Sorry to those who wasted their time reviewing. Cheers, Matt On 8/13/20 7:15 PM, Matt Coffin wrote: > The changes in edad8312cbbf9a33c86873fc4093664f150dd5c1 introduced an > issue with the sysfs interface for pp_od_clk_voltage. It overwrites the > return value to 0 when it calls another function, then returns 0. The > intended behavior is that a positive return value indicates the number > of bytes from the buffer that you processed in that call. > > With the 0 return value, clients would submit the same value to be > written over and over again, resulting in an infinite loop. > > This is resolved by returning the count of bytes read (in this case the > whole message), when the desired return is 0 (success). > > Fixes: edad8312cbbf ("drm/amdgpu: fix system hang issue during GPU") > Bug: > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1245&data=02%7C01%7Calexander.deucher%40amd.com%7C3fb1fd9f95ad441a88a208d840862e80%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637330292979204288&sdata=iABLxfzQVQa5zBK6a0JozvRYl%2Fg5eTFnfOS86r0g9rU%3D&reserved=0 > Signed-off-by: Matt Coffin > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c > index 1705e328c6fc..f00c7ed361d4 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c > @@ -937,7 +937,11 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct > device *dev, > > pro_end: >up_read(&adev->reset_sem); > - return ret; > + if (ret) { > + return ret; > + } else { > + return count; > + } > } > > static ssize_t amdgpu_get_pp_od_clk_voltage(struct device *dev, > ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7C3fb1fd9f95ad441a88a208d840862e80%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637330292979204288&sdata=GLWlbhgo0grFjcOh5ZAJWhXGxSm6Ufw8eDFDHZf95Uk%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu/jpeg: remove redundant check when it returns
[AMD Public Use] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Leo Liu Sent: Thursday, August 13, 2020 3:40 PM To: amd-gfx@lists.freedesktop.org Cc: Liu, Leo Subject: [PATCH] drm/amdgpu/jpeg: remove redundant check when it returns Fix warning from kernel test robot Signed-off-by: Leo Liu --- drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c index c41e5590a701..f4ba423af051 100644 --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c @@ -465,8 +465,6 @@ static int jpeg_v3_0_wait_for_idle(void *handle) ret = SOC15_WAIT_ON_RREG(JPEG, 0, mmUVD_JRBC_STATUS, UVD_JRBC_STATUS__RB_JOB_DONE_MASK, UVD_JRBC_STATUS__RB_JOB_DONE_MASK); - if (ret) - return ret; return ret; } -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7C3024a7a58bf24bc3731b08d83fc0df59%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637329444922074471&sdata=VqEE7z0JlPSNE0nH3HFISbRGPF7tC0uNgBB3yJnSSHo%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: load ta firmware for navy_flounder
[AMD Public Use] Reviewed-by: Alex Deucher From: Bhawanpreet Lakha Sent: Wednesday, August 12, 2020 4:17 PM To: Kazlauskas, Nicholas ; Deucher, Alexander ; amd-gfx@lists.freedesktop.org Cc: Clements, John ; Lakha, Bhawanpreet Subject: [PATCH] drm/amdgpu: load ta firmware for navy_flounder call psp_int_ta_microcode() to parse the ta firmware. Signed-off-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c index d488d250805d..6c5d9612abcb 100644 --- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c @@ -58,7 +58,7 @@ MODULE_FIRMWARE("amdgpu/arcturus_ta.bin"); MODULE_FIRMWARE("amdgpu/sienna_cichlid_sos.bin"); MODULE_FIRMWARE("amdgpu/sienna_cichlid_ta.bin"); MODULE_FIRMWARE("amdgpu/navy_flounder_sos.bin"); -MODULE_FIRMWARE("amdgpu/navy_flounder_asd.bin"); +MODULE_FIRMWARE("amdgpu/navy_flounder_ta.bin"); /* address block */ #define smnMP1_FIRMWARE_FLAGS 0x3010024 @@ -179,12 +179,11 @@ static int psp_v11_0_init_microcode(struct psp_context *psp) } break; case CHIP_SIENNA_CICHLID: + case CHIP_NAVY_FLOUNDER: err = psp_init_ta_microcode(&adev->psp, chip_name); if (err) return err; break; - case CHIP_NAVY_FLOUNDER: - break; default: BUG(); } -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdkfd: fix the wrong sdma instance query for renoir
[AMD Public Use] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Huang Rui Sent: Tuesday, August 11, 2020 2:27 AM To: amd-gfx@lists.freedesktop.org Cc: Kuehling, Felix ; Huang, Ray Subject: [PATCH] drm/amdkfd: fix the wrong sdma instance query for renoir Renoir only has one sdma instance, it will get failed once query the sdma1 registers. So use switch-case instead of static register array. Signed-off-by: Huang Rui --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 31 +-- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c index 032d3c866280..23ccfe0ad5d4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c @@ -197,19 +197,32 @@ static uint32_t get_sdma_rlc_reg_offset(struct amdgpu_device *adev, unsigned int engine_id, unsigned int queue_id) { - uint32_t sdma_engine_reg_base[2] = { - SOC15_REG_OFFSET(SDMA0, 0, -mmSDMA0_RLC0_RB_CNTL) - mmSDMA0_RLC0_RB_CNTL, - SOC15_REG_OFFSET(SDMA1, 0, -mmSDMA1_RLC0_RB_CNTL) - mmSDMA1_RLC0_RB_CNTL - }; - uint32_t retval = sdma_engine_reg_base[engine_id] + uint32_t sdma_engine_reg_base = 0; + uint32_t sdma_rlc_reg_offset; + + switch (engine_id) { + default: + dev_warn(adev->dev, +"Invalid sdma engine id (%d), using engine id 0\n", +engine_id); + /* fall through */ + case 0: + sdma_engine_reg_base = SOC15_REG_OFFSET(SDMA0, 0, + mmSDMA0_RLC0_RB_CNTL) - mmSDMA0_RLC0_RB_CNTL; + break; + case 1: + sdma_engine_reg_base = SOC15_REG_OFFSET(SDMA1, 0, + mmSDMA1_RLC0_RB_CNTL) - mmSDMA0_RLC0_RB_CNTL; + break; + } + + sdma_rlc_reg_offset = sdma_engine_reg_base + queue_id * (mmSDMA0_RLC1_RB_CNTL - mmSDMA0_RLC0_RB_CNTL); pr_debug("RLC register offset for SDMA%d RLC%d: 0x%x\n", engine_id, - queue_id, retval); +queue_id, sdma_rlc_reg_offset); - return retval; + return sdma_rlc_reg_offset; } static inline struct v9_mqd *get_mqd(void *mqd) -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7C575d3b20ab90469e7a5208d83dbfa612%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637327240654534583&sdata=u%2By9MwOEH7bGIQbajnefKann2HyJ%2FWRG6I91FBgVakM%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/powerplay: bump NAVI12 driver if version
[AMD Public Use] Acked-by: Alex Deucher From: Quan, Evan Sent: Monday, August 10, 2020 11:37 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH] drm/amd/powerplay: bump NAVI12 driver if version To fit the latest SMU firmware. Change-Id: Ic9d02de54d20b6b90d18bac8b3fbb356d8fdf3ad Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h b/drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h index ee1506beb0ea..65363d56e3cc 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h +++ b/drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h @@ -28,7 +28,7 @@ #define SMU11_DRIVER_IF_VERSION_INV 0x #define SMU11_DRIVER_IF_VERSION_ARCT 0x17 #define SMU11_DRIVER_IF_VERSION_NV10 0x36 -#define SMU11_DRIVER_IF_VERSION_NV12 0x33 +#define SMU11_DRIVER_IF_VERSION_NV12 0x36 #define SMU11_DRIVER_IF_VERSION_NV14 0x36 #define SMU11_DRIVER_IF_VERSION_Sienna_Cichlid 0x35 #define SMU11_DRIVER_IF_VERSION_Navy_Flounder 0x3 -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/2] drm/amd/powerplay: update the metrics table cache interval as 1ms
[AMD Public Use] Series is: Reviewed-by: Alex Deucher From: Quan, Evan Sent: Monday, August 10, 2020 11:35 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH 1/2] drm/amd/powerplay: update the metrics table cache interval as 1ms To make the setting same as Arcturus/Navi1x/Sienna_Cichlid. Change-Id: I7ea721bf5872023f1ab39c3827fb9c6fd05877cc Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 2 +- drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 2 +- drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c index c70c30175801..f0680dd58508 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c @@ -1272,7 +1272,7 @@ static int vega12_get_metrics_table(struct pp_hwmgr *hwmgr, if (bypass_cache || !data->metrics_time || - time_after(jiffies, data->metrics_time + HZ / 2)) { + time_after(jiffies, data->metrics_time + msecs_to_jiffies(1))) { ret = smum_smc_table_manager(hwmgr, (uint8_t *)(&data->metrics_table), TABLE_SMU_METRICS, diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c index c9f402edc0d6..da84012b7fd5 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c @@ -2082,7 +2082,7 @@ static int vega20_get_metrics_table(struct pp_hwmgr *hwmgr, if (bypass_cache || !data->metrics_time || - time_after(jiffies, data->metrics_time + HZ / 2)) { + time_after(jiffies, data->metrics_time + msecs_to_jiffies(1))) { ret = smum_smc_table_manager(hwmgr, (uint8_t *)(&data->metrics_table), TABLE_SMU_METRICS, diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c index 8a8e6033f71f..c50c4547fea9 100644 --- a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c @@ -139,7 +139,7 @@ static int renoir_get_metrics_table(struct smu_context *smu, if (bypass_cache || !smu_table->metrics_time || - time_after(jiffies, smu_table->metrics_time + msecs_to_jiffies(100))) { + time_after(jiffies, smu_table->metrics_time + msecs_to_jiffies(1))) { ret = smu_cmn_update_table(smu, SMU_TABLE_SMU_METRICS, 0, (void *)smu_table->metrics_table, false); if (ret) { -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/powerplay: correct Vega20 cached smu feature state
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: Quan, Evan Sent: Friday, August 7, 2020 5:30 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Kuehling, Felix ; Quan, Evan Subject: [PATCH] drm/amd/powerplay: correct Vega20 cached smu feature state Correct the cached smu feature state on pp_features sysfs setting. Change-Id: Icc4c3ce764876a0ffdc86ad4c8a8b9c9f0ed0e97 Signed-off-by: Evan Quan --- .../drm/amd/powerplay/hwmgr/vega20_hwmgr.c| 38 +-- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c index 90c78f127f7e..acc926c20c55 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c @@ -984,10 +984,7 @@ static int vega20_disable_all_smu_features(struct pp_hwmgr *hwmgr) { struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend); - uint64_t features_enabled; - int i; - bool enabled; - int ret = 0; + int i, ret = 0; PP_ASSERT_WITH_CODE((ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_DisableAllSmuFeatures, @@ -995,17 +992,8 @@ static int vega20_disable_all_smu_features(struct pp_hwmgr *hwmgr) "[DisableAllSMUFeatures] Failed to disable all smu features!", return ret); - ret = vega20_get_enabled_smc_features(hwmgr, &features_enabled); - PP_ASSERT_WITH_CODE(!ret, - "[DisableAllSMUFeatures] Failed to get enabled smc features!", - return ret); - - for (i = 0; i < GNLD_FEATURES_MAX; i++) { - enabled = (features_enabled & data->smu_features[i].smu_feature_bitmap) ? - true : false; - data->smu_features[i].enabled = enabled; - data->smu_features[i].supported = enabled; - } + for (i = 0; i < GNLD_FEATURES_MAX; i++) + data->smu_features[i].enabled = 0; return 0; } @@ -3242,10 +3230,11 @@ static int vega20_get_ppfeature_status(struct pp_hwmgr *hwmgr, char *buf) static int vega20_set_ppfeature_status(struct pp_hwmgr *hwmgr, uint64_t new_ppfeature_masks) { - uint64_t features_enabled; - uint64_t features_to_enable; - uint64_t features_to_disable; - int ret = 0; + struct vega20_hwmgr *data = + (struct vega20_hwmgr *)(hwmgr->backend); + uint64_t features_enabled, features_to_enable, features_to_disable; + int i, ret = 0; + bool enabled; if (new_ppfeature_masks >= (1ULL << GNLD_FEATURES_MAX)) return -EINVAL; @@ -3274,6 +3263,17 @@ static int vega20_set_ppfeature_status(struct pp_hwmgr *hwmgr, uint64_t new_ppfe return ret; } + /* Update the cached feature enablement state */ + ret = vega20_get_enabled_smc_features(hwmgr, &features_enabled); + if (ret) + return ret; + + for (i = 0; i < GNLD_FEATURES_MAX; i++) { + enabled = (features_enabled & data->smu_features[i].smu_feature_bitmap) ? + true : false; + data->smu_features[i].enabled = enabled; + } + return 0; } -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/powerplay: correct UVD/VCE PG state on custom pptable uploading
[AMD Official Use Only - Internal Distribution Only] Acked-by: Alex Deucher From: Quan, Evan Sent: Friday, August 7, 2020 5:31 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Quan, Evan Subject: [PATCH] drm/amd/powerplay: correct UVD/VCE PG state on custom pptable uploading The UVD/VCE PG state is managed by UVD and VCE IP. It's error-prone to assume the bootup state in SMU based on the dpm status. Change-Id: Ib88298ab9812d7d242592bcd55eea140bef6696a Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c index acc926c20c55..da84012b7fd5 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c @@ -1645,12 +1645,6 @@ static void vega20_init_powergate_state(struct pp_hwmgr *hwmgr) data->uvd_power_gated = true; data->vce_power_gated = true; - - if (data->smu_features[GNLD_DPM_UVD].enabled) - data->uvd_power_gated = false; - - if (data->smu_features[GNLD_DPM_VCE].enabled) - data->vce_power_gated = false; } static int vega20_enable_dpm_tasks(struct pp_hwmgr *hwmgr) -- 2.28.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access
[AMD Public Use] Christian, Can you cc stable when you apply it to drm-misc? Alex From: Kuehling, Felix Sent: Wednesday, July 29, 2020 10:15 AM To: Koenig, Christian ; dri-de...@lists.freedesktop.org ; amd-gfx@lists.freedesktop.org ; Deucher, Alexander Cc: Morichetti, Laurent Subject: Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access Am 2020-07-29 um 4:08 a.m. schrieb Christian König: > Am 28.07.20 um 20:27 schrieb Felix Kuehling: >> VMAs with a pg_offs that's offset from the start of the vma_node need >> to adjust the offset within the BO accordingly. This matches the >> offset calculation in ttm_bo_vm_fault_reserved. >> >> Signed-off-by: Felix Kuehling >> Tested-by: Laurent Morichetti > > Reviewed-by: Christian König > > Going to pick that up for inclusion in drm-misc-next. Thanks. I'll submit it to amd-staging-drm-next so it makes its way into our DKMS branch quickly. Alex, would you push this to drm-fixes? Regards, Felix > >> --- >> drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c >> b/drivers/gpu/drm/ttm/ttm_bo_vm.c >> index 389128b8c4dd..60b41447bec8 100644 >> --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c >> +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c >> @@ -405,8 +405,10 @@ static int ttm_bo_vm_access_kmap(struct >> ttm_buffer_object *bo, >> int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr, >>void *buf, int len, int write) >> { >> -unsigned long offset = (addr) - vma->vm_start; >> struct ttm_buffer_object *bo = vma->vm_private_data; >> +unsigned long offset = (addr) - vma->vm_start + >> +((vma->vm_pgoff - drm_vma_node_start(&bo->base.vma_node)) >> + << PAGE_SHIFT); >> int ret; >> if (len < 1 || (offset + len) >> PAGE_SHIFT > bo->num_pages) > ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: reconfigure spm golden settings on Navi1x after GFXOFF exit(v2)
Are any of those situations really time sensitive? Otherwise, I think we'll end up having to patch this in everywhere we want SPM to be consistent. Alex From: Yin, Tianci (Rico) Sent: Tuesday, July 28, 2020 10:26 PM To: Deucher, Alexander ; amd-gfx@lists.freedesktop.org Cc: Tuikov, Luben ; Zhang, Hawking ; Xu, Feifei ; Hesik, Christopher ; Swamy, Manjunatha ; Quan, Evan ; Chen, Guchun ; Feng, Kenneth Subject: Re: [PATCH] drm/amdgpu: reconfigure spm golden settings on Navi1x after GFXOFF exit(v2) [AMD Public Use] Hi Alex, amdgpu_gfx_off_ctrl() invoked by a few other functions, like amdgpu_info_ioctl() , putting the code into amdgpu_gfx_off_ctrl() will cost more meaningless time on SPM golden reconfiguration. amdgpu_gfx_off_ctrl(adev, false); amdgpu_asic_read_register(adev, se_num, sh_num, info->read_mmr_reg.dword_offset + i, ®s[i]); amdgpu_gfx_off_ctrl(adev, true); In most cases, we don't care about the SPM, so I think smu_enable_umd_pstate is a better place. Thanks very much! Rico ____ From: Deucher, Alexander Sent: Tuesday, July 28, 2020 22:16 To: Yin, Tianci (Rico) ; amd-gfx@lists.freedesktop.org Cc: Tuikov, Luben ; Zhang, Hawking ; Xu, Feifei ; Hesik, Christopher ; Swamy, Manjunatha ; Quan, Evan ; Chen, Guchun ; Feng, Kenneth Subject: Re: [PATCH] drm/amdgpu: reconfigure spm golden settings on Navi1x after GFXOFF exit(v2) [AMD Public Use] Would it be better to put this code into amdgpu_gfx_off_ctrl()? Then we'll handle this in all cases where we disable gfx off. Alex From: Tianci Yin Sent: Tuesday, July 28, 2020 3:04 AM To: amd-gfx@lists.freedesktop.org Cc: Tuikov, Luben ; Deucher, Alexander ; Zhang, Hawking ; Xu, Feifei ; Hesik, Christopher ; Swamy, Manjunatha ; Quan, Evan ; Chen, Guchun ; Feng, Kenneth ; Yin, Tianci (Rico) Subject: [PATCH] drm/amdgpu: reconfigure spm golden settings on Navi1x after GFXOFF exit(v2) From: "Tianci.Yin" On Navi1x, the SPM golden settings will be lost after GFXOFF enter/exit, reconfigure the golden settings after GFXOFF exit. Change-Id: I9358ba9c65f241c36f8a35916170b19535148ee9 Reviewed-by: Feifei Xu Signed-off-by: Tianci.Yin --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index 55463e7a11e2..41487123c207 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c @@ -1309,6 +1309,7 @@ static int smu_enable_umd_pstate(void *handle, struct smu_context *smu = (struct smu_context*)(handle); struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm); + struct amdgpu_device *adev = smu->adev; if (!smu->is_apu && !smu_dpm_ctx->dpm_context) return -EINVAL; @@ -1318,12 +1319,22 @@ static int smu_enable_umd_pstate(void *handle, if (*level & profile_mode_mask) { smu_dpm_ctx->saved_dpm_level = smu_dpm_ctx->dpm_level; smu_dpm_ctx->enable_umd_pstate = true; - amdgpu_device_ip_set_powergating_state(smu->adev, + amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_GFX, AMD_PG_STATE_UNGATE); - amdgpu_device_ip_set_clockgating_state(smu->adev, + amdgpu_device_ip_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_GFX, AMD_CG_STATE_UNGATE); + + if (adev->asic_type >= CHIP_NAVI10 && + adev->asic_type <= CHIP_NAVI12 && + (adev->pm.pp_feature & PP_GFXOFF_MASK)) { + if (adev->gfx.funcs->init_spm_golden) { + dev_dbg(adev->dev,"GFXOFF exited, re-init SPM golden settings\n"); + amdgpu_gfx_init_spm_golden(adev); + } else + dev_warn(adev->dev,"Callback init_spm_golden is NULL\n"); + } } } else { /* exit umd pstate, restore level, enable gfx cg*/ @@ -1331,10 +1342,10 @@ static int smu_enable_umd_pstate(void *handle, if (*level == AMD_DPM_FORCED_LEVEL_PROFILE_EXIT) *level = smu_dpm_ctx->saved_dpm_level; smu_dpm_ctx->enable_umd_pstate = fals
Re: [PATCH] drm/amdgpu: reconfigure spm golden settings on Navi1x after GFXOFF exit(v2)
[AMD Public Use] Would it be better to put this code into amdgpu_gfx_off_ctrl()? Then we'll handle this in all cases where we disable gfx off. Alex From: Tianci Yin Sent: Tuesday, July 28, 2020 3:04 AM To: amd-gfx@lists.freedesktop.org Cc: Tuikov, Luben ; Deucher, Alexander ; Zhang, Hawking ; Xu, Feifei ; Hesik, Christopher ; Swamy, Manjunatha ; Quan, Evan ; Chen, Guchun ; Feng, Kenneth ; Yin, Tianci (Rico) Subject: [PATCH] drm/amdgpu: reconfigure spm golden settings on Navi1x after GFXOFF exit(v2) From: "Tianci.Yin" On Navi1x, the SPM golden settings will be lost after GFXOFF enter/exit, reconfigure the golden settings after GFXOFF exit. Change-Id: I9358ba9c65f241c36f8a35916170b19535148ee9 Reviewed-by: Feifei Xu Signed-off-by: Tianci.Yin --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index 55463e7a11e2..41487123c207 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c @@ -1309,6 +1309,7 @@ static int smu_enable_umd_pstate(void *handle, struct smu_context *smu = (struct smu_context*)(handle); struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm); + struct amdgpu_device *adev = smu->adev; if (!smu->is_apu && !smu_dpm_ctx->dpm_context) return -EINVAL; @@ -1318,12 +1319,22 @@ static int smu_enable_umd_pstate(void *handle, if (*level & profile_mode_mask) { smu_dpm_ctx->saved_dpm_level = smu_dpm_ctx->dpm_level; smu_dpm_ctx->enable_umd_pstate = true; - amdgpu_device_ip_set_powergating_state(smu->adev, + amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_GFX, AMD_PG_STATE_UNGATE); - amdgpu_device_ip_set_clockgating_state(smu->adev, + amdgpu_device_ip_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_GFX, AMD_CG_STATE_UNGATE); + + if (adev->asic_type >= CHIP_NAVI10 && + adev->asic_type <= CHIP_NAVI12 && + (adev->pm.pp_feature & PP_GFXOFF_MASK)) { + if (adev->gfx.funcs->init_spm_golden) { + dev_dbg(adev->dev,"GFXOFF exited, re-init SPM golden settings\n"); + amdgpu_gfx_init_spm_golden(adev); + } else + dev_warn(adev->dev,"Callback init_spm_golden is NULL\n"); + } } } else { /* exit umd pstate, restore level, enable gfx cg*/ @@ -1331,10 +1342,10 @@ static int smu_enable_umd_pstate(void *handle, if (*level == AMD_DPM_FORCED_LEVEL_PROFILE_EXIT) *level = smu_dpm_ctx->saved_dpm_level; smu_dpm_ctx->enable_umd_pstate = false; - amdgpu_device_ip_set_clockgating_state(smu->adev, + amdgpu_device_ip_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_GFX, AMD_CG_STATE_GATE); - amdgpu_device_ip_set_powergating_state(smu->adev, + amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_GFX, AMD_PG_STATE_GATE); } -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/2] drm amdgpu: Skip tmr load for SRIOV
[AMD Official Use Only - Internal Distribution Only] Please fix your git setup to use your name rather than "root" as the author. Alex From: Liu ChengZhe Sent: Monday, July 27, 2020 6:57 AM To: amd-gfx@lists.freedesktop.org Cc: Tuikov, Luben ; Koenig, Christian ; Deucher, Alexander ; Xiao, Jack ; Zhang, Hawking ; Xu, Feifei ; Wang, Kevin(Yang) ; Yuan, Xiaojie ; Liu, Cheng Zhe Subject: [PATCH 1/2] drm amdgpu: Skip tmr load for SRIOV From: root 1. For Navi12, CHIP_SIENNA_CICHLID, skip tmr load operation; 2. Check pointer before release firmware. Signed-off-by: root --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 40 + 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index a053b7af0680..a9481e112cb3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -193,12 +193,18 @@ static int psp_sw_fini(void *handle) struct amdgpu_device *adev = (struct amdgpu_device *)handle; psp_memory_training_fini(&adev->psp); - release_firmware(adev->psp.sos_fw); - adev->psp.sos_fw = NULL; - release_firmware(adev->psp.asd_fw); - adev->psp.asd_fw = NULL; - release_firmware(adev->psp.ta_fw); - adev->psp.ta_fw = NULL; + if (adev->psp.sos_fw) { + release_firmware(adev->psp.sos_fw); + adev->psp.sos_fw = NULL; + } + if (adev->psp.asd_fw) { + release_firmware(adev->psp.asd_fw); + adev->psp.asd_fw = NULL; + } + if (adev->psp.ta_fw) { + release_firmware(adev->psp.ta_fw); + adev->psp.ta_fw = NULL; + } if (adev->asic_type == CHIP_NAVI10) psp_sysfs_fini(adev); @@ -409,11 +415,33 @@ static int psp_clear_vf_fw(struct psp_context *psp) return ret; } +static bool psp_skip_tmr(struct psp_context *psp) +{ + bool ret = false; + + switch (psp->adev->asic_type) { + case CHIP_NAVI12: + case CHIP_SIENNA_CICHLID: + ret = true; + break; + default: + return false; + } + + return ret; +} + static int psp_tmr_load(struct psp_context *psp) { int ret; struct psp_gfx_cmd_resp *cmd; + /* for Navi12 and CHIP_SIENNA_CICHLID SRIOV, do not setup TMR +* (already setup by host driver) +*/ + if (amdgpu_sriov_vf(psp->adev) && psp_skip_tmr(psp)) + return 0; + cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL); if (!cmd) return -ENOMEM; -- 2.25.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/amdgpu: Fix compiler warning in df driver
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Tom St Denis Sent: Wednesday, July 22, 2020 7:40 AM To: amd-gfx@lists.freedesktop.org Cc: StDenis, Tom Subject: [PATCH] drm/amd/amdgpu: Fix compiler warning in df driver Fix this warning: CC [M] drivers/gpu/drm/amd/amdgpu/gfxhub_v1_1.o In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h:29, from drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h:26, from drivers/gpu/drm/amd/amdgpu/amdgpu.h:43, from drivers/gpu/drm/amd/amdgpu/df_v3_6.c:23: drivers/gpu/drm/amd/amdgpu/df_v3_6.c: In function ‘df_v3_6_pmc_get_count’: ./include/drm/drm_print.h:487:2: warning: ‘hi_base_addr’ may be used uninitialized in this function [-Wmaybe-uninitialized] 487 | __drm_dbg(DRM_UT_DRIVER, fmt, ##__VA_ARGS__) | ^ drivers/gpu/drm/amd/amdgpu/df_v3_6.c:649:25: note: ‘hi_base_addr’ was declared here 649 | uint32_t lo_base_addr, hi_base_addr, lo_val = 0, hi_val = 0; | ^~~~ In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h:29, from drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h:26, from drivers/gpu/drm/amd/amdgpu/amdgpu.h:43, from drivers/gpu/drm/amd/amdgpu/df_v3_6.c:23: ./include/drm/drm_print.h:487:2: warning: ‘lo_base_addr’ may be used uninitialized in this function [-Wmaybe-uninitialized] 487 | __drm_dbg(DRM_UT_DRIVER, fmt, ##__VA_ARGS__) | ^ drivers/gpu/drm/amd/amdgpu/df_v3_6.c:649:11: note: ‘lo_base_addr’ was declared here 649 | uint32_t lo_base_addr, hi_base_addr, lo_val = 0, hi_val = 0; Signed-off-by: Tom St Denis --- drivers/gpu/drm/amd/amdgpu/df_v3_6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c index 1ab261836983..0aa1ac1accd6 100644 --- a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c +++ b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c @@ -646,7 +646,7 @@ static void df_v3_6_pmc_get_count(struct amdgpu_device *adev, uint64_t config, uint64_t *count) { - uint32_t lo_base_addr, hi_base_addr, lo_val = 0, hi_val = 0; + uint32_t lo_base_addr = 0, hi_base_addr = 0, lo_val = 0, hi_val = 0; *count = 0; switch (adev->asic_type) { -- 2.26.2 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7C95d3961b50a743867b6c08d82e340fe9%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637310148439516686&sdata=mkDp4Wqa3ZSS9T1Tr%2B0HvNhb0Il2RhD4RZ6WT%2BDXL9M%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 6/6] drm/amdgpu/sienna_cichlid: add SMU i2c support
[AMD Official Use Only - Internal Distribution Only] I tried that at first, but the smu i2c interface structures are different per asic. Alex From: Grodzovsky, Andrey Sent: Tuesday, July 21, 2020 1:01 PM To: Alex Deucher ; amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander Subject: Re: [PATCH 6/6] drm/amdgpu/sienna_cichlid: add SMU i2c support Looks like same code as arcturus - should we make it common helper code and reuse in both ? Andrey On 7/21/20 12:52 PM, Alex Deucher wrote: > Enable SMU i2c bus access for sienna_cichlid asics. > > Signed-off-by: Alex Deucher > --- > .../drm/amd/powerplay/sienna_cichlid_ppt.c| 239 ++ > 1 file changed, 239 insertions(+) > > diff --git a/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c > b/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c > index 5faef41b63a3..e1857fbb0a6f 100644 > --- a/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c > +++ b/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c > @@ -23,6 +23,7 @@ > > #include > #include > +#include > #include "amdgpu.h" > #include "amdgpu_smu.h" > #include "smu_internal.h" > @@ -52,6 +53,8 @@ > #undef pr_info > #undef pr_debug > > +#define to_amdgpu_device(x) (container_of(x, struct amdgpu_device, > pm.smu_i2c)) > + > #define FEATURE_MASK(feature) (1ULL << feature) > #define SMC_DPM_FEATURE ( \ >FEATURE_MASK(FEATURE_DPM_PREFETCHER_BIT) | \ > @@ -455,6 +458,8 @@ static int sienna_cichlid_tables_init(struct smu_context > *smu, struct smu_table > PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); >SMU_TABLE_INIT(tables, SMU_TABLE_SMU_METRICS, sizeof(SmuMetrics_t), > PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); > + SMU_TABLE_INIT(tables, SMU_TABLE_I2C_COMMANDS, sizeof(SwI2cRequest_t), > +PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); >SMU_TABLE_INIT(tables, SMU_TABLE_OVERDRIVE, sizeof(OverDriveTable_t), > PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM); >SMU_TABLE_INIT(tables, SMU_TABLE_PMSTATUSLOG, SMU11_TOOL_SIZE, > @@ -2487,6 +2492,238 @@ static void sienna_cichlid_dump_pptable(struct > smu_context *smu) >dev_info(smu->adev->dev, "MmHubPadding[7] = 0x%x\n", > pptable->MmHubPadding[7]); > } > > +static void sienna_cichlid_fill_i2c_req(SwI2cRequest_t *req, bool write, > + uint8_t address, uint32_t numbytes, > + uint8_t *data) > +{ > + int i; > + > + BUG_ON(numbytes > MAX_SW_I2C_COMMANDS); > + > + req->I2CcontrollerPort = 0; > + req->I2CSpeed = 2; > + req->SlaveAddress = address; > + req->NumCmds = numbytes; > + > + for (i = 0; i < numbytes; i++) { > + SwI2cCmd_t *cmd = &req->SwI2cCmds[i]; > + > + /* First 2 bytes are always write for lower 2b EEPROM address */ > + if (i < 2) > + cmd->CmdConfig = CMDCONFIG_READWRITE_MASK; > + else > + cmd->CmdConfig = write ? CMDCONFIG_READWRITE_MASK : 0; > + > + > + /* Add RESTART for read after address filled */ > + cmd->CmdConfig |= (i == 2 && !write) ? CMDCONFIG_RESTART_MASK : > 0; > + > + /* Add STOP in the end */172.31.4.187 > + cmd->CmdConfig |= (i == (numbytes - 1)) ? CMDCONFIG_STOP_MASK : > 0; > + > + /* Fill with data regardless if read or write to simplify code > */ > + cmd->ReadWriteData = data[i]; > + } > +} > + > +static int sienna_cichlid_i2c_read_data(struct i2c_adapter *control, > +uint8_t address, > +uint8_t *data, > +uint32_t numbytes) > +{ > + uint32_t i, ret = 0; > + SwI2cRequest_t req; > + struct amdgpu_device *adev = to_amdgpu_device(control); > + struct smu_table_context *smu_table = &adev->smu.smu_table; > + struct smu_table *table = &smu_table->driver_table; > + > + memset(&req, 0, sizeof(req)); > + sienna_cichlid_fill_i2c_req(&req, false, address, numbytes, data); > + > + mutex_lock(&adev->smu.mutex); > + /* Now read data starting with that address */ > + ret = smu_update_table(&adev->smu, SMU_TABLE_I2C_COMMANDS, 0, &req, > + true); > + mutex_unlock(&adev->smu.mutex); > + > + if (!ret) { > + SwI2cRequest_t *res = (SwI2cRe
Re: [PATCH 5/6] drm/amdgpu/navi1x: add SMU i2c support
[AMD Official Use Only - Internal Distribution Only] Ignore this. Sent out the wrong version. Alex From: Alex Deucher Sent: Tuesday, July 21, 2020 12:52 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander Subject: [PATCH 5/6] drm/amdgpu/navi1x: add SMU i2c support Enable SMU i2c bus access for navi1x asics. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c index ead135f39c7e..56267e6c600e 100644 --- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c @@ -23,6 +23,7 @@ #include #include +#include #include "amdgpu.h" #include "amdgpu_smu.h" #include "smu_internal.h" @@ -52,6 +53,8 @@ #undef pr_info #undef pr_debug +#define to_amdgpu_device(x) (container_of(x, struct amdgpu_device, pm.smu_i2c)) + #define FEATURE_MASK(feature) (1ULL << feature) #define SMC_DPM_FEATURE ( \ FEATURE_MASK(FEATURE_DPM_PREFETCHER_BIT) | \ -- 2.25.4 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx