From a02649496afebea97dc64b59aca49c8e6e990e19 Mon Sep 17 00:00:00 2001 From: pengcheng chen Date: Mon, 15 Oct 2018 14:07:18 +0800 Subject: [PATCH] ge2d: fixed ge2d_ion_config for axg error issue [1/1] PD#SH-1 Problem: run axg ge2d demo failed Solution: fixed ge2d_ion_config for axg error Verify: verified in A113D board Change-Id: I48d789a42e7c0aad183fa4b6df1ca32a4ce1ab9b Signed-off-by: pengcheng chen --- drivers/amlogic/media/common/ge2d/ge2d_wq.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/amlogic/media/common/ge2d/ge2d_wq.c b/drivers/amlogic/media/common/ge2d/ge2d_wq.c index 1f75b1b48d55..ac4761a70df3 100644 --- a/drivers/amlogic/media/common/ge2d/ge2d_wq.c +++ b/drivers/amlogic/media/common/ge2d/ge2d_wq.c @@ -893,11 +893,25 @@ static int build_ge2d_addr_config_ion( { int ret = -1; int bpp_value = bpp(format); + unsigned long addr_temp = 0; bpp_value /= 8; ge2d_log_dbg("build_ge2d_addr_config_ion bpp_value=%d\n", bpp_value); if (plane) { + if (plane[0].shared_fd) { +#ifdef CONFIG_AMLOGIC_ION + size_t len = 0; + + ret = meson_ion_share_fd_to_phys(ge2d_ion_client, + plane[0].shared_fd, &addr_temp, &len); + if (ret != 0) + return ret; +#else + return ret; +#endif + } + plane[0].addr += addr_temp; if (plane[0].addr) { *addr = plane[0].addr; *stride = plane[0].w * bpp_value;