Beispiel #1
0
static __s32 video_enhancement_stop(__u32 screen_id, __u32 id)
{
	if(gdisp.screen[screen_id].layer_manage[id].video_enhancement_en) {
		bsp_disp_deu_enable(screen_id,IDTOHAND(id),FALSE);
		gdisp.screen[screen_id].layer_manage[id].video_enhancement_en = 0;
	}

	return 0;
}
Beispiel #2
0
static __s32 video_enhancement_start(__u32 screen_id, __u32 id)
{
	/* assume open HDMI before video start */
	if(gdisp.screen[screen_id].output_type == DISP_OUTPUT_TYPE_LCD) {
		bsp_disp_deu_enable(screen_id,IDTOHAND(id),TRUE);
		gdisp.screen[screen_id].layer_manage[id].video_enhancement_en = 1;
	}

	return 0;
}
Beispiel #3
0
__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;
}
Beispiel #4
0
__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;
}
static ssize_t disp_hid_store(struct device *dev,
        struct device_attribute *attr,
        const char *buf, size_t count)
{
  int err;
    unsigned long val;

  err = strict_strtoul(buf, 10, &val);
  if (err) {
    printk("Invalid size\n");
    return err;
  }

    if((val>3) || (val < 0))
    {
        printk("Invalid value, 0~3 is expected!\n");
    }else
    {
        printk("%ld\n", val);
        hid = IDTOHAND(val);
  }

  return count;
}
Beispiel #6
0
__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;
}
static ssize_t disp_sys_status_show(struct device *dev,
    struct device_attribute *attr, char *buf)
{
  ssize_t count = 0;
	int num_screens, screen_id;
	int num_layers, layer_id;

	num_screens = bsp_disp_feat_get_num_screens();
	for(screen_id=0; screen_id < num_screens; screen_id ++) {
		count += sprintf(buf + count, "screen %d:\n", screen_id);
		/* output */
		if(bsp_disp_get_output_type(screen_id) == DISP_OUTPUT_TYPE_LCD) {
			count += sprintf(buf + count, "\tlcd output\tbacklight(%3d)", bsp_disp_lcd_get_bright(screen_id));
		} else if(bsp_disp_get_output_type(screen_id) == DISP_OUTPUT_TYPE_HDMI) {
			count += sprintf(buf + count, "\thdmi output");
			if(bsp_disp_hdmi_get_mode(screen_id) == DISP_TV_MOD_720P_50HZ) {
				count += sprintf(buf + count, "%16s", "720p50hz");
			} else if(bsp_disp_hdmi_get_mode(screen_id) == DISP_TV_MOD_720P_60HZ) {
				count += sprintf(buf + count, "%16s", "720p60hz");
			} else if(bsp_disp_hdmi_get_mode(screen_id) == DISP_TV_MOD_1080P_60HZ) {
				count += sprintf(buf + count, "%16s", "1080p60hz");
			} else if(bsp_disp_hdmi_get_mode(screen_id) == DISP_TV_MOD_1080P_50HZ) {
				count += sprintf(buf + count, "%16s", "1080p50hz");
			} else if(bsp_disp_hdmi_get_mode(screen_id) == DISP_TV_MOD_1080I_50HZ) {
				count += sprintf(buf + count, "%16s", "1080i50hz");
			} else if(bsp_disp_hdmi_get_mode(screen_id) == DISP_TV_MOD_1080I_60HZ) {
				count += sprintf(buf + count, "%16s", "1080i60hz");
			}
		}

		if(bsp_disp_get_output_type(screen_id) != DISP_OUTPUT_TYPE_NONE) {
			count += sprintf(buf + count, "\t%4dx%4d", bsp_disp_get_screen_width(screen_id), bsp_disp_get_screen_height(screen_id));
			count += sprintf(buf + count, "\tfps(%3d.%1d)", bsp_disp_get_fps(screen_id)/10, bsp_disp_get_fps(screen_id)%10);
			count += sprintf(buf + count, "\n");
		}
		/* hdmi hpd */
		if((bsp_disp_feat_get_supported_output_types(screen_id) & DISP_OUTPUT_TYPE_HDMI)) {
			int hpd;

			hpd = bsp_disp_hdmi_get_hpd_status(screen_id);
			count += sprintf(buf + count, "\t%11s\n", hpd? "hdmi plugin":"hdmi unplug");
		}
		count += sprintf(buf + count, "    type  |  status | id | pipe | z | pre_mult |    alpha   | colorkey |  format  | framebuffer |       source crop     |          frame        |   trd   |         address\n");
		count += sprintf(buf + count, "----------+---------+----+------+---+----------+------------+----------+----------+-------------+-----------------------+-----------------------+---------+-----------------------------\n");
		num_layers = bsp_disp_feat_get_num_layers(screen_id);
		/* layer info */
		for(layer_id=0; layer_id<num_layers; layer_id++) {
			__disp_layer_info_t layer_para;
			int ret;

			ret = bsp_disp_layer_get_para(screen_id, IDTOHAND(layer_id), &layer_para);
			if(ret == 0) {
				count += sprintf(buf + count, " %8s |", (layer_para.mode == DISP_LAYER_WORK_MODE_SCALER)? "SCALER":"NORAML");
				count += sprintf(buf + count, " %7s |", bsp_disp_layer_is_open(screen_id, IDTOHAND(layer_id))?"enable":"disable");
				count += sprintf(buf + count, " %2d |", layer_id);
				count += sprintf(buf + count, " %4d |", layer_para.pipe);
				count += sprintf(buf + count, " %1d |", layer_para.prio);
				count += sprintf(buf + count, " %8s |", (layer_para.fb.pre_multiply)? "Y":"N");
				count += sprintf(buf + count, " %5s(%3d) |", (layer_para.alpha_en)? "globl":"pixel", layer_para.alpha_val);
				count += sprintf(buf + count, " %8s |", (layer_para.ck_enable)? "enable":"disable");
				count += sprintf(buf + count, " %2d,%2d,%2d |", layer_para.fb.mode, layer_para.fb.format, layer_para.fb.seq);
				count += sprintf(buf + count, " [%4d,%4d] |", layer_para.fb.size.width, layer_para.fb.size.height);
				count += sprintf(buf + count, " [%4d,%4d,%4d,%4d] |", layer_para.src_win.x, layer_para.src_win.y, layer_para.src_win.width, layer_para.src_win.height);
				count += sprintf(buf + count, " [%4d,%4d,%4d,%4d] |", layer_para.scn_win.x, layer_para.scn_win.y, layer_para.scn_win.width, layer_para.scn_win.height);
				count += sprintf(buf + count, " [%1d%1d,%1d%1d] |", layer_para.fb.b_trd_src, layer_para.fb.trd_mode, layer_para.b_trd_out, layer_para.out_trd_mode);
				count += sprintf(buf + count, " [%8x,%8x,%8x]", layer_para.fb.addr[0], layer_para.fb.addr[1], layer_para.fb.addr[2]);
				count += sprintf(buf + count, "\n");
			}
		}
		if(bsp_disp_feat_get_smart_backlight_support(screen_id)) {
			__disp_rect_t window;
			count += sprintf(buf + count, "\n\tsmart backlight: %s", bsp_disp_drc_get_enable(screen_id)? "enable":"disable");
			if(bsp_disp_drc_get_enable(screen_id)) {
				bsp_disp_drc_get_window(screen_id, &window);
				count += sprintf(buf + count, "\twindow[%4d,%4d,%4d,%4d]", window.x, window.y, window.width, window.height);
			}
			count += sprintf(buf + count, "\n");
		}
	}

