ge2d: fixed ge2d_ion_config for axg error issue [1/1]
authorpengcheng chen <pengcheng.chen@amlogic.com>
Mon, 15 Oct 2018 06:07:18 +0000 (14:07 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Sat, 20 Oct 2018 14:28:40 +0000 (07:28 -0700)
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 <pengcheng.chen@amlogic.com>
drivers/amlogic/media/common/ge2d/ge2d_wq.c

index 1f75b1b..ac4761a 100644 (file)
@@ -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;