diff options
author | Abhinav Kumar <abhinavk@codeaurora.org> | 2020-09-15 12:56:11 -0700 |
---|---|---|
committer | Petri Latvala <petri.latvala@intel.com> | 2020-09-16 11:17:16 +0300 |
commit | 2e212b8397975926dc94293e1543b00e4bb359e6 (patch) | |
tree | 187138beba2b51b5f1a287d24324c3a063c0aa1c /tools | |
parent | e1b1f185c9e8b9d41f7dc8fb835de57454894581 (diff) |
lib/igt_kms: move some of the useful dump functions to igt_kms
Some of the functions inside the intel_dp_compliance are
generic and can be used by other modules as well. Move these
to the igt_kms lib.
changes in v2:
- add more documentation for the new APIs in the lib
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/intel_dp_compliance.c | 92 |
1 files changed, 2 insertions, 90 deletions
diff --git a/tools/intel_dp_compliance.c b/tools/intel_dp_compliance.c index 5c423897..fc512711 100644 --- a/tools/intel_dp_compliance.c +++ b/tools/intel_dp_compliance.c @@ -347,98 +347,10 @@ static int process_test_request(int test_type) return -1; } -static void dump_connectors_fd(int drmfd) -{ - int i, j; - - drmModeRes *mode_resources = drmModeGetResources(drmfd); - - if (!mode_resources) { - igt_warn("drmModeGetResources failed: %s\n", strerror(errno)); - return; - } - - igt_info("Connectors:\n"); - igt_info("id\tencoder\tstatus\t\ttype\tsize (mm)\tmodes\n"); - for (i = 0; i < mode_resources->count_connectors; i++) { - drmModeConnector *connector; - - connector = drmModeGetConnectorCurrent(drmfd, - mode_resources->connectors[i]); - if (!connector) { - igt_warn("Could not get connector %i: %s\n", - mode_resources->connectors[i], strerror(errno)); - continue; - } - - igt_info("%d\t%d\t%s\t%s\t%dx%d\t\t%d\n", - connector->connector_id, - connector->encoder_id, - kmstest_connector_status_str(connector->connection), - kmstest_connector_type_str(connector->connector_type), - connector->mmWidth, - connector->mmHeight, - connector->count_modes); - - if (!connector->count_modes) - continue; - - igt_info(" Modes:\n"); - igt_info(" name refresh (Hz) hdisp hss hse htot vdisp ""vss vse vtot flags type clock\n"); - for (j = 0; j < connector->count_modes; j++) { - igt_info("[%d]", j); - kmstest_dump_mode(&connector->modes[j]); - } - - drmModeFreeConnector(connector); - } - igt_info("\n"); - - drmModeFreeResources(mode_resources); -} - -static void dump_crtcs_fd(int drmfd) -{ - int i; - drmModeRes *mode_resources; - - mode_resources = drmModeGetResources(drmfd); - if (!mode_resources) { - igt_warn("drmModeGetResources failed: %s\n", strerror(errno)); - return; - } - - igt_info("CRTCs:\n"); - igt_info("id\tfb\tpos\tsize\n"); - for (i = 0; i < mode_resources->count_crtcs; i++) { - drmModeCrtc *crtc; - - crtc = drmModeGetCrtc(drmfd, mode_resources->crtcs[i]); - if (!crtc) { - igt_warn("Could not get crtc %i: %s\n", mode_resources->crtcs[i], strerror(errno)); - continue; - } - igt_info("%d\t%d\t(%d,%d)\t(%dx%d)\n", - crtc->crtc_id, - crtc->buffer_id, - crtc->x, - crtc->y, - crtc->width, - crtc->height); - - kmstest_dump_mode(&crtc->mode); - - drmModeFreeCrtc(crtc); - } - igt_info("\n"); - - drmModeFreeResources(mode_resources); -} - static void dump_info(void) { - dump_connectors_fd(drm_fd); - dump_crtcs_fd(drm_fd); + igt_dump_connectors_fd(drm_fd); + igt_dump_crtcs_fd(drm_fd); } static int setup_framebuffers(struct connector *dp_conn) |