From: Jessica Zhang <quic_jesszhan@quicinc.com>
To: Pekka Paalanen <pekka.paalanen@collabora.com>
Cc: Simon Ser <contact@emersion.fr>,
igt-dev@lists.freedesktop.org, Rob Clark <robdclark@gmail.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Subject: Re: [PATCH i-g-t 3/4] tests/kms_atomic: Add solid fill plane subtest
Date: Thu, 21 Dec 2023 15:57:51 -0800 [thread overview]
Message-ID: <6c910eb7-5f4b-4b03-ae3c-ca0498f0c667@quicinc.com> (raw)
In-Reply-To: <20231218121247.454bc00a.pekka.paalanen@collabora.com>
On 12/18/2023 2:12 AM, Pekka Paalanen wrote:
> On Fri, 15 Dec 2023 16:40:23 -0800
> Jessica Zhang <quic_jesszhan@quicinc.com> wrote:
>
>> Add a basic test for solid fill planes.
>>
>> This test will first commit a single-color framebuffer plane then
>> a solid fill plane with the same contents. It then validates the solid
>> fill plane by comparing the resulting CRC with the CRC of the reference
>> framebuffer commit.
>>
>> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
>> ---
>> tests/kms_atomic.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 94 insertions(+)
>>
>> diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c
>> old mode 100644
>> new mode 100755
>> index 2b6e9a8f0383..8f81e65ad84f
>> --- a/tests/kms_atomic.c
>> +++ b/tests/kms_atomic.c
>> @@ -128,6 +128,13 @@ enum kms_atomic_check_relax {
>> PLANE_RELAX_FB = (1 << 1)
>> };
>>
>> +struct solid_fill_blob {
>> + uint32_t r;
>> + uint32_t g;
>> + uint32_t b;
>> + uint32_t pad;
>> +};
>> +
>> static inline int damage_rect_width(struct drm_mode_rect *r)
>> {
>> return r->x2 - r->x1;
>> @@ -1322,6 +1329,79 @@ static void atomic_plane_damage(data_t *data)
>> igt_remove_fb(data->drm_fd, &fb_2);
>> }
>>
>> +static void test_solid_fill_plane(data_t *data, igt_output_t *output, igt_plane_t *plane)
>> +{
>> + struct drm_mode_create_blob c;
>> + struct drm_mode_destroy_blob d;
>> + drmModeModeInfo *mode = igt_output_get_mode(output);
>> + struct drm_mode_rect rect = { 0 };
>> + struct igt_fb ref_fb;
>> + igt_pipe_crc_t *pipe_crc;
>> + igt_crc_t ref_crc, new_crc;
>> + enum pipe pipe = data->pipe->pipe;
>> + int height, width;
>> + int ret;
>> +
>> + struct solid_fill_blob blob_data = {
>> + .r = 0x00000000,
>> + .g = 0x00000000,
>> + .b = 0xff000000,
>> + .pad = 0x0,
>> + };
>
> Hi Jessica!
>
> This is the blob sent to KMS as the solid fill color...
>
> ...
>
>> + igt_create_color_fb(data->drm_fd, width, height,
>> + DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR,
>> + 0.0, 0.0, 1.0, &ref_fb);
>
> ..and this (0.0, 0.0, 1.0) is the corresponding color in normalized
> values, I presume.
>
> So you say that 0xff000000 = 1.0.
>
> However, the patch for the kernel UAPI header says this:
>
> +/**
> + * struct drm_mode_solid_fill - User info for solid fill planes
> + *
> + * This is the userspace API solid fill information structure.
> + *
> + * Userspace can enable solid fill planes by assigning the plane "solid_fill"
> + * property to a blob containing a single drm_mode_solid_fill struct populated with an RGB323232
> + * color and setting the pixel source to "SOLID_FILL".
> + *
> + * For information on the plane property, see drm_plane_create_solid_fill_property()
> + *
> + * @r: Red color value of single pixel
> + * @g: Green color value of single pixel
> + * @b: Blue color value of single pixel
> + * @pad: padding, must be zero
> + */
> +struct drm_mode_solid_fill {
> + __u32 r;
> + __u32 g;
> + __u32 b;
> + __u32 pad;
> +};
>
> I assume that RGB323232 means unsigned 32-bit UNORM (Vulkan term)
> format. That means 1.0 is 0xffffffff, not 0xff000000. This looks like a
> bug in the test.
Hey Pekka,
Ah, thanks for catching this -- I'll change the blob value to 0xffffffff
so it matches the 1.0.
While we're talking about the UAPI struct, I'll also add the actual
drm_mode_solid_fill struct to the IGT drm-uapi instead of the current
workaround.
>
> It would be good to test more than one color:
> - 0.0, 0.0, 0.0
> - 1.0, 0.0, 0.0
> - 0.0, 1.0, 0.0
> - 0.0, 0.0, 1.0
> - 1.0, 1.0, 1.0
Sounds good, will change the test to validate these combinations.
>
> for example. That would get at least the so often used black explicitly
> tested, and verify each channel gets mapped correctly rather than only
> blue.
>
> It would also be really good to test dim and mid grays, but I assume it
> might be difficult to get CRC to match over various hardware. You'd
> need to use writeback with an error tolerance. (For watching photos for
> example, the background is not usually black but dim gray I believe.)
Got it, we can add this to the list of colors to test.
FWIW, I think as long as we keep the test structure as grabbing a
reference CRC from an FB commit then comparing that to a CRC from a
solid fill commit, I'm not expecting a difference in CRC values.
Thanks,
Jessica Zhang
>
>
> Thanks,
> pq
next prev parent reply other threads:[~2023-12-21 23:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-16 0:40 [PATCH i-g-t 0/4] Add tests for solid fill planes Jessica Zhang
2023-12-16 0:40 ` Jessica Zhang
2023-12-16 0:40 ` [PATCH i-g-t 1/4] tests/kms_atomic: Free pipe_crc object Jessica Zhang
2023-12-16 0:40 ` Jessica Zhang
2023-12-16 0:40 ` [PATCH i-g-t 2/4] lib: Add support for solid_fill and pixel_source plane properties Jessica Zhang
2023-12-16 0:40 ` Jessica Zhang
2023-12-19 13:51 ` Kamil Konieczny
2023-12-22 0:00 ` Jessica Zhang
2023-12-22 0:00 ` Jessica Zhang
2023-12-16 0:40 ` [PATCH i-g-t 3/4] tests/kms_atomic: Add solid fill plane subtest Jessica Zhang
2023-12-16 0:40 ` Jessica Zhang
2023-12-18 10:12 ` Pekka Paalanen
2023-12-19 13:47 ` Kamil Konieczny
2024-01-11 9:19 ` Pekka Paalanen
2023-12-21 23:57 ` Jessica Zhang [this message]
2024-01-11 9:20 ` Pekka Paalanen
2024-01-18 23:35 ` Jessica Zhang
2024-01-19 9:00 ` Pekka Paalanen
2024-01-19 17:40 ` Abhinav Kumar
2024-01-22 7:56 ` Pekka Paalanen
2024-01-23 23:28 ` Jessica Zhang
2023-12-19 13:59 ` Kamil Konieczny
2023-12-16 0:40 ` [PATCH i-g-t 4/4] tests/kms_atomic: Add subtest for solid fill cursor planes Jessica Zhang
2023-12-16 0:40 ` Jessica Zhang
2023-12-16 0:49 ` ✗ Fi.CI.BUILD: failure for Add tests for solid fill planes Patchwork
2023-12-16 0:53 ` ✗ GitLab.Pipeline: warning " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6c910eb7-5f4b-4b03-ae3c-ca0498f0c667@quicinc.com \
--to=quic_jesszhan@quicinc.com \
--cc=contact@emersion.fr \
--cc=dmitry.baryshkov@linaro.org \
--cc=igt-dev@lists.freedesktop.org \
--cc=pekka.paalanen@collabora.com \
--cc=robdclark@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox