A few more items for the glossary, and understanding GPU switching
Subsystems (4)
A message that is not in the archive (sent off-list or not yet received): 1501262214.149072942.1752943848461.JavaMail.root@zimbra39-e7.priv.proxad.net
Hello,
Back to reading some amdgpu code, I stumbled on a few things that probably ought to be added to the glossary. Well, to be fair, I actually just had to read the kernel logs to see most of them, so those likely make sense to explain.
* ATPX (could not find anything about that on the net). "PX" alone seems to be used as a synonym. Referred to as "ATPX power control", and closely linked to vga_switcheroo. This seems to be a preferred alternative to
BOCO and BACO, but those are only tersely mentioned in the glossary, and could maybe use more details. There also seem to be the notion of "ATPX hybrid" (which apparently applies to the RENOIR in my laptop)
* MACO and BAMACO looks similarly related (I may have missed some ;)
* CRAT seems to be known as "Component Resource Attribute Table" ACPI table according to various Internet sources (it is listed as "Component Resource Association Table" in kfd_crat.h, do we want to adjust this?), but I could not locate any details on this table (ACPI 6.5 seems to list it as deprecated, but even 6.4 just gives erroneous information, "Links to ACPI-related Documents" in https://uefi.org/acpi has no info) Is it useful to add to the glossary, with some info about its role in the amdgpu context?
Now about the init on my MSI Bravo17 (Renoir APU, Navi10 dGPU)...
What I understand about ATPX is that this is a "PX system", as shown by amdgpu_atpx_detect() logging:
amdgpu: vga_switcheroo: detected switching method \_SB_.PCI0.GP17.VGA_.ATPX handle
So amdgpu seems to imply vga_switcheroo is supposed to get initialized at some point, right? Similarly with another similar-looking log:
snd_hda_intel 0000:03:00.1: Handle vga_switcheroo audio client
But no other log see vga_switcheroo actually getting enabled (and the debugfs dir does not appear either, confirming this).
That is, no call to vga_switcheroo_enable() gets done (both would trigger a "vga_switcheroo: enabled" log). The 2 call chains from amdgpu would be:
amdgpu_init()
-> amdgpu_register_atpx_handler()
-> vga_switcheroo_register_handler()
amdgpu_device_init()
-> vga_switcheroo_register_client()
-> register_client()
Booting with "tp_printk ftrace=function ftrace_filter=vga_switcheroo_register_handler,vga_switcheroo_register_client,vga_switcheroo_ready" it gets obvious vga_switcheroo_register_client() never not gets called.
The answer seems to lie in amdgpu_device_supports_px(), but I'm not sure to get everything straight here:amdgpu_device_supports_px() is documented as "Returns true if the device is a dGPU with ATPX power control", but amdgpu_is_atpx_hybrid() it calls seems to take info from a single static struct, so does the quoted docstring really make sense? And if an "APTX hybrid" system does not support vga_switcheroo in the end, couldn't we just avoid any mention of vga_switcheroo in the logs (since it is indeed amdgpu itself sending the user on that track), or at least just print once that it is not supported and a short reason?
Best regards,
Signature · 1 line
Yann
Adding to the list:
* ACA, mentionned in debug_mask flags - digging the source shows it seems to be "Accelerator Check Architecture", but maybe some additional details could be added?
* DPIA (likely for dc-glossary): listed in DC_DEBUG_MASK values, source code in several places shows "DisplayPort Input Adapter", but maybe more details would be useful here too? Often associated with DP USB4 tunneling in source code.
Best regards,
Signature · 1 line
Yann
cover Minor documentation updates
In reply to Yann DirsonThis series fixes a few small things I stumbled upon while reading the amdgpu doc.
Yann Dirson (3):
Documentation/amdgpu: fix 'in the amdgfx' formulation drm/amdgpu: fix module parameter description Documentation/amdgpu: add a few acronyms to glossary
Documentation/gpu/amdgpu/amdgpu-glossary.rst | 3 +++ Documentation/gpu/amdgpu/display/dc-glossary.rst | 5 ++++- Documentation/gpu/amdgpu/display/display-contributing.rst | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-)
Signature · 1 line
2.39.5
PATCH 1/3 Documentation/amdgpu: fix 'in the amdgfx' formulation
--- Documentation/gpu/amdgpu/display/dc-glossary.rst | 2 +- Documentation/gpu/amdgpu/display/display-contributing.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/gpu/amdgpu/display/dc-glossary.rst +1 -1
@@ -5,7 +5,7 @@ DC Glossary On this page, we try to keep track of acronyms related to the display component. If you do not find what you are looking for, look at the 'Documentation/gpu/amdgpu/amdgpu-glossary.rst'; if you cannot find it anywhere, -consider asking in the amdgfx and update this page. +consider asking in the amd-gfx mailing list and update this page. .. glossary::
Documentation/gpu/amdgpu/display/display-contributing.rst +1 -1
@@ -9,7 +9,7 @@ contribution to the display code, and for that, we say thank you :) This page summarizes some of the issues you can help with; keep in mind that this is a static page, and it is always a good idea to try to reach developers -in the amdgfx or some of the maintainers. Finally, this page follows the DRM +in the amd-gfx mailing list or some of the maintainers. Finally, this page follows the DRM way of creating a TODO list; for more information, check 'Documentation/gpu/todo.rst'.
Signature · 1 line
2.39.5
PATCH 2/3 drm/amdgpu: fix module parameter description
In reply to Yann Dirson--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -1
@@ -885,7 +885,7 @@ module_param_named(dcfeaturemask, amdgpu_dc_feature_mask, uint, 0444);/** * DOC: dcdebugmask (uint) -* Override display features enabled. See enum DC_DEBUG_MASK in drivers/gpu/drm/amd/include/amd_shared.h. +* Debug options enabled. See enum DC_DEBUG_MASK in drivers/gpu/drm/amd/include/amd_shared.h. */ MODULE_PARM_DESC (dcdebugmask,"all debug options disabled (default))" );module_param_named (dcdebugmask, amdgpu_dc_debug_mask, uint,0444 );
Signature · 1 line
2.39.5
Re: [PATCH 2/3] drm/amdgpu: fix module parameter description
Applied the first two patches with some minor changes.
Alex
Quoted 22 lines · Yann Dirson
Signed-off-by Yann Dirson <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1
-2@@ -885,7 +885,7 @@ module_param_named(dcfeaturemask, amdgpu_dc_feature_mask, uint, 0444);/** * DOC: dcdebugmask (uint) -* Override display features enabled. See enum DC_DEBUG_MASK in drivers/gpu/drm/amd/include/amd_shared.h. +* Debug options enabled. See enum DC_DEBUG_MASK in drivers/gpu/drm/amd/include/amd_shared.h. */ MODULE_PARM_DESC (dcdebugmask,"all debug options disabled (default))" );module_param_named (dcdebugmask, amdgpu_dc_debug_mask, uint,0444 ); --2.39.5
PATCH 3/3 Documentation/amdgpu: add a few acronyms to glossary
In reply to Yann Dirson---
Notes (patch):
test patch note
Documentation/gpu/amdgpu/amdgpu-glossary.rst | 3 +++ Documentation/gpu/amdgpu/display/dc-glossary.rst | 3 +++ 2 files changed, 6 insertions(+)
Documentation/gpu/amdgpu/amdgpu-glossary.rst +3 -0
@@ -12,6 +12,9 @@ we have a dedicated glossary for Display Core at The number of CUs that are active on the system. The number of active CUs may be less than SE * SH * CU depending on the board configuration. + ACA + Accelerator Check Architecture + BACO Bus Alive, Chip Off
Documentation/gpu/amdgpu/display/dc-glossary.rst +3 -0
@@ -88,6 +88,9 @@ consider asking in the amd-gfx mailing list and update this page. DIO Display IO + DPIA + DisplayPort Input Adapter + DPP Display Pipes and Planes
Signature · 1 line
2.39.5
Re: [PATCH 3/3] Documentation/amdgpu: add a few acronyms to glossary
Quoted 30 lines · Yann Dirson
Signed-off-by Yann Dirson <[email protected]>---
Notes (patch):
test patch noteDocumentation/gpu/amdgpu/amdgpu-glossary.rst | 3 +++ Documentation/gpu/amdgpu/display/dc-glossary.rst | 3 +++ 2 files changed, 6 insertions(+)Documentation/gpu/amdgpu/amdgpu-glossary.rst +3
-0@@ -12,6 +12,9 @@ we have a dedicated glossary for Display Core at The number of CUs that are active on the system. The number of active CUs may be less than SE * SH * CU depending on the board configuration. + ACA + Accelerator Check Architecture + BACO Bus Alive, Chip OffDocumentation/gpu/amdgpu/display/dc-glossary.rst +0
-0
Documentation/gpu/amdgpu/display/dc-glossary.rst consider asking in the amd-gfx mailing list and update this page. · line 93
Quoted 6 lines
Documentation/gpu/amdgpu/display/dc-glossary.rst +3
-0@@ -88,6 +88,9 @@ consider asking in the amd-gfx mailing list and update this page. DIO Display IO + DPIA + DisplayPort Input Adapter +
Harry, Leo,
Is that the correct expansion of the acronym?
Alex
Quoted 6 lines
Documentation/gpu/amdgpu/display/dc-glossary.rst +0
-1DPP Display Pipes and Planes --2.39.5
Re: [PATCH 3/3] Documentation/amdgpu: add a few acronyms to glossary
Quoted 34 lines · Alex Deucher
Quoted 33 lines · Yann Dirson
Signed-off-by Yann Dirson <[email protected]>---
Notes (patch):
test patch noteDocumentation/gpu/amdgpu/amdgpu-glossary.rst | 3 +++ Documentation/gpu/amdgpu/display/dc-glossary.rst | 3 +++ 2 files changed, 6 insertions(+)Documentation/gpu/amdgpu/amdgpu-glossary.rst +3
-0@@ -12,6 +12,9 @@ we have a dedicated glossary for Display Core at The number of CUs that are active on the system. The number of active CUs may be less than SE * SH * CU depending on the board configuration. + ACA + Accelerator Check Architecture + BACO Bus Alive, Chip OffDocumentation/gpu/amdgpu/display/dc-glossary.rst +0
-0@@ -88,6 +88,9 @@ consider asking in the amd-gfx mailing list and update this page. DIO Display IO
Quoted 8 lines
Documentation/gpu/amdgpu/display/dc-glossary.rst consider asking in the amd-gfx mailing list and update this page. · line 93
Quoted 3 lines
Documentation/gpu/amdgpu/display/dc-glossary.rst +3
-0+ DPIA + DisplayPort Input Adapter +Harry, Leo,
Is that the correct expansion of the acronym?
Yes, as far as I know.
Harry
Quoted 9 lines
Alex
Quoted 6 lines
Documentation/gpu/amdgpu/display/dc-glossary.rst +0
-1DPP Display Pipes and Planes --2.39.5
Quoted 9 lines · Yann Dirson
Hello,
Back to reading some amdgpu code, I stumbled on a few things that probably ought to be added to the glossary. Well, to be fair, I actually just had to read the kernel logs to see most of them, so those likely make sense to explain.
* ATPX (could not find anything about that on the net). "PX" alone seems to be used as a synonym. Referred to as "ATPX power control", and closely linked to
vga_switcheroo.
ATPX is the name of an ACPI method. It stands for ATI PowerXpress. PowerXpress was the marketing name associated with dGPU d3cold when it was a vendor specific feature. Eventually this was standardized by ACPI and there are standard methods for controlling device power in the ACPI layer.
Quoted 4 lines
This seems to be a preferred alternative to
BOCO and BACO, but those are only tersely mentioned in the glossary, and could maybe use more details. There also seem to be the notion of "ATPX hybrid" (which apparently applies to the RENOIR in my laptop)
The ATPX method still exists on some laptops with a dGPU, but it no longer controls the dGPU power. That is handled via standard ACPI methods now and has been for a while. The driver checks the ATPX method to determine whether it should use ATPX or the standard ACPI interfaces for power control.
Quoted 1 line
* MACO and BAMACO looks similarly related (I may have missed some ;)
BOCO/BACO/BAMACO are all names for various low power states GPU can be put into.
B = Bus
M = Memory
C = Chip
A = Active
O = Off
So BOCO would be Bus Off Chip Off. Basically the entire PCIe device is powered down. Since the PCIe device is powered down, it no longer appears on the PCIe bus. This is handled by either ATPX or the standard ACPI d3cold methods. BACO is Bus Active Chip Off. In BACO, the bus interface is still up, but the chip is powered down, so the device still shows up on the PCIe bus, but most of the chip is powered down. BAMACO and BOMACO are similar to BACO and BOCO, but they keep VRAM powered up so VRAM contents are not lost when the device is powered down.
Quoted 7 lines
* CRAT seems to be known as "Component Resource Attribute Table" ACPI table according to various Internet sources (it is listed as "Component Resource Association Table" in
kfd_crat.h, do we want to adjust this?), but I could not locate any details on this table (ACPI 6.5 seems to list it as deprecated, but even 6.4 just gives erroneous information, "Links to ACPI-related Documents" in https://uefi.org/acpi has no info) Is it useful to add to the glossary, with some info about its role in the amdgpu context?
CRAT was an ACPI table which was used for topology information for APUs for ROCm. Unfortunately, not all board vendors properly supported the table, so the driver has a fallback to handle missing CRAT tables. It hasn't been used for a long time.
Quoted 8 lines
Now about the init on my MSI Bravo17 (Renoir APU, Navi10 dGPU)...
What I understand about ATPX is that this is a "PX system", as shown by
amdgpu_atpx_detect()logging:
amdgpu:vga_switcheroo: detected switching method \_SB_.PCI0.GP17.VGA_.ATPX handleSo amdgpu seems to imply
vga_switcheroois supposed to get initialized at some point, right?
IIRC, the switcheroo code looks for certain ACPI methods on its own as well.
Quoted 18 lines
Similarly with another similar-looking log:
snd_hda_intel0000:03:00.1: Handlevga_switcherooaudio clientBut no other log see
vga_switcherooactually getting enabled (and the debugfs dir does not appear either, confirming this).That is, no call to
vga_switcheroo_enable()gets done (both would trigger a "vga_switcheroo: enabled" log). The 2 call chains from amdgpu would be:
amdgpu_init()
->amdgpu_register_atpx_handler()
->vga_switcheroo_register_handler()
amdgpu_device_init()
->vga_switcheroo_register_client()
->register_client()
Quoted 8 lines
Booting with "
tp_printkftrace=function ftrace_filter=vga_switcheroo_register_handler,vga_switcheroo_register_client,vga_switcheroo_ready" it gets obviousvga_switcheroo_register_client()never not gets called.The answer seems to lie in
amdgpu_device_supports_px(), but I'm not sure to get everything straight here:amdgpu_device_supports_px()is documented as "Returns true if the device is a dGPU with ATPX power control", butamdgpu_is_atpx_hybrid()it calls seems to take info from a single static struct, so does the quoted docstring really make sense? And if an "APTX hybrid" system does not supportvga_switcherooin the end, couldn't we just avoid any mention ofvga_switcherooin the logs (since it is indeed amdgpu itself sending the user on that track), or at least just print once that it is not supported and a short reason?
ATPX was also used for mux switching on laptops which had a display mux between the APU and the dGPU. The switcheroo stuff was for handling that.
The message comes from the audio driver. I think it just checks for the presence of ATPX and sets up switcheroo on the audio side. Someone could improve the logic in the audio driver (and the switcheroo code as well) to follow what the GPU driver does if you wanted to avoid those messages.
Quoted 4 lines
Best regards,
--
Yann