[PATCH i-g-t] tests/kms_plane_alpha_blend: Reduce test complexity for simulation
Sharma, Swati2
swati2.sharma at intel.com
Tue Jul 29 07:53:38 UTC 2025
On 28-07-2025 09:24 am, Samala, Pranay wrote:
> Hi Swati,
>
>> -----Original Message-----
>> From: Sharma, Swati2 <swati2.sharma at intel.com>
>> Sent: Monday, July 21, 2025 10:51 PM
>> To: Samala, Pranay <pranay.samala at intel.com>; igt-dev at lists.freedesktop.org
>> Cc: B S, Karthik <karthik.b.s at intel.com>; Lattannavar, Sameer
>> <sameer.lattannavar at intel.com>
>> Subject: Re: [PATCH i-g-t] tests/kms_plane_alpha_blend: Reduce test
>> complexity for simulation
>>
>> Hi Pranay,
>>
>> On 19-07-2025 10:38 pm, Pranay Samala wrote:
>>> Reduce the number of plane alpha value iterations, and limit execution
>>> to a single plane for each pipe to enable this test on simulation.
>>>
>>> Signed-off-by: Pranay Samala <pranay.samala at intel.com>
>>> ---
>>> tests/kms_plane_alpha_blend.c | 13 +++++++++++--
>>> 1 file changed, 11 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/tests/kms_plane_alpha_blend.c
>>> b/tests/kms_plane_alpha_blend.c index 047cc57b4..696bb1e5e 100644
>>> --- a/tests/kms_plane_alpha_blend.c
>>> +++ b/tests/kms_plane_alpha_blend.c
>>> @@ -79,6 +79,8 @@ typedef struct {
>>> igt_pipe_crc_t *pipe_crc;
>>> } data_t;
>>>
>>> +static bool in_simulation;
>>> +
>>> static void __draw_gradient(struct igt_fb *fb, int w, int h, double a, cairo_t
>> *cr)
>>> {
>>> cairo_pattern_t *pat;
>>> @@ -289,7 +291,7 @@ static void basic_alpha(data_t *data, enum pipe
>> pipe, igt_plane_t *plane)
>>> {
>>> igt_display_t *display = &data->display;
>>> igt_crc_t ref_crc, crc;
>>> - int i;
>>> + int i, max_alpha_value;
>>>
>>> /* Testcase 1: alpha = 0.0, plane should be transparent. */
>>> igt_display_commit2(display, COMMIT_ATOMIC); @@ -298,8 +300,10
>> @@
>>> static void basic_alpha(data_t *data, enum pipe pipe, igt_plane_t
>>> *plane)
>>>
>>> igt_plane_set_fb(plane, &data->argb_fb_0);
>>>
>>> + max_alpha_value = in_simulation ? 160 : 256;
>>> +
>>> /* transparent fb should be transparent, no matter what.. */
>>> - for (i = 7; i < 256; i += 8) {
>>> + for (i = 7; i < max_alpha_value; i += 8) {
>>> igt_plane_set_prop_value(plane, IGT_PLANE_ALPHA, i | (i <<
>> 8));
>>> igt_display_commit2(display, COMMIT_ATOMIC);
>>>
>>> @@ -564,6 +568,9 @@ static void run_test_on_pipe_planes(data_t *data,
>> enum pipe pipe, igt_output_t *
>>> igt_info("Testing plane %u\n", plane->index);
>>> test(data, pipe, plane);
>>> igt_plane_set_fb(plane, NULL);
>>> +
>>> + if (in_simulation)
>>> + break;
>> If we are breaking after first plane, how do we know if that plane supports
>> alpha?
>> We need to have something like valid_plane which supports alpha and other
>> constraints and then break.
>> That will imply, we have tested with atleast 1 plane supporting alpha and
>> other constraints.
> In for loop it is checking the alpha property support for that plane.
> If plane supports alpha then only it will execute the test, else it will continue
> for the next plane.
>
> In this way we will test on atleast 1 plane supporting alpha.
>
> Regards,
> Pranay
Right, thanks for checking.
Patch LGTM
Reviewed-by: Swati Sharma <swati2.sharma at intel.com>
>>> }
>>>
>>> igt_output_set_pipe(output, PIPE_NONE); @@ -743,6 +750,8 @@
>>> igt_main_args("e", NULL, help_str, opt_handler, NULL)
>>> for_each_pipe(&data.display, pipe)
>>> active_pipes[last_pipe++] = pipe;
>>> last_pipe--;
>>> +
>>> + in_simulation = igt_run_in_simulation();
>>> }
>>>
>>> run_subtests(&data);
More information about the igt-dev
mailing list