[{"id":17422,"web_url":"https://patchwork.libcamera.org/comment/17422/","msgid":"<YL1h4Tg2vskiR2H/@pendragon.ideasonboard.com>","date":"2021-06-07T00:01:37","subject":"Re: [libcamera-devel] [PATCH v6 1/6] libcamera: controls: Add\n\tsensor test pattern mode","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hiro,\n\nThank you for the patch.\n\nOn Fri, May 28, 2021 at 12:05:26PM +0900, Hirokazu Honda wrote:\n> The control is used to report available sensor test pattern modes\n> and also specify the mode to sensor.\n> \n> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/control_ids.yaml | 58 ++++++++++++++++++++++++++++++++++\n>  1 file changed, 58 insertions(+)\n> \n> diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\n> index 88d81ac4..b1fe1dc6 100644\n> --- a/src/libcamera/control_ids.yaml\n> +++ b/src/libcamera/control_ids.yaml\n> @@ -615,4 +615,62 @@ controls:\n>          detection, additional format conversions etc) count as an additional\n>          pipeline stage.\n>  \n> +  - TestPatternMode:\n> +      type: int32_t\n> +      draft: true\n> +      description: |\n> +        Control to select the test pattern mode. Currently identical to\n> +        ANDROID_SENSOR_TEST_PATTERN_MODE.\n\nI'd add that the test pattern modes are identical to the ones defined by\nthe CCS specification. Maybe something along the lines of:\n\n\tThe modes are described in a pixel-perfect way in the MIPI\n\tCamera Command Set (https://www.mipi.org/specifications/camera-command-set)\n\tspecification.\n\nI've wondered for a long time how we could standardize test pattern\nmodes when there's no standard at the hardware level, and I've been\npointed out recently to the fact that CCS defines pixel-perfect test\npatterns (they are parametrized by a set of read-only parameters\nreported by the sensor though, the specification is worth a read). This\ncomes from the SMIA++ specification that also standardized test pattern\nmodes, but from what I've been told, not in a pixel-perfect way.\n\nApart from that, this looks good to me for now as it's a draft control.\nWe'll have to decide how to handle custom patterns once we destage this\ncontrol.\n\n> +      enum:\n> +        - name: TestPatternModeOff\n> +          value: 0\n> +          description: |\n> +            No test pattern mode is used. The camera device returns frames from\n> +            the image sensor.\n> +        - name: TestPatternModeSolidColor\n> +          value: 1\n> +          description: |\n> +            Each pixel in [R, G_even, G_odd, B] is replaced by its respective\n> +            color channel provided in test pattern data.\n> +            \\todo Add control for test pattern data.\n> +        - name: TestPatternModeColorBars\n> +          value: 2\n> +          description: |\n> +            All pixel data is replaced with an 8-bar color pattern. The vertical\n> +            bars (left-to-right) are as follows; white, yellow, cyan, green,\n> +            magenta, red, blue and black. Each bar should take up 1/8 of the\n> +            sensor pixel array width. When this is not possible, the bar size\n> +            should be rounded down to the nearest integer and the pattern can\n> +            repeat on the right side. Each bar's height must always take up the\n> +            full sensor pixel array height.\n> +        - name: TestPatternModeColorBarsFadeToGray\n> +          value: 3\n> +          description: |\n> +            The test pattern is similar to TestPatternModeColorBars,\n> +            except that each bar should start at its specified color at the top\n> +            and fade to gray at the bottom. Furthermore each bar is further\n> +            subdevided into a left and right half. The left half should have a\n> +            smooth gradient, and the right half should have a quantized\n> +            gradient. In particular, the right half's should consist of blocks\n> +            of the same color for 1/16th active sensor pixel array width. The\n> +            least significant bits in the quantized gradient should be copied\n> +            from the most significant bits of the smooth gradient. The height of\n> +            each bar should always be a multiple of 128. When this is not the\n> +            case, the pattern should repeat at the bottom of the image.\n> +        - name: TestPatternModePn9\n> +          value: 4\n> +          description: |\n> +            All pixel data is replaced by a pseudo-random sequence generated\n> +            from a PN9 512-bit sequence (typically implemented in hardware with\n> +            a linear feedback shift register). The generator should be reset at\n> +            the beginning of each frame, and thus each subsequent raw frame with\n> +            this test pattern should be exactly the same as the last.\n> +        - name: TestPatternModeCustom1\n> +          value: 5\n\nThis starts at 256 in the Android camera HAL API, I'd do the same as the\ncontrol is documented as being identical to\nANDROID_SENSOR_TEST_PATTERN_MODE.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +          description: |\n> +            The first custom test pattern. All custom patterns that are\n> +            available only on this camera device are at least this numeric\n> +            value. All of the custom test patterns will be static (that is the\n> +            raw image must not vary from frame to frame).\n> +\n>  ...","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id F3C7CC320B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Jun 2021 00:01:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6B2E368925;\n\tMon,  7 Jun 2021 02:01:52 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4A9BF68921\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Jun 2021 02:01:51 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B937D80F;\n\tMon,  7 Jun 2021 02:01:50 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"DmK3bN/4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1623024110;\n\tbh=zaJQ8+as5Q6xSFQAvJGU/88DD33rMwWeQEoe0aBbEtI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=DmK3bN/4XN2kRcoVi69mxn9/Jqd0VhK1o7pUsX8RMA1XdDuw0vnW/6paojC69NE+i\n\tzqKDdVm5F6YXaMjan5h3X44WXUsXm1TenwhShQ2fb4um2QU2sbdez2YLRd2nHOLRsl\n\tvRRypMwNLDkCiH5OanIww/9Reyfkts5HiM9ablhQ=","Date":"Mon, 7 Jun 2021 03:01:37 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YL1h4Tg2vskiR2H/@pendragon.ideasonboard.com>","References":"<20210528030531.189492-1-hiroh@chromium.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210528030531.189492-1-hiroh@chromium.org>","Subject":"Re: [libcamera-devel] [PATCH v6 1/6] libcamera: controls: Add\n\tsensor test pattern mode","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17429,"web_url":"https://patchwork.libcamera.org/comment/17429/","msgid":"<CAO5uPHNT=nDR8mvYNmHfhGOQt-Ag2vuKoPy+-kWuLbvQRMzDCg@mail.gmail.com>","date":"2021-06-07T01:07:55","subject":"Re: [libcamera-devel] [PATCH v6 1/6] libcamera: controls: Add\n\tsensor test pattern mode","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Laurent,\n\nOn Mon, Jun 7, 2021 at 9:01 AM Laurent Pinchart <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> Hi Hiro,\n>\n> Thank you for the patch.\n>\n> On Fri, May 28, 2021 at 12:05:26PM +0900, Hirokazu Honda wrote:\n> > The control is used to report available sensor test pattern modes\n> > and also specify the mode to sensor.\n> >\n> > Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/libcamera/control_ids.yaml | 58 ++++++++++++++++++++++++++++++++++\n> >  1 file changed, 58 insertions(+)\n> >\n> > diff --git a/src/libcamera/control_ids.yaml\n> b/src/libcamera/control_ids.yaml\n> > index 88d81ac4..b1fe1dc6 100644\n> > --- a/src/libcamera/control_ids.yaml\n> > +++ b/src/libcamera/control_ids.yaml\n> > @@ -615,4 +615,62 @@ controls:\n> >          detection, additional format conversions etc) count as an\n> additional\n> >          pipeline stage.\n> >\n> > +  - TestPatternMode:\n> > +      type: int32_t\n> > +      draft: true\n> > +      description: |\n> > +        Control to select the test pattern mode. Currently identical to\n> > +        ANDROID_SENSOR_TEST_PATTERN_MODE.\n>\n> I'd add that the test pattern modes are identical to the ones defined by\n> the CCS specification. Maybe something along the lines of:\n>\n>         The modes are described in a pixel-perfect way in the MIPI\n>         Camera Command Set (\n> https://www.mipi.org/specifications/camera-command-set)\n>         specification.\n>\n> I've wondered for a long time how we could standardize test pattern\n> modes when there's no standard at the hardware level, and I've been\n> pointed out recently to the fact that CCS defines pixel-perfect test\n> patterns (they are parametrized by a set of read-only parameters\n> reported by the sensor though, the specification is worth a read). This\n> comes from the SMIA++ specification that also standardized test pattern\n> modes, but from what I've been told, not in a pixel-perfect way.\n>\n>\nThanks Laurent for the info. The test pattern modes defined in CCS is\nalmost one-to-one correspondence to Android test pattern modes though 100%\ncolor tile is not defined in Android.\nTo test the test pattern modes in a pixel-perfect way, we have to tell a\nclient the parameters.\nI am fine to re-declare the test pattern mode control based on CCS\ndefinition, but testing them in a pixel-perfect way seems to require much\nmore work.\n\nRegards,\n-Hiro\n\n> Apart from that, this looks good to me for now as it's a draft control.\n> We'll have to decide how to handle custom patterns once we destage this\n> control.\n>\n> > +      enum:\n> > +        - name: TestPatternModeOff\n> > +          value: 0\n> > +          description: |\n> > +            No test pattern mode is used. The camera device returns\n> frames from\n> > +            the image sensor.\n> > +        - name: TestPatternModeSolidColor\n> > +          value: 1\n> > +          description: |\n> > +            Each pixel in [R, G_even, G_odd, B] is replaced by its\n> respective\n> > +            color channel provided in test pattern data.\n> > +            \\todo Add control for test pattern data.\n> > +        - name: TestPatternModeColorBars\n> > +          value: 2\n> > +          description: |\n> > +            All pixel data is replaced with an 8-bar color pattern. The\n> vertical\n> > +            bars (left-to-right) are as follows; white, yellow, cyan,\n> green,\n> > +            magenta, red, blue and black. Each bar should take up 1/8\n> of the\n> > +            sensor pixel array width. When this is not possible, the\n> bar size\n> > +            should be rounded down to the nearest integer and the\n> pattern can\n> > +            repeat on the right side. Each bar's height must always\n> take up the\n> > +            full sensor pixel array height.\n> > +        - name: TestPatternModeColorBarsFadeToGray\n> > +          value: 3\n> > +          description: |\n> > +            The test pattern is similar to TestPatternModeColorBars,\n> > +            except that each bar should start at its specified color at\n> the top\n> > +            and fade to gray at the bottom. Furthermore each bar is\n> further\n> > +            subdevided into a left and right half. The left half should\n> have a\n> > +            smooth gradient, and the right half should have a quantized\n> > +            gradient. In particular, the right half's should consist of\n> blocks\n> > +            of the same color for 1/16th active sensor pixel array\n> width. The\n> > +            least significant bits in the quantized gradient should be\n> copied\n> > +            from the most significant bits of the smooth gradient. The\n> height of\n> > +            each bar should always be a multiple of 128. When this is\n> not the\n> > +            case, the pattern should repeat at the bottom of the image.\n> > +        - name: TestPatternModePn9\n> > +          value: 4\n> > +          description: |\n> > +            All pixel data is replaced by a pseudo-random sequence\n> generated\n> > +            from a PN9 512-bit sequence (typically implemented in\n> hardware with\n> > +            a linear feedback shift register). The generator should be\n> reset at\n> > +            the beginning of each frame, and thus each subsequent raw\n> frame with\n> > +            this test pattern should be exactly the same as the last.\n> > +        - name: TestPatternModeCustom1\n> > +          value: 5\n>\n> This starts at 256 in the Android camera HAL API, I'd do the same as the\n> control is documented as being identical to\n> ANDROID_SENSOR_TEST_PATTERN_MODE.\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> > +          description: |\n> > +            The first custom test pattern. All custom patterns that are\n> > +            available only on this camera device are at least this\n> numeric\n> > +            value. All of the custom test patterns will be static (that\n> is the\n> > +            raw image must not vary from frame to frame).\n> > +\n> >  ...\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 79F3EC3206\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Jun 2021 01:08:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0A4BD68928;\n\tMon,  7 Jun 2021 03:08:07 +0200 (CEST)","from mail-ej1-x634.google.com (mail-ej1-x634.google.com\n\t[IPv6:2a00:1450:4864:20::634])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1260468921\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Jun 2021 03:08:06 +0200 (CEST)","by mail-ej1-x634.google.com with SMTP id ho18so12850847ejc.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 06 Jun 2021 18:08:06 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"B024VMW5\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=IGWh8HvV2mu4SJ4wLx1twoTFO5QT0gHxex3k5rbLQz4=;\n\tb=B024VMW5IG6ejB7l237qHoggx0dgA49FLrBf0bOysO+ZjAZpL/fy5lEEO2F8Ox5o2j\n\tkM9pmgfgixPE8MgKibtm1OFbTsNoFbDBgup0ICm94zp07WMKHEsXU7/zO2Qnl86c6zTp\n\tFLF1/U/2ZtlLItJf4cDZ6YKGno8sG1UoAxgSc=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=IGWh8HvV2mu4SJ4wLx1twoTFO5QT0gHxex3k5rbLQz4=;\n\tb=BgLQLEhiK6LBt/GETW4oA/6nsETLjwr4ai+xBx3ELPxEgC93VrB5uDIcd5uKm4iGLz\n\tDGtFJtPEdPVLTJYHZvml5dM5lGe1BpVhB9MD+34H6t0AKbNJIUCpUqjxRHNPs24a407F\n\tmbz13+ol6zMikc5D5UZhvnkRf4aMeZKoTzcuR/WHx8yD3QfPEFiO3252qH07K8Eez7Qk\n\tSmOfrVYILooT/wNRukXgWM3BObBozuD8xMBQVmCYWAUZUZL+w9jedZxaFpvjtxYGkI4E\n\t0hnkRLu9irI6KnNgnF/XtC1F9HaLBjasXUMrYopoVmDKM1n+6nSf55I0j1Xi0vw1cIA3\n\t3fNg==","X-Gm-Message-State":"AOAM532iKBgc9fFSDvGSzlYBUkvGGfMACTBsCYb4hPZqQgelWR7XJWcT\n\t/N0zUK6aC0/qwPh1Wdua0C29kpwF0LiiQZVGCemX0w==","X-Google-Smtp-Source":"ABdhPJwT8WTX4YRpvMzGBbd6PGJjVBWReSx1GJmXoXJVuP2jGB87M5Z26uXtzk48hnOa7H8+FMCRJdEdI7ygCba1/Uo=","X-Received":"by 2002:a17:906:55cb:: with SMTP id\n\tz11mr15546755ejp.475.1623028085759; \n\tSun, 06 Jun 2021 18:08:05 -0700 (PDT)","MIME-Version":"1.0","References":"<20210528030531.189492-1-hiroh@chromium.org>\n\t<YL1h4Tg2vskiR2H/@pendragon.ideasonboard.com>","In-Reply-To":"<YL1h4Tg2vskiR2H/@pendragon.ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Mon, 7 Jun 2021 10:07:55 +0900","Message-ID":"<CAO5uPHNT=nDR8mvYNmHfhGOQt-Ag2vuKoPy+-kWuLbvQRMzDCg@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"000000000000832ca105c422ac24\"","Subject":"Re: [libcamera-devel] [PATCH v6 1/6] libcamera: controls: Add\n\tsensor test pattern mode","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17453,"web_url":"https://patchwork.libcamera.org/comment/17453/","msgid":"<YL6US+7rqX6FuX0e@pendragon.ideasonboard.com>","date":"2021-06-07T21:48:59","subject":"Re: [libcamera-devel] [PATCH v6 1/6] libcamera: controls: Add\n\tsensor test pattern mode","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hiro,\n\nOn Mon, Jun 07, 2021 at 10:07:55AM +0900, Hirokazu Honda wrote:\n> On Mon, Jun 7, 2021 at 9:01 AM Laurent Pinchart wrote:\n> > On Fri, May 28, 2021 at 12:05:26PM +0900, Hirokazu Honda wrote:\n> > > The control is used to report available sensor test pattern modes\n> > > and also specify the mode to sensor.\n> > >\n> > > Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> > > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> > > ---\n> > >  src/libcamera/control_ids.yaml | 58 ++++++++++++++++++++++++++++++++++\n> > >  1 file changed, 58 insertions(+)\n> > >\n> > > diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\n> > > index 88d81ac4..b1fe1dc6 100644\n> > > --- a/src/libcamera/control_ids.yaml\n> > > +++ b/src/libcamera/control_ids.yaml\n> > > @@ -615,4 +615,62 @@ controls:\n> > >          detection, additional format conversions etc) count as an additional\n> > >          pipeline stage.\n> > >\n> > > +  - TestPatternMode:\n> > > +      type: int32_t\n> > > +      draft: true\n> > > +      description: |\n> > > +        Control to select the test pattern mode. Currently identical to\n> > > +        ANDROID_SENSOR_TEST_PATTERN_MODE.\n> >\n> > I'd add that the test pattern modes are identical to the ones defined by\n> > the CCS specification. Maybe something along the lines of:\n> >\n> >         The modes are described in a pixel-perfect way in the MIPI\n> >         Camera Command Set (https://www.mipi.org/specifications/camera-command-set)\n> >         specification.\n> >\n> > I've wondered for a long time how we could standardize test pattern\n> > modes when there's no standard at the hardware level, and I've been\n> > pointed out recently to the fact that CCS defines pixel-perfect test\n> > patterns (they are parametrized by a set of read-only parameters\n> > reported by the sensor though, the specification is worth a read). This\n> > comes from the SMIA++ specification that also standardized test pattern\n> > modes, but from what I've been told, not in a pixel-perfect way.\n>\n> Thanks Laurent for the info. The test pattern modes defined in CCS is\n> almost one-to-one correspondence to Android test pattern modes though 100%\n> color tile is not defined in Android.\n\nI think that's because both are based on SMIA++ (I have no proof for\nthis though).\n\n> To test the test pattern modes in a pixel-perfect way, we have to tell a\n> client the parameters.\n> I am fine to re-declare the test pattern mode control based on CCS\n> definition, but testing them in a pixel-perfect way seems to require much\n> more work.\n\nAgreed, I think it's not worth the extra work for now.\n\n> > Apart from that, this looks good to me for now as it's a draft control.\n> > We'll have to decide how to handle custom patterns once we destage this\n> > control.\n> >\n> > > +      enum:\n> > > +        - name: TestPatternModeOff\n> > > +          value: 0\n> > > +          description: |\n> > > +            No test pattern mode is used. The camera device returns frames from\n> > > +            the image sensor.\n> > > +        - name: TestPatternModeSolidColor\n> > > +          value: 1\n> > > +          description: |\n> > > +            Each pixel in [R, G_even, G_odd, B] is replaced by its respective\n> > > +            color channel provided in test pattern data.\n> > > +            \\todo Add control for test pattern data.\n> > > +        - name: TestPatternModeColorBars\n> > > +          value: 2\n> > > +          description: |\n> > > +            All pixel data is replaced with an 8-bar color pattern. The vertical\n> > > +            bars (left-to-right) are as follows; white, yellow, cyan, green,\n> > > +            magenta, red, blue and black. Each bar should take up 1/8 of the\n> > > +            sensor pixel array width. When this is not possible, the bar size\n> > > +            should be rounded down to the nearest integer and the pattern can\n> > > +            repeat on the right side. Each bar's height must always take up the\n> > > +            full sensor pixel array height.\n> > > +        - name: TestPatternModeColorBarsFadeToGray\n> > > +          value: 3\n> > > +          description: |\n> > > +            The test pattern is similar to TestPatternModeColorBars,\n> > > +            except that each bar should start at its specified color at the top\n> > > +            and fade to gray at the bottom. Furthermore each bar is further\n> > > +            subdevided into a left and right half. The left half should have a\n> > > +            smooth gradient, and the right half should have a quantized\n> > > +            gradient. In particular, the right half's should consist of blocks\n> > > +            of the same color for 1/16th active sensor pixel array width. The\n> > > +            least significant bits in the quantized gradient should be copied\n> > > +            from the most significant bits of the smooth gradient. The height of\n> > > +            each bar should always be a multiple of 128. When this is not the\n> > > +            case, the pattern should repeat at the bottom of the image.\n> > > +        - name: TestPatternModePn9\n> > > +          value: 4\n> > > +          description: |\n> > > +            All pixel data is replaced by a pseudo-random sequence generated\n> > > +            from a PN9 512-bit sequence (typically implemented in hardware with\n> > > +            a linear feedback shift register). The generator should be reset at\n> > > +            the beginning of each frame, and thus each subsequent raw frame with\n> > > +            this test pattern should be exactly the same as the last.\n> > > +        - name: TestPatternModeCustom1\n> > > +          value: 5\n> >\n> > This starts at 256 in the Android camera HAL API, I'd do the same as\n> > the control is documented as being identical to\n> > ANDROID_SENSOR_TEST_PATTERN_MODE.\n> > \n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> >\n> > > +          description: |\n> > > +            The first custom test pattern. All custom patterns that are\n> > > +            available only on this camera device are at least this numeric\n> > > +            value. All of the custom test patterns will be static (that is the\n> > > +            raw image must not vary from frame to frame).\n> > > +\n> > >  ...","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 7172EBD22E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Jun 2021 21:49:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A97526892B;\n\tMon,  7 Jun 2021 23:49:15 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5BCF96891F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Jun 2021 23:49:14 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C81118DB;\n\tMon,  7 Jun 2021 23:49:13 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"vu+5zqPN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1623102554;\n\tbh=IhlbIM1mTaIciPCE2MCGJAB29/Dph1jf05j3JqcZ4Xg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=vu+5zqPNrIxwri1DqqBI3JJSgFTHAFTPnuRIVJbxjpYCuLjTBiyDOILOPmwWTqsaQ\n\t4OWN8tHVlQThWzN5ICJcV7KmWnyk7q2QRUNMLAqN15DBMYAyOzmeW/eafn8fWOa9FZ\n\tluxMpUba0XAdkBd0O6mJkv7loTBrWEEx69lIP4U0=","Date":"Tue, 8 Jun 2021 00:48:59 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YL6US+7rqX6FuX0e@pendragon.ideasonboard.com>","References":"<20210528030531.189492-1-hiroh@chromium.org>\n\t<YL1h4Tg2vskiR2H/@pendragon.ideasonboard.com>\n\t<CAO5uPHNT=nDR8mvYNmHfhGOQt-Ag2vuKoPy+-kWuLbvQRMzDCg@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAO5uPHNT=nDR8mvYNmHfhGOQt-Ag2vuKoPy+-kWuLbvQRMzDCg@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v6 1/6] libcamera: controls: Add\n\tsensor test pattern mode","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]