Skip to contentSkip to conversation

drm/amd: add Kconfig dependency for ACP on DRM_AMDGPU

PATCH Applied Jeff Mahoney 3 participants 6 messages May 24, 2016 – May 27, 2016

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

PATCH 1/1 drm/amd: add Kconfig dependency for ACP on DRM_AMDGPU

The DRM_AMD_ACP option doesn't have any dependencies and selects MFD_CORE, which results in MFD_CORE=y. Since the code is only called from DRM_AMDGPU, it should depend on it. Adding the dependency results in MFD_CORE being selected as a module again if amdgpu is also a module.

---
 drivers/gpu/drm/amd/acp/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/acp/Kconfig +1 -0
index ca77ec1..e503e3d 100644
@@ -2,6 +2,7 @@ menu "ACP (Audio CoProcessor) Configuration"
 
 config DRM_AMD_ACP
        bool "Enable AMD Audio CoProcessor IP support"
+       depends on DRM_AMDGPU
        select MFD_CORE
        select PM_GENERIC_DOMAINS if PM
        help
Signature · 6 lines
Jeff Mahoney
SUSE Labs
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#1 lore raw
Quoted 6 lines · Jeff Mahoney

The DRM_AMD_ACP option doesn't have any dependencies and selects MFD_CORE, which results in MFD_CORE=y. Since the code is only called from DRM_AMDGPU, it should depend on it. Adding the dependency results in MFD_CORE being selected as a module again if amdgpu is also a module.

Applied. thanks!

Alex

Quoted 19 lines
---
 drivers/gpu/drm/amd/acp/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/acp/Kconfig +1 -1
index ca77ec1..e503e3d 100644
@@ -2,6 +2,7 @@ menu "ACP (Audio CoProcessor) Configuration"
 
 config DRM_AMD_ACP
        bool "Enable AMD Audio CoProcessor IP support"
+       depends on DRM_AMDGPU
        select MFD_CORE
        select PM_GENERIC_DOMAINS if PM
        help
 
 
--
Quoted 6 lines

Jeff Mahoney
SUSE Labs
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

#2 lore raw
In reply to Jeff Mahoney

Hi Jeff,

I'm thinking out loud so here are a few suggestions/ideas. Please don't take them too seriously although they do make sense from this end.

Quoted 16 lines · Jeff Mahoney

The DRM_AMD_ACP option doesn't have any dependencies and selects MFD_CORE, which results in MFD_CORE=y. Since the code is only called from DRM_AMDGPU, it should depend on it. Adding the dependency results in MFD_CORE being selected as a module again if amdgpu is also a module.

---
 drivers/gpu/drm/amd/acp/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/acp/Kconfig +0 -0
index ca77ec1..e503e3d 100644

drivers/gpu/drm/amd/acp/Kconfig menu "ACP (Audio CoProcessor) Configuration" · line 8

Quoted 7 lines
drivers/gpu/drm/amd/acp/Kconfig +1 -0
@@ -2,6 +2,7 @@ menu "ACP (Audio CoProcessor) Configuration"
 
 config DRM_AMD_ACP
        bool "Enable AMD Audio CoProcessor IP support"
+       depends on DRM_AMDGPU
        select MFD_CORE
        select PM_GENERIC_DOMAINS if PM
        help

Afaict ACP/Powerplay doesn't make sense on their own so here is an alternative solution:
- create a Kconfig in drm/amd and move/consolidate amdgpu, powerplay,
acp in there.
amdkfd can be moved as well afaict.
- make DRM_AMD_ACP and DRM_AMD_POWERPLAY submenu items for
DRM_AMDGPU. AMDKFD on the other hand depends on RADEON || AMDGPU so it should stay separate.
- crazy idea: add select and/or depends on SND_SOC_AMD_ACP. since one
is useless without the other. Or perhaps make the SOC entry should select/depend on AMD_ACP ?

