mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
media: rockchip: isp: wrap width and height config by user
Change-Id: I5090f57f4231da2af258991b264e8f91a46b5adb Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
@@ -1092,18 +1092,19 @@ static int rkisp_set_mirror_flip(struct rkisp_stream *stream,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rkisp_get_wrap_line(struct rkisp_stream *stream, int *line)
|
||||
static int rkisp_get_wrap_line(struct rkisp_stream *stream, struct rkisp_wrap_info *arg)
|
||||
{
|
||||
struct rkisp_device *dev = stream->ispdev;
|
||||
|
||||
if (dev->isp_ver != ISP_V32 && stream->id != RKISP_STREAM_MP)
|
||||
return -EINVAL;
|
||||
|
||||
*line = dev->cap_dev.wrap_line;
|
||||
arg->width = dev->cap_dev.wrap_width;
|
||||
arg->height = dev->cap_dev.wrap_line;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rkisp_set_wrap_line(struct rkisp_stream *stream, int *line)
|
||||
static int rkisp_set_wrap_line(struct rkisp_stream *stream, struct rkisp_wrap_info *arg)
|
||||
{
|
||||
struct rkisp_device *dev = stream->ispdev;
|
||||
|
||||
@@ -1114,7 +1115,8 @@ static int rkisp_set_wrap_line(struct rkisp_stream *stream, int *line)
|
||||
"wrap only support for single sensor and mainpath\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
return stream->ops->set_wrap(stream, *line);
|
||||
dev->cap_dev.wrap_width = arg->width;
|
||||
return stream->ops->set_wrap(stream, arg->height);
|
||||
}
|
||||
|
||||
static int rkisp_set_fps(struct rkisp_stream *stream, int *fps)
|
||||
|
||||
@@ -310,6 +310,7 @@ struct rkisp_capture_device {
|
||||
struct tasklet_struct rd_tasklet;
|
||||
atomic_t refcnt;
|
||||
u32 wait_line;
|
||||
u32 wrap_width;
|
||||
u32 wrap_line;
|
||||
bool is_done_early;
|
||||
bool is_mirror;
|
||||
|
||||
@@ -1486,7 +1486,7 @@ static int rkisp_create_dummy_buf(struct rkisp_stream *stream)
|
||||
if (!dev->cap_dev.wrap_line || stream->id != RKISP_STREAM_MP)
|
||||
return 0;
|
||||
|
||||
buf->size = dev->isp_sdev.in_crop.width * dev->cap_dev.wrap_line * 2;
|
||||
buf->size = dev->cap_dev.wrap_width * dev->cap_dev.wrap_line * 2;
|
||||
if (stream->out_isp_fmt.output_format == ISP32_MI_OUTPUT_YUV420)
|
||||
buf->size = buf->size - buf->size / 4;
|
||||
buf->is_need_dbuf = true;
|
||||
|
||||
@@ -80,10 +80,10 @@
|
||||
_IOW('V', BASE_VIDIOC_PRIVATE + 106, struct rkisp_mirror_flip)
|
||||
|
||||
#define RKISP_CMD_GET_WRAP_LINE \
|
||||
_IOR('V', BASE_VIDIOC_PRIVATE + 107, int)
|
||||
_IOR('V', BASE_VIDIOC_PRIVATE + 107, struct rkisp_wrap_info)
|
||||
/* set wrap line before VIDIOC_S_FMT */
|
||||
#define RKISP_CMD_SET_WRAP_LINE \
|
||||
_IOW('V', BASE_VIDIOC_PRIVATE + 108, int)
|
||||
_IOW('V', BASE_VIDIOC_PRIVATE + 108, struct rkisp_wrap_info)
|
||||
|
||||
#define RKISP_CMD_SET_FPS \
|
||||
_IOW('V', BASE_VIDIOC_PRIVATE + 109, int)
|
||||
@@ -386,6 +386,11 @@ struct rkisp_mirror_flip {
|
||||
unsigned char flip;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct rkisp_wrap_info {
|
||||
int width;
|
||||
int height;
|
||||
};
|
||||
|
||||
#define RKISP_TB_STREAM_BUF_MAX 5
|
||||
struct rkisp_tb_stream_buf {
|
||||
unsigned int dma_addr;
|
||||
|
||||
Reference in New Issue
Block a user