summaryrefslogtreecommitdiff
path: root/lib/igt_chamelium.c
diff options
context:
space:
mode:
authorSimon Ser <simon.ser@intel.com>2019-06-14 16:34:43 +0300
committerSimon Ser <simon.ser@intel.com>2019-06-17 15:04:33 +0300
commit9651105df6e7261fe3df8e05d934aac0847ec93e (patch)
treee676c6321ef210a3a089c2bb28a75e06b835efd6 /lib/igt_chamelium.c
parent5b5c8028f39719f0317978d3541d02faf6c6c5ec (diff)
lib/igt_chamelium: fix EDID list
igt_list was being mis-used, resulting in the first EDID being missed. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'lib/igt_chamelium.c')
-rw-r--r--lib/igt_chamelium.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index eaf3b5b0..0c44e56c 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);
}