__s32 BSP_disp_video_get_fb(__u32 sel, __u32 hid, __disp_video_fb_t *in_addr) { hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if(g_video[sel][hid].enable) { memcpy(in_addr, &g_video[sel][hid].video_new, sizeof(__disp_video_fb_t)); return DIS_SUCCESS; } else { return DIS_FAIL; } }
__s32 BSP_disp_video_stop(__u32 sel, __u32 hid) { hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if(g_video[sel][hid].enable) { memset(&g_video[sel][hid], 0, sizeof(frame_para_t)); return DIS_SUCCESS; } else { return DIS_FAIL; } }
__s32 BSP_disp_layer_set_bottom(__u32 sel, __u32 hid) { __s32 i,j; __u32 layer_prio[4]; hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if(gdisp.screen[sel].layer_manage[hid].status & LAYER_USED) { __u32 prio = 0; for(i=0; i<gdisp.screen[sel].max_layers; i++) { layer_prio[i] = gdisp.screen[sel].layer_manage[i].para.prio; } layer_prio[hid] = prio++; for(j=0; j<gdisp.screen[sel].max_layers; j++)//for every prio from low to high { for(i=0; i<gdisp.screen[sel].max_layers; i++)//for every layer that prio is j { if((gdisp.screen[sel].layer_manage[i].status & LAYER_USED) && (i != hid) && (gdisp.screen[sel].layer_manage[i].para.prio == j)) { layer_prio[i] = prio++; } } } for(i=0;i<gdisp.screen[sel].max_layers;i++) { if(gdisp.screen[sel].layer_manage[i].status & LAYER_USED) { DE_BE_Layer_Set_Prio(sel, i, layer_prio[i]); gdisp.screen[sel].layer_manage[i].para.prio = layer_prio[i]; } } } else { return DIS_OBJ_NOT_INITED; } return DIS_SUCCESS; }
__s32 bsp_disp_cmu_layer_get_enable(__u32 screen_id,__u32 hid) { __layer_man_t * layer_man; hid= HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[screen_id].max_layers); layer_man = &gdisp.screen[screen_id].layer_manage[hid]; if((layer_man->status & LAYER_USED) && (layer_man->para.mode == DISP_LAYER_WORK_MODE_SCALER)) { __s32 ret; ret = (gdisp.screen[screen_id].cmu.status & CMU_LAYER_EN)? 1:0; return ret; } return DIS_NOT_SUPPORT; }
__s32 bsp_disp_cmu_layer_set_window(__u32 screen_id, __u32 hid, __disp_rect_t *rect) { __layer_man_t * layer_man; hid= HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[screen_id].max_layers); layer_man = &gdisp.screen[screen_id].layer_manage[hid]; if((layer_man->status & LAYER_USED) && (layer_man->para.mode == DISP_LAYER_WORK_MODE_SCALER)) { memcpy(&gdisp.screen[screen_id].cmu.layer_rect, rect, sizeof(__disp_rect_t)); if(gdisp.screen[screen_id].cmu.status & CMU_LAYER_EN) { IEP_CMU_Set_Window(screen_id,&gdisp.screen[screen_id].cmu.layer_rect); } return DIS_SUCCESS; } return DIS_NOT_SUPPORT; }
__s32 BSP_disp_layer_set_pipe(__u32 sel, __u32 hid, __u8 pipe) { hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if (pipe != 0 && pipe != 1) return DIS_OBJ_NOT_INITED; if (gdisp.screen[sel].layer_manage[hid].status & LAYER_USED) { DE_BE_Layer_Set_Pipe(sel, hid, pipe); gdisp.screen[sel].layer_manage[hid].para.pipe = pipe; } else { return DIS_OBJ_NOT_INITED; } return DIS_SUCCESS; }
__s32 BSP_disp_layer_colorkey_enable(__u32 sel, __u32 hid, __bool enable) { hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if(gdisp.screen[sel].layer_manage[hid].status & LAYER_USED) { DE_BE_Layer_ColorKey_Enable(sel, hid,enable); gdisp.screen[sel].layer_manage[hid].para.ck_enable = enable; } else { return DIS_OBJ_NOT_INITED; } return DIS_SUCCESS; }
__s32 BSP_disp_layer_set_alpha_value(__u32 sel, __u32 hid,__u8 value) { hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if(gdisp.screen[sel].layer_manage[hid].status & LAYER_USED) { DE_BE_Layer_Set_Alpha_Value(sel, hid, value); gdisp.screen[sel].layer_manage[hid].para.alpha_val = value; } else { return DIS_OBJ_NOT_INITED; } return DIS_SUCCESS; }
__s32 BSP_disp_video_start(__u32 sel, __u32 hid) { hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if(gdisp.screen[sel].layer_manage[hid].status & LAYER_USED) { memset(&g_video[sel][hid], 0, sizeof(frame_para_t)); g_video[sel][hid].video_cur.id = -1; g_video[sel][hid].enable = TRUE; return DIS_SUCCESS; } else { return DIS_FAIL; } }
__s32 BSP_disp_video_set_fb(__u32 sel, __u32 hid, __disp_video_fb_t *in_addr) { hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if(g_video[sel][hid].enable) { memcpy(&g_video[sel][hid].video_new, in_addr, sizeof(__disp_video_fb_t)); g_video[sel][hid].have_got_frame = TRUE; g_video[sel][hid].display_cnt = 0; return DIS_SUCCESS; } else { return DIS_FAIL; } }
__s32 bsp_disp_deu_set_black_exten_level(__u32 screen_id, __u32 hid, __u32 level) { __layer_man_t * layer_man; hid= HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[screen_id].max_layers); layer_man = &gdisp.screen[screen_id].layer_manage[hid]; if((layer_man->status & LAYER_USED) && (layer_man->para.mode == DISP_LAYER_WORK_MODE_SCALER)) { if((bsp_disp_feat_get_layer_feats(screen_id, DISP_LAYER_WORK_MODE_SCALER, layer_man->scaler_index) & DISP_LAYER_FEAT_DETAIL_ENHANCE)) { gdisp.scaler[layer_man->scaler_index].deu.black_exten_level = level; if(gdisp.scaler[layer_man->scaler_index].deu.enable) { IEP_Deu_Set_Black_Level_Extension(layer_man->scaler_index,level); } return DIS_SUCCESS; } } return DIS_NOT_SUPPORT; }
__s32 BSP_disp_layer_set_top(__u32 sel, __u32 hid) { __s32 i, j; __u32 layer_prio[4]; hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if (gdisp.screen[sel].layer_manage[hid].status & LAYER_USED) { __u32 prio = gdisp.screen[sel].max_layers - 1; for (i = 0; i < gdisp.screen[sel].max_layers; i++) layer_prio[i] = gdisp.screen[sel].layer_manage[i].para.prio; layer_prio[hid] = prio--; for (j = gdisp.screen[sel].max_layers - 1; j >= 0; j--) { for (i = 0; i < gdisp.screen[sel].max_layers; i++) { if ((gdisp.screen[sel].layer_manage[i].status & LAYER_USED) && (i != hid) && (gdisp.screen[sel].layer_manage[i].para.prio == j)) layer_prio[i] = prio--; } } for (i = 0; i < gdisp.screen[sel].max_layers; i++) { if (gdisp.screen[sel].layer_manage[i].status & LAYER_USED) { DE_BE_Layer_Set_Prio(sel, i, layer_prio[i]); gdisp.screen[sel].layer_manage[i].para.prio = layer_prio[i]; } } } else { return DIS_OBJ_NOT_INITED; } return DIS_SUCCESS; }
//return 10fps __s32 bsp_disp_video_get_fps(__u32 screen_id, __u32 hid) { __u32 pre_time_index, cur_time_index; __u32 pre_time, cur_time; __u32 fps = 0xff; hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[screen_id].max_layers); pre_time_index = video_time_index[screen_id][hid]; cur_time_index = (pre_time_index == 0)? (VIDEO_TIME_LEN -1):(pre_time_index-1); pre_time = video_time[screen_id][hid][pre_time_index]; cur_time = video_time[screen_id][hid][cur_time_index]; if(pre_time != cur_time) { fps = 1000 * 100 / (cur_time - pre_time); } return fps; }
__s32 bsp_disp_deu_set_window(__u32 screen_id, __u32 hid, __disp_rect_t *rect) { __layer_man_t * layer_man; hid= HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[screen_id].max_layers); layer_man = &gdisp.screen[screen_id].layer_manage[hid]; if((bsp_disp_feat_get_layer_feats(screen_id, DISP_LAYER_WORK_MODE_SCALER, layer_man->scaler_index) & DISP_LAYER_FEAT_DETAIL_ENHANCE)) { if((rect->width == 0) || (rect->height == 0)) { bsp_disp_layer_get_screen_window(screen_id,IDTOHAND(hid),rect); } memcpy(&gdisp.scaler[layer_man->scaler_index].deu.rect, rect, sizeof(__disp_rect_t)); if((layer_man->status & LAYER_USED) && (layer_man->para.mode == DISP_LAYER_WORK_MODE_SCALER)) { IEP_Deu_Set_Winodw(layer_man->scaler_index,rect); return DIS_SUCCESS; } } return DIS_NOT_SUPPORT; }
__s32 BSP_disp_video_get_frame_id(__u32 sel, __u32 hid)//get the current displaying frame id { hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if(g_video[sel][hid].enable) { if(g_video[sel][hid].have_got_frame == TRUE) { return g_video[sel][hid].video_cur.id; } else { return DIS_FAIL; } } else { return DIS_FAIL; } }
__s32 bsp_disp_cmu_layer_set_mode(__u32 screen_id, __u32 hid, __u32 mode) { __layer_man_t * layer_man; __u32 layer_bright, layer_saturation, layer_hue,layer_mode; hid= HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[screen_id].max_layers); layer_man = &gdisp.screen[screen_id].layer_manage[hid]; if((layer_man->status & LAYER_USED) && (layer_man->para.mode == DISP_LAYER_WORK_MODE_SCALER)) { gdisp.screen[screen_id].cmu.layer_mode = mode; layer_mode = gdisp.screen[screen_id].cmu.layer_mode; layer_bright = __disp_cmu_get_adjust_value(layer_mode, gdisp.screen[screen_id].cmu.layer_bright); layer_saturation = __disp_cmu_get_adjust_value(layer_mode, gdisp.screen[screen_id].cmu.layer_saturation); layer_hue = __disp_cmu_get_adjust_value(layer_mode, gdisp.screen[screen_id].cmu.layer_hue); if(gdisp.screen[screen_id].cmu.status & CMU_LAYER_EN) { IEP_CMU_Set_Par(screen_id, layer_hue, layer_saturation, layer_bright, layer_mode); } return DIS_SUCCESS; } return DIS_NOT_SUPPORT; }
__s32 bsp_disp_layer_set_top(__u32 screen_id, __u32 hid) { __s32 i,j; __u32 layer_prio[4]; hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[screen_id].max_layers); if(gdisp.screen[screen_id].layer_manage[hid].status & LAYER_USED) { __u32 prio = gdisp.screen[screen_id].max_layers-1; for(i=0; i<gdisp.screen[screen_id].max_layers; i++) { layer_prio[i] = gdisp.screen[screen_id].layer_manage[i].para.prio; } layer_prio[hid] = prio--; /* for every prio from high to low */ for(j=gdisp.screen[screen_id].max_layers-1; j>=0; j--) { /* for every layer_prio that prio is j */ for(i=0; i<gdisp.screen[screen_id].max_layers; i++) { if((gdisp.screen[screen_id].layer_manage[i].status & LAYER_USED) && (i != hid) && (gdisp.screen[screen_id].layer_manage[i].para.prio == j)) { layer_prio[i] = prio--; } } } for(i=0;i<gdisp.screen[screen_id].max_layers;i++) { if(gdisp.screen[screen_id].layer_manage[i].status & LAYER_USED) { DE_BE_Layer_Set_Prio(screen_id, i, layer_prio[i]); gdisp.screen[screen_id].layer_manage[i].para.prio = layer_prio[i]; } } } else { return DIS_OBJ_NOT_INITED; } return DIS_SUCCESS; }
__s32 BSP_disp_video_stop(__u32 sel, __u32 hid) { hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if(g_video[sel][hid].enable) { memset(&g_video[sel][hid], 0, sizeof(frame_para_t)); Disp_drc_start_ui_mode(sel); video_enhancement_stop(sel,hid); if(sel == 1) { //disp_clk_adjust(0, 1); } return DIS_SUCCESS; } else { return DIS_FAIL; } }
__s32 bsp_disp_video_get_dit_info(__u32 screen_id, __u32 hid, __disp_dit_info_t * dit_info) { hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[screen_id].max_layers); if(g_video[screen_id][hid].enable) { dit_info->maf_enable = FALSE; dit_info->pre_frame_enable = FALSE; if(g_video[screen_id][hid].dit_enable) { if(g_video[screen_id][hid].dit_mode == DIT_MODE_MAF) { dit_info->maf_enable = TRUE; } if(g_video[screen_id][hid].tempdiff_en) { dit_info->pre_frame_enable = TRUE; } } return DIS_SUCCESS; } else { return DIS_FAIL; } }
__s32 bsp_disp_deu_set_luma_sharp_level(__u32 screen_id, __u32 hid,__u32 level) { __layer_man_t * layer_man; hid= HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[screen_id].max_layers); layer_man = &gdisp.screen[screen_id].layer_manage[hid]; if((layer_man->status & LAYER_USED) && (layer_man->para.mode == DISP_LAYER_WORK_MODE_SCALER)) { if((bsp_disp_feat_get_layer_feats(screen_id, DISP_LAYER_WORK_MODE_SCALER, layer_man->scaler_index) & DISP_LAYER_FEAT_DETAIL_ENHANCE)) { __disp_scaler_t * scaler; scaler = &(gdisp.scaler[layer_man->scaler_index]); scaler->deu.luma_sharpe_level = level; if(scaler->deu.enable) { disp_deu_set_frame_info(screen_id, IDTOHAND(hid)); IEP_Deu_Set_Luma_Sharpness_Level(layer_man->scaler_index, scaler->deu.luma_sharpe_level); } return DIS_SUCCESS; } } return DIS_NOT_SUPPORT; }
__s32 BSP_disp_video_set_fb(__u32 sel, __u32 hid, __disp_video_fb_t *in_addr) { unsigned long flags; hid = HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[sel].max_layers); if(g_video[sel][hid].enable) { memcpy(&g_video[sel][hid].video_new, in_addr, sizeof(__disp_video_fb_t)); g_video[sel][hid].have_got_frame = true; #ifdef __LINUX_OSAL__ spin_lock_irqsave(&g_video[sel][hid].flag_lock, flags); #endif g_video[sel][hid].display_cnt = 0; #ifdef __LINUX_OSAL__ spin_unlock_irqrestore(&g_video[sel][hid].flag_lock, flags); #endif return DIS_SUCCESS; } else { return DIS_FAIL; } }
__s32 disp_deu_set_frame_info(__u32 screen_id, __u32 hid) { static __disp_frame_info_t frame_info; __disp_scaler_t * scaler; __scal_src_size_t in_size; __scal_out_size_t out_size; __u32 scaler_index; __layer_man_t * layer_man; hid= HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[screen_id].max_layers); layer_man = &gdisp.screen[screen_id].layer_manage[hid]; scaler_index = gdisp.screen[screen_id].layer_manage[hid].scaler_index; scaler = &(gdisp.scaler[scaler_index]); if(!(bsp_disp_feat_get_layer_feats(screen_id, DISP_LAYER_WORK_MODE_SCALER, layer_man->scaler_index) & DISP_LAYER_FEAT_DETAIL_ENHANCE)) { return DIS_NOT_SUPPORT; } if(scaler->deu.enable) { in_size.src_width = scaler->in_fb.size.width; in_size.src_height = scaler->in_fb.size.height; in_size.x_off = scaler->src_win.x; in_size.y_off = scaler->src_win.y; in_size.scal_width = scaler->src_win.width; in_size.scal_height = scaler->src_win.height; out_size.width = scaler->out_size.width; out_size.height = scaler->out_size.height; frame_info.b_interlace_out = 0; frame_info.b_trd_out = scaler->b_trd_out; frame_info.trd_out_mode = scaler->out_trd_mode; frame_info.csc_mode = scaler->in_fb.cs_mode; frame_info.disp_size.width = out_size.width; frame_info.disp_size.height = out_size.height; if(scaler->in_fb.b_trd_src) { __scal_3d_inmode_t inmode; __scal_3d_outmode_t outmode = 0; inmode = Scaler_3d_sw_para_to_reg(0, scaler->in_fb.trd_mode, 0); outmode = Scaler_3d_sw_para_to_reg(1, scaler->out_trd_mode, frame_info.b_interlace_out); DE_SCAL_Get_3D_In_Single_Size(inmode, &in_size, &in_size); if(scaler->b_trd_out) { DE_SCAL_Get_3D_Out_Single_Size(outmode, &out_size, &out_size); } } memcpy(&frame_info.disp_size, &scaler->out_size, sizeof(__disp_rectsz_t)); frame_info.in_size.width = in_size.scal_width; frame_info.in_size.height = in_size.scal_height; if((frame_info.out_size.width != out_size.width) || (frame_info.out_size.height != out_size.height)) { //pr_warn("out_size=<%dx%d>\n", out_size.width, out_size.height); } frame_info.out_size.width = out_size.width; frame_info.out_size.height = out_size.height; IEP_Deu_Set_frameinfo(scaler_index,frame_info); if((scaler->deu.rect.width == 0) || (scaler->deu.rect.height == 0) || (scaler->deu.rect.width == 1) || (scaler->deu.rect.height == 1)) { //pr_warn("deu.rest.size=<%dx%d>\n", scaler->deu.rect.width, scaler->deu.rect.height); } if((scaler->out_size.width == 0) || (scaler->out_size.height == 0) || (scaler->out_size.width == 1) || (scaler->out_size.height == 1)) { //pr_warn("scaler.outsize=<%dx%d>\n", scaler->out_size.width, scaler->out_size.height); } if((scaler->deu.rect.width == 0) || (scaler->deu.rect.height == 0) || (scaler->deu.rect.width == 1) || (scaler->deu.rect.height == 1)) { scaler->deu.rect.x = 0; scaler->deu.rect.y = 0; scaler->deu.rect.width = scaler->out_size.width; scaler->deu.rect.height = scaler->out_size.height; } IEP_Deu_Set_Winodw(scaler_index,&scaler->deu.rect); } return DIS_SUCCESS; }
__s32 bsp_disp_deu_enable(__u8 screen_id, __u32 hid, __u32 enable) { __layer_man_t * layer_man; __scal_out_type_t out_type; hid= HANDTOID(hid); HLID_ASSERT(hid, gdisp.screen[screen_id].max_layers); layer_man = &gdisp.screen[screen_id].layer_manage[hid]; if((layer_man->status & LAYER_USED) && (layer_man->para.mode == DISP_LAYER_WORK_MODE_SCALER)) { if((bsp_disp_feat_get_layer_feats(screen_id, DISP_LAYER_WORK_MODE_SCALER, layer_man->scaler_index) & DISP_LAYER_FEAT_DETAIL_ENHANCE)) { __disp_scaler_t * scaler; scaler = &(gdisp.scaler[layer_man->scaler_index]); if((enable == 1) && (!gdisp.scaler[layer_man->scaler_index].deu.enable)) { disp_deu_set_frame_info(screen_id, IDTOHAND(hid)); IEP_Deu_Set_Luma_Sharpness_Level(layer_man->scaler_index, scaler->deu.luma_sharpe_level); IEP_Deu_Set_Chroma_Sharpness_Level(layer_man->scaler_index, scaler->deu.chroma_sharpe_level); IEP_Deu_Set_Black_Level_Extension(layer_man->scaler_index, scaler->deu.black_exten_level); IEP_Deu_Set_White_Level_Extension(layer_man->scaler_index, scaler->deu.while_exten_level); bsp_disp_cfg_start(screen_id); //Scaler_Set_Para(layer_man->scaler_index,scaler); { scaler->out_fb.mode = DISP_MOD_NON_MB_PLANAR; scaler->out_fb.seq = DISP_SEQ_P3210; scaler->out_fb.format= DISP_FORMAT_YUV444; if(get_fb_type(scaler->out_fb.format) == DISP_FB_TYPE_YUV) { if(scaler->out_fb.mode == DISP_MOD_NON_MB_PLANAR) { out_type.fmt = Scaler_sw_para_to_reg(3, scaler->out_fb.mode, scaler->out_fb.format, scaler->out_fb.seq); } else { DE_WRN("output mode:%d invalid in bsp_disp_deu_enable\n",scaler->out_fb.mode); return DIS_FAIL; } } else { if(scaler->out_fb.mode == DISP_MOD_NON_MB_PLANAR && (scaler->out_fb.format == DISP_FORMAT_RGB888 || scaler->out_fb.format == DISP_FORMAT_ARGB8888)) { out_type.fmt = DE_SCAL_OUTPRGB888; } else if(scaler->out_fb.mode == DISP_MOD_INTERLEAVED && scaler->out_fb.format == DISP_FORMAT_ARGB8888 && scaler->out_fb.seq == DISP_SEQ_ARGB) { out_type.fmt = DE_SCAL_OUTI1RGB888; } else if(scaler->out_fb.mode == DISP_MOD_INTERLEAVED && scaler->out_fb.format == DISP_FORMAT_ARGB8888 && scaler->out_fb.seq == DISP_SEQ_BGRA) { out_type.fmt = DE_SCAL_OUTI0RGB888; } else { DE_WRN("output para invalid in bsp_disp_deu_enable,mode:%d,format:%d\n",scaler->out_fb.mode, scaler->out_fb.format); return DIS_FAIL; } } out_type.byte_seq = Scaler_sw_para_to_reg(2,scaler->out_fb.mode, scaler->out_fb.format, scaler->out_fb.seq); out_type.alpha_en = 1; out_type.alpha_coef_type = 0; DE_SCAL_Set_CSC_Coef(layer_man->scaler_index, scaler->in_fb.cs_mode, DISP_BT601, get_fb_type(scaler->in_fb.format), get_fb_type(scaler->out_fb.format), scaler->in_fb.br_swap, 0); DE_SCAL_Set_Out_Format(layer_man->scaler_index, &out_type); } IEP_Deu_Enable(layer_man->scaler_index, enable); bsp_disp_cfg_finish(screen_id); } else if((enable == 0) && (gdisp.scaler[layer_man->scaler_index].deu.enable)) { bsp_disp_cfg_start(screen_id); //Scaler_Set_Para(layer_man->scaler_index,scaler); { scaler->out_fb.mode = DISP_MOD_INTERLEAVED; scaler->out_fb.seq= DISP_SEQ_ARGB; scaler->out_fb.format= DISP_FORMAT_ARGB8888; if(get_fb_type(scaler->out_fb.format) == DISP_FB_TYPE_YUV) { if(scaler->out_fb.mode == DISP_MOD_NON_MB_PLANAR) { out_type.fmt = Scaler_sw_para_to_reg(3, scaler->out_fb.mode, scaler->out_fb.format, scaler->out_fb.seq); } else { DE_WRN("output mode:%d invalid in bsp_disp_deu_enable\n",scaler->out_fb.mode); return DIS_FAIL; } } else { if(scaler->out_fb.mode == DISP_MOD_NON_MB_PLANAR && (scaler->out_fb.format == DISP_FORMAT_RGB888 || scaler->out_fb.format == DISP_FORMAT_ARGB8888)) { out_type.fmt = DE_SCAL_OUTPRGB888; } else if(scaler->out_fb.mode == DISP_MOD_INTERLEAVED && scaler->out_fb.format == DISP_FORMAT_ARGB8888 && scaler->out_fb.seq == DISP_SEQ_ARGB) { out_type.fmt = DE_SCAL_OUTI1RGB888; } else if(scaler->out_fb.mode == DISP_MOD_INTERLEAVED && scaler->out_fb.format == DISP_FORMAT_ARGB8888 && scaler->out_fb.seq == DISP_SEQ_BGRA) { out_type.fmt = DE_SCAL_OUTI0RGB888; } else { DE_WRN("output para invalid in bsp_disp_deu_enable,mode:%d,format:%d\n",scaler->out_fb.mode, scaler->out_fb.format); return DIS_FAIL; } } out_type.byte_seq = Scaler_sw_para_to_reg(2,scaler->out_fb.mode, scaler->out_fb.format, scaler->out_fb.seq); out_type.alpha_en = 1; out_type.alpha_coef_type = 0; DE_SCAL_Set_CSC_Coef(layer_man->scaler_index, scaler->in_fb.cs_mode, DISP_BT601, get_fb_type(scaler->in_fb.format), get_fb_type(scaler->out_fb.format), scaler->in_fb.br_swap, 0); DE_SCAL_Set_Out_Format(layer_man->scaler_index, &out_type); } enable = (bsp_disp_get_output_type(screen_id) == DISP_OUTPUT_TYPE_NONE)? 2:0; IEP_Deu_Enable(layer_man->scaler_index, enable); bsp_disp_cfg_finish(screen_id); } gdisp.scaler[layer_man->scaler_index].deu.enable = enable; return DIS_SUCCESS; } } return DIS_NOT_SUPPORT; }