	return count;
}
void LCD_vbi_event_proc(__u32 screen_id, __u32 tcon_index)
{
	__u32 cur_line = 0, start_delay = 0;
	__u32 i = 0;
	__u32 num_scalers;
#ifdef __LINUX_OSAL__
	unsigned long flags;
#endif
	num_scalers = bsp_disp_feat_get_num_scalers();

	disp_vint_checkin(screen_id);
	disp_lcd_set_fps(screen_id);

	Video_Operation_In_Vblanking(screen_id, tcon_index);
	disp_capture_screen_proc(screen_id);

	cur_line = TCON_get_cur_line(screen_id, tcon_index);
	start_delay = TCON_get_start_delay(screen_id, tcon_index);
	if(cur_line > start_delay-4) {
		//DE_INF("int:%d,%d\n", cur_line,start_delay);
		/* return while not  trigger mode  */
		if(gpanel_info[screen_id].lcd_fresh_mode == 0) {
			return ;
		}
	}

#ifdef __LINUX_OSAL__
	spin_lock_irqsave(&gdisp.screen[screen_id].flag_lock, flags);
#endif
	if(gdisp.screen[screen_id].cache_flag == FALSE && gdisp.screen[screen_id].cfg_cnt == 0) {
		gdisp.screen[screen_id].have_cfg_reg = TRUE;
#ifdef __LINUX_OSAL__
	spin_unlock_irqrestore(&gdisp.screen[screen_id].flag_lock, flags);
#endif
		DE_BE_Cfg_Ready(screen_id);
		IEP_CMU_Operation_In_Vblanking(screen_id);
		for(i=0; i<num_scalers; i++) {
			if((gdisp.scaler[i].status & SCALER_USED) && (gdisp.scaler[i].screen_index == screen_id))	{
				__u32 hid;

				if(gdisp.scaler[i].b_close == TRUE) {
					Scaler_close(i);
					gdisp.scaler[i].b_close = FALSE;
				}	else {
					hid = gdisp.scaler[i].layer_id;
					DE_SCAL_Set_Reg_Rdy(i);
					//DE_SCAL_Reset(i);
					//DE_SCAL_Start(i);
					disp_deu_set_frame_info(screen_id, IDTOHAND(hid));
					disp_deu_output_select(screen_id, IDTOHAND(hid), screen_id);
					IEP_Deu_Operation_In_Vblanking(i);
				}
				gdisp.scaler[i].b_reg_change = FALSE;
			}
		}

		if(DISP_OUTPUT_TYPE_LCD == bsp_disp_get_output_type(screen_id)) {
			IEP_Drc_Operation_In_Vblanking(screen_id);
		}

		if(gdisp.init_para.take_effect) {
			gdisp.init_para.take_effect(screen_id);
		}
	} else {
#ifdef __LINUX_OSAL__
	spin_unlock_irqrestore(&gdisp.screen[screen_id].flag_lock, flags);
#endif
	}

#if 0
	cur_line = LCDC_get_cur_line(screen_id, tcon_index);

	if(cur_line > 5) {
		DE_INF("%d\n", cur_line);
	}
#endif

	return ;
}