Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4329777ybg; Mon, 8 Jun 2020 05:17:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZmfGpgHXYcH+leENQTZoqe0x35hH5CFy+MZDHQ1bWJbKypHCD57GexVo8TeEtV857GtMu X-Received: by 2002:a17:906:3590:: with SMTP id o16mr19909009ejb.506.1591618653588; Mon, 08 Jun 2020 05:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591618653; cv=none; d=google.com; s=arc-20160816; b=EITu8WwUkJ12QRAzTLx3AE+qSnCDw0JnUY8nC9sWC/gEX7aM+K59UJ6jE1xOvjdad+ hVj9e4kxp7ioX7v3PcLOSEIlAxIaORWnT/XDvpNB6aFEC11q33yOwf3FYZ1vKh+ThZVX /jSV3LYwDJrFp6GteshgwHp7E75G3F8BT1ie5qIJR77l899KjLib30zk7b4qu3VGTSoN MtuHIDZbjI2qJi5+nWMn/i02vHWS2JMhDDrzrldM319xDc5J/3XNxcXxLOx1up+zMxeG qdEDtEaMUsMZFmk6YkJuoL2qphBHZDM5RergUbKmINrqPrXF6nqBXfPK71OchmRuyHP6 VV/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=LG+ZpTz9C7ypBzn7QNrNwCiha54hEkQDIs2SmenQD/Y=; b=qHlrP3SUoYQH0KmRWKj0SOA1kwlci6EWv4zW8p/gHva4IhMHNPq0knpYHTFJ32xkYS PLyAS7yqEhTLBTaQpQCBtvh5JZukloTpIQxUDxFfQfJaRSsIb/UChLzhdlMjSesqPfLA Dbj26b15uAjGCN+UXG9FwLl2n03QgmW6oKMF0HjZbwpNII1AxyZVktNqPl7C6daBrGGx vk/+f6eqoZGLeR6JBj4i6lTpb2q096C+yE9NRv6jyQHy/XJrx2yKyof5RNtgp+rpTv8z 5BJ7q3CUFCPfTzaJHuqB7qDPcMjhQEEKZPB5vxKQ6FlqHBWYO/mhP2hLidmxKTvQnRxZ 3WAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="ijmXl/xy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si8126565ejn.435.2020.06.08.05.17.11; Mon, 08 Jun 2020 05:17:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="ijmXl/xy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729721AbgFHMNA (ORCPT + 99 others); Mon, 8 Jun 2020 08:13:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729644AbgFHMM7 (ORCPT ); Mon, 8 Jun 2020 08:12:59 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45350C08C5C2; Mon, 8 Jun 2020 05:12:59 -0700 (PDT) Received: from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AD32D2C9; Mon, 8 Jun 2020 14:12:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1591618377; bh=v6RTJWuXMkECLHzVE4fQZJvBLgBCPytLELdCgrurFP8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ijmXl/xy6GwWhq1m+5PG+qpIYp/wvWZpxKPyBCCs74wPMLPnwedA/UUlRWWyB+tYi M/IcF3oSFqLXhuZvSVvqsViokYbSuTkYGAxqb5G8KAP1YpNG3Y/UI13XnQ0HjpE4VX S7UNILCTCqdh0XZwZ8htghB2apaGTHQWVhMabWUQ= Date: Mon, 8 Jun 2020 15:12:38 +0300 From: Laurent Pinchart To: Hans Verkuil Cc: Dafna Hirschfeld , Kaaira Gupta , linux-media@vger.kernel.org, Helen Koike , Shuah Khan , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, kieran.bingham@ideasonboard.com Subject: Re: [RFC PATCH] vimc: Add colors' order over test image Message-ID: <20200608121238.GB5896@pendragon.ideasonboard.com> References: <20200607135325.GA16838@kaaira-HP-Pavilion-Notebook> <5866f6c9-36c7-ffe3-41b3-94f184cd9e5d@collabora.com> <38db03a4-6b22-c341-103c-ed0d4dcce856@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <38db03a4-6b22-c341-103c-ed0d4dcce856@xs4all.nl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, Jun 08, 2020 at 11:33:21AM +0200, Hans Verkuil wrote: > On 08/06/2020 09:10, Dafna Hirschfeld wrote: > > On 07.06.20 15:53, Kaaira Gupta wrote: > >> Currently there is no method to know if the test image generated by vimc > >> is correct (except for comparing it with a known 'correct' image). Add > >> text over the test image, representing the correct order of colors. > >> > >> I have sent it as an RFC because we can add the text as an optional > >> control, and maybe we can print some other useful information as well > >> (like vivid does). > > > > Yes, it seems like a good idea to add it as a control of the sensor. > > > >> Signed-off-by: Kaaira Gupta > >> ---> drivers/media/test-drivers/vimc/Kconfig | 2 ++ > >> drivers/media/test-drivers/vimc/vimc-core.c | 9 +++++++++ > >> drivers/media/test-drivers/vimc/vimc-sensor.c | 8 ++++++++ > >> 3 files changed, 19 insertions(+) > >> > >> diff --git a/drivers/media/test-drivers/vimc/Kconfig b/drivers/media/test-drivers/vimc/Kconfig > >> index 4068a67585f9..da4b2ad6e40c 100644 > >> --- a/drivers/media/test-drivers/vimc/Kconfig > >> +++ b/drivers/media/test-drivers/vimc/Kconfig > >> @@ -2,6 +2,8 @@ > >> config VIDEO_VIMC > >> tristate "Virtual Media Controller Driver (VIMC)" > >> depends on VIDEO_DEV && VIDEO_V4L2 > >> + select FONT_SUPPORT > >> + select FONT_8x16 > >> select MEDIA_CONTROLLER > >> select VIDEO_V4L2_SUBDEV_API > >> select VIDEOBUF2_VMALLOC > >> diff --git a/drivers/media/test-drivers/vimc/vimc-core.c b/drivers/media/test-drivers/vimc/vimc-core.c > >> index 11210aaa2551..8142bfbcbd49 100644 > >> --- a/drivers/media/test-drivers/vimc/vimc-core.c > >> +++ b/drivers/media/test-drivers/vimc/vimc-core.c > >> @@ -5,10 +5,12 @@ > >> * Copyright (C) 2015-2017 Helen Koike > >> */ > >> > >> +#include > >> #include > >> #include > >> #include > >> #include > >> +#include > >> #include > >> > >> #include "vimc-common.h" > >> @@ -265,7 +267,14 @@ static int vimc_probe(struct platform_device *pdev) > >> { > >> struct vimc_device *vimc; > >> int ret; > >> + const struct font_desc *font = find_font("VGA8x16"); > >> > >> + if (font == NULL) { > >> + pr_err("vimc: could not find font\n"); > >> + return -ENODEV; > >> + } > >> + > >> + tpg_set_font(font->data); > > > > I think the code that set the format should move to the > > code that registers the sensor in vimc-sensor.c > > > >> dev_dbg(&pdev->dev, "probe"); > >> > >> vimc = kzalloc(sizeof(*vimc), GFP_KERNEL); > >> diff --git a/drivers/media/test-drivers/vimc/vimc-sensor.c b/drivers/media/test-drivers/vimc/vimc-sensor.c > >> index a2f09ac9a360..4b13955c502a 100644 > >> --- a/drivers/media/test-drivers/vimc/vimc-sensor.c > >> +++ b/drivers/media/test-drivers/vimc/vimc-sensor.c > >> @@ -185,10 +185,18 @@ static const struct v4l2_subdev_pad_ops vimc_sen_pad_ops = { > >> static void *vimc_sen_process_frame(struct vimc_ent_device *ved, > >> const void *sink_frame) > >> { > >> + u8 *basep[TPG_MAX_PLANES][2]; > >> + char str[100]; > >> struct vimc_sen_device *vsen = container_of(ved, struct vimc_sen_device, > >> ved); > >> > >> + tpg_calc_text_basep(&vsen->tpg, basep, 0, vsen->frame); > >> tpg_fill_plane_buffer(&vsen->tpg, 0, 0, vsen->frame); > >> + > >> + snprintf(str, sizeof(str), > >> + "Order: white, yellow, cyan, green, magenta, red, blue, black"); > > The colors are generated by the tpg, so I think it should be a feature of the tpg to print the colors. > > I agree. The tpg knows where each color is and based on the width and height it can > print the text. A tpg_gen_pattern_text() function that does the work would be very > nice. Could we go one step further, and print the colour name on each colour bar ? > It also doesn't make sense for all patterns, so this is really a nice feature to > incorporate into the TPG itself and enable it via a vivid and vimc control. > > > For example, a function in v4l2-tpg-core.c that get the pattern as an argument and return > > this string, or maybe returns a const pointer to the array of colors, or something like that. > > Then maybe we can add a control in vivid for the same tpg feature. > > > > Note also that the sensor has a control to change the pattern: vimc_sen_ctrl_test_pattern > > So the string depends on that pattern. > > > >> + tpg_gen_text(&vsen->tpg, basep, 1, 1, str); > >> + > >> return vsen->frame; > >> } > >> -- Regards, Laurent Pinchart