All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH i-g-t 6/6] lib/igt_device_scan: Improve Intel discrete GPU selection
Date: Mon, 30 Jan 2023 07:30:09 +0100	[thread overview]
Message-ID: <20230130063009.g5cojnchfcarkjre@zkempczy-mobl2> (raw)
In-Reply-To: <20230127111241.3624629-7-tvrtko.ursulin@linux.intel.com>

On Fri, Jan 27, 2023 at 11:12:41AM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Now that DRM subsystem can contain PCI cards with the vendor set to Intel
> but they are not Intel GPUs, we need a better selection logic than looking
> at the vendor. Use the driver name instead.
> 
> Caveat that the driver key was on a blacklist so far, and although I can't
> imagine it can be slow to probe, this is something to double check.

I don't remember why driver was added to the list. But you're right, driver
instead of vendor gives clear situation what drm device we're working on.

> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> ---
>  lib/igt_device_scan.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_device_scan.c b/lib/igt_device_scan.c
> index ed128d24dd10..8b767eed202d 100644
> --- a/lib/igt_device_scan.c
> +++ b/lib/igt_device_scan.c
> @@ -237,6 +237,7 @@ struct igt_device {
>  	char *vendor;
>  	char *device;
>  	char *pci_slot_name;
> +	char *driver;
>  	int gpu_index; /* For more than one GPU with same vendor and device. */
>  
>  	char *codename; /* For grouping by codename */
> @@ -440,7 +441,6 @@ static bool is_on_blacklist(const char *what)
>  				      "resource3", "resource4", "resource5",
>  				      "resource0_wc", "resource1_wc", "resource2_wc",
>  				      "resource3_wc", "resource4_wc", "resource5_wc",
> -				      "driver",
>  				      "uevent", NULL};
>  	const char *key;
>  	int i = 0;
> @@ -662,6 +662,8 @@ static struct igt_device *igt_device_new_from_udev(struct udev_device *dev)
>  		get_pci_vendor_device(idev, &vendor, &device);
>  		idev->codename = __pci_codename(vendor, device);
>  		idev->dev_type = __pci_devtype(vendor, device, idev->pci_slot_name);
> +		idev->driver = strdup_nullsafe(get_attr(idev, "driver"));
> +		igt_assert(idev->driver);
>  	}
>  
>  	return idev;
> @@ -776,7 +778,7 @@ static bool __find_first_i915_card(struct igt_device_card *card, bool discrete)
>  
>  	igt_list_for_each_entry(dev, &igt_devs.all, link) {
>  
> -		if (!is_pci_subsystem(dev) || !is_vendor_matched(dev, "intel"))
> +		if (!is_pci_subsystem(dev) || strcmp(dev->driver, "i915"))

We can easily add finding xe card in the future similar to the above. From me:

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

--
Zbigniew

>  			continue;
>  
>  		cmp = strncmp(dev->pci_slot_name, INTEGRATED_I915_GPU_PCI_ID,
> @@ -1023,6 +1025,7 @@ static void igt_device_free(struct igt_device *dev)
>  	free(dev->drm_render);
>  	free(dev->vendor);
>  	free(dev->device);
> +	free(dev->driver);
>  	free(dev->pci_slot_name);
>  	g_hash_table_destroy(dev->attrs_ht);
>  	g_hash_table_destroy(dev->props_ht);
> -- 
> 2.34.1
> 

WARNING: multiple messages have this Message-ID (diff)
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 6/6] lib/igt_device_scan: Improve Intel discrete GPU selection
Date: Mon, 30 Jan 2023 07:30:09 +0100	[thread overview]
Message-ID: <20230130063009.g5cojnchfcarkjre@zkempczy-mobl2> (raw)
In-Reply-To: <20230127111241.3624629-7-tvrtko.ursulin@linux.intel.com>

On Fri, Jan 27, 2023 at 11:12:41AM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Now that DRM subsystem can contain PCI cards with the vendor set to Intel
> but they are not Intel GPUs, we need a better selection logic than looking
> at the vendor. Use the driver name instead.
> 
> Caveat that the driver key was on a blacklist so far, and although I can't
> imagine it can be slow to probe, this is something to double check.

I don't remember why driver was added to the list. But you're right, driver
instead of vendor gives clear situation what drm device we're working on.

> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> ---
>  lib/igt_device_scan.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_device_scan.c b/lib/igt_device_scan.c
> index ed128d24dd10..8b767eed202d 100644
> --- a/lib/igt_device_scan.c
> +++ b/lib/igt_device_scan.c
> @@ -237,6 +237,7 @@ struct igt_device {
>  	char *vendor;
>  	char *device;
>  	char *pci_slot_name;
> +	char *driver;
>  	int gpu_index; /* For more than one GPU with same vendor and device. */
>  
>  	char *codename; /* For grouping by codename */
> @@ -440,7 +441,6 @@ static bool is_on_blacklist(const char *what)
>  				      "resource3", "resource4", "resource5",
>  				      "resource0_wc", "resource1_wc", "resource2_wc",
>  				      "resource3_wc", "resource4_wc", "resource5_wc",
> -				      "driver",
>  				      "uevent", NULL};
>  	const char *key;
>  	int i = 0;
> @@ -662,6 +662,8 @@ static struct igt_device *igt_device_new_from_udev(struct udev_device *dev)
>  		get_pci_vendor_device(idev, &vendor, &device);
>  		idev->codename = __pci_codename(vendor, device);
>  		idev->dev_type = __pci_devtype(vendor, device, idev->pci_slot_name);
> +		idev->driver = strdup_nullsafe(get_attr(idev, "driver"));
> +		igt_assert(idev->driver);
>  	}
>  
>  	return idev;
> @@ -776,7 +778,7 @@ static bool __find_first_i915_card(struct igt_device_card *card, bool discrete)
>  
>  	igt_list_for_each_entry(dev, &igt_devs.all, link) {
>  
> -		if (!is_pci_subsystem(dev) || !is_vendor_matched(dev, "intel"))
> +		if (!is_pci_subsystem(dev) || strcmp(dev->driver, "i915"))

We can easily add finding xe card in the future similar to the above. From me:

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

--
Zbigniew

>  			continue;
>  
>  		cmp = strncmp(dev->pci_slot_name, INTEGRATED_I915_GPU_PCI_ID,
> @@ -1023,6 +1025,7 @@ static void igt_device_free(struct igt_device *dev)
>  	free(dev->drm_render);
>  	free(dev->vendor);
>  	free(dev->device);
> +	free(dev->driver);
>  	free(dev->pci_slot_name);
>  	g_hash_table_destroy(dev->attrs_ht);
>  	g_hash_table_destroy(dev->props_ht);
> -- 
> 2.34.1
> 

  parent reply	other threads:[~2023-01-30  6:30 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 11:12 [Intel-gfx] [PATCH i-g-t 0/6] Assorted intel_gpu_top improvements Tvrtko Ursulin
2023-01-27 11:12 ` [igt-dev] " Tvrtko Ursulin
2023-01-27 11:12 ` [Intel-gfx] [PATCH i-g-t 1/6] intel_gpu_top: Fix man page formatting Tvrtko Ursulin
2023-01-27 11:12   ` [igt-dev] " Tvrtko Ursulin
2023-01-27 17:18   ` [Intel-gfx] " Kamil Konieczny
2023-01-27 17:18     ` [igt-dev] " Kamil Konieczny
2023-01-27 11:12 ` [Intel-gfx] [PATCH i-g-t 2/6] intel_gpu_top: Automatically enclose JSON output into brackets Tvrtko Ursulin
2023-01-27 11:12   ` [igt-dev] " Tvrtko Ursulin
2023-01-27 11:12 ` [Intel-gfx] [PATCH i-g-t 3/6] intel_gpu_top: Add command line switch to start in physical engine mode Tvrtko Ursulin
2023-01-27 11:12   ` [igt-dev] " Tvrtko Ursulin
2023-01-27 11:12 ` [Intel-gfx] [PATCH i-g-t 4/6] intel_gpu_top: Aggregate engine classes in all output modes Tvrtko Ursulin
2023-01-27 11:12   ` [igt-dev] " Tvrtko Ursulin
2023-01-27 11:12 ` [Intel-gfx] [PATCH i-g-t 5/6] intel_gpu_top: Fix cleanup on old kernels / unsupported GPU Tvrtko Ursulin
2023-01-27 11:12   ` [igt-dev] " Tvrtko Ursulin
2023-01-27 16:10   ` [Intel-gfx] " Kamil Konieczny
2023-01-27 16:10     ` [igt-dev] " Kamil Konieczny
2023-01-30 10:55     ` [Intel-gfx] [igt-dev] " Tvrtko Ursulin
2023-01-30 10:55       ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
2023-01-30 10:58       ` [Intel-gfx] [igt-dev] " Das, Nirmoy
2023-01-30 10:58         ` [igt-dev] [Intel-gfx] " Das, Nirmoy
2023-01-30 16:54       ` [Intel-gfx] [igt-dev] " Kamil Konieczny
2023-01-30 16:54         ` [igt-dev] [Intel-gfx] " Kamil Konieczny
2023-01-27 11:12 ` [Intel-gfx] [PATCH i-g-t 6/6] lib/igt_device_scan: Improve Intel discrete GPU selection Tvrtko Ursulin
2023-01-27 11:12   ` [igt-dev] " Tvrtko Ursulin
2023-01-27 11:39   ` [Intel-gfx] " Petri Latvala
2023-01-27 11:39     ` Petri Latvala
2023-01-27 11:53     ` [Intel-gfx] " Tvrtko Ursulin
2023-01-27 11:53       ` Tvrtko Ursulin
2023-01-27 13:41       ` [Intel-gfx] " Petri Latvala
2023-01-27 13:41         ` Petri Latvala
2023-01-27 16:17   ` [Intel-gfx] " Kamil Konieczny
2023-01-27 16:17     ` [igt-dev] " Kamil Konieczny
2023-01-30 11:04     ` [Intel-gfx] " Tvrtko Ursulin
2023-01-30 11:04       ` Tvrtko Ursulin
2023-01-30 16:51       ` [Intel-gfx] " Kamil Konieczny
2023-01-30 16:51         ` Kamil Konieczny
2023-01-30  6:30   ` Zbigniew Kempczyński [this message]
2023-01-30  6:30     ` Zbigniew Kempczyński
2023-01-27 12:16 ` [igt-dev] ✓ Fi.CI.BAT: success for Assorted intel_gpu_top improvements Patchwork
2023-01-27 14:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-01-30 12:28   ` Kamil Konieczny
2023-01-30 15:02     ` Yedireswarapu, SaiX Nandan
2023-01-30 13:51 ` [igt-dev] ✓ Fi.CI.IGT: success " 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=20230130063009.g5cojnchfcarkjre@zkempczy-mobl2 \
    --to=zbigniew.kempczynski@intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tvrtko.ursulin@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.