mirror of
https://github.com/terrapkg/packages.git
synced 2026-06-08 04:42:22 +00:00
4861d78287
* Add: IPU6 Camera Stack
* Fix: Use Mock
* Change: Remove ipu6-camera-hal to move to another PR
(cherry picked from commit 562cf68d3f)
Co-authored-by: Gil <rockgrub@protonmail.com>
86 lines
2.4 KiB
Diff
86 lines
2.4 KiB
Diff
From 5917297efb44d52548a052c04e9f759926ca2ddd Mon Sep 17 00:00:00 2001
|
|
From: Hans de Goede <hdegoede@redhat.com>
|
|
Date: Tue, 11 Jun 2024 11:39:34 +0200
|
|
Subject: [PATCH 2/6] media: ipu6: Fix compilation with kernels >= 6.10
|
|
|
|
Fix compilation with kernels >= 6.10.
|
|
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
[vicamo: update for v6.12-rc1]
|
|
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
|
|
---
|
|
drivers/media/pci/intel/ipu-mmu.c | 1 +
|
|
drivers/media/pci/intel/ipu-psys.c | 31 ++++++++++++++++++++++++++++++
|
|
drivers/media/pci/intel/ipu.c | 1 +
|
|
3 files changed, 33 insertions(+)
|
|
|
|
diff --git a/drivers/media/pci/intel/ipu-mmu.c b/drivers/media/pci/intel/ipu-mmu.c
|
|
index a36a6ded8..b06c9f8c1 100644
|
|
--- a/drivers/media/pci/intel/ipu-mmu.c
|
|
+++ b/drivers/media/pci/intel/ipu-mmu.c
|
|
@@ -7,6 +7,7 @@
|
|
#include <linux/iova.h>
|
|
#include <linux/module.h>
|
|
#include <linux/sizes.h>
|
|
+#include <linux/vmalloc.h>
|
|
|
|
#include "ipu.h"
|
|
#include "ipu-platform.h"
|
|
diff --git a/drivers/media/pci/intel/ipu-psys.c b/drivers/media/pci/intel/ipu-psys.c
|
|
index b12ecf3fc..87fab7cf8 100644
|
|
--- a/drivers/media/pci/intel/ipu-psys.c
|
|
+++ b/drivers/media/pci/intel/ipu-psys.c
|
|
@@ -128,6 +128,37 @@ ipu_psys_lookup_kbuffer_by_kaddr(struct ipu_psys_fh *fh, void *kaddr)
|
|
return NULL;
|
|
}
|
|
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
|
|
+/* Dropped from 6.10, use our own copy for now */
|
|
+static int follow_pfn(struct vm_area_struct *vma, unsigned long address, unsigned long *pfn)
|
|
+{
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
|
|
+ spinlock_t *ptl;
|
|
+ pte_t *ptep;
|
|
+
|
|
+ if (follow_pte(vma, address, &ptep, &ptl))
|
|
+ return -EINVAL;
|
|
+
|
|
+ *pfn = pte_pfn(ptep_get(ptep));
|
|
+ pte_unmap_unlock(ptep, ptl);
|
|
+#else
|
|
+ struct follow_pfnmap_args args = {
|
|
+ .vma = vma,
|
|
+ .address = address,
|
|
+ };
|
|
+ int ret;
|
|
+
|
|
+ ret = follow_pfnmap_start(&args);
|
|
+ if (ret)
|
|
+ return ret;
|
|
+
|
|
+ *pfn = args.pfn;
|
|
+ follow_pfnmap_end(&args);
|
|
+#endif
|
|
+ return 0;
|
|
+}
|
|
+#endif
|
|
+
|
|
static int ipu_psys_get_userpages(struct ipu_dma_buf_attach *attach)
|
|
{
|
|
struct vm_area_struct *vma;
|
|
diff --git a/drivers/media/pci/intel/ipu.c b/drivers/media/pci/intel/ipu.c
|
|
index 33592a662..fc091a11a 100644
|
|
--- a/drivers/media/pci/intel/ipu.c
|
|
+++ b/drivers/media/pci/intel/ipu.c
|
|
@@ -15,6 +15,7 @@
|
|
#include <linux/timer.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/version.h>
|
|
+#include <linux/vmalloc.h>
|
|
|
|
#include "ipu.h"
|
|
#include "ipu-buttress.h"
|
|
--
|
|
2.47.0
|
|
|