Skip to content

Commit

Permalink
Merge pull request #693 from MaxKrummenacher/6.6-2.1.x-imx
Browse files Browse the repository at this point in the history
6.6 2.1.x imx
  • Loading branch information
otavio authored Oct 31, 2024
2 parents 9af9134 + ac0de57 commit 34d773e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 266 deletions.
21 changes: 3 additions & 18 deletions drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,6 @@ static void vsi_dec_buf_queue(struct vb2_buffer *vb)
set_bit(BUF_FLAG_QUEUED, &ctx->srcvbufflag[vb->index]);
list_add_tail(&vsibuf->list, &ctx->input_list);
ctx->queued_srcnum++;
ctx->performance.input_buf_num++;
}
ret = vsiv4l2_execcmd(ctx, V4L2_DAEMON_VIDIOC_BUF_RDY, vb);
}
Expand All @@ -856,27 +855,16 @@ static int vsi_dec_buf_prepare(struct vb2_buffer *vb)
static int vsi_dec_start_streaming(struct vb2_queue *q, unsigned int count)
{
struct vsi_v4l2_ctx *ctx = fh_to_ctx(q->drv_priv);
struct vb2_queue *vq_peer;

if (V4L2_TYPE_IS_OUTPUT(q->type)) {
if (V4L2_TYPE_IS_OUTPUT(q->type))
ctx->out_sequence = 0;
vq_peer = &ctx->output_que;
} else {
else
ctx->cap_sequence = 0;
vq_peer = &ctx->input_que;
}

if (vb2_is_streaming(vq_peer))
ctx->performance.ts_start = ktime_get_raw();

return 0;
}
static void vsi_dec_stop_streaming(struct vb2_queue *q)
static void vsi_dec_stop_streaming(struct vb2_queue *vq)
{
struct vsi_v4l2_ctx *ctx = fh_to_ctx(q->drv_priv);

if (V4L2_TYPE_IS_OUTPUT(q->type))
vsi_v4l2_reset_performance(ctx);
}

static void vsi_dec_buf_finish(struct vb2_buffer *vb)
Expand Down Expand Up @@ -1214,9 +1202,6 @@ static int v4l2_dec_open(struct file *filp)
atomic_set(&ctx->srcframen, 0);
atomic_set(&ctx->dstframen, 0);
ctx->status = VSI_STATUS_INIT;
ctx->tgid = current->tgid;
ctx->pid = current->pid;
vsi_v4l2_create_dbgfs_file(ctx);

//dev->vdev->queue = q;
//single queue is used for v4l2 default ops such as ioctl, read, write and poll
Expand Down
26 changes: 5 additions & 21 deletions drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,12 +783,10 @@ static void vsi_enc_buf_queue(struct vb2_buffer *vb)

v4l2_klog(LOGLVL_FLOW, "%s:%d:%d", __func__, vb->type, vb->index);
vsibuf = vb_to_vsibuf(vb);
if (!binputqueue(vq->type)) {
if (!binputqueue(vq->type))
list_add_tail(&vsibuf->list, &ctx->output_list);
} else {
else
list_add_tail(&vsibuf->list, &ctx->input_list);
ctx->performance.input_buf_num++;
}
ret = vsiv4l2_execcmd(ctx, V4L2_DAEMON_VIDIOC_BUF_RDY, vb);
}

Expand All @@ -808,27 +806,16 @@ static int vsi_enc_buf_prepare(struct vb2_buffer *vb)
static int vsi_enc_start_streaming(struct vb2_queue *q, unsigned int count)
{
struct vsi_v4l2_ctx *ctx = fh_to_ctx(q->drv_priv);
struct vb2_queue *vq_peer;

if (V4L2_TYPE_IS_OUTPUT(q->type)) {
if (V4L2_TYPE_IS_OUTPUT(q->type))
ctx->out_sequence = 0;
vq_peer = &ctx->output_que;
} else {
else
ctx->cap_sequence = 0;
vq_peer = &ctx->input_que;
}

if (vb2_is_streaming(vq_peer))
ctx->performance.ts_start = ktime_get_raw();

return 0;
}
static void vsi_enc_stop_streaming(struct vb2_queue *q)
static void vsi_enc_stop_streaming(struct vb2_queue *vq)
{
struct vsi_v4l2_ctx *ctx = fh_to_ctx(q->drv_priv);

if (V4L2_TYPE_IS_OUTPUT(q->type))
vsi_v4l2_reset_performance(ctx);
}