And some future work (cleanups):
- fold the acp folder (or inline respective files) within amdgpu.
- add forward declarations in acp/include/acp_gfx_if.h and move the
cgs* includes where needed (acp/acp_hw.c and amdgpu/amdgpu_acp.c)
- apply similar polish for amdgpu/amdgpu_acp.h.
- drop the (unneeded ?) include of amdgpu_acp.h include from amdgpu/vi.c
- kill off amdgpu_acp::private. Afaict there's not a single place (as
of 95306975e9dd38ba2775dd96cb29987ecc7d9360) that actually defines the amd_acp_private struct. Is something broken on my end or this does not build without warnings/errors ?
- kill off amdgpu_acp::acp_genpd::cgs_dev (use amdgpu_acp::cgs_device
directly) and inline the ::acp_genpd::gpd into amdgpu_acp.

Regards,
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 5 lines · Emil Velikov

Hi Jeff,

I'm thinking out loud so here are a few suggestions/ideas. Please don't take them too seriously although they do make sense from this end.

Hi Emil -

I'm not at all involved in amdgpu development. This patch came from me fielding reports that the openSUSE Tumbleweed kernel had MFD_CORE=y as part of a version update. In the process of troubleshooting, I did see how the code was structured and there are some interesting choices in there.

Quoted 17 lines · Jeff Mahoney
Quoted 16 lines

The DRM_AMD_ACP option doesn't have any dependencies and selects MFD_CORE, which results in MFD_CORE=y. Since the code is only called from DRM_AMDGPU, it should depend on it. Adding the dependency results in MFD_CORE being selected as a module again if amdgpu is also a module.

---
 drivers/gpu/drm/amd/acp/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/acp/Kconfig +0 -0
index ca77ec1..e503e3d 100644
@@ -2,6 +2,7 @@ menu "ACP (Audio CoProcessor) Configuration"
 
Quoted 11 lines

drivers/gpu/drm/amd/acp/Kconfig menu "ACP (Audio CoProcessor) Configuration" · line 8

Quoted 7 lines
drivers/gpu/drm/amd/acp/Kconfig +1 -0
 config DRM_AMD_ACP
        bool "Enable AMD Audio CoProcessor IP support"
+       depends on DRM_AMDGPU
        select MFD_CORE
        select PM_GENERIC_DOMAINS if PM
        help

Afaict ACP/Powerplay doesn't make sense on their own so here is an alternative solution:
- create a Kconfig in drm/amd and move/consolidate amdgpu, powerplay,
acp in there.

I have a patch to do this already. The bigger issue, though, is the weird hierarchy that may make sense for an external driver but is an outlier for in-kernel drivers.

Quoted 10 lines

amdkfd can be moved as well afaict.
- make DRM_AMD_ACP and DRM_AMD_POWERPLAY submenu items for
DRM_AMDGPU. AMDKFD on the other hand depends on RADEON || AMDGPU so it should stay separate.
- crazy idea: add select and/or depends on SND_SOC_AMD_ACP. since one
is useless without the other. Or perhaps make the SOC entry should select/depend on AMD_ACP ?

And some future work (cleanups):
- fold the acp folder (or inline respective files) within amdgpu.

Yes. This should be part of amdgpu. All of the code except for this one function is there already. Having this weird build setup for a single source file with a single function is silly. I have a patch for that too but didn't know if there was a reason for the way it's structured that isn't immediately visible.

Quoted 10 lines

- add forward declarations in acp/include/acp_gfx_if.h and move the
cgs* includes where needed (acp/acp_hw.c and amdgpu/amdgpu_acp.c)
- apply similar polish for amdgpu/amdgpu_acp.h.
- drop the (unneeded ?) include of amdgpu_acp.h include from amdgpu/vi.c
- kill off amdgpu_acp::private. Afaict there's not a single place (as
of 95306975e9dd38ba2775dd96cb29987ecc7d9360) that actually defines the amd_acp_private struct. Is something broken on my end or this does not build without warnings/errors ?
- kill off amdgpu_acp::acp_genpd::cgs_dev (use amdgpu_acp::cgs_device
directly) and inline the ::acp_genpd::gpd into amdgpu_acp.

This starts getting into the code itself and I don't have hardware to test with, so I didn't dig in at all.

