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>
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",
if (userptr)
free((void *)userptr);
+fail:
g2d_fini(ctx);
return ret;
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",
if (userptr)
free((void *)userptr);
+fail:
g2d_fini(ctx);
return 0;
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",
if (userptr)
free((void *)userptr);
+fail:
g2d_fini(ctx);
return 0;
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;