diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/igt_kms.c | 13 | ||||
| -rw-r--r-- | lib/igt_kms.h | 3 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index dc8992cb..a66a6850 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -182,6 +182,8 @@ const unsigned char *igt_kms_get_alt_edid(void) return (unsigned char *) &edid; } +#define AUDIO_EDID_LENGTH (2 * EDID_LENGTH) + static void generate_audio_edid(unsigned char raw_edid[static AUDIO_EDID_LENGTH], bool with_vsd, struct cea_sad *sad, @@ -990,15 +992,13 @@ bool kmstest_force_connector(int drm_fd, drmModeConnector *connector, * @drm_fd: drm file descriptor * @connector: connector to set @edid on * @edid: An EDID data block - * @length: length of the EDID data. #EDID_LENGTH defines the standard EDID - * length * * Set the EDID data on @connector to @edid. See also #igt_kms_get_base_edid. * - * If @length is zero, the forced EDID will be removed. + * If @edid is NULL, the forced EDID will be removed. */ void kmstest_force_edid(int drm_fd, drmModeConnector *connector, - const unsigned char *edid, size_t length) + const unsigned char *edid) { char *path; int debugfs_fd, ret; @@ -1011,10 +1011,11 @@ void kmstest_force_edid(int drm_fd, drmModeConnector *connector, igt_require(debugfs_fd != -1); - if (length == 0) + if (edid == NULL) ret = write(debugfs_fd, "reset", 5); else - ret = write(debugfs_fd, edid, length); + ret = write(debugfs_fd, edid, + edid_get_size((struct edid *) edid)); close(debugfs_fd); /* To allow callers to always use GetConnectorCurrent we need to force a diff --git a/lib/igt_kms.h b/lib/igt_kms.h index a448a003..f7250864 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -197,7 +197,7 @@ bool kmstest_force_connector(int fd, drmModeConnector *connector, void kmstest_edid_add_3d(const unsigned char *edid, size_t length, unsigned char *new_edid_ptr[], size_t *new_length); void kmstest_edid_add_4k(const unsigned char *edid, size_t length, unsigned char *new_edid_ptr[], size_t *new_length); void kmstest_force_edid(int drm_fd, drmModeConnector *connector, - const unsigned char *edid, size_t length); + const unsigned char *edid); bool kmstest_get_connector_default_mode(int drm_fd, drmModeConnector *connector, drmModeModeInfo *mode); @@ -759,7 +759,6 @@ struct cea_sad; struct cea_speaker_alloc; #define EDID_LENGTH 128 -#define AUDIO_EDID_LENGTH (2 * EDID_LENGTH) const unsigned char *igt_kms_get_base_edid(void); const unsigned char *igt_kms_get_alt_edid(void); const unsigned char *igt_kms_get_hdmi_audio_edid(void); |
