aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Jakobi2015-06-12 13:15:14 -0500
committerEmil Velikov2015-06-29 13:19:23 -0500
commit2bf0d5bf63cda5a0abd79f2fd4b5737cb852b476 (patch)
treeb53f918ad4e272a6bcd009df7cf5b93e773f27fb /tests/exynos/exynos_fimg2d_test.c
parentb26c8efb6566e78d12a93fee7c01f6857e07f611 (diff)
downloadexternal-libgbm-2bf0d5bf63cda5a0abd79f2fd4b5737cb852b476.tar.gz
external-libgbm-2bf0d5bf63cda5a0abd79f2fd4b5737cb852b476.tar.xz
external-libgbm-2bf0d5bf63cda5a0abd79f2fd4b5737cb852b476.zip
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/exynos_fimg2d_test.c')
-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,
270 src_img.user_ptr[0].userptr = userptr; 270 src_img.user_ptr[0].userptr = userptr;
271 src_img.user_ptr[0].size = size; 271 src_img.user_ptr[0].size = size;
272 break; 272 break;
273 case G2D_IMGBUF_COLOR:
273 default: 274 default:
274 type = G2D_IMGBUF_GEM; 275 ret = -EFAULT;
275 break; 276 goto fail;
276 } 277 }
277 278
278 printf("copy test with %s.\n", 279 printf("copy test with %s.\n",
@@ -306,6 +307,7 @@ err_free_userptr:
306 if (userptr) 307 if (userptr)
307 free((void *)userptr); 308 free((void *)userptr);
308 309
310fail:
309 g2d_fini(ctx); 311 g2d_fini(ctx);
310 312
311 return ret; 313 return ret;
@@ -349,9 +351,10 @@ static int g2d_copy_with_scale_test(struct exynos_device *dev,
349 src_img.user_ptr[0].userptr = userptr; 351 src_img.user_ptr[0].userptr = userptr;
350 src_img.user_ptr[0].size = size; 352 src_img.user_ptr[0].size = size;
351 break; 353 break;
354 case G2D_IMGBUF_COLOR:
352 default: 355 default:
353 type = G2D_IMGBUF_GEM; 356 ret = -EFAULT;
354 break; 357 goto fail;
355 } 358 }
356 359
357 printf("copy and scale test with %s.\n", 360 printf("copy and scale test with %s.\n",
@@ -390,6 +393,7 @@ err_free_userptr:
390 if (userptr) 393 if (userptr)
391 free((void *)userptr); 394 free((void *)userptr);
392 395
396fail:
393 g2d_fini(ctx); 397 g2d_fini(ctx);
394 398
395 return 0; 399 return 0;
@@ -435,9 +439,10 @@ static int g2d_blend_test(struct exynos_device *dev,
435 src_img.user_ptr[0].userptr = userptr; 439 src_img.user_ptr[0].userptr = userptr;
436 src_img.user_ptr[0].size = size; 440 src_img.user_ptr[0].size = size;
437 break; 441 break;
442 case G2D_IMGBUF_COLOR:
438 default: 443 default:
439 type = G2D_IMGBUF_GEM; 444 ret = -EFAULT;
440 break; 445 goto fail;
441 } 446 }
442 447
443 printf("blend test with %s.\n", 448 printf("blend test with %s.\n",
@@ -487,6 +492,7 @@ err_free_userptr:
487 if (userptr) 492 if (userptr)
488 free((void *)userptr); 493 free((void *)userptr);
489 494
495fail:
490 g2d_fini(ctx); 496 g2d_fini(ctx);
491 497
492 return 0; 498 return 0;
@@ -532,6 +538,7 @@ static int g2d_checkerboard_test(struct exynos_device *dev,
532 src_img.user_ptr[0].userptr = (unsigned long)checkerboard; 538 src_img.user_ptr[0].userptr = (unsigned long)checkerboard;
533 src_img.user_ptr[0].size = img_w * img_h * 4; 539 src_img.user_ptr[0].size = img_w * img_h * 4;
534 break; 540 break;
541 case G2D_IMGBUF_COLOR:
535 default: 542 default:
536 ret = -EFAULT; 543 ret = -EFAULT;
537 goto fail; 544 goto fail;