Skip to contentSkip to conversation

drm/amdgpu: Set module parameter for emulation

PATCH In review Shaoyun Liu 5 participants 6 messages Feb 1, 2018 5 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: Set module parameter for emulation

During emulation period, use the directly load for firmware also only enable the GFX , SDMA and necessary common, gmc, ih IP block

Change-Id: I325910fa06be4060725f404e471cc79daaf343c3

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +9 -1
index 5a5ed47..7a1c670 100644
@@ -93,10 +93,18 @@
 int amdgpu_msi = -1;
 int amdgpu_lockup_timeout = 10000;
 int amdgpu_dpm = -1;
-int amdgpu_fw_load_type = -1;
 int amdgpu_aspm = -1;
 int amdgpu_runtime_pm = -1;
+#ifndef AMDGPU_EMULATOR_BUILD
 uint amdgpu_ip_block_mask = 0xffffffff;
+int amdgpu_fw_load_type = -1;
+#else
+/* Only enable GFX and  SDMA + common, gmc, ih IP  block for emulation */
+uint amdgpu_ip_block_mask = 0xc7;
+/* Normally, only direct load is support durign emulation time */
+int amdgpu_fw_load_type = 0;
+#endif
+
 int amdgpu_bapm = -1;
 int amdgpu_deep_color = 0;
 int amdgpu_vm_size = -1;
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1517516135-28167-1-git-send-email-Shaoyun.Liu-5C7GfCeVMHo@public.gmane.org

#2 lore raw

I don't think we should push any emulation specific code upstream.

Nobody outside of AMD can test anything of that not actually make any use of it.

Regards,
Christian.

Am 01.02.2018 um 21:15 schrieb Shaoyun Liu:

Quoted 24 lines

During emulation period, use the directly load for firmware also only enable the GFX , SDMA and necessary common, gmc, ih IP block

Change-Id: I325910fa06be4060725f404e471cc79daaf343c3

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -1
index 5a5ed47..7a1c670 100644
@@ -93,10 +93,18 @@
  int amdgpu_msi = -1;
  int amdgpu_lockup_timeout = 10000;
  int amdgpu_dpm = -1;
-int amdgpu_fw_load_type = -1;
  int amdgpu_aspm = -1;
  int amdgpu_runtime_pm = -1;
+#ifndef AMDGPU_EMULATOR_BUILD
  uint amdgpu_ip_block_mask = 0xffffffff;
+int amdgpu_fw_load_type = -1;

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c line 110

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +7 -0
+#else
+/* Only enable GFX and  SDMA + common, gmc, ih IP  block for emulation */
+uint amdgpu_ip_block_mask = 0xc7;
+/* Normally, only direct load is support durign emulation time */
+int amdgpu_fw_load_type = 0;
+#endif
+
  int amdgpu_bapm = -1;
  int amdgpu_deep_color = 0;
  int amdgpu_vm_size = -1;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 97de707f-980e-8247-deff-e7d490291f31-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#4 lore raw
Quoted 4 lines · Christian König

I don't think we should push any emulation specific code upstream.

Nobody outside of AMD can test anything of that not actually make any use of it.

It makes it much easier to maintain the code however and debug things on the emulator in the future if we encounter an issue, even after we get silicon back. Some emulation features can even be used on real silicon, although there is not much value in doing so.

Quoted 27 lines

Regards,
Christian.

Am 01.02.2018 um 21:15 schrieb Shaoyun Liu:

Quoted 21 lines

During emulation period, use the directly load for firmware also only enable the GFX , SDMA and necessary common, gmc, ih IP block

Change-Id: I325910fa06be4060725f404e471cc79daaf343c3

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
index 5a5ed47..7a1c670 100644
@@ -93,10 +93,18 @@
  int amdgpu_msi = -1;
  int amdgpu_lockup_timeout = 10000;
  int amdgpu_dpm = -1;
-int amdgpu_fw_load_type = -1;
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c line 103

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -0
  int amdgpu_aspm = -1;
  int amdgpu_runtime_pm = -1;
+#ifndef AMDGPU_EMULATOR_BUILD
  uint amdgpu_ip_block_mask = 0xffffffff;
+int amdgpu_fw_load_type = -1;
+#else
+/* Only enable GFX and  SDMA + common, gmc, ih IP  block for emulation */
+uint amdgpu_ip_block_mask = 0xc7;

I'm not sure it's a good idea to hardcode the block mask in this case. We'll be changing it as we test additional blocks on the emulator.

Alex

Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -0
+/* Normally, only direct load is support durign emulation time */
+int amdgpu_fw_load_type = 0;
+#endif
+
  int amdgpu_bapm = -1;
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c line 110

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
  int amdgpu_deep_color = 0;
  int amdgpu_vm_size = -1;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CADnq5_NN49kdtQXMH1TEob2Z0znJAD-22gA_TJB1qR=ayEOOWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#6 lore raw

