Thierry Reding
2015-Jan-05 15:32 UTC
[Nouveau] [PATCH nouveau 09/11] drm: export some variable and functions to resue the PM functions
On Tue, Dec 30, 2014 at 11:18:34AM +0800, Vince Hsu wrote:> Hi Emil, > > On 12/30/2014 10:34 AM, Emil Velikov wrote: > >On 23/12/14 10:40, Vince Hsu wrote: > >>This patch adds some checks in the suspend/resume functions to distinguish > >>the dGPU and mobile GPU and exports some variables/functions so that the > >>nouveau platform device can reuse them. > >> > >Hi Vince, > > > >Afaiu one needs to export a symbol as it's used by another module or > >subsystem. With the follow up two patches you are not doing either one, > >so I'd assume that you can just omit the EXPORT_* changes. > The nouveau platform device driver is built as another module - > nouveau_platform.ko. :)I'd like to hear the opinion of the nouveau people and Alex, but I'd very much prefer if nouveau_platform.o was simply linked into the nouveau.ko module. I don't see any good reason to keep it separate. Something like the attached patch (untested) ought to do it. Thierry -------------- next part -------------- diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig index 40afc69a3778..5ab13e7939db 100644 --- a/drivers/gpu/drm/nouveau/Kconfig +++ b/drivers/gpu/drm/nouveau/Kconfig @@ -26,7 +26,7 @@ config DRM_NOUVEAU Choose this option for open-source NVIDIA support. config NOUVEAU_PLATFORM_DRIVER - tristate "Nouveau (NVIDIA) SoC GPUs" + bool "Nouveau (NVIDIA) SoC GPUs" depends on DRM_NOUVEAU && ARCH_TEGRA default y help diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile index ea40cd653c7c..13acf90c11c8 100644 --- a/drivers/gpu/drm/nouveau/Makefile +++ b/drivers/gpu/drm/nouveau/Makefile @@ -394,8 +394,6 @@ nouveau-$(CONFIG_ACPI) += nouveau_acpi.o endif nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o nouveau-$(CONFIG_DEBUG_FS) += nouveau_debugfs.o +nouveau-$(CONFIG_NOUVEAU_PLATFORM_DRIVER) += nouveau_platform.o obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o - -# platform driver -obj-$(CONFIG_NOUVEAU_PLATFORM_DRIVER) += nouveau_platform.o -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20150105/66cde126/attachment.sig>
Alexandre Courbot
2015-Jan-05 19:50 UTC
[Nouveau] [PATCH nouveau 09/11] drm: export some variable and functions to resue the PM functions
On Mon, Jan 5, 2015 at 4:32 PM, Thierry Reding <thierry.reding at gmail.com> wrote:> On Tue, Dec 30, 2014 at 11:18:34AM +0800, Vince Hsu wrote: >> Hi Emil, >> >> On 12/30/2014 10:34 AM, Emil Velikov wrote: >> >On 23/12/14 10:40, Vince Hsu wrote: >> >>This patch adds some checks in the suspend/resume functions to distinguish >> >>the dGPU and mobile GPU and exports some variables/functions so that the >> >>nouveau platform device can reuse them. >> >> >> >Hi Vince, >> > >> >Afaiu one needs to export a symbol as it's used by another module or >> >subsystem. With the follow up two patches you are not doing either one, >> >so I'd assume that you can just omit the EXPORT_* changes. >> The nouveau platform device driver is built as another module - >> nouveau_platform.ko. :) > > I'd like to hear the opinion of the nouveau people and Alex, but I'd > very much prefer if nouveau_platform.o was simply linked into the > nouveau.ko module. I don't see any good reason to keep it separate.Yep, I agree. The decision to host platform support in a separate module looks misleaded if it results in additional exports that we would otherwise avoid. IIUC I did this to be able to use the module convenience macros to register the platform driver.> > Something like the attached patch (untested) ought to do it.This patch alone won't be enough for the reason I mentioned above. However, if Vince doesn't mind handling the platform driver registration manually in nouveau_drm_init/nouveau_drm_exit, I agree this would be the way to go. Cheers, Alex.
Vince Hsu
2015-Jan-06 09:36 UTC
[Nouveau] [PATCH nouveau 09/11] drm: export some variable and functions to resue the PM functions
On 01/06/2015 03:50 AM, Alexandre Courbot wrote:> On Mon, Jan 5, 2015 at 4:32 PM, Thierry Reding <thierry.reding at gmail.com> wrote: >> On Tue, Dec 30, 2014 at 11:18:34AM +0800, Vince Hsu wrote: >>> Hi Emil, >>> >>> On 12/30/2014 10:34 AM, Emil Velikov wrote: >>>> On 23/12/14 10:40, Vince Hsu wrote: >>>>> This patch adds some checks in the suspend/resume functions to distinguish >>>>> the dGPU and mobile GPU and exports some variables/functions so that the >>>>> nouveau platform device can reuse them. >>>>> >>>> Hi Vince, >>>> >>>> Afaiu one needs to export a symbol as it's used by another module or >>>> subsystem. With the follow up two patches you are not doing either one, >>>> so I'd assume that you can just omit the EXPORT_* changes. >>> The nouveau platform device driver is built as another module - >>> nouveau_platform.ko. :) >> I'd like to hear the opinion of the nouveau people and Alex, but I'd >> very much prefer if nouveau_platform.o was simply linked into the >> nouveau.ko module. I don't see any good reason to keep it separate. > Yep, I agree. The decision to host platform support in a separate > module looks misleaded if it results in additional exports that we > would otherwise avoid. IIUC I did this to be able to use the module > convenience macros to register the platform driver. > >> Something like the attached patch (untested) ought to do it. > This patch alone won't be enough for the reason I mentioned above. > However, if Vince doesn't mind handling the platform driver > registration manually in nouveau_drm_init/nouveau_drm_exit, I agree > this would be the way to go.I definitely don't mind. :) Will fix in next version based on you guys' suggestions. Thanks, Vince
Thierry Reding
2015-Jan-06 11:49 UTC
[Nouveau] [PATCH nouveau 09/11] drm: export some variable and functions to resue the PM functions
On Mon, Jan 05, 2015 at 08:50:18PM +0100, Alexandre Courbot wrote:> On Mon, Jan 5, 2015 at 4:32 PM, Thierry Reding <thierry.reding at gmail.com> wrote: > > On Tue, Dec 30, 2014 at 11:18:34AM +0800, Vince Hsu wrote: > >> Hi Emil, > >> > >> On 12/30/2014 10:34 AM, Emil Velikov wrote: > >> >On 23/12/14 10:40, Vince Hsu wrote: > >> >>This patch adds some checks in the suspend/resume functions to distinguish > >> >>the dGPU and mobile GPU and exports some variables/functions so that the > >> >>nouveau platform device can reuse them. > >> >> > >> >Hi Vince, > >> > > >> >Afaiu one needs to export a symbol as it's used by another module or > >> >subsystem. With the follow up two patches you are not doing either one, > >> >so I'd assume that you can just omit the EXPORT_* changes. > >> The nouveau platform device driver is built as another module - > >> nouveau_platform.ko. :) > > > > I'd like to hear the opinion of the nouveau people and Alex, but I'd > > very much prefer if nouveau_platform.o was simply linked into the > > nouveau.ko module. I don't see any good reason to keep it separate. > > Yep, I agree. The decision to host platform support in a separate > module looks misleaded if it results in additional exports that we > would otherwise avoid. IIUC I did this to be able to use the module > convenience macros to register the platform driver. > > > > > Something like the attached patch (untested) ought to do it. > > This patch alone won't be enough for the reason I mentioned above. > However, if Vince doesn't mind handling the platform driver > registration manually in nouveau_drm_init/nouveau_drm_exit, I agree > this would be the way to go.If we do the conversion to generic power domains, the only Tegra- specific API remaining will be the access to the fuse registers for the speedo value. At that point we wouldn't need the ARCH_TEGRA dependency any longer and could always build the platform driver along with the PCI driver. I guess we could do that even now if we simply #ifdef the various Tegra- specific parts. That in turn would have the advantage that we don't need to #ifdef the driver registration code. And it would help separate things in case anybody wanted to use one of the SoC GPUs in a non-Tegra SoC. Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20150106/b856b87c/attachment.sig>
Maybe Matching Threads
- [PATCH nouveau 09/11] drm: export some variable and functions to resue the PM functions
- [PATCH nouveau 09/11] drm: export some variable and functions to resue the PM functions
- [PATCH nouveau 09/11] drm: export some variable and functions to resue the PM functions
- [PATCH nouveau 09/11] drm: export some variable and functions to resue the PM functions
- [PATCH nouveau 09/11] drm: export some variable and functions to resue the PM functions