aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/coda/coda.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/platform/coda/coda.h')
-rw-r--r--drivers/media/platform/coda/coda.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/media/platform/coda/coda.h b/drivers/media/platform/coda/coda.h
index 0c35cd5032ff..6a5c8f6c688e 100644
--- a/drivers/media/platform/coda/coda.h
+++ b/drivers/media/platform/coda/coda.h
@@ -12,6 +12,9 @@
12 * (at your option) any later version. 12 * (at your option) any later version.
13 */ 13 */
14 14
15#ifndef __CODA_H__
16#define __CODA_H__
17
15#include <linux/debugfs.h> 18#include <linux/debugfs.h>
16#include <linux/irqreturn.h> 19#include <linux/irqreturn.h>
17#include <linux/mutex.h> 20#include <linux/mutex.h>
@@ -26,7 +29,6 @@
26#include "coda_regs.h" 29#include "coda_regs.h"
27 30
28#define CODA_MAX_FRAMEBUFFERS 8 31#define CODA_MAX_FRAMEBUFFERS 8
29#define CODA_MAX_FRAME_SIZE 0x100000
30#define FMO_SLICE_SAVE_BUF_SIZE (32) 32#define FMO_SLICE_SAVE_BUF_SIZE (32)
31 33
32enum { 34enum {
@@ -178,6 +180,7 @@ struct coda_ctx;
178struct coda_context_ops { 180struct coda_context_ops {
179 int (*queue_init)(void *priv, struct vb2_queue *src_vq, 181 int (*queue_init)(void *priv, struct vb2_queue *src_vq,
180 struct vb2_queue *dst_vq); 182 struct vb2_queue *dst_vq);
183 int (*reqbufs)(struct coda_ctx *ctx, struct v4l2_requestbuffers *rb);
181 int (*start_streaming)(struct coda_ctx *ctx); 184 int (*start_streaming)(struct coda_ctx *ctx);
182 int (*prepare_run)(struct coda_ctx *ctx); 185 int (*prepare_run)(struct coda_ctx *ctx);
183 void (*finish_run)(struct coda_ctx *ctx); 186 void (*finish_run)(struct coda_ctx *ctx);
@@ -249,13 +252,6 @@ int coda_alloc_aux_buf(struct coda_dev *dev, struct coda_aux_buf *buf,
249 size_t size, const char *name, struct dentry *parent); 252 size_t size, const char *name, struct dentry *parent);
250void coda_free_aux_buf(struct coda_dev *dev, struct coda_aux_buf *buf); 253void coda_free_aux_buf(struct coda_dev *dev, struct coda_aux_buf *buf);
251 254
252static inline int coda_alloc_context_buf(struct coda_ctx *ctx,
253 struct coda_aux_buf *buf, size_t size,
254 const char *name)
255{
256 return coda_alloc_aux_buf(ctx->dev, buf, size, name, ctx->debugfs_entry);
257}
258
259int coda_encoder_queue_init(void *priv, struct vb2_queue *src_vq, 255int coda_encoder_queue_init(void *priv, struct vb2_queue *src_vq,
260 struct vb2_queue *dst_vq); 256 struct vb2_queue *dst_vq);
261int coda_decoder_queue_init(void *priv, struct vb2_queue *src_vq, 257int coda_decoder_queue_init(void *priv, struct vb2_queue *src_vq,
@@ -263,7 +259,7 @@ int coda_decoder_queue_init(void *priv, struct vb2_queue *src_vq,
263 259
264int coda_hw_reset(struct coda_ctx *ctx); 260int coda_hw_reset(struct coda_ctx *ctx);
265 261
266void coda_fill_bitstream(struct coda_ctx *ctx); 262void coda_fill_bitstream(struct coda_ctx *ctx, bool streaming);
267 263
268void coda_set_gdi_regs(struct coda_ctx *ctx); 264void coda_set_gdi_regs(struct coda_ctx *ctx);
269 265
@@ -284,7 +280,7 @@ const char *coda_product_name(int product);
284 280
285int coda_check_firmware(struct coda_dev *dev); 281int coda_check_firmware(struct coda_dev *dev);
286 282
287static inline int coda_get_bitstream_payload(struct coda_ctx *ctx) 283static inline unsigned int coda_get_bitstream_payload(struct coda_ctx *ctx)
288{ 284{
289 return kfifo_len(&ctx->bitstream_fifo); 285 return kfifo_len(&ctx->bitstream_fifo);
290} 286}
@@ -301,3 +297,5 @@ extern const struct coda_context_ops coda_bit_encode_ops;
301extern const struct coda_context_ops coda_bit_decode_ops; 297extern const struct coda_context_ops coda_bit_decode_ops;
302 298
303irqreturn_t coda_irq_handler(int irq, void *data); 299irqreturn_t coda_irq_handler(int irq, void *data);
300
301#endif /* __CODA_H__ */