All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Ngai-Mint Kwan <ngai-mint.kwan@linux.intel.com>,
	<igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t v2] tests/kms_atomic_transition: Fix dynamic subtest
Date: Thu, 30 Oct 2025 23:52:01 -0300	[thread overview]
Message-ID: <176187912169.3303.6001455874424417370@intel.com> (raw)
In-Reply-To: <5a23aefb-a9a5-4143-839a-18cbb95d9098@linux.intel.com>

Quoting Ngai-Mint Kwan (2025-10-30 17:02:10-03:00)
>
>On 2025-10-30 13:00, Ngai-Mint Kwan wrote:
>> Hi Gustavo,
>>
>> On 2025-10-30 12:33, Gustavo Sousa wrote:
>>> Quoting Ngai-Mint Kwan (2025-10-30 16:15:50-03:00)
>>>> Fix Segmentation Fault when calling igt_pipe_crc_free() due to 
>>>> double-freeing a
>>>> dangling pointer.
>>>>
>>>> This occurs when a system connected to multiple displays executes a 
>>>> test with
>>>> "1x-outputs" dynamic subtest.
>>>>
>>>> Example:
>>>> kms_atomic_transition --run-subtest modeset-transition 
>>>> --dynamic-subtest 1x-outputs
>>>>
>>>> v2:
>>>> - Move test cleanup inside run_modeset_tests().
>>>>
>>>> Signed-off-by: Ngai-Mint Kwan <ngai-mint.kwan@linux.intel.com>
>>>> ---
>>>> tests/kms_atomic_transition.c | 25 +++++++++++++------------
>>>> 1 file changed, 13 insertions(+), 12 deletions(-)
>>>>
>>>> diff --git a/tests/kms_atomic_transition.c 
>>>> b/tests/kms_atomic_transition.c
>>>> index e1387bd89..419afe4dd 100644
>>>> --- a/tests/kms_atomic_transition.c
>>>> +++ b/tests/kms_atomic_transition.c
>>>> @@ -899,6 +899,7 @@ static void run_modeset_tests(data_t *data, int 
>>>> howmany, bool nonblocking, bool
>>>>          unsigned iter_max;
>>>>          igt_output_t *output;
>>>>          uint16_t width = 0, height = 0;
>>>> +        enum pipe pipe_enum;
>>> Nit: I would have just gone with 'enum pipe pipe', which seems to be 
>>> the most
>>> common way of doing it (according to
>>>
>>>      git grep -oh 'enum pipe \w\+' | sort | uniq -c | sort -g
>>>
>>> ).
>>>
>>> The change itself looks logically right, so:
>>>
>>> Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
>> That would have been my first choice too!
>> Unfortunately, the following warning appears on compile:
>>
>> ../tests/kms_atomic_transition.c: In function ‘run_modeset_tests’:
>> ../tests/kms_atomic_transition.c:921:29: warning: declaration of 
>> ‘pipe’ shadows a previous local [-Wshadow]
>>   921 |                 igt_pipe_t *pipe = &data->display.pipes[i];
>>       |                             ^~~~
>> ../tests/kms_atomic_transition.c:902:19: note: shadowed declaration is 
>> here
>>   902 |         enum pipe pipe;
>>       |                   ^~~~
>>
>> This is why I settled with "enum_pipe", but I am open to other 
>> suggestions.
>Correction: "pipe_enum"

Yep.  I did not see that.  Thanks.

I think we can go ahead with the patch as is.

--
Gustavo Sousa

>
>Kwan
>>
>> Kwan
>>>
>>>> retry:
>>>>          unset_output_pipe(&data->display);
>>>> @@ -1033,6 +1034,18 @@ retry:
>>>>                          }
>>>>                  }
>>>>          }
>>>> +
>>>> +        /* Cleanup */
>>>> +        unset_output_pipe(&data->display);
>>>> +        igt_display_commit2(&data->display, COMMIT_ATOMIC);
>>>> +
>>>> +        if (is_intel_device(data->drm_fd)) {
>>>> +                for_each_pipe(&data->display, pipe_enum)
>>>> + igt_pipe_crc_free(data->pipe_crcs[pipe_enum]);
>>>> +        }
>>>> +
>>>> +        igt_remove_fb(data->drm_fd, &data->fbs[0]);
>>>> +        igt_remove_fb(data->drm_fd, &data->fbs[1]);
>>>> }
>>>>
>>>> static void run_modeset_transition(data_t *data, int 
>>>> requested_outputs, bool nonblocking, bool fencing)
>>>> @@ -1067,18 +1080,6 @@ static void run_modeset_transition(data_t 
>>>> *data, int requested_outputs, bool non
>>>>
>>>>          igt_dynamic_f("%ix-outputs", requested_outputs)
>>>>                  run_modeset_tests(data, requested_outputs, 
>>>> nonblocking, fencing);
>>>> -
>>>> -        /* Cleanup */
>>>> -        unset_output_pipe(&data->display);
>>>> -        igt_display_commit2(&data->display, COMMIT_ATOMIC);
>>>> -
>>>> -        if (is_intel_device(data->drm_fd)) {
>>>> -                for_each_pipe(&data->display, pipe)
>>>> - igt_pipe_crc_free(data->pipe_crcs[pipe]);
>>>> -        }
>>>> -
>>>> -        igt_remove_fb(data->drm_fd, &data->fbs[0]);
>>>> -        igt_remove_fb(data->drm_fd, &data->fbs[1]);
>>>> }
>>>>
>>>> static bool pipe_output_combo_valid(igt_display_t *display,
>>>> -- 
>>>> 2.43.0
>>>>
>>
>

  reply	other threads:[~2025-10-31  2:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-30 19:15 [PATCH i-g-t v2] tests/kms_atomic_transition: Fix dynamic subtest Ngai-Mint Kwan
2025-10-30 19:33 ` Gustavo Sousa
2025-10-30 20:00   ` Ngai-Mint Kwan
2025-10-30 20:02     ` Ngai-Mint Kwan
2025-10-31  2:52       ` Gustavo Sousa [this message]
2025-10-30 23:09 ` ✓ Xe.CI.BAT: success for tests/kms_atomic_transition: Fix dynamic subtest (rev2) Patchwork
2025-10-30 23:18 ` ✓ i915.CI.BAT: " Patchwork
2025-10-31  6:59 ` ✓ Xe.CI.Full: " Patchwork
2025-10-31 12:18 ` ✗ i915.CI.Full: failure " Patchwork
2025-11-05 17:39   ` Matt Roper

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=176187912169.3303.6001455874424417370@intel.com \
    --to=gustavo.sousa@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=ngai-mint.kwan@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.