igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	<igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t v1 1/4] tests/prime_udl: Fix opening
Date: Tue, 16 Dec 2025 08:55:20 +0530	[thread overview]
Message-ID: <221bd65f-c20a-4f20-8f12-76bf758c625d@intel.com> (raw)
In-Reply-To: <20251215223639.117028-2-kamil.konieczny@linux.intel.com>

Hi Kamil,

On 12/16/2025 4:06 AM, Kamil Konieczny wrote:
> Cards numbering can be non-squential so create a way to open them
> in such case.

Typo: non-sequential.

>
> Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Karthik B S <karthik.b.s@intel.com>
> ---
>   tests/prime_udl.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tests/prime_udl.c b/tests/prime_udl.c
> index 25950a09d..c3e92be1e 100644
> --- a/tests/prime_udl.c
> +++ b/tests/prime_udl.c
> @@ -27,13 +27,13 @@ static int find_and_open_devices(void)
>   	FILE *fl;
>   	char vendor_id[8];
>   	int venid;
> -	for (i = 0; i < 9; i++) {
> +	for (i = 0; i < 9 && intel_fd == -1 && udl_fd == -1; i++) {
>   		sprintf(path, "/sys/class/drm/card%d/device/vendor", i);
>   		if (stat(path, &buf)) {
>   			/* look for usb dev */
>   			sprintf(path, "/sys/class/drm/card%d/device/idVendor", i);
>   			if (stat(path, &buf))
> -				break;
> +				continue;
>   		}
>   
>   		fl = fopen(path, "r");
> @@ -45,11 +45,11 @@ static int find_and_open_devices(void)
>   
>   		venid = strtoul(vendor_id, NULL, 16);
>   		sprintf(path, "/dev/dri/card%d", i);
> -		if (venid == 0x8086) {
> +		if (venid == 0x8086 && intel_fd == -1) {
>   			intel_fd = open(path, O_RDWR);
>   			if (!intel_fd)
>   				return -1;
> -		} else if (venid == 0x17e9) {
> +		} else if (venid == 0x17e9 && udl_fd == -1) {
>   			udl_fd = open(path, O_RDWR);
>   			if (!udl_fd)
>   				return -1;

  reply	other threads:[~2025-12-16  3:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15 22:36 [PATCH i-g-t v1 0/4] Various fixes for prime_udl test Kamil Konieczny
2025-12-15 22:36 ` [PATCH i-g-t v1 1/4] tests/prime_udl: Fix opening Kamil Konieczny
2025-12-16  3:25   ` Karthik B S [this message]
2025-12-15 22:36 ` [PATCH i-g-t v1 2/4] tests/prime_udl: Create subtests Kamil Konieczny
2025-12-16  3:26   ` Karthik B S
2025-12-15 22:36 ` [PATCH i-g-t v1 3/4] tests/prime_udl: Fix error handling Kamil Konieczny
2025-12-16  3:27   ` Karthik B S
2025-12-15 22:36 ` [PATCH i-g-t v1 4/4] tests/prime_udl: Fix i915 device opening Kamil Konieczny
2025-12-16  3:27   ` Karthik B S
2025-12-16  2:00 ` ✓ i915.CI.BAT: success for Various fixes for prime_udl test Patchwork
2025-12-16  3:15 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-12-16  3:33 ` [PATCH i-g-t v1 0/4] " Karthik B S
2025-12-16 15:40   ` Kamil Konieczny
2025-12-17  3:54     ` Karthik B S
2025-12-16  7:27 ` ✗ i915.CI.Full: failure for " Patchwork
2025-12-16 15:15 ` ✗ Xe.CI.Full: " 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=221bd65f-c20a-4f20-8f12-76bf758c625d@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).