static void vsi_enc_buf_finish(struct vb2_buffer *vb)
Expand Down Expand Up @@ -1529,9 +1516,6 @@ static int v4l2_enc_open(struct file *filp)
atomic_set(&ctx->srcframen, 0);
atomic_set(&ctx->dstframen, 0);
ctx->status = VSI_STATUS_INIT;
ctx->tgid = current->tgid;
ctx->pid = current->pid;
vsi_v4l2_create_dbgfs_file(ctx);

return 0;

Expand Down
22 changes: 0 additions & 22 deletions drivers/mxc/hantro_v4l2/vsi-v4l2-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include <linux/version.h>
#include <linux/v4l2-controls.h>
#include <linux/debugfs.h>
#include <linux/imx_vpu.h>
#include "vsi-v4l2.h"

Expand Down Expand Up @@ -250,7 +249,6 @@ struct vsi_v4l2_device {
struct video_device *vdec;
struct mutex lock;
struct mutex irqlock;
struct dentry *debugfs;
};

struct vsi_vpu_buf {
Expand Down Expand Up @@ -302,17 +300,6 @@ enum {
BUF_FLAG_TIMESTAMP_INVALID,
};

struct vsi_vpu_performance_info {
ktime_t ts_start;
ktime_t ts_last;
ktime_t ts_disp_first;
ktime_t ts_disp_last;
u64 total_time;
u64 input_buf_num;
u64 processed_buf_num;
u64 display_frame_num;
};

struct vsi_v4l2_ctx {
struct v4l2_fh fh;
struct vsi_v4l2_device *dev;
Expand Down Expand Up @@ -363,12 +350,6 @@ struct vsi_v4l2_ctx {

u32 out_sequence;
u32 cap_sequence;

pid_t tgid;
pid_t pid;

struct vsi_vpu_performance_info performance;
struct dentry *debugfs;
};

struct vsi_v4l2_ctrl_applicable {
Expand Down Expand Up @@ -397,8 +378,6 @@ struct video_device *vsi_v4l2_probe_enc(
void vsi_v4l2_release_enc(struct video_device *venc);
struct video_device *vsi_v4l2_probe_dec(struct platform_device *pdev, struct vsi_v4l2_device *vpu);
void vsi_v4l2_release_dec(struct video_device *vdec);
int vsi_v4l2_create_dbgfs_file(struct vsi_v4l2_ctx *ctx);
void vsi_v4l2_remove_dbgfs_file(struct vsi_v4l2_ctx *ctx);

u64 vsi_v4l2_getbandwidth(void);
int vsiv4l2_initdaemon(void);
Expand Down Expand Up @@ -448,7 +427,6 @@ void vsi_convertROI(struct vsi_v4l2_ctx *ctx);
void vsi_convertIPCM(struct vsi_v4l2_ctx *ctx);
int vsiv4l2_verifycrop(struct v4l2_selection *s);
void vsi_v4l2_update_ctrlcfg(struct v4l2_ctrl_config *cfg);
void vsi_v4l2_reset_performance(struct vsi_v4l2_ctx *ctx);
bool vsi_v4l2_ctrl_is_applicable(struct vsi_v4l2_ctx *ctx, u32 ctrl_id);

static inline int isencoder(struct vsi_v4l2_ctx *ctx)
Expand Down
Loading

0 comments on commit 34d773e

Please sign in to comment.