mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
media: rockchip: isp: add tb api for rockit
Change-Id: I8d08816cda58c2605e7b8dd0558e7207644e33c1 Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
@@ -1481,8 +1481,8 @@ static int rkisp_get_fps(struct rkisp_stream *stream, int *fps)
|
||||
return rkisp_rockit_fps_get(fps, stream);
|
||||
}
|
||||
|
||||
static int rkisp_get_tb_stream_info(struct rkisp_stream *stream,
|
||||
struct rkisp_tb_stream_info *info)
|
||||
int rkisp_get_tb_stream_info(struct rkisp_stream *stream,
|
||||
struct rkisp_tb_stream_info *info)
|
||||
{
|
||||
struct rkisp_device *dev = stream->ispdev;
|
||||
|
||||
@@ -1495,12 +1495,14 @@ static int rkisp_get_tb_stream_info(struct rkisp_stream *stream,
|
||||
v4l2_err(&dev->v4l2_dev, "thunderboot no enough memory for image\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
stream->is_using_resmem = false;
|
||||
memcpy(info, &dev->tb_stream_info, sizeof(*info));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rkisp_free_tb_stream_buf(struct rkisp_device *dev)
|
||||
int rkisp_free_tb_stream_buf(struct rkisp_stream *stream)
|
||||
{
|
||||
struct rkisp_device *dev = stream->ispdev;
|
||||
struct rkisp_isp_subdev *sdev = &dev->isp_sdev;
|
||||
struct v4l2_subdev *sd = &sdev->sd;
|
||||
|
||||
@@ -1575,7 +1577,7 @@ static long rkisp_ioctl_default(struct file *file, void *fh,
|
||||
ret = rkisp_get_tb_stream_info(stream, arg);
|
||||
break;
|
||||
case RKISP_CMD_FREE_TB_STREAM_BUF:
|
||||
ret = rkisp_free_tb_stream_buf(stream->ispdev);
|
||||
ret = rkisp_free_tb_stream_buf(stream);
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
|
||||
@@ -331,4 +331,8 @@ int rkisp_fcc_xysubs(u32 fcc, u32 *xsubs, u32 *ysubs);
|
||||
int rkisp_mbus_code_xysubs(u32 code, u32 *xsubs, u32 *ysubs);
|
||||
int rkisp_fh_open(struct file *filp);
|
||||
int rkisp_fop_release(struct file *file);
|
||||
|
||||
int rkisp_get_tb_stream_info(struct rkisp_stream *stream,
|
||||
struct rkisp_tb_stream_info *info);
|
||||
int rkisp_free_tb_stream_buf(struct rkisp_stream *stream);
|
||||
#endif /* _RKISP_PATH_VIDEO_H */
|
||||
|
||||
@@ -374,6 +374,36 @@ int rkisp_rockit_resume_stream(struct rockit_cfg *input_rockit_cfg)
|
||||
}
|
||||
EXPORT_SYMBOL(rkisp_rockit_resume_stream);
|
||||
|
||||
int rkisp_rockit_get_tb_stream_info(struct rockit_cfg *input_rockit_cfg,
|
||||
struct rkisp_tb_stream_info *info)
|
||||
{
|
||||
struct rkisp_stream *stream;
|
||||
|
||||
if (!input_rockit_cfg || !info)
|
||||
return -EINVAL;
|
||||
|
||||
stream = rkisp_rockit_get_stream(input_rockit_cfg);
|
||||
if (!stream)
|
||||
return -EINVAL;
|
||||
|
||||
return rkisp_get_tb_stream_info(stream, info);
|
||||
}
|
||||
EXPORT_SYMBOL(rkisp_rockit_get_tb_stream_info);
|
||||
|
||||
int rkisp_rockit_free_tb_stream_buf(struct rockit_cfg *input_rockit_cfg)
|
||||
{
|
||||
struct rkisp_stream *stream;
|
||||
|
||||
if (!input_rockit_cfg)
|
||||
return -EINVAL;
|
||||
stream = rkisp_rockit_get_stream(input_rockit_cfg);
|
||||
if (!stream)
|
||||
return -EINVAL;
|
||||
|
||||
return rkisp_free_tb_stream_buf(stream);
|
||||
}
|
||||
EXPORT_SYMBOL(rkisp_rockit_free_tb_stream_buf);
|
||||
|
||||
int rkisp_rockit_buf_free(struct rkisp_stream *stream)
|
||||
{
|
||||
struct rkisp_rockit_buffer *isprk_buf = NULL;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define __SOC_ROCKCHIP_ROCKIT_H
|
||||
|
||||
#include <linux/dma-buf.h>
|
||||
#include <linux/rkisp2-config.h>
|
||||
|
||||
#define ROCKIT_BUF_NUM_MAX 5
|
||||
#define ROCKIT_ISP_NUM_MAX 3
|
||||
@@ -82,7 +83,9 @@ int rkisp_rockit_pause_stream(struct rockit_cfg *input_rockit_cfg);
|
||||
int rkisp_rockit_resume_stream(struct rockit_cfg *input_rockit_cfg);
|
||||
int rkisp_rockit_config_stream(struct rockit_cfg *input_rockit_cfg,
|
||||
int width, int height, int wrap_line);
|
||||
|
||||
int rkisp_rockit_get_tb_stream_info(struct rockit_cfg *input_rockit_cfg,
|
||||
struct rkisp_tb_stream_info *info);
|
||||
int rkisp_rockit_free_tb_stream_buf(struct rockit_cfg *input_rockit_cfg);
|
||||
#else
|
||||
|
||||
static inline void *rkisp_rockit_function_register(void *function, int cmd) { return NULL; }
|
||||
@@ -105,6 +108,17 @@ static inline int rkisp_rockit_config_stream(struct rockit_cfg *input_rockit_cfg
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int rkisp_rockit_get_tb_stream_info(struct rockit_cfg *input_rockit_cfg,
|
||||
struct rkisp_tb_stream_info *info)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int rkisp_rockit_free_tb_stream_buf(struct rockit_cfg *input_rockit_cfg)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user