diff --git a/drivers/amlogic/media/osd/osd_fb.c b/drivers/amlogic/media/osd/osd_fb.c index 6b8227cf5460..80221a5dafd7 100644 --- a/drivers/amlogic/media/osd/osd_fb.c +++ b/drivers/amlogic/media/osd/osd_fb.c @@ -738,6 +738,11 @@ static int osd_set_par(struct fb_info *info) struct osd_ctl_s *osd_ctrl = &fbdev->osd_ctl; u32 virt_end_x, virt_end_y; +#ifdef CONFIG_ARCH_MESON64_ODROIDN2 + info->var.xres_virtual = info->var.xres; + info->var.yres_virtual = info->var.yres; +#endif + if (fbdev->fb_index <= OSD3) { 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 44482063bcbd..5e8609b3553d 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -2206,6 +2206,12 @@ void osd_setup_hw(u32 index, int update_geometry = 0; u32 w = (color->bpp * xres_virtual + 7) >> 3; u32 i; +#ifdef CONFIG_ARCH_MESON64_ODROIDN2 + if (index == 0) { + xres_virtual = xres; + yres_virtual = yres; + } +#endif /* CONFIG_ARCH_MESON64_ODROIDN2 */ osd_hw.buffer_alloc[index] = 1; pan_data.x_start = xoffset; @@ -2290,6 +2296,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); +#ifdef CONFIG_ARCH_MESON64_ODROIDN2 + 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 c48d644cdd0e..6211a6e3f8b2 100644 --- a/drivers/amlogic/media/osd/osd_logo.c +++ b/drivers/amlogic/media/osd/osd_logo.c @@ -30,7 +30,9 @@ /* Local Headers */ #include "osd_hw.h" #include "osd_log.h" - +#ifdef CONFIG_ARCH_MESON64_ODROIDN2 +#include "osd_fb.h" +#endif #undef pr_fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -190,6 +192,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; +#ifdef CONFIG_ARCH_MESON64_ODROIDN2 + 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 16f9a16bac3a..2d79eb5ee214 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 @@ -477,7 +477,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) || +#ifndef CONFIG_ARCH_MESON64_ODROIDN2 (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); @@ -585,10 +587,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 */ +#ifndef CONFIG_ARCH_MESON64_ODROIDN2 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)); hdev->output_blank_flag = 1; diff --git a/drivers/amlogic/media/vout/vout_serve/vout_serve.c b/drivers/amlogic/media/vout/vout_serve/vout_serve.c index dc897893337e..8dd7ce6a489d 100644 --- a/drivers/amlogic/media/vout/vout_serve/vout_serve.c +++ b/drivers/amlogic/media/vout/vout_serve/vout_serve.c @@ -377,7 +377,12 @@ static ssize_t vout_mode_show(struct class *class, { int ret = 0; - ret = snprintf(buf, VMODE_NAME_LEN_MAX, "%s\n", vout_mode); +#ifdef CONFIG_ARCH_MESON64_ODROIDN2 + 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; } @@ -400,7 +405,12 @@ static ssize_t vout_axis_show(struct class *class, { int ret = 0; - ret = snprintf(buf, 64, "%s\n", vout_axis); +#ifdef CONFIG_ARCH_MESON64_ODROIDN2 + 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; }