mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 06:33:34 +00:00
media: cedrus: Use helpers to access capture queue
Accessing capture queue structue directly is not safe. Use helpers for that. Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
61ad123318
commit
1fd50a2c29
@ -197,12 +197,16 @@ static inline dma_addr_t cedrus_buf_addr(struct vb2_buffer *buf,
|
||||
static inline dma_addr_t cedrus_dst_buf_addr(struct cedrus_ctx *ctx,
|
||||
int index, unsigned int plane)
|
||||
{
|
||||
struct vb2_buffer *buf;
|
||||
struct vb2_buffer *buf = NULL;
|
||||
struct vb2_queue *vq;
|
||||
|
||||
if (index < 0)
|
||||
return 0;
|
||||
|
||||
buf = ctx->fh.m2m_ctx->cap_q_ctx.q.bufs[index];
|
||||
vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE);
|
||||
if (vq)
|
||||
buf = vb2_get_buffer(vq, index);
|
||||
|
||||
return buf ? cedrus_buf_addr(buf, &ctx->dst_fmt, plane) : 0;
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ static void cedrus_write_frame_list(struct cedrus_ctx *ctx,
|
||||
const struct v4l2_ctrl_h264_decode_params *decode = run->h264.decode_params;
|
||||
const struct v4l2_ctrl_h264_slice_params *slice = run->h264.slice_params;
|
||||
const struct v4l2_ctrl_h264_sps *sps = run->h264.sps;
|
||||
struct vb2_queue *cap_q = &ctx->fh.m2m_ctx->cap_q_ctx.q;
|
||||
struct vb2_queue *cap_q;
|
||||
struct cedrus_buffer *output_buf;
|
||||
struct cedrus_dev *dev = ctx->dev;
|
||||
unsigned long used_dpbs = 0;
|
||||
@ -105,6 +105,8 @@ static void cedrus_write_frame_list(struct cedrus_ctx *ctx,
|
||||
unsigned int output = 0;
|
||||
unsigned int i;
|
||||
|
||||
cap_q = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE);
|
||||
|
||||
memset(pic_list, 0, sizeof(pic_list));
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(decode->dpb); i++) {
|
||||
@ -168,12 +170,14 @@ static void _cedrus_write_ref_list(struct cedrus_ctx *ctx,
|
||||
enum cedrus_h264_sram_off sram)
|
||||
{
|
||||
const struct v4l2_ctrl_h264_decode_params *decode = run->h264.decode_params;
|
||||
struct vb2_queue *cap_q = &ctx->fh.m2m_ctx->cap_q_ctx.q;
|
||||
struct vb2_queue *cap_q;
|
||||
struct cedrus_dev *dev = ctx->dev;
|
||||
u8 sram_array[CEDRUS_MAX_REF_IDX];
|
||||
unsigned int i;
|
||||
size_t size;
|
||||
|
||||
cap_q = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE);
|
||||
|
||||
memset(sram_array, 0, sizeof(sram_array));
|
||||
|
||||
for (i = 0; i < num_ref; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user