From: Simon Ser <simon.ser@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: martin.peres@intel.com
Subject: [igt-dev] [PATCH i-g-t 2/3] lib/igt_chamelium: fix EDID list
Date: Fri, 14 Jun 2019 17:22:02 +0300 [thread overview]
Message-ID: <20190614142203.7753-3-simon.ser@intel.com> (raw)
In-Reply-To: <20190614142203.7753-1-simon.ser@intel.com>
igt_list was being mis-used, resulting in the first EDID being missed.
Signed-off-by: Simon Ser <simon.ser@intel.com>
---
lib/igt_chamelium.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index eaf3b5b07097..0c44e56cad86 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -118,7 +118,7 @@ struct chamelium {
int drm_fd;
- struct chamelium_edid *edids;
+ struct igt_list edids;
struct chamelium_port *ports;
int port_count;
};
@@ -552,12 +552,8 @@ int chamelium_new_edid(struct chamelium *chamelium,
memset(allocated_edid, 0, sizeof(*allocated_edid));
allocated_edid->id = edid_id;
- igt_list_init(&allocated_edid->link);
- if (chamelium->edids)
- igt_list_add(&chamelium->edids->link, &allocated_edid->link);
- else
- chamelium->edids = allocated_edid;
+ igt_list_add(&allocated_edid->link, &chamelium->edids);
return edid_id;
}
@@ -1850,6 +1846,7 @@ struct chamelium *chamelium_init(int drm_fd)
memset(chamelium, 0, sizeof(*chamelium));
chamelium->drm_fd = drm_fd;
+ igt_list_init(&chamelium->edids);
/* Setup the libxmlrpc context */
xmlrpc_env_init(&chamelium->env);
@@ -1901,7 +1898,7 @@ void chamelium_deinit(struct chamelium *chamelium)
chamelium_plug(chamelium, &chamelium->ports[i]);
/* Destroy any EDIDs we created to make sure we don't leak them */
- igt_list_for_each_safe(pos, tmp, &chamelium->edids->link, link) {
+ igt_list_for_each_safe(pos, tmp, &chamelium->edids, link) {
chamelium_destroy_edid(chamelium, pos->id);
free(pos);
}
--
2.22.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-06-14 14:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-14 14:22 [igt-dev] [PATCH i-g-t 0/3] Preliminary work for automagical Chamelium port mapping Simon Ser
2019-06-14 14:22 ` [igt-dev] [PATCH i-g-t 1/3] tests/kms_chamelium: drop TEST_EDID_CHAMELIUM_DEFAULT Simon Ser
2019-06-17 7:17 ` Martin Peres
2019-06-14 14:22 ` Simon Ser [this message]
2019-06-17 10:57 ` [igt-dev] [PATCH i-g-t 2/3] lib/igt_chamelium: fix EDID list Arkadiusz Hiler
2019-06-14 14:22 ` [igt-dev] [PATCH i-g-t 3/3] lib/igt_chamelium: replace EDID IDs with opaque structs Simon Ser
2019-06-17 7:21 ` Martin Peres
2019-06-15 2:56 ` [igt-dev] ✓ Fi.CI.BAT: success for Preliminary work for automagical Chamelium port mapping Patchwork
2019-06-15 20:39 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20190614142203.7753-3-simon.ser@intel.com \
--to=simon.ser@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=martin.peres@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