[PATCH i-g-t 5/9] tests/kms_hdmi_inject: Test cleanup
Bhanuprakash Modem
bhanuprakash.modem at intel.com
Mon Jun 10 16:34:53 UTC 2024
From: Kunal Joshi <kunal1.joshi at intel.com>
Make sure the below points in IGT cleanup:
- Sanitize the state before starting the subtest.
- Clear the states before exiting the subtest.
- Update existing libdrm APIs with IGT kms APIs.
- Other misc (Ex: update deprecated APIs/macros/enums, FB leaks etc..)
v2: (Bhanu)
- Rebase
- Initialize pointers with NULL
- Update connector type HDMI checks
Signed-off-by: Kunal Joshi <kunal1.joshi at intel.com>
Reviewed-by: Jeevan B <jeevan.b at intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
tests/kms_hdmi_inject.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/kms_hdmi_inject.c b/tests/kms_hdmi_inject.c
index dce74fac0..d28be38e4 100644
--- a/tests/kms_hdmi_inject.c
+++ b/tests/kms_hdmi_inject.c
@@ -80,14 +80,15 @@ static drmModeConnector *
get_connector(int drm_fd, drmModeRes *res)
{
int i;
- drmModeConnector *connector;
+ drmModeConnector *connector = NULL;
for (i = 0; i < res->count_connectors; i++) {
connector =
drmModeGetConnectorCurrent(drm_fd, res->connectors[i]);
- if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA)
+ if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
+ connector->connector_type == DRM_MODE_CONNECTOR_HDMIB)
break;
drmModeFreeConnector(connector);
@@ -243,6 +244,7 @@ igt_main
igt_fixture {
drmModeFreeConnector(connector);
+ drmModeFreeResources(res);
drm_close_driver(drm_fd);
}
}
--
2.43.2
More information about the igt-dev
mailing list