mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-20 22:36:24 +00:00
lib: allow the edid to be reset
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This commit is contained in:
parent
eef768f283
commit
b81020526f
@ -476,6 +476,8 @@ void kmstest_force_connector(int drm_fd, drmModeConnector *connector, enum
|
||||
*
|
||||
* Set the EDID data on @connector to @edid. See #generic_edid and
|
||||
* #kmstest_generic_edid for a set of generic EDID data blocks.
|
||||
*
|
||||
* If @length is zero, the forced EDID will be removed.
|
||||
*/
|
||||
void kmstest_force_edid(int drm_fd, drmModeConnector *connector,
|
||||
const unsigned char *edid, size_t length)
|
||||
@ -491,7 +493,10 @@ void kmstest_force_edid(int drm_fd, drmModeConnector *connector,
|
||||
|
||||
igt_assert(debugfs_fd != -1);
|
||||
|
||||
ret = write(debugfs_fd, edid, length);
|
||||
if (length == 0)
|
||||
ret = write(debugfs_fd, "reset", 5);
|
||||
else
|
||||
ret = write(debugfs_fd, edid, length);
|
||||
close(debugfs_fd);
|
||||
|
||||
igt_assert(ret != -1);
|
||||
|
@ -93,6 +93,13 @@ main (int argc, char **argv)
|
||||
|
||||
drmModeFreeConnector(temp);
|
||||
|
||||
/* remove edid */
|
||||
kmstest_force_edid(drm_fd, connector, NULL, 0);
|
||||
temp = drmModeGetConnector(drm_fd, connector->connector_id);
|
||||
/* the connector should now have the 5 default modes */
|
||||
igt_assert(temp->count_modes == 5);
|
||||
drmModeFreeConnector(temp);
|
||||
|
||||
/* force the connector off */
|
||||
kmstest_force_connector(drm_fd, connector, FORCE_CONNECTOR_OFF);
|
||||
temp = drmModeGetConnector(drm_fd, connector->connector_id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user