From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benoit Parrot Subject: [Patch v2 10/21] media: ti-vpe: vpe: Make sure YUYV is set as default format Date: Fri, 4 Oct 2019 11:29:41 -0500 Message-ID: <20191004162952.4963-11-bparrot@ti.com> References: <20191004162952.4963-1-bparrot@ti.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <20191004162952.4963-1-bparrot@ti.com> Sender: linux-kernel-owner@vger.kernel.org To: Hans Verkuil Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Benoit Parrot List-Id: devicetree@vger.kernel.org v4l2-compliance fails with this message: fail: v4l2-test-formats.cpp(672): \ Video Capture Multiplanar: TRY_FMT(G_FMT) != G_FMT fail: v4l2-test-formats.cpp(672): \ Video Output Multiplanar: TRY_FMT(G_FMT) != G_FMT ... test VIDIOC_TRY_FMT: FAIL Fixes: 94ed726e8e01 ("media: ti-vpe: Add support for NV21 format") The default pixel format was setup as pointing to a specific offset in the vpe_formats table assuming it was pointing to the V4L2_PIX_FMT_YUYV entry. This became false after the addition on the NV21 format (see above commid-id) So instead of hard-coding an offset which might change over time we need to use a lookup helper instead so we know the default will always be what we intended. Signed-off-by: Benoit Parrot Reviewed-by: Tomi Valkeinen --- drivers/media/platform/ti-vpe/vpe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c index d3f1ae8b72fa..7aa83026fb6c 100644 --- a/drivers/media/platform/ti-vpe/vpe.c +++ b/drivers/media/platform/ti-vpe/vpe.c @@ -2321,7 +2321,7 @@ static int vpe_open(struct file *file) v4l2_ctrl_handler_setup(hdl); s_q_data = &ctx->q_data[Q_DATA_SRC]; - s_q_data->fmt = &vpe_formats[2]; + s_q_data->fmt = __find_format(V4L2_PIX_FMT_YUYV); s_q_data->width = 1920; s_q_data->height = 1080; s_q_data->nplanes = 1; -- 2.17.1