If it helps, my recollection was that Intel was also pushing some pre-silicon support code upstream.

Agree that if the changes get big/messy/invasive we should rethink this, but my impression is that the changes can be fairly small. There will be one Big Honkin' function that programs ~10,000 registers with some readback and delay logic specific to the emulator, but we can replace that with a stub and maybe move it to a separate file.

Christian, are you OK with upstreaming the ZFB patches ? We will be using those on both emulator and real silicon.

Thanks,
John

Quoted 74 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Alex Deucher
Sent: Thursday, February 01, 2018 3:31 PM
To: Koenig, Christian
Cc: amd-gfx list; Liu, Shaoyun
Subject: Re: [PATCH 1/2] drm/amdgpu: Set module parameter for emulation

Quoted 4 lines · Christian König

I don't think we should push any emulation specific code upstream.

Nobody outside of AMD can test anything of that not actually make any use of it.

It makes it much easier to maintain the code however and debug things on the emulator in the future if we encounter an issue, even after we get silicon back. Some emulation features can even be used on real silicon, although there is not much value in doing so.

Quoted 27 lines

Regards,
Christian.

Am 01.02.2018 um 21:15 schrieb Shaoyun Liu:

Quoted 21 lines

During emulation period, use the directly load for firmware also only enable the GFX , SDMA and necessary common, gmc, ih IP block

Change-Id: I325910fa06be4060725f404e471cc79daaf343c3

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
index 5a5ed47..7a1c670 100644
@@ -93,10 +93,18 @@
  int amdgpu_msi = -1;
  int amdgpu_lockup_timeout = 10000;
  int amdgpu_dpm = -1;
-int amdgpu_fw_load_type = -1;
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -0
  int amdgpu_aspm = -1;
  int amdgpu_runtime_pm = -1;
+#ifndef AMDGPU_EMULATOR_BUILD
  uint amdgpu_ip_block_mask = 0xffffffff;
+int amdgpu_fw_load_type = -1;
+#else
+/* Only enable GFX and  SDMA + common, gmc, ih IP  block for
+emulation */ uint amdgpu_ip_block_mask = 0xc7;

I'm not sure it's a good idea to hardcode the block mask in this case. We'll be changing it as we test additional blocks on the emulator.

Alex

Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -0
+/* Normally, only direct load is support durign emulation time */
+int amdgpu_fw_load_type = 0; #endif
+
  int amdgpu_bapm = -1;
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c line 110

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
  int amdgpu_deep_color = 0;
  int amdgpu_vm_size = -1;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1348AA48023E16DADE2C3611E8FA0-/b2+HYfkarQX0pEhCR5T8QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#8 lore raw

The changes I send out are try to minimize the emulation specific code , like the ip_block_mask change , so developer can just change the module parameter to enable the specific ip block during emulation. Otherwise we need a messy ifdef to enable specific ip block for the specific ASIC to run on emulator . The soc aisc init function will be basic specific and will be added on developer works on that asic .

Regards
Shaoyun.liu

-----Original Message-----
From: Bridgman, John
Sent: Thursday, February 01, 2018 3:37 PM
To: Alex Deucher; Koenig, Christian
Cc: amd-gfx list; Liu, Shaoyun
Subject: RE: [PATCH 1/2] drm/amdgpu: Set module parameter for emulation

If it helps, my recollection was that Intel was also pushing some pre-silicon support code upstream.

Agree that if the changes get big/messy/invasive we should rethink this, but my impression is that the changes can be fairly small. There will be one Big Honkin' function that programs ~10,000 registers with some readback and delay logic specific to the emulator, but we can replace that with a stub and maybe move it to a separate file.

Christian, are you OK with upstreaming the ZFB patches ? We will be using those on both emulator and real silicon.

Thanks,
John

Quoted 74 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Alex Deucher
Sent: Thursday, February 01, 2018 3:31 PM
To: Koenig, Christian
Cc: amd-gfx list; Liu, Shaoyun
Subject: Re: [PATCH 1/2] drm/amdgpu: Set module parameter for emulation

Quoted 4 lines · Christian König

I don't think we should push any emulation specific code upstream.

Nobody outside of AMD can test anything of that not actually make any use of it.

It makes it much easier to maintain the code however and debug things on the emulator in the future if we encounter an issue, even after we get silicon back. Some emulation features can even be used on real silicon, although there is not much value in doing so.

Quoted 27 lines

Regards,
Christian.

Am 01.02.2018 um 21:15 schrieb Shaoyun Liu:

Quoted 21 lines

During emulation period, use the directly load for firmware also only enable the GFX , SDMA and necessary common, gmc, ih IP block

Change-Id: I325910fa06be4060725f404e471cc79daaf343c3

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
index 5a5ed47..7a1c670 100644
@@ -93,10 +93,18 @@
  int amdgpu_msi = -1;
  int amdgpu_lockup_timeout = 10000;
  int amdgpu_dpm = -1;
