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 23:40:24 +0000 [thread overview]
Message-ID: <10feb0b0fd924e48a149b0fa2a8d5d29@intel.com> (raw)
In-Reply-To: <160798410071.13039.10818205990449584130@build.alporthouse.com>
[-- Attachment #1.1: Type: text/plain, Size: 2594 bytes --]
>From: Chris Wilson <chris@chris-wilson.co.uk>
>
>Sent: Monday, December 14, 2020 2:15 PM
>To: Chang, Yu bruce; intel-gfx@lists.freedesktop.org
>Subject: Re: [Intel-gfx] [PATCH i-g-t] lib: Pass device fd to gem_mmappable_aperture_size()
>
>Quoting Chang, Yu bruce (2020-12-14 21:52:10)
>>
>> >
>> >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.
>
>It's held true for ~20 years :)
>
>I hear you; for the remaining users, they should probably use the lsgpu
>interface to pick the right device to work on (and remove
>intel_get_pci_device).
>
>tools/intel_audio_dump.c
>tools/intel_backlight.c
>tools/intel_display_poller.c
>tools/intel_forcewaked.c
>tools/intel_gpu_time.c
>tools/intel_gtt.c
>tools/intel_infoframes.c
>tools/intel_lid.c
>tools/intel_panel_fitter.c
>tools/intel_reg.c
>tools/intel_reg_checker.c
>tools/intel_watermark.c
>
>A few of those could even be retired.
>-Chris
>
>
Sounds reasonably to me. the rest of your changes look good to me, and also fix my issue.
Thanks,
Bruce
Reviewed-by: Bruce Chang <yu.bruce.chang@intel.com>
[-- Attachment #1.2: Type: text/html, Size: 5559 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
prev parent reply other threads:[~2020-12-14 23:40 UTC|newest]
Thread overview: 6+ 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-14 18:45 ` Chang, Yu bruce
2020-12-14 20:48 ` Chris Wilson
2020-12-14 21:52 ` Chang, Yu bruce
2020-12-14 22:15 ` Chris Wilson
2020-12-14 23:40 ` Chang, Yu bruce [this message]
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=10feb0b0fd924e48a149b0fa2a8d5d29@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox