Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp3666266ybg; Sun, 7 Jun 2020 06:57:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkbi+vCY/IMwyamjuN5KwbXBv82LkTCuCr/tYvR7XzPAqdn7QqLlOVvinP6H3QTaoxW1bn X-Received: by 2002:a05:6402:5:: with SMTP id d5mr18300945edu.247.1591538228755; Sun, 07 Jun 2020 06:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591538228; cv=none; d=google.com; s=arc-20160816; b=aybWT5LEUzKwtCuKmeDaGwtQVnbXguEuyooHCgP9Y2qJXzDaIR6JzCy8YmV+1kt/5s xG1U+iaGxGiS96W0NnjqUpPcY+L3kOysQaWGS6skrNV+tfT1KwWN2VSQdnvOe8XgNLxQ 9f3zE3MJxsTHPNZZg4wE4Mvy/G6tuagZ66Sp0igzzysxIm4sA+V+GUBgUvCFNGPje2bo il6MI7DdU+w0PyUCdipvikBlwOQ8iBUi/7SBfQf1HJTNLV+NJ9LAXnTjN/3iy35UpXFc HsSPtwdkYpp9vCOYpdPgDuqnZiAopl+cP+jbfSPzTghZzs6MbsPTczgdyBqs/ncRWlQL laTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=2vRbY4KOtns2itvV4Abjc+mSm6ew8Al41Vyl7F7LcdA=; b=0zSeTqMxV+1INbTBaZf17l6xKUIbueUt6BBR9XImTUUScUPaRJyP6wj9RYUi4O2djM 5kasJMfskNVe9rilsa1E9zSwnIa/YSf9YqVd1/L0RwFZXqlwLRktpnmk3jT2Otmx9MNA ptt1uePGoJf5W7Jq6uu65WPegYjL4nJJZwRAsem7kxHGbt3T3UCJyBSIaP5HnBlfseih i5w4IUQqwss5UaKSXTbKnpTxVuVbMT/URw70UH/QcDh5gZyCEVGKSFLH6FFgrOv14R6S +q7J6eZcTzxO1cZ1dyhIqd3hIbgPmrw3YyM5JaZ4mg3F3mvLYcmalKambJs1yNV4PvGV E2Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@es-iitr-ac-in.20150623.gappssmtp.com header.s=20150623 header.b=pkqJ9LWq; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=iitr.ac.in Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h11si7487527ejc.87.2020.06.07.06.56.46; Sun, 07 Jun 2020 06:57:08 -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 header.i=@es-iitr-ac-in.20150623.gappssmtp.com header.s=20150623 header.b=pkqJ9LWq; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=iitr.ac.in Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726651AbgFGNxe (ORCPT + 99 others); Sun, 7 Jun 2020 09:53:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbgFGNxe (ORCPT ); Sun, 7 Jun 2020 09:53:34 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02B77C08C5C3 for ; Sun, 7 Jun 2020 06:53:34 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id b16so7298388pfi.13 for ; Sun, 07 Jun 2020 06:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=2vRbY4KOtns2itvV4Abjc+mSm6ew8Al41Vyl7F7LcdA=; b=pkqJ9LWqDAS5lRiZQyChQWq4Ql4oVB7yZYVmVP9QEO2MGsIa59vlJgAsGzKAgfE3Jy RHLPh+DxdnqnrKOA+dsbC+u5gow9pNytetMHbFV74Wb2hor7Uif26+wGX07mn3BVf5az jx9FndQ7hd9l4HxGJWMDaDbVANiRUoDzyq9X0ip5Dipe2HiEV9rZQm88DfbCnvokZW7E UXd6dXr/L0ViHgnBu8zW1IALGI62NRvXYP1qL0573prf7awQYay639gplEXUcz/ad/Hz +bxvHEs1jhS4/U1RCHkzrxChD1xMPxeKANKwMfEj5i4hUjHgsaQ736oackQc7GsEDNwL Y66w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=2vRbY4KOtns2itvV4Abjc+mSm6ew8Al41Vyl7F7LcdA=; b=SA3t6xVV5rhvUV9gAzsuMJlfc9JsSDLahetgXQU1kR9NGUzAoYFJ9qmuXIQDnk2nEU znWhEBXO1rrOG9NC88ZOLocejy8cpkSC3EE7p52En0a+VSyW+UneY1xdqMHcuiKy1DX+ VP+tQUHAwZ2hJDFaF0BdtayMLLzIxPBNQ5+Uyr+W2BX13jQkwkV9eTQ1uJIPvIIbjpSJ 2igg7xN/AeqqOuZXhd/OggOgaEST7p50tQD2WbxR9bDg21JNPpB35o3zSfKaa2QPxse/ ZYSM8kaB6rbnGxhQ3rwFNjE5ghzVP/nJz1Cp+1qnCJHYBoHZ7FiH8RdTWzdtyJQlGNWz jh4w== X-Gm-Message-State: AOAM530ofJbu/3qmMLivkrSoAzWaeviSBae6ykAr+S3RNILHpTQk9ovc vZwWknR6X0XQwu5lwzKCSA3Isg== X-Received: by 2002:aa7:8506:: with SMTP id v6mr17711930pfn.303.1591538013449; Sun, 07 Jun 2020 06:53:33 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.174]) by smtp.gmail.com with ESMTPSA id 77sm4610313pfu.139.2020.06.07.06.53.29 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Jun 2020 06:53:32 -0700 (PDT) Date: Sun, 7 Jun 2020 19:23:25 +0530 From: Kaaira Gupta To: linux-media@vger.kernel.org, Helen Koike , Shuah Khan , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, kieran.bingham@ideasonboard.com, laurent.pinchart@ideasonboard.com Subject: [RFC PATCH] vimc: Add colors' order over test image Message-ID: <20200607135325.GA16838@kaaira-HP-Pavilion-Notebook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). 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); 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"); + tpg_gen_text(&vsen->tpg, basep, 1, 1, str); + return vsen->frame; } -- 2.17.1