A few patches make s5p-mfc work with Gstreamer
cover A few patches make s5p-mfc work with Gstreamer
A user-space application will follow the V4l2 document, but I meet a problem when I test it with Gstreamer. I look at the V4l2 document, the driver check the external setting which the document not cover, so that is what the second patch do.
The first patch comes from chromium project, but I didn't find it is merged, so I sent it again with new kernel API. But I have not test it with 4.6-rc6, as I meet sysmmu problem there.
But all those patches have been confirmed at Linux 4.1.16.
ayaka (3):
[media] s5p-mfc: Add handling of buffer freeing reqbufs request [media] s5p-mfc: remove unnecessary check in try_fmt [media] s5p-mfc: fix a typo in s5p_mfc_dec
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 2 +- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-)
Signature · 1 line
2.5.5
PATCH 1/3 s5p-mfc: Add handling of buffer freeing reqbufs request
The encoder forget the work to call hardware to release its buffers. This patch came from chromium project. I just change its code style and make the API match with new kernel.
--- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +3 -0
@@ -1144,7 +1144,10 @@ static int vidioc_reqbufs(struct file *file, void *priv,return -EINVAL ;if (reqbufs->type ==V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ) {if (reqbufs->count ==0 ) { +mfc_debug (2 ,"Freeing buffers\n" ); ret =vb2_reqbufs (&ctx->vq_dst, reqbufs); +s5p_mfc_hw_call (dev->mfc_ops, release_codec_buffers, + ctx); ctx->capture_state =QUEUE_FREE ;return ret; }
Signature · 1 line
2.5.5
PATCH 2/3 s5p-mfc: remove unnecessary check in try_fmt
In reply to ayakaWe don't need to request the sizeimage or num_planes in try_fmt.
--- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +0 -9
@@ -1043,10 +1043,6 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f)mfc_err ("failed to try output format\n" );return -EINVAL ; } -if (pix_fmt_mp->plane_fmt[0 ].sizeimage ==0 ) { -mfc_err ("must be set encoding output size\n" ); -return -EINVAL ; - }if ((dev->variant->version_bit & fmt->versions) ==0 ) {mfc_err ("Unsupported format by this MFC version.\n" );return -EINVAL ;
@@ -1060,11 +1056,6 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f)mfc_err ("failed to try output format\n" );return -EINVAL ; } - -if (fmt->num_planes != pix_fmt_mp->num_planes) { -mfc_err ("failed to try output format\n" ); -return -EINVAL ; - }if ((dev->variant->version_bit & fmt->versions) ==0 ) {mfc_err ("Unsupported format by this MFC version.\n" );return -EINVAL ;
Signature · 1 line
2.5.5
PATCH 3/3 s5p-mfc: fix a typo in s5p_mfc_dec
In reply to ayakaIt is a cosmetic commit.
--- drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +1 -1
@@ -573,7 +573,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,struct s5p_mfc_ctx *ctx =fh_to_ctx (priv);if (reqbufs->memory !=V4L2_MEMORY_MMAP ) { -mfc_err ("Only V4L2_MEMORY_MAP is supported\n" ); +mfc_err ("Only V4L2_MEMORY_MMAP is supported\n" );return -EINVAL ; }
Signature · 1 line
2.5.5