-int amdgpu_fw_load_type = -1;
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c line 103

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -0
  int amdgpu_aspm = -1;
  int amdgpu_runtime_pm = -1;
+#ifndef AMDGPU_EMULATOR_BUILD
  uint amdgpu_ip_block_mask = 0xffffffff;
+int amdgpu_fw_load_type = -1;
+#else
+/* Only enable GFX and  SDMA + common, gmc, ih IP  block for 
+emulation */ uint amdgpu_ip_block_mask = 0xc7;

I'm not sure it's a good idea to hardcode the block mask in this case. We'll be changing it as we test additional blocks on the emulator.

Alex

Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -0
+/* Normally, only direct load is support durign emulation time */ 
+int amdgpu_fw_load_type = 0; #endif
+
  int amdgpu_bapm = -1;
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c line 109

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -0
  int amdgpu_deep_color = 0;
  int amdgpu_vm_size = -1;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1172C157A2FD87E24D7FAE14F4FA0-/b2+HYfkarTft/[email protected]

#10 lore raw

We can certainly upstream ZFB support if we clean it up a bit more.

If we need some different default values and/or disable vbios access we can add an amdgpu_emulation parameter to trigger setting those automatically.

But please, no single #ifdef AMDGPU_EMULATOR_BUILD in the code. Nobody outside AMD will build this and so sooner or later it is going to break horrible.

Regards,
Christian.

Am 01.02.2018 um 21:51 schrieb Liu, Shaoyun:

Quoted 12 lines

The changes I send out are try to minimize the emulation specific code , like the ip_block_mask change , so developer can just change the module parameter to enable the specific ip block during emulation. Otherwise we need a messy ifdef to enable specific ip block for the specific ASIC to run on emulator . The soc aisc init function will be basic specific and will be added on developer works on that asic .

Regards
Shaoyun.liu

-----Original Message-----
From: Bridgman, John
Sent: Thursday, February 01, 2018 3:37 PM
To: Alex Deucher; Koenig, Christian
Cc: amd-gfx list; Liu, Shaoyun
Subject: RE: [PATCH 1/2] drm/amdgpu: Set module parameter for emulation

Quoted 82 lines

If it helps, my recollection was that Intel was also pushing some pre-silicon support code upstream.

Agree that if the changes get big/messy/invasive we should rethink this, but my impression is that the changes can be fairly small. There will be one Big Honkin' function that programs ~10,000 registers with some readback and delay logic specific to the emulator, but we can replace that with a stub and maybe move it to a separate file.

Christian, are you OK with upstreaming the ZFB patches ? We will be using those on both emulator and real silicon.

Thanks,
John

Quoted 73 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Alex Deucher
Sent: Thursday, February 01, 2018 3:31 PM
To: Koenig, Christian
Cc: amd-gfx list; Liu, Shaoyun
Subject: Re: [PATCH 1/2] drm/amdgpu: Set module parameter for emulation

Quoted 4 lines · Christian König

I don't think we should push any emulation specific code upstream.

Nobody outside of AMD can test anything of that not actually make any use of it.

It makes it much easier to maintain the code however and debug things on the emulator in the future if we encounter an issue, even after we get silicon back. Some emulation features can even be used on real silicon, although there is not much value in doing so.

Quoted 25 lines

Regards,
Christian.

Am 01.02.2018 um 21:15 schrieb Shaoyun Liu:

Quoted 20 lines

During emulation period, use the directly load for firmware also only enable the GFX , SDMA and necessary common, gmc, ih IP block

Change-Id: I325910fa06be4060725f404e471cc79daaf343c3

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 10 +++++++++-
   1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
index 5a5ed47..7a1c670 100644
@@ -93,10 +93,18 @@
   int amdgpu_msi = -1;
   int amdgpu_lockup_timeout = 10000;
   int amdgpu_dpm = -1;
-int amdgpu_fw_load_type = -1;
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c line 103

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -0
   int amdgpu_aspm = -1;
   int amdgpu_runtime_pm = -1;
+#ifndef AMDGPU_EMULATOR_BUILD
   uint amdgpu_ip_block_mask = 0xffffffff;
+int amdgpu_fw_load_type = -1;
+#else
+/* Only enable GFX and  SDMA + common, gmc, ih IP  block for
+emulation */ uint amdgpu_ip_block_mask = 0xc7;

I'm not sure it's a good idea to hardcode the block mask in this case. We'll be changing it as we test additional blocks on the emulator.

Alex

Quoted 11 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c line 109

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -0
+/* Normally, only direct load is support durign emulation time */
+int amdgpu_fw_load_type = 0; #endif
+
   int amdgpu_bapm = -1;
   int amdgpu_deep_color = 0;
   int amdgpu_vm_size = -1;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx