aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-03-01 16:58:47 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-03-01 17:38:16 +0100
commit5c9e7a4e29801e7a76e9a25117c765ebecfed98f (patch)
tree0b39f44adc64f6b270e9d5463d2b1bdfd6d23684
parenta236fddff61e8357f3070effdf23e9b5f20b26e6 (diff)
Rename frame_vector functions.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--v4l/compat.h53
-rw-r--r--v4l/scripts/make_config_compat.pl2
2 files changed, 11 insertions, 44 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index bb400f3..dfd9c30 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -1740,50 +1740,17 @@ static inline void kvfree(const void *addr)
#ifdef NEED_FRAME_VECTOR
#include <linux/mm.h>
-#include <linux/err.h>
-#include <linux/module.h>
-
-/* Container for pinned pfns / pages */
-struct frame_vector {
- unsigned int nr_allocated; /* Number of frames we have space for */
- unsigned int nr_frames; /* Number of frames stored in ptrs array */
- bool got_ref; /* Did we pin pages by getting page ref? */
- bool is_pfns; /* Does array contain pages or pfns? */
- void *ptrs[0]; /* Array of pinned pfns / pages. Use
- * pfns_vector_pages() or pfns_vector_pfns()
- * for access */
-};
-
-struct frame_vector *frame_vector_create(unsigned int nr_frames);
-void frame_vector_destroy(struct frame_vector *vec);
-int get_vaddr_frames(unsigned long start, unsigned int nr_pfns,
- bool write, bool force, struct frame_vector *vec);
-void put_vaddr_frames(struct frame_vector *vec);
-int frame_vector_to_pages(struct frame_vector *vec);
-void frame_vector_to_pfns(struct frame_vector *vec);
-
-static inline unsigned int frame_vector_count(struct frame_vector *vec)
-{
- return vec->nr_frames;
-}
-static inline struct page **frame_vector_pages(struct frame_vector *vec)
-{
- if (vec->is_pfns) {
- int err = frame_vector_to_pages(vec);
-
- if (err)
- return ERR_PTR(err);
- }
- return (struct page **)(vec->ptrs);
-}
-
-static inline unsigned long *frame_vector_pfns(struct frame_vector *vec)
-{
- if (!vec->is_pfns)
- frame_vector_to_pfns(vec);
- return (unsigned long *)(vec->ptrs);
-}
+#define frame_vector media_frame_vector
+#define frame_vector_create media_frame_vector_create
+#define frame_vector_destroy media_frame_vector_destroy
+#define get_vaddr_frames media_get_vaddr_frames
+#define put_vaddr_frames media_put_vaddr_frames
+#define frame_vector_to_pages media_frame_vector_to_pages
+#define frame_vector_to_pfns media_frame_vector_to_pfns
+#define frame_vector_count media_frame_vector_count
+#define frame_vector_pages media_frame_vector_pages
+#define frame_vector_pfns media_frame_vector_pfns
#endif
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl
index 7435d32..a9b6996 100644
--- a/v4l/scripts/make_config_compat.pl
+++ b/v4l/scripts/make_config_compat.pl
@@ -652,7 +652,7 @@ sub check_other_dependencies()
check_files_for_func("of_property_read_u64_array", "NEED_PROP_READ_U64_ARRAY", "include/linux/of.h");
check_files_for_func("module_pnp_driver", "NEED_MODULE_PNP_DRIVER", "include/linux/pnp.h");
check_files_for_func("eth_zero_addr", "NEED_ETH_ZERO_ADDR", "include/linux/etherdevice.h");
- check_files_for_func("frame_vector_create", "NEED_FRAME_VECTOR", "include/linux/mm.h");
+ check_files_for_func("frame_vector_create", "NEED_FRAME_VECTOR", "include/media/frame_vector.h");
check_files_for_func("kvfree", "NEED_KVFREE", "include/linux/mm.h");
check_files_for_func("kvzalloc", "NEED_KVZALLOC", "include/linux/mm.h");
check_files_for_func("ktime_before", "NEED_KTIME_BEFORE", "include/linux/ktime.h");

Privacy Policy