mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
s5p-mfc: Handle 'v4l2_pix_format:field' in try_fmt and g_fmt
It is required by the standard that the field order is set by the driver, default to NONE in case any is provided, but we can basically accept any value provided by the userspace as we will anyway not be able to do any deinterlacing. In this patch we also make sure to pass the interlacing mode provided by userspace from the output to the capture side of the device so that the information is given back to userspace. This way it can handle it and potentially deinterlace afterward. Signed-off-by: Thibault Saunier <thibault.saunier@osg.samsung.com> Series-to: linux-kernel@vger.kernel.org Series-cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>, Andi Shyti <andi.shyti@samsung.com>, Thibault Saunier <thibault.saunier@osg.samsung.com>, Shuah Khan <shuahkh@osg.samsung.com>, Inki Dae <inki.dae@samsung.com>, Nicolas Dufresne <nicolas.dufresne@collabora.com>, Javier Martinez Canillas <javier@osg.samsung.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Marek Szyprowski <m.szyprowski@samsung.com>, Kukjin Kim <kgene@kernel.org>, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki <s.nawrocki@samsung.com>, linux-media@vger.kernel.org, Krzysztof Kozlowski <krzk@kernel.org>, linux-arm-kernel@lists.infradead.org, Ulf Hansson <ulf.hansson@linaro.org> Cover-letter: Fixes for colorspace logic in exynos-gsc and s5p-mfc drivers Hello, This patchset fixes a few issues on the colorspace logic for the exynos-gsc and s5p-mfc drivers. We now handle the colorspace in those drivers, and make sure to respect user setting if possible. We also now set the 'v4l2_pix_format:field' if userspace passed ANY, and replicate users value on the capture side. This is the sixth version of the patch serie. Best regards, Thibault Saunier END Series-version: 6 Series-changes: 2 - Fix a silly build error that slipped in while rebasing the patches Series-changes: 3 - Do not check values in the g_fmt functions as Andrzej explained in previous review Series-changes: 5 - Just adapt the field and never error out. Series-changes: 6 - Pass user output field value to the capture as the device is not doing any deinterlacing and thus decoded content will still be interlaced on the output.
This commit is contained in:
committed by
Mauro (mdrjr) Ribeiro
parent
9403aeaf8a
commit
67837d4fb6
@@ -641,6 +641,8 @@ struct s5p_mfc_ctx {
|
||||
size_t me_buffer_size;
|
||||
size_t tmv_buffer_size;
|
||||
|
||||
enum v4l2_field field;
|
||||
|
||||
enum v4l2_mpeg_mfc51_video_force_frame_type force_frame_type;
|
||||
|
||||
struct list_head ref_queue;
|
||||
|
||||
@@ -345,7 +345,7 @@ static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f)
|
||||
rectangle. */
|
||||
pix_mp->width = ctx->buf_width;
|
||||
pix_mp->height = ctx->buf_height;
|
||||
pix_mp->field = V4L2_FIELD_NONE;
|
||||
pix_mp->field = ctx->field;
|
||||
pix_mp->num_planes = 2;
|
||||
/* Set pixelformat to the format in which MFC
|
||||
outputs the decoded frame */
|
||||
@@ -380,6 +380,9 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f)
|
||||
struct s5p_mfc_dev *dev = video_drvdata(file);
|
||||
struct s5p_mfc_fmt *fmt;
|
||||
|
||||
if (f->fmt.pix.field == V4L2_FIELD_ANY)
|
||||
f->fmt.pix.field = V4L2_FIELD_NONE;
|
||||
|
||||
mfc_debug(2, "Type is %d\n", f->type);
|
||||
if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
|
||||
fmt = find_format(f, MFC_FMT_DEC);
|
||||
@@ -436,6 +439,7 @@ static int vidioc_s_fmt(struct file *file, void *priv, struct v4l2_format *f)
|
||||
goto out;
|
||||
} else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
|
||||
/* src_fmt is validated by call to vidioc_try_fmt */
|
||||
ctx->field = f->fmt.pix.field;
|
||||
ctx->src_fmt = find_format(f, MFC_FMT_DEC);
|
||||
ctx->codec_mode = ctx->src_fmt->codec_mode;
|
||||
mfc_debug(2, "The codec number is: %d\n", ctx->codec_mode);
|
||||
|
||||
Reference in New Issue
Block a user