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,
-- 
Yann

Reply via email to