From: Petri Latvala <petri.latvala@intel.com>
To: Alexandru M Stan <amstan@chromium.org>
Cc: robdclark@chromium.org, Ilja Friedel <ihf@google.com>,
igt-dev@lists.freedesktop.org, seanpaul@chromium.org,
Mark Yacoub <markyacoub@google.com>,
khaled.almahallawy@intel.com
Subject: Re: [igt-dev] [PATCH] lib/igt_chamelium: Extend check of valid ports to port=0
Date: Fri, 29 Jul 2022 16:15:21 +0300 [thread overview]
Message-ID: <YuPdaT6wKtn2UtnZ@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <CAHNYxRy1txH-VKyt3+ONanP5Dvnznkd-aWERPDHRQKa1oF9J9Q@mail.gmail.com>
On Fri, Jul 15, 2022 at 03:29:49PM -0400, Alexandru M Stan wrote:
> On Fri, Jul 15, 2022 at 3:22 PM Mark Yacoub <markyacoub@chromium.org> wrote:
> >
> > [Why]
> > Chamelium V3 has a valid port at 0 so 0 should not be rejected.
>
> Can confirm, nowhere in the API specifications does it say port_id==0
> is invalid and I have started using 0 on v3 since they're just indexes
> in my internal chameleond ports array, so they start at 0.
>
> >
> > [How]
> > Check for port values between 0 and CHAMELIUM_MAX_PORTS which should
> > also include the V2 ports range.
> >
> > Test: ./kms_chamelium --run-subtest dp-hp
> > Tested on: Volteer & cv3
> >
> > Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
> > ---
> > lib/igt_chamelium.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
> > index 55cbfa12..5d68372b 100644
> > --- a/lib/igt_chamelium.c
> > +++ b/lib/igt_chamelium.c
> > @@ -2311,7 +2311,7 @@ static bool chamelium_read_port_mappings(struct chamelium *chamelium,
> > port->id = g_key_file_get_integer(igt_key_file, group,
> > "ChameliumPortID",
> > &error);
> > - if (!port->id) {
> > + if (port->id < 0 || port->id > CHAMELIUM_MAX_PORTS) {
>
> CHAMELIUM_MAX_PORTS seems to be #defined to 4 in another file. That
> looks a little wrong.
It's documented as "the maximum number of ports supported by
igt_chamelium".
IGT's usage of port ids are from
https://chromium.googlesource.com/chromiumos/platform/chameleon/+/master/chameleond/utils/ids.py,
for the record.
--
Petri Latvala
>
> I would do an RPC call for .GetSupportedPorts() to get the exact valid
> set of port_ids instead of relying on a range. You might have some
> invalid ones in there if you do it this way (no plans to do such gaps,
> but again the API does not really specify).
>
> > igt_warn("Failed to read chamelium port ID for %s: %s\n",
> > map_name, error->message);
> > ret = false;
> > --
> > 2.37.0.170.g444d1eabd0-goog
> >
>
> Alexandru Stan (amstan)
next prev parent reply other threads:[~2022-07-29 13:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 19:22 [igt-dev] [PATCH] lib/igt_chamelium: Extend check of valid ports to port=0 Mark Yacoub
2022-07-15 19:29 ` Alexandru M Stan
2022-07-29 13:15 ` Petri Latvala [this message]
2022-07-16 15:41 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2022-07-16 17:15 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-07-18 14:42 ` Mark Yacoub
2022-07-18 21:39 ` Vudum, Lakshminarayana
2022-07-18 15:05 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2022-07-29 13:12 ` [igt-dev] [PATCH] " Petri Latvala
2022-07-29 14:53 ` Mark Yacoub
2022-07-29 14:51 ` [igt-dev] [PATCH v2] lib/igt_chamelium: Check for error instead of port id for invalid Mark Yacoub
2022-08-01 10:07 ` Petri Latvala
2022-08-01 12:21 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_chamelium: Extend check of valid ports to port=0 (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=YuPdaT6wKtn2UtnZ@platvala-desk.ger.corp.intel.com \
--to=petri.latvala@intel.com \
--cc=amstan@chromium.org \
--cc=igt-dev@lists.freedesktop.org \
--cc=ihf@google.com \
--cc=khaled.almahallawy@intel.com \
--cc=markyacoub@google.com \
--cc=robdclark@chromium.org \
--cc=seanpaul@chromium.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.