summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongyeon Kim <dy5.kim@samsung.com>2015-11-12 17:30:53 +0900
committerDongyeon Kim <dy5.kim@samsung.com>2015-11-12 17:32:55 +0900
commit8c2f9a2669b27fcb904205d7422971648f86b246 (patch)
tree1287e4e6c92efc4f9dfbc8510aff974f501b9350
parent7db0e2066108c2ee78afd317727b581d1d7e8342 (diff)
evas/gl_generic: Check for errors when calling tbm surface map/unmap
tbm_surface_map/unmap might fail and return error, so we need to check the return value of these APIs.
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 6adea19166..8278b057ed 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -757,10 +757,15 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, i
757 if ((im->gc->shared->info.sec_tbm_surface) && (secsym_tbm_surface_map)) 757 if ((im->gc->shared->info.sec_tbm_surface) && (secsym_tbm_surface_map))
758 { 758 {
759 tbm_surface_info_s info; 759 tbm_surface_info_s info;
760 secsym_tbm_surface_map(im->tex->pt->dyn.buffer, 760 if (secsym_tbm_surface_map(im->tex->pt->dyn.buffer,
761 TBM_SURF_OPTION_READ|TBM_SURF_OPTION_WRITE, 761 TBM_SURF_OPTION_READ|TBM_SURF_OPTION_WRITE,
762 &info); 762 &info))
763 *image_data = im->tex->pt->dyn.data = (DATA32 *) info.planes[0].ptr; 763 {
764 ERR("tbm_surface_map failed!");
765 *image_data = im->tex->pt->dyn.data = NULL;
766 }
767 else
768 *image_data = im->tex->pt->dyn.data = (DATA32 *) info.planes[0].ptr;
764 } 769 }
765 else if ((im->gc->shared->info.sec_image_map) && (secsym_eglMapImageSEC)) 770 else if ((im->gc->shared->info.sec_image_map) && (secsym_eglMapImageSEC))
766 { 771 {
@@ -933,7 +938,10 @@ eng_image_data_put(void *data, void *image, DATA32 *image_data)
933 if (im->tex->pt->dyn.checked_out == 0) 938 if (im->tex->pt->dyn.checked_out == 0)
934 { 939 {
935 if (im->gc->shared->info.sec_tbm_surface) 940 if (im->gc->shared->info.sec_tbm_surface)
936 secsym_tbm_surface_unmap(im->tex->pt->dyn.buffer); 941 {
942 if (secsym_tbm_surface_unmap(im->tex->pt->dyn.buffer))
943 ERR("tbm_surface_unmap failed!");
944 }
937 else if (im->gc->shared->info.sec_image_map) 945 else if (im->gc->shared->info.sec_image_map)
938 { 946 {
939 void *disp = disp = re->window_egl_display_get(re->software.ob); 947 void *disp = disp = re->window_egl_display_get(re->software.ob);