summaryrefslogtreecommitdiff
path: root/tests/kms_chamelium.c
diff options
context:
space:
mode:
authorSimon Ser <simon.ser@intel.com>2019-06-17 18:29:14 +0300
committerSimon Ser <simon.ser@intel.com>2019-07-19 10:50:24 +0300
commit26d8543681efc78e68dcce7273e7c39084d022ca (patch)
treea47c170eebb99cb0143b8e5e54934bb793399547 /tests/kms_chamelium.c
parent9b35bb9edf02ed4f024f48968767fcdcc49264a2 (diff)
lib/igt_chamelium: allow EDIDs to be mutated for each port
This adds the infrastructure necessary to change EDIDs provided to chamelium_new_edid, without actually doing it yet. This commit just updates the API to make it possible, documents expectations and updates callers accordingly. Mutating EDIDs is necessary to add an identifier to them (e.g. by adding a serial number) and to be able to map Chamelium ports to DRM connectors. A new function chamelium_edid_get_raw allows callers to retrieve the exact EDID used for a particular port. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'tests/kms_chamelium.c')
-rw-r--r--tests/kms_chamelium.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index aaf539b7..b7d30a2d 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -272,9 +272,10 @@ static void
test_edid_read(data_t *data, struct chamelium_port *port, enum test_edid edid)
{
drmModePropertyBlobPtr edid_blob = NULL;
- const unsigned char *raw_edid = get_edid(edid);
drmModeConnector *connector = chamelium_port_get_connector(
data->chamelium, port, false);
+ size_t raw_edid_size;
+ const struct edid *raw_edid;
uint64_t edid_blob_id;
reset_state(data, port);
@@ -291,7 +292,9 @@ test_edid_read(data_t *data, struct chamelium_port *port, enum test_edid edid)
igt_assert(edid_blob = drmModeGetPropertyBlob(data->drm_fd,
edid_blob_id));
- igt_assert(memcmp(raw_edid, edid_blob->data, EDID_LENGTH) == 0);
+ raw_edid = chamelium_edid_get_raw(data->edids[edid], port);
+ raw_edid_size = edid_get_size(raw_edid);
+ igt_assert(memcmp(raw_edid, edid_blob->data, raw_edid_size) == 0);
drmModeFreePropertyBlob(edid_blob);
drmModeFreeConnector(connector);