diff options
| author | Benjamin Gaignard <benjamin.gaignard@linaro.org> | 2016-07-29 03:38:55 -0400 |
|---|---|---|
| committer | Benjamin Gaignard <benjamin.gaignard@linaro.org> | 2016-07-29 03:38:55 -0400 |
| commit | 62c2cd0f49333a2bb53602ec23039ca99a19cb9d (patch) | |
| tree | 82ce682c6902ebe63275a60bdc3d406b26f09c84 /include | |
| parent | a1f5524a66ff6284d1380cdd7723de82698ff9d3 (diff) | |
| parent | 894dde5c5d1c6d33c4bd3d4384c6cf0aff3f8015 (diff) | |
Merge remote-tracking branch 'media_tree/vsp1' into generic-zpos-v8
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/of_reserved_mem.h | 25 | ||||
| -rw-r--r-- | include/media/media-device.h | 5 | ||||
| -rw-r--r-- | include/media/media-devnode.h | 46 | ||||
| -rw-r--r-- | include/media/rcar-fcp.h | 37 | ||||
| -rw-r--r-- | include/media/videobuf2-dma-contig.h | 2 | ||||
| -rw-r--r-- | include/media/vsp1.h | 29 | ||||
| -rw-r--r-- | include/uapi/linux/media.h | 10 | ||||
| -rw-r--r-- | include/uapi/linux/vsp1.h | 34 |
8 files changed, 120 insertions, 68 deletions
diff --git a/include/linux/of_reserved_mem.h b/include/linux/of_reserved_mem.h index c201060e0c6d..f8e1992d6423 100644 --- a/include/linux/of_reserved_mem.h +++ b/include/linux/of_reserved_mem.h | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | #ifndef __OF_RESERVED_MEM_H | 1 | #ifndef __OF_RESERVED_MEM_H |
| 2 | #define __OF_RESERVED_MEM_H | 2 | #define __OF_RESERVED_MEM_H |
| 3 | 3 | ||
| 4 | struct device; | 4 | #include <linux/device.h> |
| 5 | |||
| 5 | struct of_phandle_args; | 6 | struct of_phandle_args; |
| 6 | struct reserved_mem_ops; | 7 | struct reserved_mem_ops; |
| 7 | 8 | ||
| @@ -28,7 +29,9 @@ typedef int (*reservedmem_of_init_fn)(struct reserved_mem *rmem); | |||
| 28 | _OF_DECLARE(reservedmem, name, compat, init, reservedmem_of_init_fn) | 29 | _OF_DECLARE(reservedmem, name, compat, init, reservedmem_of_init_fn) |
| 29 | 30 | ||
| 30 | #ifdef CONFIG_OF_RESERVED_MEM | 31 | #ifdef CONFIG_OF_RESERVED_MEM |
| 31 | int of_reserved_mem_device_init(struct device *dev); | 32 | |
| 33 | int of_reserved_mem_device_init_by_idx(struct device *dev, | ||
| 34 | struct device_node *np, int idx); | ||
| 32 | void of_reserved_mem_device_release(struct device *dev); | 35 | void of_reserved_mem_device_release(struct device *dev); |
| 33 | 36 | ||
| 34 | int early_init_dt_alloc_reserved_memory_arch(phys_addr_t size, | 37 | int early_init_dt_alloc_reserved_memory_arch(phys_addr_t size, |
| @@ -42,7 +45,8 @@ void fdt_init_reserved_mem(void); | |||
| 42 | void fdt_reserved_mem_save_node(unsigned long node, const char *uname, | 45 | void fdt_reserved_mem_save_node(unsigned long node, const char *uname, |
| 43 | phys_addr_t base, phys_addr_t size); | 46 | phys_addr_t base, phys_addr_t size); |
| 44 | #else | 47 | #else |
| 45 | static inline int of_reserved_mem_device_init(struct device *dev) | 48 | static inline int of_reserved_mem_device_init_by_idx(struct device *dev, |
| 49 | struct device_node *np, int idx) | ||
| 46 | { | 50 | { |
| 47 | return -ENOSYS; | 51 | return -ENOSYS; |
| 48 | } | 52 | } |
| @@ -53,4 +57,19 @@ static inline void fdt_reserved_mem_save_node(unsigned long node, | |||
| 53 | const char *uname, phys_addr_t base, phys_addr_t size) { } | 57 | const char *uname, phys_addr_t base, phys_addr_t size) { } |
| 54 | #endif | 58 | #endif |
| 55 | 59 | ||
| 60 | /** | ||
| 61 | * of_reserved_mem_device_init() - assign reserved memory region to given device | ||
| 62 | * @dev: Pointer to the device to configure | ||
| 63 | * | ||
| 64 | * This function assigns respective DMA-mapping operations based on the first | ||
| 65 | * reserved memory region specified by 'memory-region' property in device tree | ||
| 66 | * node of the given device. | ||
| 67 | * | ||
| 68 | * Returns error code or zero on success. | ||
| 69 | */ | ||
| 70 | static inline int of_reserved_mem_device_init(struct device *dev) | ||
| 71 | { | ||
| 72 | return of_reserved_mem_device_init_by_idx(dev, dev->of_node, 0); | ||
| 73 | } | ||
| 74 | |||
| 56 | #endif /* __OF_RESERVED_MEM_H */ | 75 | #endif /* __OF_RESERVED_MEM_H */ |
diff --git a/include/media/media-device.h b/include/media/media-device.h index a9b33c47310d..f743ae2210ee 100644 --- a/include/media/media-device.h +++ b/include/media/media-device.h | |||
| @@ -347,7 +347,7 @@ struct media_entity_notify { | |||
| 347 | struct media_device { | 347 | struct media_device { |
| 348 | /* dev->driver_data points to this struct. */ | 348 | /* dev->driver_data points to this struct. */ |
| 349 | struct device *dev; | 349 | struct device *dev; |
| 350 | struct media_devnode devnode; | 350 | struct media_devnode *devnode; |
| 351 | 351 | ||
| 352 | char model[32]; | 352 | char model[32]; |
| 353 | char driver_name[32]; | 353 | char driver_name[32]; |
| @@ -393,9 +393,6 @@ struct usb_device; | |||
| 393 | #define MEDIA_DEV_NOTIFY_PRE_LINK_CH 0 | 393 | #define MEDIA_DEV_NOTIFY_PRE_LINK_CH 0 |
| 394 | #define MEDIA_DEV_NOTIFY_POST_LINK_CH 1 | 394 | #define MEDIA_DEV_NOTIFY_POST_LINK_CH 1 |
| 395 | 395 | ||
| 396 | /* media_devnode to media_device */ | ||
| 397 | #define to_media_device(node) container_of(node, struct media_device, devnode) | ||
| 398 | |||
| 399 | /** | 396 | /** |
| 400 | * media_entity_enum_init - Initialise an entity enumeration | 397 | * media_entity_enum_init - Initialise an entity enumeration |
| 401 | * | 398 | * |
diff --git a/include/media/media-devnode.h b/include/media/media-devnode.h index fe42f08e72bd..37d494805944 100644 --- a/include/media/media-devnode.h +++ b/include/media/media-devnode.h | |||
| @@ -33,6 +33,8 @@ | |||
| 33 | #include <linux/device.h> | 33 | #include <linux/device.h> |
| 34 | #include <linux/cdev.h> | 34 | #include <linux/cdev.h> |
| 35 | 35 | ||
| 36 | struct media_device; | ||
| 37 | |||
| 36 | /* | 38 | /* |
| 37 | * Flag to mark the media_devnode struct as registered. Drivers must not touch | 39 | * Flag to mark the media_devnode struct as registered. Drivers must not touch |
| 38 | * this flag directly, it will be set and cleared by media_devnode_register and | 40 | * this flag directly, it will be set and cleared by media_devnode_register and |
| @@ -67,8 +69,9 @@ struct media_file_operations { | |||
| 67 | 69 | ||
| 68 | /** | 70 | /** |
| 69 | * struct media_devnode - Media device node | 71 | * struct media_devnode - Media device node |
| 72 | * @media_dev: pointer to struct &media_device | ||
| 70 | * @fops: pointer to struct &media_file_operations with media device ops | 73 | * @fops: pointer to struct &media_file_operations with media device ops |
| 71 | * @dev: struct device pointer for the media controller device | 74 | * @dev: pointer to struct &device containing the media controller device |
| 72 | * @cdev: struct cdev pointer character device | 75 | * @cdev: struct cdev pointer character device |
| 73 | * @parent: parent device | 76 | * @parent: parent device |
| 74 | * @minor: device node minor number | 77 | * @minor: device node minor number |
| @@ -81,6 +84,8 @@ struct media_file_operations { | |||
| 81 | * before registering the node. | 84 | * before registering the node. |
| 82 | */ | 85 | */ |
| 83 | struct media_devnode { | 86 | struct media_devnode { |
| 87 | struct media_device *media_dev; | ||
| 88 | |||
| 84 | /* device ops */ | 89 | /* device ops */ |
| 85 | const struct media_file_operations *fops; | 90 | const struct media_file_operations *fops; |
| 86 | 91 | ||
| @@ -94,7 +99,7 @@ struct media_devnode { | |||
| 94 | unsigned long flags; /* Use bitops to access flags */ | 99 | unsigned long flags; /* Use bitops to access flags */ |
| 95 | 100 | ||
| 96 | /* callbacks */ | 101 | /* callbacks */ |
| 97 | void (*release)(struct media_devnode *mdev); | 102 | void (*release)(struct media_devnode *devnode); |
| 98 | }; | 103 | }; |
| 99 | 104 | ||
| 100 | /* dev to media_devnode */ | 105 | /* dev to media_devnode */ |
| @@ -103,7 +108,8 @@ struct media_devnode { | |||
| 103 | /** | 108 | /** |
| 104 | * media_devnode_register - register a media device node | 109 | * media_devnode_register - register a media device node |
| 105 | * | 110 | * |
| 106 | * @mdev: media device node structure we want to register | 111 | * @mdev: struct media_device we want to register a device node |
| 112 | * @devnode: media device node structure we want to register | ||
| 107 | * @owner: should be filled with %THIS_MODULE | 113 | * @owner: should be filled with %THIS_MODULE |
| 108 | * | 114 | * |
| 109 | * The registration code assigns minor numbers and registers the new device node | 115 | * The registration code assigns minor numbers and registers the new device node |
| @@ -116,20 +122,33 @@ struct media_devnode { | |||
| 116 | * the media_devnode structure is *not* called, so the caller is responsible for | 122 | * the media_devnode structure is *not* called, so the caller is responsible for |
| 117 | * freeing any data. | 123 | * freeing any data. |
| 118 | */ | 124 | */ |
| 119 | int __must_check media_devnode_register(struct media_devnode *mdev, | 125 | int __must_check media_devnode_register(struct media_device *mdev, |
| 126 | struct media_devnode *devnode, | ||
| 120 | struct module *owner); | 127 | struct module *owner); |
| 121 | 128 | ||
| 122 | /** | 129 | /** |
| 130 | * media_devnode_unregister_prepare - clear the media device node register bit | ||
| 131 | * @devnode: the device node to prepare for unregister | ||
| 132 | * | ||
| 133 | * This clears the passed device register bit. Future open calls will be met | ||
| 134 | * with errors. Should be called before media_devnode_unregister() to avoid | ||
| 135 | * races with unregister and device file open calls. | ||
| 136 | * | ||
| 137 | * This function can safely be called if the device node has never been | ||
| 138 | * registered or has already been unregistered. | ||
| 139 | */ | ||
| 140 | void media_devnode_unregister_prepare(struct media_devnode *devnode); | ||
| 141 | |||
| 142 | /** | ||
| 123 | * media_devnode_unregister - unregister a media device node | 143 | * media_devnode_unregister - unregister a media device node |
| 124 | * @mdev: the device node to unregister | 144 | * @devnode: the device node to unregister |
| 125 | * | 145 | * |
| 126 | * This unregisters the passed device. Future open calls will be met with | 146 | * This unregisters the passed device. Future open calls will be met with |
| 127 | * errors. | 147 | * errors. |
| 128 | * | 148 | * |
| 129 | * This function can safely be called if the device node has never been | 149 | * Should be called after media_devnode_unregister_prepare() |
| 130 | * registered or has already been unregistered. | ||
| 131 | */ | 150 | */ |
| 132 | void media_devnode_unregister(struct media_devnode *mdev); | 151 | void media_devnode_unregister(struct media_devnode *devnode); |
| 133 | 152 | ||
| 134 | /** | 153 | /** |
| 135 | * media_devnode_data - returns a pointer to the &media_devnode | 154 | * media_devnode_data - returns a pointer to the &media_devnode |
| @@ -145,11 +164,16 @@ static inline struct media_devnode *media_devnode_data(struct file *filp) | |||
| 145 | * media_devnode_is_registered - returns true if &media_devnode is registered; | 164 | * media_devnode_is_registered - returns true if &media_devnode is registered; |
| 146 | * false otherwise. | 165 | * false otherwise. |
| 147 | * | 166 | * |
| 148 | * @mdev: pointer to struct &media_devnode. | 167 | * @devnode: pointer to struct &media_devnode. |
| 168 | * | ||
| 169 | * Note: If mdev is NULL, it also returns false. | ||
| 149 | */ | 170 | */ |
| 150 | static inline int media_devnode_is_registered(struct media_devnode *mdev) | 171 | static inline int media_devnode_is_registered(struct media_devnode *devnode) |
| 151 | { | 172 | { |
| 152 | return test_bit(MEDIA_FLAG_REGISTERED, &mdev->flags); | 173 | if (!devnode) |
| 174 | return false; | ||
| 175 | |||
| 176 | return test_bit(MEDIA_FLAG_REGISTERED, &devnode->flags); | ||
| 153 | } | 177 | } |
| 154 | 178 | ||
| 155 | #endif /* _MEDIA_DEVNODE_H */ | 179 | #endif /* _MEDIA_DEVNODE_H */ |
diff --git a/include/media/rcar-fcp.h b/include/media/rcar-fcp.h new file mode 100644 index 000000000000..4c7fc77eaf29 --- /dev/null +++ b/include/media/rcar-fcp.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | /* | ||
| 2 | * rcar-fcp.h -- R-Car Frame Compression Processor Driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2016 Renesas Electronics Corporation | ||
| 5 | * | ||
| 6 | * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | */ | ||
| 13 | #ifndef __MEDIA_RCAR_FCP_H__ | ||
| 14 | #define __MEDIA_RCAR_FCP_H__ | ||
| 15 | |||
| 16 | struct device_node; | ||
| 17 | struct rcar_fcp_device; | ||
| 18 | |||
| 19 | #if IS_ENABLED(CONFIG_VIDEO_RENESAS_FCP) | ||
| 20 | struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np); | ||
| 21 | void rcar_fcp_put(struct rcar_fcp_device *fcp); | ||
| 22 | int rcar_fcp_enable(struct rcar_fcp_device *fcp); | ||
| 23 | void rcar_fcp_disable(struct rcar_fcp_device *fcp); | ||
| 24 | #else | ||
| 25 | static inline struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np) | ||
| 26 | { | ||
| 27 | return ERR_PTR(-ENOENT); | ||
| 28 | } | ||
| 29 | static inline void rcar_fcp_put(struct rcar_fcp_device *fcp) { } | ||
| 30 | static inline int rcar_fcp_enable(struct rcar_fcp_device *fcp) | ||
| 31 | { | ||
| 32 | return -ENOSYS; | ||
| 33 | } | ||
| 34 | static inline void rcar_fcp_disable(struct rcar_fcp_device *fcp) { } | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #endif /* __MEDIA_RCAR_FCP_H__ */ | ||
diff --git a/include/media/videobuf2-dma-contig.h b/include/media/videobuf2-dma-contig.h index 2087c9a68be3..f7dc8401817e 100644 --- a/include/media/videobuf2-dma-contig.h +++ b/include/media/videobuf2-dma-contig.h | |||
| @@ -35,6 +35,8 @@ static inline void *vb2_dma_contig_init_ctx(struct device *dev) | |||
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | void vb2_dma_contig_cleanup_ctx(void *alloc_ctx); | 37 | void vb2_dma_contig_cleanup_ctx(void *alloc_ctx); |
| 38 | int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size); | ||
| 39 | void vb2_dma_contig_clear_max_seg_size(struct device *dev); | ||
| 38 | 40 | ||
| 39 | extern const struct vb2_mem_ops vb2_dma_contig_memops; | 41 | extern const struct vb2_mem_ops vb2_dma_contig_memops; |
| 40 | 42 | ||
diff --git a/include/media/vsp1.h b/include/media/vsp1.h index 3e654a0455bd..9322d9775fb7 100644 --- a/include/media/vsp1.h +++ b/include/media/vsp1.h | |||
| @@ -14,31 +14,28 @@ | |||
| 14 | #define __MEDIA_VSP1_H__ | 14 | #define __MEDIA_VSP1_H__ |
| 15 | 15 | ||
| 16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
| 17 | #include <linux/videodev2.h> | ||
| 17 | 18 | ||
| 18 | struct device; | 19 | struct device; |
| 19 | struct v4l2_rect; | ||
| 20 | 20 | ||
| 21 | int vsp1_du_init(struct device *dev); | 21 | int vsp1_du_init(struct device *dev); |
| 22 | 22 | ||
| 23 | int vsp1_du_setup_lif(struct device *dev, unsigned int width, | 23 | int vsp1_du_setup_lif(struct device *dev, unsigned int width, |
| 24 | unsigned int height); | 24 | unsigned int height); |
| 25 | 25 | ||
| 26 | struct vsp1_du_atomic_config { | ||
| 27 | u32 pixelformat; | ||
| 28 | unsigned int pitch; | ||
| 29 | dma_addr_t mem[2]; | ||
| 30 | struct v4l2_rect src; | ||
| 31 | struct v4l2_rect dst; | ||
| 32 | unsigned int alpha; | ||
| 33 | unsigned int zpos; | ||
| 34 | }; | ||
| 35 | |||
| 26 | void vsp1_du_atomic_begin(struct device *dev); | 36 | void vsp1_du_atomic_begin(struct device *dev); |
| 27 | int vsp1_du_atomic_update_ext(struct device *dev, unsigned int rpf, | 37 | int vsp1_du_atomic_update(struct device *dev, unsigned int rpf, |
| 28 | u32 pixelformat, unsigned int pitch, | 38 | const struct vsp1_du_atomic_config *cfg); |
| 29 | dma_addr_t mem[2], const struct v4l2_rect *src, | ||
| 30 | const struct v4l2_rect *dst, unsigned int alpha, | ||
| 31 | unsigned int zpos); | ||
| 32 | void vsp1_du_atomic_flush(struct device *dev); | 39 | void vsp1_du_atomic_flush(struct device *dev); |
| 33 | 40 | ||
| 34 | static inline int vsp1_du_atomic_update(struct device *dev, | ||
| 35 | unsigned int rpf_index, u32 pixelformat, | ||
| 36 | unsigned int pitch, dma_addr_t mem[2], | ||
| 37 | const struct v4l2_rect *src, | ||
| 38 | const struct v4l2_rect *dst) | ||
| 39 | { | ||
| 40 | return vsp1_du_atomic_update_ext(dev, rpf_index, pixelformat, pitch, | ||
| 41 | mem, src, dst, 255, 0); | ||
| 42 | } | ||
| 43 | |||
| 44 | #endif /* __MEDIA_VSP1_H__ */ | 41 | #endif /* __MEDIA_VSP1_H__ */ |
diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h index df59edee25d1..7acf0f634f70 100644 --- a/include/uapi/linux/media.h +++ b/include/uapi/linux/media.h | |||
| @@ -95,6 +95,16 @@ struct media_device_info { | |||
| 95 | #define MEDIA_ENT_F_AUDIO_MIXER (MEDIA_ENT_F_BASE + 0x03003) | 95 | #define MEDIA_ENT_F_AUDIO_MIXER (MEDIA_ENT_F_BASE + 0x03003) |
| 96 | 96 | ||
| 97 | /* | 97 | /* |
| 98 | * Processing entities | ||
| 99 | */ | ||
| 100 | #define MEDIA_ENT_F_PROC_VIDEO_COMPOSER (MEDIA_ENT_F_BASE + 0x4001) | ||
| 101 | #define MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER (MEDIA_ENT_F_BASE + 0x4002) | ||
| 102 | #define MEDIA_ENT_F_PROC_VIDEO_PIXEL_ENC_CONV (MEDIA_ENT_F_BASE + 0x4003) | ||
| 103 | #define MEDIA_ENT_F_PROC_VIDEO_LUT (MEDIA_ENT_F_BASE + 0x4004) | ||
| 104 | #define MEDIA_ENT_F_PROC_VIDEO_SCALER (MEDIA_ENT_F_BASE + 0x4005) | ||
| 105 | #define MEDIA_ENT_F_PROC_VIDEO_STATISTICS (MEDIA_ENT_F_BASE + 0x4006) | ||
| 106 | |||
| 107 | /* | ||
| 98 | * Connectors | 108 | * Connectors |
| 99 | */ | 109 | */ |
| 100 | /* It is a responsibility of the entity drivers to add connectors and links */ | 110 | /* It is a responsibility of the entity drivers to add connectors and links */ |
diff --git a/include/uapi/linux/vsp1.h b/include/uapi/linux/vsp1.h deleted file mode 100644 index 9a823696d816..000000000000 --- a/include/uapi/linux/vsp1.h +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * vsp1.h | ||
| 3 | * | ||
| 4 | * Renesas R-Car VSP1 - User-space API | ||
| 5 | * | ||
| 6 | * Copyright (C) 2013 Renesas Corporation | ||
| 7 | * | ||
| 8 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __VSP1_USER_H__ | ||
| 16 | #define __VSP1_USER_H__ | ||
| 17 | |||
| 18 | #include <linux/types.h> | ||
| 19 | #include <linux/videodev2.h> | ||
| 20 | |||
| 21 | /* | ||
| 22 | * Private IOCTLs | ||
| 23 | * | ||
| 24 | * VIDIOC_VSP1_LUT_CONFIG - Configure the lookup table | ||
| 25 | */ | ||
| 26 | |||
| 27 | #define VIDIOC_VSP1_LUT_CONFIG \ | ||
| 28 | _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct vsp1_lut_config) | ||
| 29 | |||
| 30 | struct vsp1_lut_config { | ||
| 31 | __u32 lut[256]; | ||
| 32 | }; | ||
| 33 | |||
| 34 | #endif /* __VSP1_USER_H__ */ | ||
