All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chang, Yu bruce" <yu.bruce.chang@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH i-g-t] lib: Pass device fd to gem_mmappable_aperture_size()
Date: Mon, 14 Dec 2020 21:52:10 +0000	[thread overview]
Message-ID: <b9269e1c98b34fb6a06fb14a277be599@intel.com> (raw)
In-Reply-To: <160797892093.13039.18269573801947438332@build.alporthouse.com>


[-- Attachment #1.1: Type: text/plain, Size: 2451 bytes --]


>
>From: Chris Wilson <chris@chris-wilson.co.uk>
>Sent: Monday, December 14, 2020 12:48 PM
>To: Chang, Yu bruce; intel-gfx@lists.freedesktop.org
>Cc: igt-dev@
>Subject: Re: [Intel-gfx] [PATCH i-g-t] lib: Pass device fd to gem_mmappable_aperture_size()
>
>Quoting Chang, Yu bruce (2020-12-14 18:45:04)
>> +/**
>> + * gem_mappable_aperture_size:
>> + *
>> + * Feature test macro to query the kernel for the mappable gpu aperture size.
>> + * This is the area available for GTT memory mappings.
>> + *
> + * Returns: The mappable gtt address space size.
> + */
> +uint64_t gem_mappable_aperture_size(int fd)
> +{
> +       struct pci_device *pci_dev = igt_device_get_pci_device(fd);
>
> Does it make sense to eliminate the function intel_get_pci_device() if not
> being used anymore? But it can be a separate patch.
>
>It's still used by tools. The complication there is that we mostly
>need to lookup the pci device without loading i915.ko.
>-Chris
>

That makes sense.

Then we need to make sure not start from a fix slot to look for GPU device in the intel_get_pci_device() below as
it may not work for a discrete GPU as that slot can be a non-vga device but with vendor_id 0x8086.

        pci_dev = pci_device_find_by_slot(0, 0, 2, 0);
        if (pci_dev == NULL || pci_dev->vendor_id != 0x8086) {

So, either add extra check to make sure it is VGA class or always use pci_device_next to search.

Thanks,
-Bruce


________________________________
From: Chris Wilson <chris@chris-wilson.co.uk>
Sent: Monday, December 14, 2020 12:48:40 PM
To: Chang, Yu bruce; intel-gfx@lists.freedesktop.org
Cc: igt-dev@
Subject: Re: [Intel-gfx] [PATCH i-g-t] lib: Pass device fd to gem_mmappable_aperture_size()

Quoting Chang, Yu bruce (2020-12-14 18:45:04)
> +/**
> + * gem_mappable_aperture_size:
> + *
> + * Feature test macro to query the kernel for the mappable gpu aperture size.
> + * This is the area available for GTT memory mappings.
> + *
> + * Returns: The mappable gtt address space size.
> + */
> +uint64_t gem_mappable_aperture_size(int fd)
> +{
> +       struct pci_device *pci_dev = igt_device_get_pci_device(fd);
>
> Does it make sense to eliminate the function intel_get_pci_device() if not
> being used anymore? But it can be a separate patch.

It's still used by tools. The complication there is that we mostly
need to lookup the pci device without loading i915.ko.
-Chris

[-- Attachment #1.2: Type: text/html, Size: 12344 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-12-14 21:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-12  9:43 [Intel-gfx] [PATCH i-g-t] lib: Pass device fd to gem_mmappable_aperture_size() Chris Wilson
2020-12-12 10:20 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-12-12 11:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2020-12-14 18:45 ` [Intel-gfx] [PATCH i-g-t] " Chang, Yu bruce
2020-12-14 18:45   ` [igt-dev] " Chang, Yu bruce
2020-12-14 20:48   ` [Intel-gfx] " Chris Wilson
2020-12-14 21:52     ` Chang, Yu bruce [this message]
2020-12-14 22:15       ` Chris Wilson
2020-12-14 23:40         ` Chang, Yu bruce
2020-12-14 19:05 ` [igt-dev] ✗ Fi.CI.BUILD: failure for lib: Pass device fd to gem_mmappable_aperture_size() (rev2) 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=b9269e1c98b34fb6a06fb14a277be599@intel.com \
    --to=yu.bruce.chang@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.