Hi,
Building imx_v6_v7_defconfig on linux-next 20130212 gives me the following build error:
CC drivers/gpu/drm/drm_pci.o drivers/gpu/drm/drm_pci.c: In function ‘drm_pcie_get_speed_cap_mask’: drivers/gpu/drm/drm_pci.c:485:2: error: implicit declaration of function ‘pcie_capability_read_dword’ [-Werror=implicit-function-declaration]
Then I tried to fix it as follows:
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 6f58c81..6a08165 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -8,7 +8,7 @@ drm-y := drm_auth.o drm_buffer.o drm_bufs.o drm_cache.o \ drm_context.o drm_dma.o \ drm_drv.o drm_fops.o drm_gem.o drm_ioctl.o drm_irq.o \ drm_lock.o drm_memory.o drm_proc.o drm_stub.o drm_vm.o \ - drm_agpsupport.o drm_scatter.o drm_pci.o \ + drm_agpsupport.o drm_scatter.o \ drm_platform.o drm_sysfs.o drm_hashtab.o drm_mm.o \ drm_crtc.o drm_modes.o drm_edid.o \ drm_info.o drm_debugfs.o drm_encoder_slave.o \ @@ -16,7 +16,7 @@ drm-y := drm_auth.o drm_buffer.o drm_bufs.o drm_cache.o \
drm-$(CONFIG_COMPAT) += drm_ioc32.o drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o -drm-$(CONFIG_PCI) += ati_pcigart.o +drm-$(CONFIG_PCI) += ati_pcigart.o drm_pci.o
drm-usb-y := drm_usb.o
,which caused another issue:
GEN .version CHK include/generated/compile.h UPD include/generated/compile.h CC init/version.o LD init/built-in.o drivers/built-in.o: In function `drm_rmmap_locked': clk-vexpress-osc.c:(.text+0x4f370): undefined reference to `__drm_pci_free' drivers/built-in.o: In function `drm_addmap_core': clk-vexpress-osc.c:(.text+0x4f4f4): undefined reference to `drm_pci_alloc' drivers/built-in.o: In function `drm_cleanup_buf_error': clk-vexpress-osc.c:(.text+0x4f920): undefined reference to `drm_pci_free' drivers/built-in.o: In function `drm_addbufs_pci': clk-vexpress-osc.c:(.text+0x4fc00): undefined reference to `drm_pci_alloc' drivers/built-in.o: In function `drm_dma_takedown': clk-vexpress-osc.c:(.text+0x51c84): undefined reference to `drm_pci_free' drivers/built-in.o: In function `drm_vm_shm_close': clk-vexpress-osc.c:(.text+0x57d60): undefined reference to `__drm_pci_free' make: *** [vmlinux] Error 1
Any ideas or suggestions?
Thanks,
Fabio Estevam
Dave/Bjorn,
On Tue, Feb 12, 2013 at 3:50 PM, Fabio Estevam festevam@gmail.com wrote:
Hi,
Building imx_v6_v7_defconfig on linux-next 20130212 gives me the following build error:
CC drivers/gpu/drm/drm_pci.o drivers/gpu/drm/drm_pci.c: In function ‘drm_pcie_get_speed_cap_mask’: drivers/gpu/drm/drm_pci.c:485:2: error: implicit declaration of function ‘pcie_capability_read_dword’ [-Werror=implicit-function-declaration]
,and it is caused by commit:
commit dd66cc2e1f4765d0e6f39eb1e7d8d64d3f1cc522 Author: Bjorn Helgaas bhelgaas@google.com Date: Fri Jan 4 19:10:42 2013 +0000
drm/pci: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify this code a bit. For non-PCIe devices or pre-PCIe 3.0 devices that don't implement the Link Capabilities 2 register, pcie_capability_read_dword() reads a zero.
Since we're only testing whether the bits we care about are set, there's no need to mask out the other bits we *don't* care about.
Signed-off-by: Bjorn Helgaas bhelgaas@google.com Signed-off-by: Dave Airlie airlied@redhat.com
The patch below fixes the build on imx_v6_v7_defconfig (which has CONFIG_PCI unselected):
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 86102a0..93ec85d 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -466,6 +466,7 @@ void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver) } EXPORT_SYMBOL(drm_pci_exit);
+#ifdef CONFIG_PCI int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask) { struct pci_dev *root; @@ -503,3 +504,4 @@ int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask) return 0; } EXPORT_SYMBOL(drm_pcie_get_speed_cap_mask); +#endif
If this looks good I can submit it formally.
On Tue, Feb 12, 2013 at 07:20:30PM -0200, Fabio Estevam wrote:
Dave/Bjorn,
On Tue, Feb 12, 2013 at 3:50 PM, Fabio Estevam festevam@gmail.com wrote:
Hi,
Building imx_v6_v7_defconfig on linux-next 20130212 gives me the following build error:
CC drivers/gpu/drm/drm_pci.o drivers/gpu/drm/drm_pci.c: In function ‘drm_pcie_get_speed_cap_mask’: drivers/gpu/drm/drm_pci.c:485:2: error: implicit declaration of function ‘pcie_capability_read_dword’ [-Werror=implicit-function-declaration]
,and it is caused by commit:
commit dd66cc2e1f4765d0e6f39eb1e7d8d64d3f1cc522 Author: Bjorn Helgaas bhelgaas@google.com Date: Fri Jan 4 19:10:42 2013 +0000
drm/pci: Use PCI Express Capability accessors
I sent Dave the patch below last Friday. It's essentially the same as yours, Fabio.
commit ed0708e69f71fab656afc1c891f3c54c9b105664 Author: Bjorn Helgaas bhelgaas@google.com Date: Fri Feb 8 15:18:35 2013 -0700
drm/pci: define drm_pcie_get_speed_cap_mask() only when CONFIG_PCI=y
Move drm_pcie_get_speed_cap_mask() under #ifdef CONFIG_PCI because it it used only for PCI devices (evergreen, r600, r770), and it uses PCI interfaces that only exist when CONFIG_PCI=y.
Previously, we tried to compile drm_pcie_get_speed_cap_mask() even when CONFIG_PCI=n, which fails.
Tested-by: Fengguang Wu fengguang.wu@intel.com Signed-off-by: Bjorn Helgaas bhelgaas@google.com
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 754bc96..2b818c7 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -439,33 +439,6 @@ int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver) return 0; }
-#else - -int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver) -{ - return -1; -} - -#endif - -EXPORT_SYMBOL(drm_pci_init); - -/*@}*/ -void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver) -{ - struct drm_device *dev, *tmp; - DRM_DEBUG("\n"); - - if (driver->driver_features & DRIVER_MODESET) { - pci_unregister_driver(pdriver); - } else { - list_for_each_entry_safe(dev, tmp, &driver->device_list, driver_item) - drm_put_dev(dev); - } - DRM_INFO("Module unloaded\n"); -} -EXPORT_SYMBOL(drm_pci_exit); - int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask) { struct pci_dev *root; @@ -514,3 +487,30 @@ int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask) return 0; } EXPORT_SYMBOL(drm_pcie_get_speed_cap_mask); + +#else + +int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver) +{ + return -1; +} + +#endif + +EXPORT_SYMBOL(drm_pci_init); + +/*@}*/ +void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver) +{ + struct drm_device *dev, *tmp; + DRM_DEBUG("\n"); + + if (driver->driver_features & DRIVER_MODESET) { + pci_unregister_driver(pdriver); + } else { + list_for_each_entry_safe(dev, tmp, &driver->device_list, driver_item) + drm_put_dev(dev); + } + DRM_INFO("Module unloaded\n"); +} +EXPORT_SYMBOL(drm_pci_exit);
dri-devel@lists.freedesktop.org