diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2011-09-08 12:05:00 +0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2011-09-08 12:05:26 +0800 |
commit | 830ac1681063150c3aaf00670b56ffa957aebcf1 (patch) | |
tree | 2a86fab079c2b96cf27a8a73fec885ee619fb464 | |
parent | 3ea0051cad55fb3e53d49b9535f4cef8c417bdeb (diff) | |
download | external_drm_gralloc-830ac1681063150c3aaf00670b56ffa957aebcf1.zip external_drm_gralloc-830ac1681063150c3aaf00670b56ffa957aebcf1.tar.gz external_drm_gralloc-830ac1681063150c3aaf00670b56ffa957aebcf1.tar.bz2 |
log connector info
Log the number of modes available, what the best mode is, and etc.
-rw-r--r-- | gralloc_drm_kms.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gralloc_drm_kms.c b/gralloc_drm_kms.c index db4a547..d2900ae 100644 --- a/gralloc_drm_kms.c +++ b/gralloc_drm_kms.c @@ -376,6 +376,11 @@ static drmModeModeInfoPtr find_mode(drmModeConnectorPtr connector, int *bpp) if (sscanf(value, "%dx%d", &xres, &yres) != 2) xres = yres = 0; } + + if ((xres && yres) || *bpp) { + LOGI("will find the closest match for %dx%d@%d", + xres, yres, *bpp); + } } else { *bpp = 0; @@ -441,7 +446,24 @@ static int drm_kms_init_with_connector(struct gralloc_drm_t *drm, drm->crtc_id = drm->resources->crtcs[i]; drm->connector_id = connector->connector_id; + /* print connector info */ + if (connector->count_modes > 1) { + LOGI("there are %d modes on connector 0x%x", + connector->count_modes, + connector->connector_id); + for (i = 0; i < connector->count_modes; i++) + LOGI(" %s", connector->modes[i].name); + } + else { + LOGI("there is one mode on connector 0x%d: %s", + connector->connector_id, + connector->modes[0].name); + } + mode = find_mode(connector, &bpp); + + LOGI("the best mode is %s", mode->name); + drm->mode = *mode; switch (bpp) { case 2: |