From: Katarzyna Dec <katarzyna.dec@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org,
Petri Latvala <petri.latvala@intel.com>,
Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [igt-dev] [PATCH i-g-t v4 1/2] Introduce multi-device selection API
Date: Wed, 21 Aug 2019 13:58:09 +0200 [thread overview]
Message-ID: <20190821115809.GA7219@kdec5-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20190821110430.GB21194@kdec5-desk.ger.corp.intel.com>
On Wed, Aug 21, 2019 at 01:04:30PM +0200, Katarzyna Dec wrote:
> > + * igt_device_card_match
> > + * @filter: filter string
> > + * @card: pointer to igt_device_card struct
> > + *
> > + * Function applies filter to match device from device array.
> > + *
> > + * Returns:
> > + * false - no card pointer was passed or card wasn't matched,
> > + * true - card matched and returned.
> > + */
> > +bool igt_device_card_match(const char *filter, struct igt_device_card *card)
> > +{
> > + struct igt_device *dev = NULL;
> > +
> > + if (!card)
> > + return false;
> > + memset(card, 0, sizeof(*card));
> > +
> > + igt_devices_scan(false);
> > +
> > + if (igt_device_filter_apply(filter) == false)
> > + return false;
> > +
> > + if (!igt_devs.view->len)
> > + return false;
> > +
> > + /* We take first one if more than one card matches filter */
> > + dev = g_ptr_array_index(igt_devs.view, 0);
> > + card->chipset = DRIVER_ANY;
> > + if (dev->vs)
> > + card->chipset = dev->vs->chipset;
> > +
> > + safe_strncpy(card->subsystem, dev->subsystem, NAME_MAX);
> > + safe_strncpy(card->card, dev->drm_card, NAME_MAX);
> > + safe_strncpy(card->render, dev->drm_render, NAME_MAX);
> This macro is returing true/false, do we check the results? It looks like magic
> to me :)
Now it is not magic :) After a good lunch I realized what is going on here :)
Kasia :)
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-08-21 11:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-12 8:47 [igt-dev] [PATCH i-g-t v4 0/2] Add device selection methods Zbigniew Kempczyński
2019-08-12 8:47 ` [igt-dev] [PATCH i-g-t v4 1/2] Introduce multi-device selection API Zbigniew Kempczyński
2019-08-21 8:09 ` Arkadiusz Hiler
2019-08-21 11:01 ` Zbigniew Kempczyński
2019-08-21 11:04 ` Katarzyna Dec
2019-08-21 11:58 ` Katarzyna Dec [this message]
2019-08-22 7:23 ` Zbigniew Kempczyński
2019-08-12 8:47 ` [igt-dev] [PATCH i-g-t v4 2/2] Add multi-device selection for IGT Zbigniew Kempczyński
2019-08-21 7:56 ` Arkadiusz Hiler
2019-08-21 10:42 ` Zbigniew Kempczyński
2019-08-21 12:08 ` Katarzyna Dec
2019-08-12 10:52 ` [igt-dev] ✓ Fi.CI.BAT: success for Add device selection methods (rev4) Patchwork
2019-08-12 13:29 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20190821115809.GA7219@kdec5-desk.ger.corp.intel.com \
--to=katarzyna.dec@intel.com \
--cc=daniel@ffwll.ch \
--cc=igt-dev@lists.freedesktop.org \
--cc=petri.latvala@intel.com \
--cc=zbigniew.kempczynski@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