osd: screen blank when Plugin HDMI after system bootup in 15s [1/1]
authorPengcheng Chen <pengcheng.chen@amlogic.com>
Thu, 13 Jun 2019 10:27:15 +0000 (18:27 +0800)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 07:04:51 +0000 (15:04 +0800)
PD#OTT-4292

Problem:
Root Cause:gralloc set afbcd = 1, but hwcomposer have no frame set,
hdmi plug and uboot logo update and osd_enable_hw() called, in this api,
there is a protection: if afbcd.enable set and phy_addr == 0 will
wait vsync till phy_addr != 0, this section code logic caused screen blank

Solution:
when gralloc set afbcd = 1, don't set afbcd.enable = 1,
it will update with hwcomposer post afbc frame.

Verify:
verify with Raven

Change-Id: I98a88cffd139832a34825adde7c21219937b63ce
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
drivers/amlogic/media/osd/osd_hw.c

index 37dac2f..f2cab7f 100644 (file)
@@ -2148,29 +2148,27 @@ void osd_set_pxp_mode(u32 mode)
 }
 void osd_set_afbc(u32 index, u32 enable)
 {
-       if (osd_hw.osd_meson_dev.afbc_type)
-               osd_hw.osd_afbcd[index].enable = enable;
-       osd_log_info("afbc_type=%d,enable=%d\n",
-               osd_hw.osd_meson_dev.afbc_type,
-               osd_hw.osd_afbcd[index].enable);
+       if (osd_hw.osd_meson_dev.osd_ver == OSD_NORMAL) {
+               if (osd_hw.osd_meson_dev.afbc_type)
+                       osd_hw.osd_afbcd[index].enable = enable;
+               osd_log_info("afbc_type=%d,enable=%d\n",
+                       osd_hw.osd_meson_dev.afbc_type,
+                       osd_hw.osd_afbcd[index].enable);
+       }
 }
 
 u32 osd_get_afbc(u32 index)
 {
        u32 afbc_type = 0;
-       u32 afbc_enalbe;
-
-       afbc_enalbe = osd_hw.osd_afbcd[index].enable;
-       if (afbc_enalbe) {
-               if (osd_hw.osd_meson_dev.cpu_id ==
-                       __MESON_CPU_MAJOR_ID_GXM)
-                       afbc_type = 1;
-               else if (osd_hw.osd_meson_dev.cpu_id >=
-                       __MESON_CPU_MAJOR_ID_G12A)
-                       afbc_type = 2;
-               else
-                       afbc_type = 0;
-       }
+
+       if (osd_hw.osd_meson_dev.cpu_id ==
+               __MESON_CPU_MAJOR_ID_GXM)
+               afbc_type = 1;
+       else if (osd_hw.osd_meson_dev.cpu_id >=
+               __MESON_CPU_MAJOR_ID_G12A)
+               afbc_type = 2;
+       else
+               afbc_type = 0;
        return afbc_type;
 }