Skip to content
Snippets Groups Projects
Commit 734d13b1 authored by Tobias Jakobi's avatar Tobias Jakobi Committed by Emil Velikov
Browse files

tests/exynos: improve error handling


Check for a useable connector and also if the resolution is sane
(width and height are both non-zero).

Signed-off-by: default avatarTobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
Tested-by: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
parent 74add49f
No related branches found
No related tags found
No related merge requests found
......@@ -616,10 +616,22 @@ int main(int argc, char **argv)
connector_find_mode(dev->fd, &con, resources);
drmModeFreeResources(resources);
if (!con.mode) {
fprintf(stderr, "failed to find usable connector\n");
ret = -EFAULT;
goto err_drm_close;
}
screen_width = con.mode->hdisplay;
screen_height = con.mode->vdisplay;
printf("screen width = %d, screen height = %d\n", screen_width,
if (screen_width == 0 || screen_height == 0) {
fprintf(stderr, "failed to find sane resolution on connector\n");
ret = -EFAULT;
goto err_drm_close;
}
printf("screen width = %d, screen height = %d\n", screen_width,
screen_height);
bo = exynos_create_buffer(dev, screen_width * screen_height * 4, 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment