diff options
author | Simon Ser <simon.ser@intel.com> | 2019-07-02 10:57:37 +0300 |
---|---|---|
committer | Simon Ser <simon.ser@intel.com> | 2019-07-05 16:06:40 +0300 |
commit | 219430933ac316313b71832f6a65e2e08c08cbd7 (patch) | |
tree | e047fb451be5f93c8daf072581266f62536ad019 /tests/kms_hdmi_inject.c | |
parent | f0e39642f6f8da5406627bfa79c6600df949e203 (diff) |
lib/igt_kms: remove length parameter from kmstest_force_edid
Given an EDID, computing the size is trivial. Instead of having one size
constant per EDID and hope the callers use the right one (ie. *not* EDID_LENGTH
when there's an extension), we can make functions that take EDIDs compute the
size if they need it.
We have tests in lib/tests/igt_edid.c which assert the number of extensions
present in the EDID anyway.
Signed-off-by: Simon Ser <simon.ser@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_hdmi_inject.c')
-rw-r--r-- | tests/kms_hdmi_inject.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/kms_hdmi_inject.c b/tests/kms_hdmi_inject.c index 8c0d1333..9a968fa9 100644 --- a/tests/kms_hdmi_inject.c +++ b/tests/kms_hdmi_inject.c @@ -93,7 +93,7 @@ hdmi_inject_4k(int drm_fd, drmModeConnector *connector) kmstest_edid_add_4k(igt_kms_get_base_edid(), EDID_LENGTH, &edid, &length); - kmstest_force_edid(drm_fd, connector, edid, length); + kmstest_force_edid(drm_fd, connector, edid); if (!kmstest_force_connector(drm_fd, connector, FORCE_CONNECTOR_ON)) igt_skip("Could not force connector on\n"); @@ -134,7 +134,7 @@ hdmi_inject_4k(int drm_fd, drmModeConnector *connector) igt_remove_fb(drm_fd, &fb); kmstest_force_connector(drm_fd, connector, FORCE_CONNECTOR_UNSPECIFIED); - kmstest_force_edid(drm_fd, connector, NULL, 0); + kmstest_force_edid(drm_fd, connector, NULL); free(edid); } @@ -143,15 +143,12 @@ static void hdmi_inject_audio(int drm_fd, drmModeConnector *connector) { const unsigned char *edid; - size_t length; int fb_id, cid, ret, crtc_mask = -1; struct igt_fb fb; struct kmstest_connector_config config; edid = igt_kms_get_hdmi_audio_edid(); - length = AUDIO_EDID_LENGTH; - - kmstest_force_edid(drm_fd, connector, edid, length); + kmstest_force_edid(drm_fd, connector, edid); if (!kmstest_force_connector(drm_fd, connector, FORCE_CONNECTOR_ON)) igt_skip("Could not force connector on\n"); @@ -191,7 +188,7 @@ hdmi_inject_audio(int drm_fd, drmModeConnector *connector) kmstest_dump_mode(&connector->modes[0]); kmstest_force_connector(drm_fd, connector, FORCE_CONNECTOR_UNSPECIFIED); - kmstest_force_edid(drm_fd, connector, NULL, 0); + kmstest_force_edid(drm_fd, connector, NULL); } igt_main |