summaryrefslogtreecommitdiff
path: root/tests/exynos
diff options
context:
space:
mode:
authorTobias Jakobi <tjakobi@math.uni-bielefeld.de>2015-06-12 20:15:14 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2015-06-29 19:19:23 +0100
commit2bf0d5bf63cda5a0abd79f2fd4b5737cb852b476 (patch)
treeb53f918ad4e272a6bcd009df7cf5b93e773f27fb /tests/exynos
parentb26c8efb6566e78d12a93fee7c01f6857e07f611 (diff)
tests/exynos: handle G2D_IMGBUF_COLOR in switch statements
This fixes a compiler warning about missing handling of enum values in the switch statements. Also remove the silent mapping to G2D_IMGBUF_GEM when an unknown buffer type is encountered. We have full control about the type here, and if it's unknown then we obviously have a bug in the code. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'tests/exynos')
-rw-r--r--tests/exynos/exynos_fimg2d_test.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/exynos/exynos_fimg2d_test.c b/tests/exynos/exynos_fimg2d_test.c
index 59de4ba4..8794dac3 100644
--- a/tests/exynos/exynos_fimg2d_test.c
+++ b/tests/exynos/exynos_fimg2d_test.c
@@ -270,9 +270,10 @@ static int g2d_copy_test(struct exynos_device *dev, struct exynos_bo *src,
src_img.user_ptr[0].userptr = userptr;
src_img.user_ptr[0].size = size;
break;
+ case G2D_IMGBUF_COLOR:
default:
- type = G2D_IMGBUF_GEM;
- break;
+ ret = -EFAULT;
+ goto fail;
}
printf("copy test with %s.\n",
@@ -306,6 +307,7 @@ err_free_userptr:
if (userptr)
free((void *)userptr);
+fail:
g2d_fini(ctx);
return ret;
@@ -349,9 +351,10 @@ static int g2d_copy_with_scale_test(struct exynos_device *dev,
src_img.user_ptr[0].userptr = userptr;
src_img.user_ptr[0].size = size;
break;
+ case G2D_IMGBUF_COLOR:
default:
- type = G2D_IMGBUF_GEM;
- break;
+ ret = -EFAULT;
+ goto fail;
}
printf("copy and scale test with %s.\n",
@@ -390,6 +393,7 @@ err_free_userptr:
if (userptr)
free((void *)userptr);
+fail:
g2d_fini(ctx);
return 0;
@@ -435,9 +439,10 @@ static int g2d_blend_test(struct exynos_device *dev,
src_img.user_ptr[0].userptr = userptr;
src_img.user_ptr[0].size = size;
break;
+ case G2D_IMGBUF_COLOR:
default:
- type = G2D_IMGBUF_GEM;
- break;
+ ret = -EFAULT;
+ goto fail;
}
printf("blend test with %s.\n",
@@ -487,6 +492,7 @@ err_free_userptr:
if (userptr)
free((void *)userptr);
+fail:
g2d_fini(ctx);
return 0;
@@ -532,6 +538,7 @@ static int g2d_checkerboard_test(struct exynos_device *dev,
src_img.user_ptr[0].userptr = (unsigned long)checkerboard;
src_img.user_ptr[0].size = img_w * img_h * 4;
break;
+ case G2D_IMGBUF_COLOR:
default:
ret = -EFAULT;
goto fail;