* [PATCH 1/2] amdgpu: make pmu support optional
@ 2019-07-08 14:41 Arnd Bergmann
2019-07-08 14:41 ` [PATCH 2/2] amdgpu: make SOC15/navi support conditional Arnd Bergmann
2019-07-08 15:58 ` [PATCH 1/2] amdgpu: make pmu support optional Alex Deucher
0 siblings, 2 replies; 5+ messages in thread
From: Arnd Bergmann @ 2019-07-08 14:41 UTC (permalink / raw)
To: Alex Deucher, Christian König, David (ChunMing) Zhou,
David Airlie, Daniel Vetter
Cc: Arnd Bergmann, Jonathan Kim, Felix Kuehling, Hawking Zhang,
Huang Rui, Xiaojie Yuan, Jack Xiao, Andrey Grodzovsky, Rex Zhu,
Emily Deng, xinhui pan, Evan Quan, amd-gfx, dri-devel,
linux-kernel
When CONFIG_PERF_EVENTS is disabled, we cannot compile the pmu
portion of the amdgpu driver:
drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c:48:38: error: no member named 'hw' in 'struct perf_event'
struct hw_perf_event *hwc = &event->hw;
~~~~~ ^
drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c:51:13: error: no member named 'attr' in 'struct perf_event'
if (event->attr.type != event->pmu->type)
~~~~~ ^
...
Use conditional compilation for this file.
Fixes: 9c7c85f7ea1f ("drm/amdgpu: add pmu counters")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/amd/amdgpu/Makefile | 4 +++-
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile
index 3a15a46b4ecb..3f5329906fce 100644
--- a/drivers/gpu/drm/amd/amdgpu/Makefile
+++ b/drivers/gpu/drm/amd/amdgpu/Makefile
@@ -54,7 +54,9 @@ amdgpu-y += amdgpu_device.o amdgpu_kms.o \
amdgpu_gtt_mgr.o amdgpu_vram_mgr.o amdgpu_virt.o amdgpu_atomfirmware.o \
amdgpu_vf_error.o amdgpu_sched.o amdgpu_debugfs.o amdgpu_ids.o \
amdgpu_gmc.o amdgpu_xgmi.o amdgpu_csa.o amdgpu_ras.o amdgpu_vm_cpu.o \
- amdgpu_vm_sdma.o amdgpu_pmu.o amdgpu_discovery.o
+ amdgpu_vm_sdma.o amdgpu_discovery.o
+
+amdgpu-$(CONFIG_PERF_EVENTS) += amdgpu_pmu.o
# add asic specific block
amdgpu-$(CONFIG_DRM_AMDGPU_CIK)+= cik.o cik_ih.o kv_smc.o kv_dpm.o \
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 30989b455047..a02ccce7bf53 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2816,7 +2816,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
return r;
}
- r = amdgpu_pmu_init(adev);
+ if (IS_ENABLED(CONFIG_PERF_EVENTS))
+ r = amdgpu_pmu_init(adev);
if (r)
dev_err(adev->dev, "amdgpu_pmu_init failed\n");
@@ -2888,7 +2889,8 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
amdgpu_debugfs_regs_cleanup(adev);
device_remove_file(adev->dev, &dev_attr_pcie_replay_count);
amdgpu_ucode_sysfs_fini(adev);
- amdgpu_pmu_fini(adev);
+ if (IS_ENABLED(CONFIG_PERF_EVENTS))
+ amdgpu_pmu_fini(adev);
amdgpu_debugfs_preempt_cleanup(adev);
if (amdgpu_discovery)
amdgpu_discovery_fini(adev);
--
2.20.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] amdgpu: make SOC15/navi support conditional 2019-07-08 14:41 [PATCH 1/2] amdgpu: make pmu support optional Arnd Bergmann @ 2019-07-08 14:41 ` Arnd Bergmann 2019-07-08 14:46 ` Alex Deucher 2019-07-08 15:58 ` [PATCH 1/2] amdgpu: make pmu support optional Alex Deucher 1 sibling, 1 reply; 5+ messages in thread From: Arnd Bergmann @ 2019-07-08 14:41 UTC (permalink / raw) To: Alex Deucher, Christian König, David (ChunMing) Zhou, David Airlie, Daniel Vetter, Oded Gabbay Cc: Arnd Bergmann, Felix Kuehling, Philip Yang, Amber Lin, Thomas Gleixner, Hawking Zhang, Huang Rui, Feifei Xu, Jack Xiao, Shaoyun Liu, Oak Zeng, Yong Zhao, Andrey Grodzovsky, Rex Zhu, Emily Deng, xinhui pan, Evan Quan, amd-gfx, dri-devel, linux-kernel Enabling amdgpu but not CONFIG_DRM_AMD_DC leads to a warning: drivers/gpu/drm/amd/amdgpu/nv.c: In function 'nv_set_ip_blocks': drivers/gpu/drm/amd/amdgpu/nv.c:400:3: error: #warning "Enable CONFIG_DRM_AMD_DC for display support on navi." [-Werror=cpp] # warning "Enable CONFIG_DRM_AMD_DC for display support on navi." ^~~~~~~ drivers/gpu/drm/amd/amdgpu/soc15.c: In function 'soc15_set_ip_blocks': drivers/gpu/drm/amd/amdgpu/soc15.c:653:3: error: #warning "Enable CONFIG_DRM_AMD_DC for display support on SOC15." [-Werror=cpp] However, CONFIG_DRM_AMD_DC can only be enabled on x86, so we cannot do that when building for other architectures. Add another Kconfig symbol to handle the SOC15 and navi, making sure that we implicitly enable DC. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/gpu/drm/amd/amdgpu/Kconfig | 7 +++++ drivers/gpu/drm/amd/amdgpu/Makefile | 32 +++++++++++++++------- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/Kconfig b/drivers/gpu/drm/amd/amdgpu/Kconfig index a04f2fc7bf37..d7186dd88dbc 100644 --- a/drivers/gpu/drm/amd/amdgpu/Kconfig +++ b/drivers/gpu/drm/amd/amdgpu/Kconfig @@ -24,6 +24,13 @@ config DRM_AMDGPU_CIK radeon.cik_support=0 amdgpu.cik_support=1 +config DRM_AMDGPU_SOC15 + bool "Enable amdgpu support for SOC15 parts" + depends on DRM_AMDGPU + select DRM_AMD_DC + help + Choose this option if you want to enable support for SOC15 asics. + config DRM_AMDGPU_USERPTR bool "Always enable userptr write support" depends on DRM_AMDGPU diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile index 3f5329906fce..e95ae468eaa1 100644 --- a/drivers/gpu/drm/amd/amdgpu/Makefile +++ b/drivers/gpu/drm/amd/amdgpu/Makefile @@ -64,9 +64,10 @@ amdgpu-$(CONFIG_DRM_AMDGPU_CIK)+= cik.o cik_ih.o kv_smc.o kv_dpm.o \ amdgpu-$(CONFIG_DRM_AMDGPU_SI)+= si.o gmc_v6_0.o gfx_v6_0.o si_ih.o si_dma.o dce_v6_0.o si_dpm.o si_smc.o -amdgpu-y += \ - vi.o mxgpu_vi.o nbio_v6_1.o soc15.o emu_soc.o mxgpu_ai.o nbio_v7_0.o vega10_reg_init.o \ - vega20_reg_init.o nbio_v7_4.o nbio_v2_3.o nv.o navi10_reg_init.o navi14_reg_init.o +amdgpu-y += vi.o mxgpu_vi.o emu_soc.o nbio_v7_4.o + +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += gmc_v9_0.o nbio_v6_1.o soc15.o mxgpu_ai.o nbio_v7_0.o \ + vega10_reg_init.o vega20_reg_init.o nbio_v2_3.o nv.o navi10_reg_init.o navi14_reg_init.o # add DF block amdgpu-y += \ @@ -77,7 +78,10 @@ amdgpu-y += \ amdgpu-y += \ gmc_v7_0.o \ gmc_v8_0.o \ - gfxhub_v1_0.o mmhub_v1_0.o gmc_v9_0.o gfxhub_v1_1.o \ + gfxhub_v1_0.o mmhub_v1_0.o gfxhub_v1_1.o + +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += \ + gmc_v9_0.o \ gfxhub_v2_0.o mmhub_v2_0.o gmc_v10_0.o # add IH block @@ -86,7 +90,9 @@ amdgpu-y += \ amdgpu_ih.o \ iceland_ih.o \ tonga_ih.o \ - cz_ih.o \ + cz_ih.o + +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += \ vega10_ih.o \ navi10_ih.o @@ -111,7 +117,9 @@ amdgpu-y += \ amdgpu-y += \ amdgpu_gfx.o \ amdgpu_rlc.o \ - gfx_v8_0.o \ + gfx_v8_0.o + +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += \ gfx_v9_0.o \ gfx_v10_0.o @@ -119,12 +127,14 @@ amdgpu-y += \ amdgpu-y += \ amdgpu_sdma.o \ sdma_v2_4.o \ - sdma_v3_0.o \ + sdma_v3_0.o + +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += \ sdma_v4_0.o \ sdma_v5_0.o # add MES block -amdgpu-y += \ +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += \ mes_v10_1.o # add UVD block @@ -161,8 +171,10 @@ amdgpu-y += \ amdgpu_amdkfd_fence.o \ amdgpu_amdkfd_gpuvm.o \ amdgpu_amdkfd_gfx_v8.o \ - amdgpu_amdkfd_gfx_v9.o \ - amdgpu_amdkfd_gfx_v10.o + +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += \ + amdgpu_amdkfd_gfx_v9.o \ + amdgpu_amdkfd_gfx_v10.o ifneq ($(CONFIG_DRM_AMDGPU_CIK),) amdgpu-y += amdgpu_amdkfd_gfx_v7.o diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index 9fa4f25a3745..101d806ff996 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c @@ -81,6 +81,7 @@ void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev) case CHIP_VEGAM: kfd2kgd = amdgpu_amdkfd_gfx_8_0_get_functions(); break; +#ifdef CONFIG_DRM_AMDGPU_SOC15 case CHIP_VEGA10: case CHIP_VEGA12: case CHIP_VEGA20: @@ -90,6 +91,7 @@ void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev) case CHIP_NAVI10: kfd2kgd = amdgpu_amdkfd_gfx_10_0_get_functions(); break; +#endif default: dev_info(adev->dev, "kfd not supported on this ASIC\n"); return; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index a02ccce7bf53..2a6447febcb0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -1530,6 +1530,7 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev) return r; break; #endif +#ifdef CONFIG_DRM_AMDGPU_SOC15 case CHIP_VEGA10: case CHIP_VEGA12: case CHIP_VEGA20: @@ -1551,6 +1552,7 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev) if (r) return r; break; +#endif default: /* FIXME: not supported yet */ return -EINVAL; -- 2.20.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] amdgpu: make SOC15/navi support conditional 2019-07-08 14:41 ` [PATCH 2/2] amdgpu: make SOC15/navi support conditional Arnd Bergmann @ 2019-07-08 14:46 ` Alex Deucher 2019-07-08 16:08 ` Arnd Bergmann 0 siblings, 1 reply; 5+ messages in thread From: Alex Deucher @ 2019-07-08 14:46 UTC (permalink / raw) To: Arnd Bergmann Cc: Alex Deucher, Christian König, David (ChunMing) Zhou, David Airlie, Daniel Vetter, Oded Gabbay, Philip Yang, Jack Xiao, Evan Quan, Yong Zhao, Amber Lin, Feifei Xu, Felix Kuehling, xinhui pan, LKML, amd-gfx list, Emily Deng, Huang Rui, Maling list - DRI developers, Rex Zhu, Thomas Gleixner, Shaoyun Liu, Oak Zeng, Hawking Zhang On Mon, Jul 8, 2019 at 10:42 AM Arnd Bergmann <arnd@arndb.de> wrote: > > Enabling amdgpu but not CONFIG_DRM_AMD_DC leads to a warning: > > drivers/gpu/drm/amd/amdgpu/nv.c: In function 'nv_set_ip_blocks': > drivers/gpu/drm/amd/amdgpu/nv.c:400:3: error: #warning "Enable CONFIG_DRM_AMD_DC for display support on navi." [-Werror=cpp] > # warning "Enable CONFIG_DRM_AMD_DC for display support on navi." > ^~~~~~~ > drivers/gpu/drm/amd/amdgpu/soc15.c: In function 'soc15_set_ip_blocks': > drivers/gpu/drm/amd/amdgpu/soc15.c:653:3: error: #warning "Enable CONFIG_DRM_AMD_DC for display support on SOC15." [-Werror=cpp] > > However, CONFIG_DRM_AMD_DC can only be enabled on x86, so we > cannot do that when building for other architectures. DC is not limited to x86. I can drop the warning if that is the concern. Alex > > Add another Kconfig symbol to handle the SOC15 and navi, making > sure that we implicitly enable DC. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/gpu/drm/amd/amdgpu/Kconfig | 7 +++++ > drivers/gpu/drm/amd/amdgpu/Makefile | 32 +++++++++++++++------- > drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 2 ++ > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ > 4 files changed, 33 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/Kconfig b/drivers/gpu/drm/amd/amdgpu/Kconfig > index a04f2fc7bf37..d7186dd88dbc 100644 > --- a/drivers/gpu/drm/amd/amdgpu/Kconfig > +++ b/drivers/gpu/drm/amd/amdgpu/Kconfig > @@ -24,6 +24,13 @@ config DRM_AMDGPU_CIK > > radeon.cik_support=0 amdgpu.cik_support=1 > > +config DRM_AMDGPU_SOC15 > + bool "Enable amdgpu support for SOC15 parts" > + depends on DRM_AMDGPU > + select DRM_AMD_DC > + help > + Choose this option if you want to enable support for SOC15 asics. > + > config DRM_AMDGPU_USERPTR > bool "Always enable userptr write support" > depends on DRM_AMDGPU > diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile > index 3f5329906fce..e95ae468eaa1 100644 > --- a/drivers/gpu/drm/amd/amdgpu/Makefile > +++ b/drivers/gpu/drm/amd/amdgpu/Makefile > @@ -64,9 +64,10 @@ amdgpu-$(CONFIG_DRM_AMDGPU_CIK)+= cik.o cik_ih.o kv_smc.o kv_dpm.o \ > > amdgpu-$(CONFIG_DRM_AMDGPU_SI)+= si.o gmc_v6_0.o gfx_v6_0.o si_ih.o si_dma.o dce_v6_0.o si_dpm.o si_smc.o > > -amdgpu-y += \ > - vi.o mxgpu_vi.o nbio_v6_1.o soc15.o emu_soc.o mxgpu_ai.o nbio_v7_0.o vega10_reg_init.o \ > - vega20_reg_init.o nbio_v7_4.o nbio_v2_3.o nv.o navi10_reg_init.o navi14_reg_init.o > +amdgpu-y += vi.o mxgpu_vi.o emu_soc.o nbio_v7_4.o > + > +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += gmc_v9_0.o nbio_v6_1.o soc15.o mxgpu_ai.o nbio_v7_0.o \ > + vega10_reg_init.o vega20_reg_init.o nbio_v2_3.o nv.o navi10_reg_init.o navi14_reg_init.o > > # add DF block > amdgpu-y += \ > @@ -77,7 +78,10 @@ amdgpu-y += \ > amdgpu-y += \ > gmc_v7_0.o \ > gmc_v8_0.o \ > - gfxhub_v1_0.o mmhub_v1_0.o gmc_v9_0.o gfxhub_v1_1.o \ > + gfxhub_v1_0.o mmhub_v1_0.o gfxhub_v1_1.o > + > +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += \ > + gmc_v9_0.o \ > gfxhub_v2_0.o mmhub_v2_0.o gmc_v10_0.o > > # add IH block > @@ -86,7 +90,9 @@ amdgpu-y += \ > amdgpu_ih.o \ > iceland_ih.o \ > tonga_ih.o \ > - cz_ih.o \ > + cz_ih.o > + > +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += \ > vega10_ih.o \ > navi10_ih.o > > @@ -111,7 +117,9 @@ amdgpu-y += \ > amdgpu-y += \ > amdgpu_gfx.o \ > amdgpu_rlc.o \ > - gfx_v8_0.o \ > + gfx_v8_0.o > + > +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += \ > gfx_v9_0.o \ > gfx_v10_0.o > > @@ -119,12 +127,14 @@ amdgpu-y += \ > amdgpu-y += \ > amdgpu_sdma.o \ > sdma_v2_4.o \ > - sdma_v3_0.o \ > + sdma_v3_0.o > + > +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += \ > sdma_v4_0.o \ > sdma_v5_0.o > > # add MES block > -amdgpu-y += \ > +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += \ > mes_v10_1.o > > # add UVD block > @@ -161,8 +171,10 @@ amdgpu-y += \ > amdgpu_amdkfd_fence.o \ > amdgpu_amdkfd_gpuvm.o \ > amdgpu_amdkfd_gfx_v8.o \ > - amdgpu_amdkfd_gfx_v9.o \ > - amdgpu_amdkfd_gfx_v10.o > + > +amdgpu-$(CONFIG_DRM_AMDGPU_SOC15) += \ > + amdgpu_amdkfd_gfx_v9.o \ > + amdgpu_amdkfd_gfx_v10.o > > ifneq ($(CONFIG_DRM_AMDGPU_CIK),) > amdgpu-y += amdgpu_amdkfd_gfx_v7.o > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > index 9fa4f25a3745..101d806ff996 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > @@ -81,6 +81,7 @@ void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev) > case CHIP_VEGAM: > kfd2kgd = amdgpu_amdkfd_gfx_8_0_get_functions(); > break; > +#ifdef CONFIG_DRM_AMDGPU_SOC15 > case CHIP_VEGA10: > case CHIP_VEGA12: > case CHIP_VEGA20: > @@ -90,6 +91,7 @@ void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev) > case CHIP_NAVI10: > kfd2kgd = amdgpu_amdkfd_gfx_10_0_get_functions(); > break; > +#endif > default: > dev_info(adev->dev, "kfd not supported on this ASIC\n"); > return; > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index a02ccce7bf53..2a6447febcb0 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -1530,6 +1530,7 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev) > return r; > break; > #endif > +#ifdef CONFIG_DRM_AMDGPU_SOC15 > case CHIP_VEGA10: > case CHIP_VEGA12: > case CHIP_VEGA20: > @@ -1551,6 +1552,7 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev) > if (r) > return r; > break; > +#endif > default: > /* FIXME: not supported yet */ > return -EINVAL; > -- > 2.20.0 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] amdgpu: make SOC15/navi support conditional 2019-07-08 14:46 ` Alex Deucher @ 2019-07-08 16:08 ` Arnd Bergmann 0 siblings, 0 replies; 5+ messages in thread From: Arnd Bergmann @ 2019-07-08 16:08 UTC (permalink / raw) To: Alex Deucher Cc: Alex Deucher, Christian König, David (ChunMing) Zhou, David Airlie, Daniel Vetter, Oded Gabbay, Philip Yang, Jack Xiao, Evan Quan, Yong Zhao, Amber Lin, Feifei Xu, Felix Kuehling, xinhui pan, LKML, amd-gfx list, Emily Deng, Huang Rui, Maling list - DRI developers, Rex Zhu, Thomas Gleixner, Shaoyun Liu, Oak Zeng, Hawking Zhang On Mon, Jul 8, 2019 at 4:46 PM Alex Deucher <alexdeucher@gmail.com> wrote: > > On Mon, Jul 8, 2019 at 10:42 AM Arnd Bergmann <arnd@arndb.de> wrote: > > > > Enabling amdgpu but not CONFIG_DRM_AMD_DC leads to a warning: > > > > drivers/gpu/drm/amd/amdgpu/nv.c: In function 'nv_set_ip_blocks': > > drivers/gpu/drm/amd/amdgpu/nv.c:400:3: error: #warning "Enable CONFIG_DRM_AMD_DC for display support on navi." [-Werror=cpp] > > # warning "Enable CONFIG_DRM_AMD_DC for display support on navi." > > ^~~~~~~ > > drivers/gpu/drm/amd/amdgpu/soc15.c: In function 'soc15_set_ip_blocks': > > drivers/gpu/drm/amd/amdgpu/soc15.c:653:3: error: #warning "Enable CONFIG_DRM_AMD_DC for display support on SOC15." [-Werror=cpp] > > > > However, CONFIG_DRM_AMD_DC can only be enabled on x86, so we > > cannot do that when building for other architectures. > > DC is not limited to x86. Ah, right, only DRM_AMD_DC_DCN1_0 is x86-only. > I can drop the warning if that is the concern. That would be great, yes. Arnd ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] amdgpu: make pmu support optional 2019-07-08 14:41 [PATCH 1/2] amdgpu: make pmu support optional Arnd Bergmann 2019-07-08 14:41 ` [PATCH 2/2] amdgpu: make SOC15/navi support conditional Arnd Bergmann @ 2019-07-08 15:58 ` Alex Deucher 1 sibling, 0 replies; 5+ messages in thread From: Alex Deucher @ 2019-07-08 15:58 UTC (permalink / raw) To: Arnd Bergmann Cc: Alex Deucher, Christian König, David (ChunMing) Zhou, David Airlie, Daniel Vetter, Jack Xiao, Jonathan Kim, Felix Kuehling, xinhui pan, LKML, amd-gfx list, Emily Deng, Huang Rui, Maling list - DRI developers, Evan Quan, Hawking Zhang, Rex Zhu, Xiaojie Yuan On Mon, Jul 8, 2019 at 10:42 AM Arnd Bergmann <arnd@arndb.de> wrote: > > When CONFIG_PERF_EVENTS is disabled, we cannot compile the pmu > portion of the amdgpu driver: > > drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c:48:38: error: no member named 'hw' in 'struct perf_event' > struct hw_perf_event *hwc = &event->hw; > ~~~~~ ^ > drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c:51:13: error: no member named 'attr' in 'struct perf_event' > if (event->attr.type != event->pmu->type) > ~~~~~ ^ > ... > > Use conditional compilation for this file. > > Fixes: 9c7c85f7ea1f ("drm/amdgpu: add pmu counters") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Applied this patch. Thanks! Alex > --- > drivers/gpu/drm/amd/amdgpu/Makefile | 4 +++- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++-- > 2 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile > index 3a15a46b4ecb..3f5329906fce 100644 > --- a/drivers/gpu/drm/amd/amdgpu/Makefile > +++ b/drivers/gpu/drm/amd/amdgpu/Makefile > @@ -54,7 +54,9 @@ amdgpu-y += amdgpu_device.o amdgpu_kms.o \ > amdgpu_gtt_mgr.o amdgpu_vram_mgr.o amdgpu_virt.o amdgpu_atomfirmware.o \ > amdgpu_vf_error.o amdgpu_sched.o amdgpu_debugfs.o amdgpu_ids.o \ > amdgpu_gmc.o amdgpu_xgmi.o amdgpu_csa.o amdgpu_ras.o amdgpu_vm_cpu.o \ > - amdgpu_vm_sdma.o amdgpu_pmu.o amdgpu_discovery.o > + amdgpu_vm_sdma.o amdgpu_discovery.o > + > +amdgpu-$(CONFIG_PERF_EVENTS) += amdgpu_pmu.o > > # add asic specific block > amdgpu-$(CONFIG_DRM_AMDGPU_CIK)+= cik.o cik_ih.o kv_smc.o kv_dpm.o \ > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index 30989b455047..a02ccce7bf53 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -2816,7 +2816,8 @@ int amdgpu_device_init(struct amdgpu_device *adev, > return r; > } > > - r = amdgpu_pmu_init(adev); > + if (IS_ENABLED(CONFIG_PERF_EVENTS)) > + r = amdgpu_pmu_init(adev); > if (r) > dev_err(adev->dev, "amdgpu_pmu_init failed\n"); > > @@ -2888,7 +2889,8 @@ void amdgpu_device_fini(struct amdgpu_device *adev) > amdgpu_debugfs_regs_cleanup(adev); > device_remove_file(adev->dev, &dev_attr_pcie_replay_count); > amdgpu_ucode_sysfs_fini(adev); > - amdgpu_pmu_fini(adev); > + if (IS_ENABLED(CONFIG_PERF_EVENTS)) > + amdgpu_pmu_fini(adev); > amdgpu_debugfs_preempt_cleanup(adev); > if (amdgpu_discovery) > amdgpu_discovery_fini(adev); > -- > 2.20.0 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-07-08 16:08 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-07-08 14:41 [PATCH 1/2] amdgpu: make pmu support optional Arnd Bergmann 2019-07-08 14:41 ` [PATCH 2/2] amdgpu: make SOC15/navi support conditional Arnd Bergmann 2019-07-08 14:46 ` Alex Deucher 2019-07-08 16:08 ` Arnd Bergmann 2019-07-08 15:58 ` [PATCH 1/2] amdgpu: make pmu support optional Alex Deucher
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox