From 6f7138e3ac2a900a0720be31d486fcb8514fe5ed Mon Sep 17 00:00:00 2001 From: Joy Cho Date: Wed, 17 Jul 2019 14:08:50 +0900 Subject: [PATCH] ODROID-COMMON: osd: Adjust osd scaler and vout serve to fit in KODI Change-Id: Iab2b015061ba29fd407282be21509d01165b3d50 Signed-off-by: Dongjin Kim --- drivers/amlogic/media/osd/osd_fb.c | 5 +++++ drivers/amlogic/media/osd/osd_hw.c | 9 +++++++++ drivers/amlogic/media/osd/osd_logo.c | 13 +++++++++++++ .../media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c | 4 ++++ drivers/amlogic/media/vout/vout_serve/vout_serve.c | 14 ++++++++++++-- 5 files changed, 43 insertions(+), 2 deletions(-) diff --git a/drivers/amlogic/media/osd/osd_fb.c b/drivers/amlogic/media/osd/osd_fb.c index 850090f59780..ebe36aa9eb9b 100644 --- a/drivers/amlogic/media/osd/osd_fb.c +++ b/drivers/amlogic/media/osd/osd_fb.c @@ -692,6 +692,11 @@ static int osd_set_par(struct fb_info *info) output_index = get_output_device_id(fbdev->fb_index); +#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON) + info->var.xres_virtual = info->var.xres; + info->var.yres_virtual = info->var.yres; +#endif + if (fbdev->fb_index < osd_hw.osd_meson_dev.viu1_osd_count) { vinfo = get_current_vinfo(); if (!vinfo) { diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c index 88c53af454ff..31e93390032f 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -2802,6 +2802,12 @@ void osd_setup_hw(u32 index, int update_geometry = 0; u32 w = (color->bpp * xres_virtual + 7) >> 3; u32 i; +#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON) + if (index == 0) { + xres_virtual = xres; + yres_virtual = yres; + } +#endif /* CONFIG_ARCH_MESON64_ODROID_COMMON */ osd_hw.buffer_alloc[index] = 1; pan_data.x_start = xoffset; @@ -2886,6 +2892,9 @@ void osd_setup_hw(u32 index, osd_log_info("osd[%d] out_addr_id =0x%x\n", index, osd_hw.osd_afbcd[index].out_addr_id); +#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON) + set_osd_logo_freescaler(); +#endif if (osd_hw.osd_meson_dev.osd_ver == OSD_SIMPLE) osd_update_phy_addr(0); #ifdef CONFIG_AMLOGIC_MEDIA_CANVAS diff --git a/drivers/amlogic/media/osd/osd_logo.c b/drivers/amlogic/media/osd/osd_logo.c index d00279eb6bf5..49d26014706b 100644 --- a/drivers/amlogic/media/osd/osd_logo.c +++ b/drivers/amlogic/media/osd/osd_logo.c @@ -32,6 +32,9 @@ #include "osd_log.h" #include "osd.h" +#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON) +#include "osd_fb.h" +#endif #undef pr_fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -191,6 +194,16 @@ int set_osd_logo_freescaler(void) s32 dst_y_start = 0, dst_y_end = 0; s32 target_x_end = 0, target_y_end = 0; +#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON) + struct osd_fb_dev_s *fb_dev; + + fb_dev = gp_fbdev_list[0]; + if (fb_dev) { + logo_info.fb_width = fb_dev->fb_info->var.xres; + logo_info.fb_height = fb_dev->fb_info->var.yres; + } +#endif + if (logo_info.loaded == 0) return 0; diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c index c8d910070c1e..f2b0eb748b9f 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c @@ -495,7 +495,9 @@ static int set_disp_mode_auto(void) (strncmp(info->name, "ntsc_m", 6) == 0) || (strncmp(info->name, "pal_m", 5) == 0) || (strncmp(info->name, "pal_n", 5) == 0) || +#if !defined(CONFIG_ARCH_MESON64_ODROID_COMMON) (strncmp(info->name, "panel", 5) == 0) || +#endif (strncmp(info->name, "null", 4) == 0)) { pr_info(SYS "%s not valid hdmi mode\n", info->name); hdev->hwop.cntlconfig(hdev, CONF_CLR_AVI_PACKET, 0); @@ -606,10 +608,12 @@ static int set_disp_mode_auto(void) hdev->mux_hpd_if_pin_high_flag = 0; } /* If current display is NOT panel, needn't TURNOFF_HDMIHW */ +#if !defined(CONFIG_ARCH_MESON64_ODROID_COMMON) if (strncmp(mode, "panel", 5) == 0) { hdev->hwop.cntl(hdev, HDMITX_HWCMD_TURNOFF_HDMIHW, (hdev->hpdmode == 2)?1:0); } +#endif } hdmitx_set_audio(hdev, &(hdev->cur_audio_param)); if (hdev->cedst_policy) { diff --git a/drivers/amlogic/media/vout/vout_serve/vout_serve.c b/drivers/amlogic/media/vout/vout_serve/vout_serve.c index 3321fe90a530..6cc230d7e63f 100644 --- a/drivers/amlogic/media/vout/vout_serve/vout_serve.c +++ b/drivers/amlogic/media/vout/vout_serve/vout_serve.c @@ -399,7 +399,12 @@ static ssize_t vout_mode_show(struct class *class, { int ret = 0; - ret = snprintf(buf, VMODE_NAME_LEN_MAX, "%s\n", vout_mode); +#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON) + if (strncmp(vout_mode, "custombuilt", 11) == 0) + ret = snprintf(buf, VMODE_NAME_LEN_MAX, "%s\n", "panel"); + else +#endif + ret = snprintf(buf, VMODE_NAME_LEN_MAX, "%s\n", vout_mode); return ret; } @@ -422,7 +427,12 @@ static ssize_t vout_axis_show(struct class *class, { int ret = 0; - ret = snprintf(buf, 64, "%s\n", vout_axis); +#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON) + if (strncmp(vout_mode, "custombuilt", 11) == 0) + ret = snprintf(buf, 64, "%s\n", "0 0 1920 1080 0 0"); + else +#endif + ret = snprintf(buf, 64, "%s\n", vout_axis); return ret; }