Commit 9fcb242b authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Mauro Carvalho Chehab
Browse files

media: mtk-vcodec: remove unneeded proxy functions



We were getting the codec interface through a proxy function that does
not bring anything compared to just accessing the interface definition
directly, so just do that. Also make the decoder interfaces const.

Signed-off-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 86aed3f5
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -485,16 +485,9 @@ static int vdec_h264_get_param(void *h_vdec, enum vdec_get_param_type type,
	return 0;
}

static struct vdec_common_if vdec_h264_if = {
const struct vdec_common_if vdec_h264_if = {
	.init		= vdec_h264_init,
	.decode		= vdec_h264_decode,
	.get_param	= vdec_h264_get_param,
	.deinit		= vdec_h264_deinit,
};

struct vdec_common_if *get_h264_dec_comm_if(void);

struct vdec_common_if *get_h264_dec_comm_if(void)
{
	return &vdec_h264_if;
}
+1 −8
Original line number Diff line number Diff line
@@ -610,16 +610,9 @@ static void vdec_vp8_deinit(void *h_vdec)
	kfree(inst);
}

static struct vdec_common_if vdec_vp8_if = {
const struct vdec_common_if vdec_vp8_if = {
	.init		= vdec_vp8_init,
	.decode		= vdec_vp8_decode,
	.get_param	= vdec_vp8_get_param,
	.deinit		= vdec_vp8_deinit,
};

struct vdec_common_if *get_vp8_dec_comm_if(void);

struct vdec_common_if *get_vp8_dec_comm_if(void)
{
	return &vdec_vp8_if;
}
+1 −8
Original line number Diff line number Diff line
@@ -1000,16 +1000,9 @@ static int vdec_vp9_get_param(void *h_vdec, enum vdec_get_param_type type,
	return ret;
}

static struct vdec_common_if vdec_vp9_if = {
const struct vdec_common_if vdec_vp9_if = {
	.init		= vdec_vp9_init,
	.decode		= vdec_vp9_decode,
	.get_param	= vdec_vp9_get_param,
	.deinit		= vdec_vp9_deinit,
};

struct vdec_common_if *get_vp9_dec_comm_if(void);

struct vdec_common_if *get_vp9_dec_comm_if(void)
{
	return &vdec_vp9_if;
}
+3 −7
Original line number Diff line number Diff line
@@ -15,23 +15,19 @@
#include "mtk_vcodec_dec_pm.h"
#include "mtk_vpu.h"

const struct vdec_common_if *get_h264_dec_comm_if(void);
const struct vdec_common_if *get_vp8_dec_comm_if(void);
const struct vdec_common_if *get_vp9_dec_comm_if(void);

int vdec_if_init(struct mtk_vcodec_ctx *ctx, unsigned int fourcc)
{
	int ret = 0;

	switch (fourcc) {
	case V4L2_PIX_FMT_H264:
		ctx->dec_if = get_h264_dec_comm_if();
		ctx->dec_if = &vdec_h264_if;
		break;
	case V4L2_PIX_FMT_VP8:
		ctx->dec_if = get_vp8_dec_comm_if();
		ctx->dec_if = &vdec_vp8_if;
		break;
	case V4L2_PIX_FMT_VP9:
		ctx->dec_if = get_vp9_dec_comm_if();
		ctx->dec_if = &vdec_vp9_if;
		break;
	default:
		return -EINVAL;
+4 −0
Original line number Diff line number Diff line
@@ -54,6 +54,10 @@ struct vdec_fb_node {
	struct vdec_fb *fb;
};

extern const struct vdec_common_if vdec_h264_if;
extern const struct vdec_common_if vdec_vp8_if;
extern const struct vdec_common_if vdec_vp9_if;

/**
 * vdec_if_init() - initialize decode driver
 * @ctx	: [in] v4l2 context
Loading