linux/drivers/media/platform/mtk-vcodec/vdec_drv_base.h
Alexandre Courbot 86aed3f519 media: mtk-vcodec: avoid unneeded pointer-to-long conversions
The interface used to communicate with the firmware casts pointers
into unsigned longs and back again in order to store private
references, all of this for pointers that remain purely in the kernel.
Replace these unsigned longs with void pointers to make the code a bit
sturdier and easier to follow.

Also simplify some interfaces by removing arguments that could be
infered from others.

Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: fix checkpatch alignment warning]
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-21 17:09:30 -04:00

49 lines
1.1 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2016 MediaTek Inc.
* Author: PC Chen <pc.chen@mediatek.com>
*/
#ifndef _VDEC_DRV_BASE_
#define _VDEC_DRV_BASE_
#include "mtk_vcodec_drv.h"
#include "vdec_drv_if.h"
struct vdec_common_if {
/**
* (*init)() - initialize decode driver
* @ctx : [in] mtk v4l2 context
* @h_vdec : [out] driver handle
*/
int (*init)(struct mtk_vcodec_ctx *ctx);
/**
* (*decode)() - trigger decode
* @h_vdec : [in] driver handle
* @bs : [in] input bitstream
* @fb : [in] frame buffer to store decoded frame
* @res_chg : [out] resolution change happen
*/
int (*decode)(void *h_vdec, struct mtk_vcodec_mem *bs,
struct vdec_fb *fb, bool *res_chg);
/**
* (*get_param)() - get driver's parameter
* @h_vdec : [in] driver handle
* @type : [in] input parameter type
* @out : [out] buffer to store query result
*/
int (*get_param)(void *h_vdec, enum vdec_get_param_type type,
void *out);
/**
* (*deinit)() - deinitialize driver.
* @h_vdec : [in] driver handle to be deinit
*/
void (*deinit)(void *h_vdec);
};
#endif