From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2759CC433E0 for ; Sun, 7 Jun 2020 13:53:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E3ABC2067B for ; Sun, 7 Jun 2020 13:53:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=es-iitr-ac-in.20150623.gappssmtp.com header.i=@es-iitr-ac-in.20150623.gappssmtp.com header.b="pkqJ9LWq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726663AbgFGNxf (ORCPT ); Sun, 7 Jun 2020 09:53:35 -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-Google-Smtp-Source: ABdhPJwdpj4ZwamU05hG0KQmIvoD0WamjgfDFFYtmjeTTgBJhoo3BbvUo29iRqr+j1rjX3ZTfJt4Mg== 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