Hi Justin, Le mercredi 01 juin 2022 à 10:00 -0400, Justin Green a écrit : > Sure thing! Sorry about that, I think something got messed up with the > tabs. I've switched the "=" padding to spaces to spacing to make sure > everything is consistent. I think the removals part of the diff might > still look odd on some clients because of the tabs though. Best practice to to not mix style and functional changes, unless trivial. So if you want to change the style, add a second patch. Otherwise just maintain the original style (my recommendation). By the way you can add: Suggested-by: Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx> I'd be very interested to learn from Sergey on why this feature wasn't enable more broadly. I notice though the begin/end access bits have not been implemented, so when used with DMABuf, this isn't going to behave quite right by default. I also notice that the code make no use of the attached device dma_coherent flag, so another case were this feature would get some help before being generalized. > > > diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c > b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c > index 52e5d36aa912..6a47b34c5bc9 100644 > --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c > +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c > @@ -929,30 +929,32 @@ int mtk_vcodec_dec_queue_init(void *priv, struct > vb2_queue *src_vq, > > mtk_v4l2_debug(3, "[%d]", ctx->id); > > - src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; > - src_vq->io_modes = VB2_DMABUF | VB2_MMAP; > - src_vq->drv_priv = ctx; > - src_vq->buf_struct_size = sizeof(struct mtk_video_dec_buf); > - src_vq->ops = ctx->dev->vdec_pdata->vdec_vb2_ops; > - src_vq->mem_ops = &vb2_dma_contig_memops; > - src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; > - src_vq->lock = &ctx->dev->dev_mutex; > - src_vq->dev = &ctx->dev->plat_dev->dev; > + src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; > + src_vq->io_modes = VB2_DMABUF | VB2_MMAP; > + src_vq->drv_priv = ctx; > + src_vq->buf_struct_size = sizeof(struct mtk_video_dec_buf); > + src_vq->ops = ctx->dev->vdec_pdata->vdec_vb2_ops; > + src_vq->mem_ops = &vb2_dma_contig_memops; > + src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; > + src_vq->lock = &ctx->dev->dev_mutex; > + src_vq->dev = &ctx->dev->plat_dev->dev; > + src_vq->allow_cache_hints = 1; As a side effect, you'll only have this line added, no noise around it. > > ret = vb2_queue_init(src_vq); > if (ret) { > mtk_v4l2_err("Failed to initialize videobuf2 queue(output)"); > return ret; > } > - dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; > - dst_vq->io_modes = VB2_DMABUF | VB2_MMAP; > - dst_vq->drv_priv = ctx; > - dst_vq->buf_struct_size = sizeof(struct mtk_video_dec_buf); > - dst_vq->ops = ctx->dev->vdec_pdata->vdec_vb2_ops; > - dst_vq->mem_ops = &vb2_dma_contig_memops; > - dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; > - dst_vq->lock = &ctx->dev->dev_mutex; > - dst_vq->dev = &ctx->dev->plat_dev->dev; > + dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; > + dst_vq->io_modes = VB2_DMABUF | VB2_MMAP; > + dst_vq->drv_priv = ctx; > + dst_vq->buf_struct_size = sizeof(struct mtk_video_dec_buf); > + dst_vq->ops = ctx->dev->vdec_pdata->vdec_vb2_ops; > + dst_vq->mem_ops = &vb2_dma_contig_memops; > + dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; > + dst_vq->lock = &ctx->dev->dev_mutex; > + dst_vq->dev = &ctx->dev->plat_dev->dev; > + dst_vq->allow_cache_hints = 1; > > ret = vb2_queue_init(dst_vq); > if (ret)