diff for duplicates of <20140822173900.0d3efcd1@bones> diff --git a/a/1.txt b/N1/1.txt index 4b7ac7d..6d5f1a0 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -70,7 +70,8 @@ Thanks, Mikhail. > > b/drivers/media/platform/Makefile index e5269da..e438534 100644 > > --- a/drivers/media/platform/Makefile > > +++ b/drivers/media/platform/Makefile -> > @@ -47,6 +47,8 @@ obj-$(CONFIG_SOC_CAMERA) +> > soc_camera/ +> > @@ -47,6 +47,8 @@ obj-$(CONFIG_SOC_CAMERA) += +> > soc_camera/ > > obj-$(CONFIG_VIDEO_RENESAS_VSP1) += vsp1/ > > > > +obj-$(CONFIG_VIDEO_RENESAS_JPU) += jpu.o @@ -555,10 +556,10 @@ Thanks, Mikhail. > > + > > +/* > > + * -> > ====================================== +> > ============================================================================ > > + * video ioctl operations > > + * -> > ====================================== +> > ============================================================================ > > + */ > > +static void put_byte(unsigned long *p, u8 v) > > +{ @@ -633,7 +634,7 @@ Thanks, Mikhail. > > + put_byte(&p, 0x03); > > + put_byte(&p, 0x01); > > + -> > + if (q->fmt->fourcc = V4L2_PIX_FMT_NV16) +> > + if (q->fmt->fourcc == V4L2_PIX_FMT_NV16) > > + put_byte(&p, 0x21); > > + else > > + put_byte(&p, 0x22); @@ -653,7 +654,7 @@ Thanks, Mikhail. > > +{ > > + struct jpu_ctx *ctx = fh_to_ctx(priv); > > + -> > + if (ctx->mode = JPU_ENCODE) { +> > + if (ctx->mode == JPU_ENCODE) { > > + strlcpy(cap->driver, JPU_M2M_NAME " encoder", > > + sizeof(cap->driver)); > > + strlcpy(cap->card, JPU_M2M_NAME " encoder", @@ -678,20 +679,20 @@ Thanks, Mikhail. > > +{ > > + unsigned int k, fmt_flag; > > + -> > + if (mode = JPU_ENCODE) -> > + fmt_flag = (fmt_type = JPU_FMT_TYPE_OUTPUT) ? +> > + if (mode == JPU_ENCODE) +> > + fmt_flag = (fmt_type == JPU_FMT_TYPE_OUTPUT) ? > > JPU_ENC_OUTPUT : > > + > > JPU_ENC_CAPTURE; > > + else -> > + fmt_flag = (fmt_type = JPU_FMT_TYPE_OUTPUT) ? +> > + fmt_flag = (fmt_type == JPU_FMT_TYPE_OUTPUT) ? > > JPU_DEC_OUTPUT : > > + > > JPU_DEC_CAPTURE; + > > + for (k = 0; k < ARRAY_SIZE(jpu_formats); k++) { > > + struct jpu_fmt *fmt = &jpu_formats[k]; > > + -> > + if (fmt->fourcc = pixelformat && +> > + if (fmt->fourcc == pixelformat && > > + fmt->types & fmt_flag) { > > + return fmt; > > + } @@ -707,7 +708,7 @@ Thanks, Mikhail. > > + for (i = 0; i < ARRAY_SIZE(jpu_formats); ++i) { > > + if (jpu_formats[i].types & type) { > > + /* index-th format of type type found ? */ -> > + if (num = f->index) +> > + if (num == f->index) > > + break; > > + /* > > + * Correct type but haven't reached our @@ -734,7 +735,7 @@ Thanks, Mikhail. > > +{ > > + struct jpu_ctx *ctx = fh_to_ctx(priv); > > + -> > + if (ctx->mode = JPU_ENCODE) +> > + if (ctx->mode == JPU_ENCODE) > > + return jpu_enum_fmt(f, JPU_ENC_CAPTURE); > > + > > + return jpu_enum_fmt(f, JPU_DEC_CAPTURE); @@ -745,7 +746,7 @@ Thanks, Mikhail. > > +{ > > + struct jpu_ctx *ctx = fh_to_ctx(priv); > > + -> > + if (ctx->mode = JPU_ENCODE) +> > + if (ctx->mode == JPU_ENCODE) > > + return jpu_enum_fmt(f, JPU_ENC_OUTPUT); > > + > > + return jpu_enum_fmt(f, JPU_DEC_OUTPUT); @@ -775,8 +776,8 @@ Thanks, Mikhail. > > + if (!vq) > > + return -EINVAL; > > + -> > + if (f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE && -> > + ctx->mode = JPU_DECODE && !ctx->hdr_parsed) +> > + if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && +> > + ctx->mode == JPU_DECODE && !ctx->hdr_parsed) > > + return -EINVAL; > > + > > + q_data = jpu_get_q_data(ctx, f->type); @@ -822,7 +823,7 @@ Thanks, Mikhail. > > +{ > > + struct v4l2_pix_format *pix = &f->fmt.pix; > > + -> > + if (pix->field = V4L2_FIELD_ANY) +> > + if (pix->field == V4L2_FIELD_ANY) > > + pix->field = V4L2_FIELD_NONE; > > + else if (pix->field != V4L2_FIELD_NONE) > > + return -EINVAL; @@ -838,7 +839,7 @@ Thanks, Mikhail. > > JPU_HEIGHT_MIN, > > + JPU_HEIGHT_MAX, fmt->v_align); > > + -> > + if (fmt->fourcc = V4L2_PIX_FMT_JPEG) { +> > + if (fmt->fourcc == V4L2_PIX_FMT_JPEG) { > > + if (pix->sizeimage <= 0) > > + pix->sizeimage = PAGE_SIZE; > > + pix->bytesperline = 0; @@ -962,7 +963,7 @@ Thanks, Mikhail. > > + s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) > > + return -EINVAL; > > + -> > + /* For JPEG blob active = default = bounds */ +> > + /* For JPEG blob active == default == bounds */ > > + switch (s->target) { > > + case V4L2_SEL_TGT_CROP: > > + case V4L2_SEL_TGT_CROP_BOUNDS: @@ -995,7 +996,7 @@ Thanks, Mikhail. > > + > > + spin_lock_irqsave(&ctx->jpu->slock, flags); > > + -> > + if (ctrl->id = V4L2_CID_JPEG_COMPRESSION_QUALITY) +> > + if (ctrl->id == V4L2_CID_JPEG_COMPRESSION_QUALITY) > > + ctx->compr_quality = ctrl->val; > > + > > + spin_unlock_irqrestore(&ctx->jpu->slock, flags); @@ -1016,17 +1017,22 @@ Thanks, Mikhail. > > + .vidioc_g_fmt_vid_cap = jpu_g_fmt, > > + .vidioc_g_fmt_vid_out = jpu_g_fmt, > > + -> > + .vidioc_try_fmt_vid_cap > > jpu_try_fmt_vid_cap, -> > + .vidioc_try_fmt_vid_out > > jpu_try_fmt_vid_out, + +> > + .vidioc_try_fmt_vid_cap = +> > jpu_try_fmt_vid_cap, +> > + .vidioc_try_fmt_vid_out = +> > jpu_try_fmt_vid_out, + > > + .vidioc_s_fmt_vid_cap = jpu_s_fmt_vid_cap, > > + .vidioc_s_fmt_vid_out = jpu_s_fmt_vid_out, > > + -> > + .vidioc_reqbufs > > v4l2_m2m_ioctl_reqbufs, +> > + .vidioc_reqbufs = +> > v4l2_m2m_ioctl_reqbufs, > > + .vidioc_querybuf = v4l2_m2m_ioctl_querybuf, > > + .vidioc_qbuf = v4l2_m2m_ioctl_qbuf, -> > + .vidioc_dqbuf > > v4l2_m2m_ioctl_dqbuf, +> > + .vidioc_dqbuf = +> > v4l2_m2m_ioctl_dqbuf, > > + .vidioc_streamon = v4l2_m2m_ioctl_streamon, -> > + .vidioc_streamoff > > v4l2_m2m_ioctl_streamoff, + +> > + .vidioc_streamoff = +> > v4l2_m2m_ioctl_streamoff, + > > + .vidioc_g_selection = jpu_g_selection, > > +}; > > + @@ -1036,7 +1042,7 @@ Thanks, Mikhail. > > + > > + v4l2_ctrl_handler_init(&ctx->ctrl_handler, 3); > > + -> > + if (ctx->mode = JPU_ENCODE) { +> > + if (ctx->mode == JPU_ENCODE) { > > + v4l2_ctrl_new_std(&ctx->ctrl_handler, > > &jpu_ctrl_ops, > > + @@ -1047,7 +1053,7 @@ Thanks, Mikhail. > > + if (ctx->ctrl_handler.error) > > + return ctx->ctrl_handler.error; > > + -> > + if (ctx->mode = JPU_DECODE) +> > + if (ctx->mode == JPU_DECODE) > > + ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE | > > + V4L2_CTRL_FLAG_READ_ONLY; > > + @@ -1056,10 +1062,10 @@ Thanks, Mikhail. > > + > > +/* > > + * -> > ====================================== +> > ============================================================================ > > + * Queue operations > > + * -> > ====================================== +> > ============================================================================ > > + */ > > +static int jpu_queue_setup(struct vb2_queue *vq, > > + const struct v4l2_format *fmt, @@ -1081,7 +1087,7 @@ Thanks, Mikhail. > > + * in the context so we do not allow another buffer to > > overwrite it > > + */ -> > + if (ctx->mode = JPU_DECODE) +> > + if (ctx->mode == JPU_DECODE) > > + count = 1; > > + > > + *nbuffers = count; @@ -1116,8 +1122,8 @@ Thanks, Mikhail. > > +{ > > + struct jpu_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue); > > + -> > + if (ctx->mode = JPU_DECODE && -> > + vb->vb2_queue->type = V4L2_BUF_TYPE_VIDEO_OUTPUT) +> > + if (ctx->mode == JPU_DECODE && +> > + vb->vb2_queue->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) > > { > > + struct jpu_q_data *q_data; > > + struct jpu *jpu = ctx->jpu; @@ -1148,7 +1154,7 @@ Thanks, Mikhail. > > + > > msecs_to_jiffies(100)) > 0 > > + && -> > jpu->status = JPU_OK) +> > jpu->status == JPU_OK) > > + ctx->hdr_parsed = true; > > + > > + w_out = ioread32(jpu->regs + JCHSZU) << 8 | @@ -1194,7 +1200,8 @@ Thanks, Mikhail. > > subsampling, > > + > > JPU_FMT_TYPE_CAPTURE); + -> > + q_data->size > > + (q_data->w * q_data->h * +> > + q_data->size = +> > + (q_data->w * q_data->h * > > q_data->fmt->depth) >> 3; > > + } > > + @@ -1254,10 +1261,10 @@ Thanks, Mikhail. > > + > > +/* > > + * -> > ====================================== +> > ============================================================================ > > + * Device file operations > > + * -> > ====================================== +> > ============================================================================ > > + */ > > +static int jpu_open(struct file *file) > > +{ @@ -1282,7 +1289,7 @@ Thanks, Mikhail. > > + v4l2_fh_add(&ctx->fh); > > + > > + ctx->jpu = jpu; -> > + if (vfd = jpu->vfd_encoder) { +> > + if (vfd == jpu->vfd_encoder) { > > + ctx->mode = JPU_ENCODE; > > + out_fmt = jpu_find_format(ctx->mode, > > V4L2_PIX_FMT_NV16, @@ -1315,7 +1322,7 @@ Thanks, Mikhail. > > + if (ret < 0) > > + goto error; > > + -> > + if (jpu->ref_count = 0) { +> > + if (jpu->ref_count == 0) { > > + ret = clk_prepare_enable(jpu->clk); > > + if (ret < 0) > > + goto error; @@ -1341,7 +1348,7 @@ Thanks, Mikhail. > > + struct jpu_ctx *ctx = fh_to_ctx(file->private_data); > > + > > + mutex_lock(&jpu->mutex); -> > + if (--jpu->ref_count = 0) +> > + if (--jpu->ref_count == 0) > > + clk_disable_unprepare(jpu->clk); > > + v4l2_m2m_ctx_release(ctx->fh.m2m_ctx); > > + v4l2_ctrl_handler_free(&ctx->ctrl_handler); @@ -1364,10 +1371,10 @@ Thanks, Mikhail. > > + > > +/* > > + * -> > ====================================== +> > ============================================================================ > > + * mem2mem callbacks > > + * -> > ====================================== +> > ============================================================================ > > + */ > > +static void jpu_device_run(void *priv) > > +{ @@ -1388,7 +1395,7 @@ Thanks, Mikhail. > > + > > + jpu_reset(jpu->regs); > > + -> > + if (ctx->mode = JPU_ENCODE) { +> > + if (ctx->mode == JPU_ENCODE) { > > + unsigned int redu, inft; > > + > > + w = ctx->out_q.w; @@ -1396,7 +1403,7 @@ Thanks, Mikhail. > > + > > + jpu_generate_hdr(&ctx->out_q, ctx->compr_quality, > > dst_vaddr); + -> > + if (ctx->out_q.fmt->fourcc = V4L2_PIX_FMT_NV12) { +> > + if (ctx->out_q.fmt->fourcc == V4L2_PIX_FMT_NV12) { > > + redu = JCMOD_REDU_420; > > + inft = JIFECNT_INFT_420; > > + } else { @@ -1472,7 +1479,7 @@ Thanks, Mikhail. > > +{ > > + struct jpu_ctx *ctx = priv; > > + -> > + if (ctx->mode = JPU_DECODE) +> > + if (ctx->mode == JPU_DECODE) > > + return ctx->hdr_parsed; > > + return 1; > > +} @@ -1489,10 +1496,10 @@ Thanks, Mikhail. > > + > > +/* > > + * -> > ====================================== +> > ============================================================================ > > + * IRQ handler > > + * -> > ====================================== +> > ============================================================================ > > + */ > > +static irqreturn_t jpu_irq_handler(int irq, void *dev_id) > > +{ @@ -1519,7 +1526,7 @@ Thanks, Mikhail. > > + return IRQ_NONE; > > + } > > + -> > + if (jpu->status = JPU_BUSY) { +> > + if (jpu->status == JPU_BUSY) { > > + if (int_status & INT(3)) > > + jpu->status = JPU_OK; > > + if (int_status & INT(5)) @@ -1537,7 +1544,7 @@ Thanks, Mikhail. > > + dst_buf = v4l2_m2m_dst_buf_remove(curr_ctx->fh.m2m_ctx); > > + > > + if (int_status & INT(10)) { -> > + if (curr_ctx->mode = JPU_ENCODE) { +> > + if (curr_ctx->mode == JPU_ENCODE) { > > + payload_size = ioread32(jpu->regs + > > JCDTCU) << 16 | > > + ioread32(jpu->regs + @@ -1565,10 +1572,10 @@ Thanks, Mikhail. > > + > > +/* > > + * -> > ====================================== +> > ============================================================================ > > + * Driver basic infrastructure > > + * -> > ====================================== +> > ============================================================================ > > + */ > > +static const struct of_device_id jpu_dt_ids[] = { > > + { .compatible = "renesas,jpu-r8a7790" }, @@ -1764,7 +1771,7 @@ Thanks, Mikhail. > > +{ > > + struct jpu *jpu = dev_get_drvdata(dev); > > + -> > + if (jpu->ref_count = 0) +> > + if (jpu->ref_count == 0) > > + return 0; > > + > > + clk_disable_unprepare(jpu->clk); diff --git a/a/content_digest b/N1/content_digest index 4d5cbf5..f7473e2 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -3,7 +3,7 @@ "ref\053F3531C.4080105@xs4all.nl\0" "From\0Mikhail Ulianov <mikhail.ulyanov@cogentembedded.com>\0" "Subject\0Re: [PATCH 1/6] V4L2: Add Renesas R-Car JPEG codec driver.\0" - "Date\0Fri, 22 Aug 2014 13:39:00 +0000\0" + "Date\0Fri, 22 Aug 2014 17:39:00 +0400\0" "To\0Hans Verkuil <hverkuil@xs4all.nl>\0" "Cc\0m.chehab@samsung.com" horms@verge.net.au @@ -89,7 +89,8 @@ "> > b/drivers/media/platform/Makefile index e5269da..e438534 100644\n" "> > --- a/drivers/media/platform/Makefile\n" "> > +++ b/drivers/media/platform/Makefile\n" - "> > @@ -47,6 +47,8 @@ obj-$(CONFIG_SOC_CAMERA)\t\t+> > soc_camera/ \n" + "> > @@ -47,6 +47,8 @@ obj-$(CONFIG_SOC_CAMERA)\t\t+=\n" + "> > soc_camera/ \n" "> > obj-$(CONFIG_VIDEO_RENESAS_VSP1)\t+= vsp1/\n" "> > \n" "> > +obj-$(CONFIG_VIDEO_RENESAS_JPU)\t+= jpu.o\n" @@ -574,10 +575,10 @@ "> > +\n" "> > +/*\n" "> > + *\n" - "> > ======================================\n" + "> > ============================================================================\n" "> > + * video ioctl operations\n" "> > + *\n" - "> > ======================================\n" + "> > ============================================================================\n" "> > + */\n" "> > +static void put_byte(unsigned long *p, u8 v)\n" "> > +{\n" @@ -652,7 +653,7 @@ "> > +\tput_byte(&p, 0x03);\n" "> > +\tput_byte(&p, 0x01);\n" "> > +\n" - "> > +\tif (q->fmt->fourcc = V4L2_PIX_FMT_NV16)\n" + "> > +\tif (q->fmt->fourcc == V4L2_PIX_FMT_NV16)\n" "> > +\t\tput_byte(&p, 0x21);\n" "> > +\telse\n" "> > +\t\tput_byte(&p, 0x22);\n" @@ -672,7 +673,7 @@ "> > +{\n" "> > +\tstruct jpu_ctx *ctx = fh_to_ctx(priv);\n" "> > +\n" - "> > +\tif (ctx->mode = JPU_ENCODE) {\n" + "> > +\tif (ctx->mode == JPU_ENCODE) {\n" "> > +\t\tstrlcpy(cap->driver, JPU_M2M_NAME \" encoder\",\n" "> > +\t\t\tsizeof(cap->driver));\n" "> > +\t\tstrlcpy(cap->card, JPU_M2M_NAME \" encoder\",\n" @@ -697,20 +698,20 @@ "> > +{\n" "> > +\tunsigned int k, fmt_flag;\n" "> > +\n" - "> > +\tif (mode = JPU_ENCODE)\n" - "> > +\t\tfmt_flag = (fmt_type = JPU_FMT_TYPE_OUTPUT) ?\n" + "> > +\tif (mode == JPU_ENCODE)\n" + "> > +\t\tfmt_flag = (fmt_type == JPU_FMT_TYPE_OUTPUT) ?\n" "> > JPU_ENC_OUTPUT :\n" "> > +\n" "> > JPU_ENC_CAPTURE;\n" "> > +\telse\n" - "> > +\t\tfmt_flag = (fmt_type = JPU_FMT_TYPE_OUTPUT) ?\n" + "> > +\t\tfmt_flag = (fmt_type == JPU_FMT_TYPE_OUTPUT) ?\n" "> > JPU_DEC_OUTPUT :\n" "> > +\n" "> > JPU_DEC_CAPTURE; +\n" "> > +\tfor (k = 0; k < ARRAY_SIZE(jpu_formats); k++) {\n" "> > +\t\tstruct jpu_fmt *fmt = &jpu_formats[k];\n" "> > +\n" - "> > +\t\tif (fmt->fourcc = pixelformat &&\n" + "> > +\t\tif (fmt->fourcc == pixelformat &&\n" "> > +\t\t\tfmt->types & fmt_flag) {\n" "> > +\t\t\treturn fmt;\n" "> > +\t\t}\n" @@ -726,7 +727,7 @@ "> > +\tfor (i = 0; i < ARRAY_SIZE(jpu_formats); ++i) {\n" "> > +\t\tif (jpu_formats[i].types & type) {\n" "> > +\t\t\t/* index-th format of type type found ? */\n" - "> > +\t\t\tif (num = f->index)\n" + "> > +\t\t\tif (num == f->index)\n" "> > +\t\t\t\tbreak;\n" "> > +\t\t\t/*\n" "> > +\t\t\t * Correct type but haven't reached our\n" @@ -753,7 +754,7 @@ "> > +{\n" "> > +\tstruct jpu_ctx *ctx = fh_to_ctx(priv);\n" "> > +\n" - "> > +\tif (ctx->mode = JPU_ENCODE)\n" + "> > +\tif (ctx->mode == JPU_ENCODE)\n" "> > +\t\treturn jpu_enum_fmt(f, JPU_ENC_CAPTURE);\n" "> > +\n" "> > +\treturn jpu_enum_fmt(f, JPU_DEC_CAPTURE);\n" @@ -764,7 +765,7 @@ "> > +{\n" "> > +\tstruct jpu_ctx *ctx = fh_to_ctx(priv);\n" "> > +\n" - "> > +\tif (ctx->mode = JPU_ENCODE)\n" + "> > +\tif (ctx->mode == JPU_ENCODE)\n" "> > +\t\treturn jpu_enum_fmt(f, JPU_ENC_OUTPUT);\n" "> > +\n" "> > +\treturn jpu_enum_fmt(f, JPU_DEC_OUTPUT);\n" @@ -794,8 +795,8 @@ "> > +\tif (!vq)\n" "> > +\t\treturn -EINVAL;\n" "> > +\n" - "> > +\tif (f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE &&\n" - "> > +\t\tctx->mode = JPU_DECODE && !ctx->hdr_parsed)\n" + "> > +\tif (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE &&\n" + "> > +\t\tctx->mode == JPU_DECODE && !ctx->hdr_parsed)\n" "> > +\t\treturn -EINVAL;\n" "> > +\n" "> > +\tq_data = jpu_get_q_data(ctx, f->type);\n" @@ -841,7 +842,7 @@ "> > +{\n" "> > +\tstruct v4l2_pix_format *pix = &f->fmt.pix;\n" "> > +\n" - "> > +\tif (pix->field = V4L2_FIELD_ANY)\n" + "> > +\tif (pix->field == V4L2_FIELD_ANY)\n" "> > +\t\tpix->field = V4L2_FIELD_NONE;\n" "> > +\telse if (pix->field != V4L2_FIELD_NONE)\n" "> > +\t\treturn -EINVAL;\n" @@ -857,7 +858,7 @@ "> > JPU_HEIGHT_MIN,\n" "> > +\t\t\t JPU_HEIGHT_MAX, fmt->v_align);\n" "> > +\n" - "> > +\tif (fmt->fourcc = V4L2_PIX_FMT_JPEG) {\n" + "> > +\tif (fmt->fourcc == V4L2_PIX_FMT_JPEG) {\n" "> > +\t\tif (pix->sizeimage <= 0)\n" "> > +\t\t\tpix->sizeimage = PAGE_SIZE;\n" "> > +\t\tpix->bytesperline = 0;\n" @@ -981,7 +982,7 @@ "> > +\t\ts->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)\n" "> > +\t\treturn -EINVAL;\n" "> > +\n" - "> > +\t/* For JPEG blob active = default = bounds */\n" + "> > +\t/* For JPEG blob active == default == bounds */\n" "> > +\tswitch (s->target) {\n" "> > +\tcase V4L2_SEL_TGT_CROP:\n" "> > +\tcase V4L2_SEL_TGT_CROP_BOUNDS:\n" @@ -1014,7 +1015,7 @@ "> > +\n" "> > +\tspin_lock_irqsave(&ctx->jpu->slock, flags);\n" "> > +\n" - "> > +\tif (ctrl->id = V4L2_CID_JPEG_COMPRESSION_QUALITY)\n" + "> > +\tif (ctrl->id == V4L2_CID_JPEG_COMPRESSION_QUALITY)\n" "> > +\t\tctx->compr_quality = ctrl->val;\n" "> > +\n" "> > +\tspin_unlock_irqrestore(&ctx->jpu->slock, flags);\n" @@ -1035,17 +1036,22 @@ "> > +\t.vidioc_g_fmt_vid_cap\t\t= jpu_g_fmt,\n" "> > +\t.vidioc_g_fmt_vid_out\t\t= jpu_g_fmt,\n" "> > +\n" - "> > +\t.vidioc_try_fmt_vid_cap\t\t> > jpu_try_fmt_vid_cap,\n" - "> > +\t.vidioc_try_fmt_vid_out\t\t> > jpu_try_fmt_vid_out, +\n" + "> > +\t.vidioc_try_fmt_vid_cap\t\t=\n" + "> > jpu_try_fmt_vid_cap,\n" + "> > +\t.vidioc_try_fmt_vid_out\t\t=\n" + "> > jpu_try_fmt_vid_out, +\n" "> > +\t.vidioc_s_fmt_vid_cap\t\t= jpu_s_fmt_vid_cap,\n" "> > +\t.vidioc_s_fmt_vid_out\t\t= jpu_s_fmt_vid_out,\n" "> > +\n" - "> > +\t.vidioc_reqbufs\t\t\t> > v4l2_m2m_ioctl_reqbufs,\n" + "> > +\t.vidioc_reqbufs\t\t\t=\n" + "> > v4l2_m2m_ioctl_reqbufs,\n" "> > +\t.vidioc_querybuf\t\t= v4l2_m2m_ioctl_querybuf,\n" "> > +\t.vidioc_qbuf\t\t\t= v4l2_m2m_ioctl_qbuf,\n" - "> > +\t.vidioc_dqbuf\t\t\t> > v4l2_m2m_ioctl_dqbuf,\n" + "> > +\t.vidioc_dqbuf\t\t\t=\n" + "> > v4l2_m2m_ioctl_dqbuf,\n" "> > +\t.vidioc_streamon\t\t= v4l2_m2m_ioctl_streamon,\n" - "> > +\t.vidioc_streamoff\t\t> > v4l2_m2m_ioctl_streamoff, +\n" + "> > +\t.vidioc_streamoff\t\t=\n" + "> > v4l2_m2m_ioctl_streamoff, +\n" "> > +\t.vidioc_g_selection\t\t= jpu_g_selection,\n" "> > +};\n" "> > +\n" @@ -1055,7 +1061,7 @@ "> > +\n" "> > +\tv4l2_ctrl_handler_init(&ctx->ctrl_handler, 3);\n" "> > +\n" - "> > +\tif (ctx->mode = JPU_ENCODE) {\n" + "> > +\tif (ctx->mode == JPU_ENCODE) {\n" "> > +\t\tv4l2_ctrl_new_std(&ctx->ctrl_handler,\n" "> > &jpu_ctrl_ops,\n" "> > +\n" @@ -1066,7 +1072,7 @@ "> > +\tif (ctx->ctrl_handler.error)\n" "> > +\t\treturn ctx->ctrl_handler.error;\n" "> > +\n" - "> > +\tif (ctx->mode = JPU_DECODE)\n" + "> > +\tif (ctx->mode == JPU_DECODE)\n" "> > +\t\tctrl->flags |= V4L2_CTRL_FLAG_VOLATILE |\n" "> > +\t\t\t V4L2_CTRL_FLAG_READ_ONLY;\n" "> > +\n" @@ -1075,10 +1081,10 @@ "> > +\n" "> > +/*\n" "> > + *\n" - "> > ======================================\n" + "> > ============================================================================\n" "> > + * Queue operations\n" "> > + *\n" - "> > ======================================\n" + "> > ============================================================================\n" "> > + */\n" "> > +static int jpu_queue_setup(struct vb2_queue *vq,\n" "> > +\t\t\t const struct v4l2_format *fmt,\n" @@ -1100,7 +1106,7 @@ "> > +\t * in the context so we do not allow another buffer to\n" "> > overwrite it\n" "> > +\t */\n" - "> > +\tif (ctx->mode = JPU_DECODE)\n" + "> > +\tif (ctx->mode == JPU_DECODE)\n" "> > +\t\tcount = 1;\n" "> > +\n" "> > +\t*nbuffers = count;\n" @@ -1135,8 +1141,8 @@ "> > +{\n" "> > +\tstruct jpu_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue);\n" "> > +\n" - "> > +\tif (ctx->mode = JPU_DECODE &&\n" - "> > +\t\tvb->vb2_queue->type = V4L2_BUF_TYPE_VIDEO_OUTPUT)\n" + "> > +\tif (ctx->mode == JPU_DECODE &&\n" + "> > +\t\tvb->vb2_queue->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)\n" "> > {\n" "> > +\t\tstruct jpu_q_data *q_data;\n" "> > +\t\tstruct jpu *jpu = ctx->jpu;\n" @@ -1167,7 +1173,7 @@ "> > +\n" "> > msecs_to_jiffies(100)) > 0\n" "> > +\t\t\t\t\t\t &&\n" - "> > jpu->status = JPU_OK)\n" + "> > jpu->status == JPU_OK)\n" "> > +\t\t\tctx->hdr_parsed = true;\n" "> > +\n" "> > +\t\tw_out = ioread32(jpu->regs + JCHSZU) << 8 |\n" @@ -1213,7 +1219,8 @@ "> > subsampling,\n" "> > +\n" "> > JPU_FMT_TYPE_CAPTURE); +\n" - "> > +\t\tq_data->size > > +\t\t\t(q_data->w * q_data->h *\n" + "> > +\t\tq_data->size =\n" + "> > +\t\t\t(q_data->w * q_data->h *\n" "> > q_data->fmt->depth) >> 3;\n" "> > +\t}\n" "> > +\n" @@ -1273,10 +1280,10 @@ "> > +\n" "> > +/*\n" "> > + *\n" - "> > ======================================\n" + "> > ============================================================================\n" "> > + * Device file operations\n" "> > + *\n" - "> > ======================================\n" + "> > ============================================================================\n" "> > + */\n" "> > +static int jpu_open(struct file *file)\n" "> > +{\n" @@ -1301,7 +1308,7 @@ "> > +\tv4l2_fh_add(&ctx->fh);\n" "> > +\n" "> > +\tctx->jpu = jpu;\n" - "> > +\tif (vfd = jpu->vfd_encoder) {\n" + "> > +\tif (vfd == jpu->vfd_encoder) {\n" "> > +\t\tctx->mode = JPU_ENCODE;\n" "> > +\t\tout_fmt = jpu_find_format(ctx->mode,\n" "> > V4L2_PIX_FMT_NV16,\n" @@ -1334,7 +1341,7 @@ "> > +\tif (ret < 0)\n" "> > +\t\tgoto error;\n" "> > +\n" - "> > +\tif (jpu->ref_count = 0) {\n" + "> > +\tif (jpu->ref_count == 0) {\n" "> > +\t\tret = clk_prepare_enable(jpu->clk);\n" "> > +\t\tif (ret < 0)\n" "> > +\t\t\tgoto error;\n" @@ -1360,7 +1367,7 @@ "> > +\tstruct jpu_ctx *ctx = fh_to_ctx(file->private_data);\n" "> > +\n" "> > +\tmutex_lock(&jpu->mutex);\n" - "> > +\tif (--jpu->ref_count = 0)\n" + "> > +\tif (--jpu->ref_count == 0)\n" "> > +\t\tclk_disable_unprepare(jpu->clk);\n" "> > +\tv4l2_m2m_ctx_release(ctx->fh.m2m_ctx);\n" "> > +\tv4l2_ctrl_handler_free(&ctx->ctrl_handler);\n" @@ -1383,10 +1390,10 @@ "> > +\n" "> > +/*\n" "> > + *\n" - "> > ======================================\n" + "> > ============================================================================\n" "> > + * mem2mem callbacks\n" "> > + *\n" - "> > ======================================\n" + "> > ============================================================================\n" "> > + */\n" "> > +static void jpu_device_run(void *priv)\n" "> > +{\n" @@ -1407,7 +1414,7 @@ "> > +\n" "> > +\tjpu_reset(jpu->regs);\n" "> > +\n" - "> > +\tif (ctx->mode = JPU_ENCODE) {\n" + "> > +\tif (ctx->mode == JPU_ENCODE) {\n" "> > +\t\tunsigned int redu, inft;\n" "> > +\n" "> > +\t\tw = ctx->out_q.w;\n" @@ -1415,7 +1422,7 @@ "> > +\n" "> > +\t\tjpu_generate_hdr(&ctx->out_q, ctx->compr_quality,\n" "> > dst_vaddr); +\n" - "> > +\t\tif (ctx->out_q.fmt->fourcc = V4L2_PIX_FMT_NV12) {\n" + "> > +\t\tif (ctx->out_q.fmt->fourcc == V4L2_PIX_FMT_NV12) {\n" "> > +\t\t\tredu = JCMOD_REDU_420;\n" "> > +\t\t\tinft = JIFECNT_INFT_420;\n" "> > +\t\t} else {\n" @@ -1491,7 +1498,7 @@ "> > +{\n" "> > +\tstruct jpu_ctx *ctx = priv;\n" "> > +\n" - "> > +\tif (ctx->mode = JPU_DECODE)\n" + "> > +\tif (ctx->mode == JPU_DECODE)\n" "> > +\t\treturn ctx->hdr_parsed;\n" "> > +\treturn 1;\n" "> > +}\n" @@ -1508,10 +1515,10 @@ "> > +\n" "> > +/*\n" "> > + *\n" - "> > ======================================\n" + "> > ============================================================================\n" "> > + * IRQ handler\n" "> > + *\n" - "> > ======================================\n" + "> > ============================================================================\n" "> > + */\n" "> > +static irqreturn_t jpu_irq_handler(int irq, void *dev_id)\n" "> > +{\n" @@ -1538,7 +1545,7 @@ "> > +\t\treturn IRQ_NONE;\n" "> > +\t}\n" "> > +\n" - "> > +\tif (jpu->status = JPU_BUSY) {\n" + "> > +\tif (jpu->status == JPU_BUSY) {\n" "> > +\t\tif (int_status & INT(3))\n" "> > +\t\t\tjpu->status = JPU_OK;\n" "> > +\t\tif (int_status & INT(5))\n" @@ -1556,7 +1563,7 @@ "> > +\tdst_buf = v4l2_m2m_dst_buf_remove(curr_ctx->fh.m2m_ctx);\n" "> > +\n" "> > +\tif (int_status & INT(10)) {\n" - "> > +\t\tif (curr_ctx->mode = JPU_ENCODE) {\n" + "> > +\t\tif (curr_ctx->mode == JPU_ENCODE) {\n" "> > +\t\t\tpayload_size = ioread32(jpu->regs +\n" "> > JCDTCU) << 16 |\n" "> > +\t\t\t\t ioread32(jpu->regs +\n" @@ -1584,10 +1591,10 @@ "> > +\n" "> > +/*\n" "> > + *\n" - "> > ======================================\n" + "> > ============================================================================\n" "> > + * Driver basic infrastructure\n" "> > + *\n" - "> > ======================================\n" + "> > ============================================================================\n" "> > + */\n" "> > +static const struct of_device_id jpu_dt_ids[] = {\n" "> > +\t{ .compatible = \"renesas,jpu-r8a7790\" },\n" @@ -1783,7 +1790,7 @@ "> > +{\n" "> > +\tstruct jpu *jpu = dev_get_drvdata(dev);\n" "> > +\n" - "> > +\tif (jpu->ref_count = 0)\n" + "> > +\tif (jpu->ref_count == 0)\n" "> > +\t\treturn 0;\n" "> > +\n" "> > +\tclk_disable_unprepare(jpu->clk);\n" @@ -1829,4 +1836,4 @@ "> > \n" > -3aa03f45ddf27ffed5f347b70666bb2c61fd4cfa7615990e90b1a6dc6adb2088 +226d8fdf9b8f125cbb3d3ed93662f5b5f1ed6d29277378f43ce1fdc270821d99
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.