},
};
-static inline struct tegra_ctx *fh_to_tegra_ctx(struct v4l2_fh *fh)
+static inline struct tegra_ctx *file_to_tegra_ctx(struct file *file)
{
- return container_of(fh, struct tegra_ctx, fh);
+ return container_of(file_to_v4l2_fh(file), struct tegra_ctx, fh);
}
static void tegra_set_control_data(struct tegra_ctx *ctx, void *data, u32 id)
static int tegra_enum_decoded_fmt(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
- struct tegra_ctx *ctx = fh_to_tegra_ctx(priv);
+ struct tegra_ctx *ctx = file_to_tegra_ctx(file);
if (WARN_ON(!ctx->coded_fmt_desc))
return -EINVAL;
static int tegra_g_decoded_fmt(struct file *file, void *priv,
struct v4l2_format *f)
{
- struct tegra_ctx *ctx = fh_to_tegra_ctx(priv);
+ struct tegra_ctx *ctx = file_to_tegra_ctx(file);
*f = ctx->decoded_fmt;
return 0;
static int tegra_try_decoded_fmt(struct file *file, void *priv,
struct v4l2_format *f)
{
+ struct tegra_ctx *ctx = file_to_tegra_ctx(file);
struct v4l2_pix_format_mplane *pix_mp = &f->fmt.pix_mp;
- struct tegra_ctx *ctx = fh_to_tegra_ctx(priv);
const struct tegra_coded_fmt_desc *coded_desc;
unsigned int i;
static int tegra_s_decoded_fmt(struct file *file, void *priv,
struct v4l2_format *f)
{
- struct tegra_ctx *ctx = fh_to_tegra_ctx(priv);
+ struct tegra_ctx *ctx = file_to_tegra_ctx(file);
struct vb2_queue *vq;
int err;
static int tegra_enum_coded_fmt(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
- struct tegra_ctx *ctx = fh_to_tegra_ctx(priv);
+ struct tegra_ctx *ctx = file_to_tegra_ctx(file);
const struct tegra_vde_soc *soc = ctx->vde->soc;
if (f->index >= soc->num_coded_fmts)
static int tegra_g_coded_fmt(struct file *file, void *priv,
struct v4l2_format *f)
{
- struct tegra_ctx *ctx = fh_to_tegra_ctx(priv);
+ struct tegra_ctx *ctx = file_to_tegra_ctx(file);
*f = ctx->coded_fmt;
return 0;
struct v4l2_format *f)
{
struct v4l2_pix_format_mplane *pix_mp = &f->fmt.pix_mp;
- struct tegra_ctx *ctx = fh_to_tegra_ctx(priv);
+ struct tegra_ctx *ctx = file_to_tegra_ctx(file);
const struct tegra_vde_soc *soc = ctx->vde->soc;
int size = pix_mp->plane_fmt[0].sizeimage;
const struct tegra_coded_fmt_desc *desc;
static int tegra_s_coded_fmt(struct file *file, void *priv,
struct v4l2_format *f)
{
- struct tegra_ctx *ctx = fh_to_tegra_ctx(priv);
+ struct tegra_ctx *ctx = file_to_tegra_ctx(file);
struct v4l2_m2m_ctx *m2m_ctx = ctx->fh.m2m_ctx;
const struct tegra_coded_fmt_desc *desc;
struct vb2_queue *peer_vq, *vq;
static int tegra_enum_framesizes(struct file *file, void *priv,
struct v4l2_frmsizeenum *fsize)
{
- struct tegra_ctx *ctx = fh_to_tegra_ctx(priv);
+ struct tegra_ctx *ctx = file_to_tegra_ctx(file);
const struct tegra_coded_fmt_desc *fmt;
if (fsize->index)
static int tegra_release(struct file *file)
{
+ struct tegra_ctx *ctx = file_to_tegra_ctx(file);
struct v4l2_fh *fh = file_to_v4l2_fh(file);
- struct tegra_ctx *ctx = fh_to_tegra_ctx(fh);
struct tegra_vde *vde = ctx->vde;
v4l2_fh_del(fh, file);