-Jeff

Signature · 2 lines
Jeff Mahoney
SUSE Labs

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

#4 lore raw
Quoted 10 lines · Jeff Mahoney
Quoted 5 lines · Emil Velikov

Hi Jeff,

I'm thinking out loud so here are a few suggestions/ideas. Please don't take them too seriously although they do make sense from this end.

Hi Emil -

I'm not at all involved in amdgpu development.

About the same here, sadly.

Quoted 34 lines

This patch came from me
fielding reports that the openSUSE Tumbleweed kernel had MFD_CORE=y as part of a version update. In the process of troubleshooting, I did see how the code was structured and there are some interesting choices in there.

Quoted 17 lines · Jeff Mahoney
Quoted 16 lines

The DRM_AMD_ACP option doesn't have any dependencies and selects MFD_CORE, which results in MFD_CORE=y. Since the code is only called from DRM_AMDGPU, it should depend on it. Adding the dependency results in MFD_CORE being selected as a module again if amdgpu is also a module.

---
 drivers/gpu/drm/amd/acp/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/acp/Kconfig +0 -0
index ca77ec1..e503e3d 100644
@@ -2,6 +2,7 @@ menu "ACP (Audio CoProcessor) Configuration"
 
Quoted 11 lines

drivers/gpu/drm/amd/acp/Kconfig menu "ACP (Audio CoProcessor) Configuration" · line 8

Quoted 7 lines
drivers/gpu/drm/amd/acp/Kconfig +1 -0
 config DRM_AMD_ACP
        bool "Enable AMD Audio CoProcessor IP support"
+       depends on DRM_AMDGPU
        select MFD_CORE
        select PM_GENERIC_DOMAINS if PM
        help

Afaict ACP/Powerplay doesn't make sense on their own so here is an alternative solution:
- create a Kconfig in drm/amd and move/consolidate amdgpu, powerplay,
acp in there.

Quoted 4 lines

I have a patch to do this already. The bigger issue, though, is the weird hierarchy that may make sense for an external driver but is an outlier for in-kernel drivers.

Glad to hear we've both reached ~same conclusion. Alex and other AMD devs are quite open to input so don't be shy to put the patch forward.

Quoted 8 lines
Quoted 8 lines

amdkfd can be moved as well afaict.
- make DRM_AMD_ACP and DRM_AMD_POWERPLAY submenu items for
DRM_AMDGPU. AMDKFD on the other hand depends on RADEON || AMDGPU so it should stay separate.
- crazy idea: add select and/or depends on SND_SOC_AMD_ACP. since one
is useless without the other. Or perhaps make the SOC entry should select/depend on AMD_ACP ?

Quoted 9 lines
Quoted 2 lines

And some future work (cleanups):
- fold the acp folder (or inline respective files) within amdgpu.

Yes. This should be part of amdgpu. All of the code except for this one function is there already. Having this weird build setup for a single source file with a single function is silly. I have a patch for that too but didn't know if there was a reason for the way it's structured that isn't immediately visible.

Just send it out and devs involved will weight in ;-)

Quoted 11 lines
Quoted 10 lines

- add forward declarations in acp/include/acp_gfx_if.h and move the
cgs* includes where needed (acp/acp_hw.c and amdgpu/amdgpu_acp.c)
- apply similar polish for amdgpu/amdgpu_acp.h.
- drop the (unneeded ?) include of amdgpu_acp.h include from amdgpu/vi.c
- kill off amdgpu_acp::private. Afaict there's not a single place (as
of 95306975e9dd38ba2775dd96cb29987ecc7d9360) that actually defines the amd_acp_private struct. Is something broken on my end or this does not build without warnings/errors ?
- kill off amdgpu_acp::acp_genpd::cgs_dev (use amdgpu_acp::cgs_device
directly) and inline the ::acp_genpd::gpd into amdgpu_acp.

Quoted 3 lines

This starts getting into the code itself and I don't have hardware to test with, so I didn't dig in at all.

