From: pengcheng chen Date: Mon, 11 Jun 2018 08:54:47 +0000 (+0800) Subject: osd: add ion_alloc failed process X-Git-Tag: khadas-vims-v0.9.6-release~1919 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76bd12e11b5caa5654c64cdf1a6bffcbd6455260;p=platform%2Fkernel%2Flinux-amlogic.git osd: add ion_alloc failed process PD#167090: osd: add ion_alloc failed process Change-Id: I4b6424f3bfaacc57553355a7115be0ed8f7feb34 Signed-off-by: pengcheng chen --- diff --git a/drivers/amlogic/media/osd/osd_fb.c b/drivers/amlogic/media/osd/osd_fb.c index 3a2195b..d5cc68e 100644 --- a/drivers/amlogic/media/osd/osd_fb.c +++ b/drivers/amlogic/media/osd/osd_fb.c @@ -1261,7 +1261,8 @@ static int malloc_osd_memory(struct fb_info *info) } } else { #ifdef CONFIG_AMLOGIC_ION - pr_info("use ion buffer for fb memory\n"); + pr_info("use ion buffer for fb memory, fb_index=%d\n", + fb_index); if (osd_meson_dev.afbc_type && osd_get_afbc(fb_index)) { pr_info("OSD%d as afbcd mode,afbc_type=%d\n", fb_index, osd_meson_dev.afbc_type); @@ -1274,6 +1275,11 @@ static int malloc_osd_memory(struct fb_info *info) 0, (1 << ION_HEAP_TYPE_DMA), 0); + if (IS_ERR(fb_ion_handle[fb_index][j])) { + osd_log_err("%s: size=%x, FAILED.\n", + __func__, fb_memsize[fb_index + 1]); + return -ENOMEM; + } ret = ion_phys(fb_ion_client, fb_ion_handle[fb_index][j], (ion_phys_addr_t *) @@ -1324,6 +1330,11 @@ static int malloc_osd_memory(struct fb_info *info) 0, (1 << ION_HEAP_TYPE_DMA), 0); + if (IS_ERR(fb_ion_handle[fb_index][0])) { + osd_log_err("%s: size=%x, FAILED.\n", + __func__, fb_memsize[fb_index + 1]); + return -ENOMEM; + } ret = ion_phys(fb_ion_client, fb_ion_handle[fb_index][0], (ion_phys_addr_t *)