patjak / facetimehd

Reverse engineered Linux driver for the FacetimeHD (Broadcom 1570) PCIe webcam
GNU General Public License v2.0
1.35k stars 160 forks source link

Build failure on 5.18-rc1/rc2 #263

Closed satmandu closed 2 years ago

satmandu commented 2 years ago

This is the error:

  CC [M]  /var/lib/dkms/facetimehd/0.1/build/fthd_ddr.o
  CC [M]  /var/lib/dkms/facetimehd/0.1/build/fthd_hw.o
  CC [M]  /var/lib/dkms/facetimehd/0.1/build/fthd_drv.o
  CC [M]  /var/lib/dkms/facetimehd/0.1/build/fthd_ringbuf.o
  CC [M]  /var/lib/dkms/facetimehd/0.1/build/fthd_isp.o
  CC [M]  /var/lib/dkms/facetimehd/0.1/build/fthd_v4l2.o
  CC [M]  /var/lib/dkms/facetimehd/0.1/build/fthd_buffer.o
  CC [M]  /var/lib/dkms/facetimehd/0.1/build/fthd_debugfs.o
/var/lib/dkms/facetimehd/0.1/build/fthd_drv.c: In function ‘fthd_pci_init’:
/var/lib/dkms/facetimehd/0.1/build/fthd_drv.c:399:9: error: implicit declaration of function ‘pci_set_consistent_dma_mask’ [-Werror=implicit-function-declaration]
  399 |         pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(dev_priv->dma_mask));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:288: /var/lib/dkms/facetimehd/0.1/build/fthd_drv.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1834: /var/lib/dkms/facetimehd/0.1/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.18.0-rc2'

Here's a related patch for the nvidia drivers which are having the same issue which might help with fixing this issue for the newer kernels:

http://rglinuxtech.com/?p=3015#comment-310988

— nvidia-510.54/nvidia/nv.c 2022-02-08 13:41:43.000000000 +0800
+++ nvidia-510.54/nvidia/nv.c 2022-04-04 13:15:50.459893021 +0800
@@ -22,6 +22,7 @@
*/

#include “nvmisc.h”
+#include <linux/dma-mapping.h>
#include “os-interface.h”
#include “nv-linux.h”
#include “nv-p2p.h”
@@ -2765,13 +2766,13 @@
*/
if (!nvl->tce_bypass_enabled)
{
– pci_set_dma_mask(nvl->pci_dev, new_mask);
+ dma_set_mask(&nvl->pci_dev->dev, new_mask);
/* Certain kernels have a bug which causes pci_set_consistent_dma_mask
* to call GPL sme_active symbol, this bug has already been fixed in a
* minor release update but detect the failure scenario here to prevent
* an installation regression */
#if !NV_IS_EXPORT_SYMBOL_GPL_sme_active
– pci_set_consistent_dma_mask(nvl->pci_dev, new_mask);
+ dma_set_coherent_mask(&nvl->pci_dev->dev, new_mask);
#endif
}
}
satmandu commented 2 years ago

Thanks for taking care of this!

Fixed by https://github.com/patjak/facetimehd/commit/75a2a5800aa46cbd679847b4d0863a5e3cef3b9e