No problems. It was just some ideas if you/others are interested in doing some tidying up.

Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
Quoted 47 lines · Emil Velikov
Quoted 10 lines · Jeff Mahoney
Quoted 5 lines · Emil Velikov

Hi Jeff,

I'm thinking out loud so here are a few suggestions/ideas. Please don't take them too seriously although they do make sense from this end.

Hi Emil -

I'm not at all involved in amdgpu development.

About the same here, sadly.

Quoted 34 lines

This patch came from me
fielding reports that the openSUSE Tumbleweed kernel had MFD_CORE=y as part of a version update. In the process of troubleshooting, I did see how the code was structured and there are some interesting choices in there.

Quoted 28 lines · Jeff Mahoney
Quoted 16 lines

The DRM_AMD_ACP option doesn't have any dependencies and selects MFD_CORE, which results in MFD_CORE=y. Since the code is only called from DRM_AMDGPU, it should depend on it. Adding the dependency results in MFD_CORE being selected as a module again if amdgpu is also a module.

---
 drivers/gpu/drm/amd/acp/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/acp/Kconfig +0 -0
index ca77ec1..e503e3d 100644

drivers/gpu/drm/amd/acp/Kconfig menu "ACP (Audio CoProcessor) Configuration" · line 8

Quoted 7 lines
drivers/gpu/drm/amd/acp/Kconfig +1 -0
@@ -2,6 +2,7 @@ menu "ACP (Audio CoProcessor) Configuration"
 
 config DRM_AMD_ACP
        bool "Enable AMD Audio CoProcessor IP support"
+       depends on DRM_AMDGPU
        select MFD_CORE
        select PM_GENERIC_DOMAINS if PM
        help

Afaict ACP/Powerplay doesn't make sense on their own so here is an alternative solution:
- create a Kconfig in drm/amd and move/consolidate amdgpu, powerplay,
acp in there.

Quoted 6 lines
Quoted 4 lines

I have a patch to do this already. The bigger issue, though, is the weird hierarchy that may make sense for an external driver but is an outlier for in-kernel drivers.

Glad to hear we've both reached ~same conclusion. Alex and other AMD devs are quite open to input so don't be shy to put the patch forward.

Yes, please do. We are happy to review any patches you might have.

Alex

Quoted 37 lines
Quoted 9 lines
Quoted 9 lines

amdkfd can be moved as well afaict.
- make DRM_AMD_ACP and DRM_AMD_POWERPLAY submenu items for
DRM_AMDGPU. AMDKFD on the other hand depends on RADEON || AMDGPU so it should stay separate.
- crazy idea: add select and/or depends on SND_SOC_AMD_ACP. since one
is useless without the other. Or perhaps make the SOC entry should select/depend on AMD_ACP ?

Quoted 9 lines
Quoted 2 lines

And some future work (cleanups):
- fold the acp folder (or inline respective files) within amdgpu.

Yes. This should be part of amdgpu. All of the code except for this one function is there already. Having this weird build setup for a single source file with a single function is silly. I have a patch for that too but didn't know if there was a reason for the way it's structured that isn't immediately visible.

Just send it out and devs involved will weight in ;-)

Quoted 11 lines
Quoted 10 lines

- add forward declarations in acp/include/acp_gfx_if.h and move the
cgs* includes where needed (acp/acp_hw.c and amdgpu/amdgpu_acp.c)
- apply similar polish for amdgpu/amdgpu_acp.h.
- drop the (unneeded ?) include of amdgpu_acp.h include from amdgpu/vi.c
- kill off amdgpu_acp::private. Afaict there's not a single place (as
of 95306975e9dd38ba2775dd96cb29987ecc7d9360) that actually defines the amd_acp_private struct. Is something broken on my end or this does not build without warnings/errors ?
- kill off amdgpu_acp::acp_genpd::cgs_dev (use amdgpu_acp::cgs_device
directly) and inline the ::acp_genpd::gpd into amdgpu_acp.

Quoted 3 lines

This starts getting into the code itself and I don't have hardware to test with, so I didn't dig in at all.

No problems. It was just some ideas if you/others are interested in doing some tidying up.

Quoted 6 lines

Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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