From 547e4995ac18091913e0500d09374a241bcae59d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Thu, 13 Feb 2025 00:13:48 +0100 Subject: Propagate the test-pattern size thru bytesused MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When reading test-pattern files from disk the size of the pattern must for the most cases match the configured size of each plane. The exception is compressed or otherwise special format indicated by the plane being configured with a bytesperline set to 0. In the special cases the pattern is read up-to the size of the file on disk and queued to the device. The size of the test pattern are however not propagated correctly in the bytesused filed of the buffer being queued to the vdev. This makes it impossible to queue meta buffers containing extendable parameters, e.g. V4L2_META_FMT_RK_ISP1_EXT_PARAMS, using yavta. As the RkISP1 driver uses the information stored in bytesused to figure out how much valid data there is in the buffer. Fix this by updating the size of the test-pattern when reading it from disk. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- yavta.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yavta.c b/yavta.c index c8706df..546b91d 100644 --- a/yavta.c +++ b/yavta.c @@ -1944,6 +1944,8 @@ static int video_load_test_pattern(struct device *dev, const char *filename) ret = -EINVAL; goto done; } + + size = ret; } else { uint8_t *data = dev->pattern[plane]; unsigned int i; -- cgit v1.2.3