Ejemplo n.º 1
0
s32 disp_device_detach(int disp_mgr, int disp_dev, disp_output_type output_type)
{
	struct disp_manager *mgr = NULL;
	struct disp_device *dispdev = NULL;

	mgr = disp_get_layer_manager(disp_mgr);
	if(!mgr) {
		DE_WRN("get mgr%d fail\n", disp_mgr);
		return -1;
	}

	dispdev = disp_device_get(disp_dev, output_type);
	if(!dispdev) {
		DE_WRN("get device%d fail\n", disp_dev);
		return -1;
	}

	if(mgr->device == dispdev) {
		if(dispdev->disable)
			dispdev->disable(dispdev);
		if(dispdev->unset_manager)
			dispdev->unset_manager(dispdev);
	}

	return 0;
}
Ejemplo n.º 2
0
/***********************************************************
 *
 * lcd interface
 *
 ***********************************************************/
s32 bsp_disp_lcd_pre_enable(u32 screen_id)
{
	struct disp_lcd* lcd;
	struct disp_manager *mgr;

	mgr = disp_get_layer_manager(screen_id);
	lcd = disp_get_lcd(screen_id);
	if(!mgr || !lcd) {
		DE_WRN("get lcd%d or mgr%d fail\n", screen_id, screen_id);
	}

	if(mgr->is_enabled && mgr->is_enabled(mgr)) {
		DE_WRN("manager %d is already enable\n", screen_id);
		return DIS_FAIL;
	}

	if(mgr->enable)
		mgr->enable(mgr);
	if(mgr->set_output_type && lcd && lcd->is_vga_used && lcd->is_vga_used(lcd)){
		mgr->set_output_type(mgr, DISP_OUTPUT_TYPE_VGA);
    }else if(mgr->set_output_type){
		mgr->set_output_type(mgr, DISP_OUTPUT_TYPE_LCD);
    }
	if(lcd && lcd->pre_enable)
		return lcd->pre_enable(lcd);

	return DIS_FAIL;
}
Ejemplo n.º 3
0
/***********************************************************
 *
 * lcd interface
 *
 ***********************************************************/
s32 bsp_disp_lcd_pre_enable(u32 screen_id)
{
	struct disp_lcd* lcd;
	struct disp_manager *mgr;

	mgr = disp_get_layer_manager(screen_id);
	lcd = disp_get_lcd(screen_id);
	if(!mgr || !lcd) {
		DE_WRN("get lcd%d or mgr%d fail\n", screen_id, screen_id);
        return -1;
	}

	if(mgr->is_enabled && mgr->is_enabled(mgr)) {
		DE_WRN("manager %d is already enable\n", screen_id);
		return DIS_FAIL;
	}

	if(mgr->enable)
		mgr->enable(mgr);

	if(lcd && lcd->pre_enable)
		return lcd->pre_enable(lcd);

	return DIS_FAIL;
}
Ejemplo n.º 4
0
/***********************************************************
 *
 * hdmi interface
 *
 ***********************************************************/
s32 bsp_disp_hdmi_enable(u32 screen_id)
{
	struct disp_hdmi* hdmi;
	struct disp_manager *mgr;
	hdmi = disp_get_hdmi(screen_id);
	mgr = disp_get_layer_manager(screen_id);

	if(!hdmi || !mgr) {
		DE_WRN("get hdm%dor mgr%d failed!\n", screen_id, screen_id);
		return DIS_FAIL;
	    }

	if(mgr->is_enabled && mgr->is_enabled(mgr)) {
		DE_WRN("manager %d is already enable\n", screen_id);
		return DIS_FAIL;
	}

	if(mgr->enable)
		mgr->enable(mgr);
	if(mgr->set_output_type)
		mgr->set_output_type(mgr, DISP_OUTPUT_TYPE_HDMI);

	if(hdmi->enable) {
	    return hdmi->enable(hdmi);
	    }

	return DIS_FAIL;
}
Ejemplo n.º 5
0
s32 disp_init_connections(void)
{
	u32 disp = 0;
	u32 num_screens = 0;
	u32 num_layers = 0,layer_id = 0;

	DE_INF("disp_init_connections\n");

	num_screens = bsp_disp_feat_get_num_screens();
	for(disp=0; disp<num_screens; disp++) {
		struct disp_manager *mgr;
		struct disp_layer *lyr;
		struct disp_device *lcd = NULL;
		struct disp_enhance *enhance = NULL;
		struct disp_smbl *smbl = NULL;
		struct disp_capture *cptr = NULL;

		mgr = disp_get_layer_manager(disp);
		if(!mgr)
			continue;

		/* connect layer & it's manager */
		num_layers = bsp_disp_feat_get_num_layers(disp);
		for(layer_id=0; layer_id<num_layers; layer_id++) {
			lyr = disp_get_layer_1(disp, layer_id);
			if(NULL != lyr) {
				lyr->set_manager(lyr, mgr);
			}
		}

		/* connect device & it's manager */
		if(bsp_disp_feat_is_supported_output_types(disp, DISP_OUTPUT_TYPE_LCD)) {
			lcd = disp_get_lcd(disp);
			if((lcd) && (lcd->set_manager))
				lcd->set_manager(lcd, mgr);
		} else {
			//other device
		}

		enhance = disp_get_enhance(disp);
		if(enhance && (enhance->set_manager)) {
			enhance->set_manager(enhance, mgr);
		}

		smbl = disp_get_smbl(disp);
		if(smbl && (smbl->set_manager)) {
			smbl->set_manager(smbl, mgr);
		}

		cptr = disp_get_capture(disp);
		if(cptr && (cptr->set_manager)) {
			cptr->set_manager(cptr, mgr);
		}
	}

	return 0;
}
Ejemplo n.º 6
0
static s32 disp_sync_all(u32 screen_id)
{
	struct disp_manager *mgr;
	struct disp_smbl *smbl;
	struct disp_capture *capture;
	struct disp_smcl *smcl;

#if defined(CONFIG_ARCH_SUN9IW1P1)
	struct disp_cursor *cursor;
#endif

	mgr = disp_get_layer_manager(screen_id);
	if(!mgr) {
		//DE_WRN("get mgr%d fail\n", screen_id);
	} else {
		if(mgr->sync)
			mgr->sync(mgr);
		}

	smbl = disp_get_smbl(screen_id);
	if(!smbl) {
		//DE_WRN("get smbl%d fail\n", screen_id);
	} else {
		if(smbl->sync)
			smbl->sync(smbl);
		}

	capture = disp_get_capture(screen_id);
	if(!capture) {
		//DE_WRN("get capture%d fail\n", screen_id);
	} else {
		if(capture->sync)
			capture->sync(capture);
		}

	smcl = disp_get_smcl(screen_id);
	if(!smcl) {
		//DE_WRN("get smcl %d fail\n", screen_id);
	} else {
		if(smcl->sync)
			smcl->sync(smcl);
		}

#if defined(CONFIG_ARCH_SUN9IW1P1)
	cursor = disp_get_cursor(screen_id);
	if(!cursor) {
		//DE_WRN("get cursor%d fail\n", screen_id);
	} else {
		if(cursor->sync)
			cursor->sync(cursor);
		}

#endif
	return 0;
}
Ejemplo n.º 7
0
s32 bsp_disp_get_output_type(u32 disp)
{
	struct disp_manager *mgr = disp_get_layer_manager(disp);
	if(mgr) {
		struct disp_device *dispdev = mgr->device;
		if(dispdev && dispdev->is_enabled && dispdev->is_enabled(dispdev))
			return dispdev->type;
	}

	return DISP_OUTPUT_TYPE_NONE;
}
Ejemplo n.º 8
0
s32 disp_device_attached_and_enable(int disp_mgr, int disp_dev, disp_output_type output_type, disp_tv_mode mode)
{
	struct disp_manager *mgr = NULL;
	struct disp_device *dispdev = NULL;

	mgr = disp_get_layer_manager(disp_mgr);
	if(!mgr)
		return -1;

	/* no need to attch */
	if(mgr->device && (output_type == mgr->device->type)) {
		if(mgr->device->is_enabled && !mgr->device->is_enabled(mgr->device)) {
			if((DISP_OUTPUT_TYPE_HDMI == output_type)
				|| (DISP_OUTPUT_TYPE_TV == output_type)) {
				if(mgr->device->set_mode)
					mgr->device->set_mode(mgr->device, mode);
			}

			if(mgr->device->enable)
				mgr->device->enable(mgr->device);
		}
		return 0;
	}

	/* detach manager and device first */
	if(mgr->device) {
		dispdev = mgr->device;
		if(dispdev->is_enabled && dispdev->is_enabled(dispdev)
			&& dispdev->disable)
			dispdev->disable(dispdev);
		if(dispdev->unset_manager)
			dispdev->unset_manager(dispdev);
	}

	dispdev = disp_device_get(disp_dev, output_type);
	if(dispdev && dispdev->set_manager) {
			dispdev->set_manager(dispdev, mgr);
			DE_WRN("attched ok, mgr%d<-->device%d, type=%d, mode=%d----\n", disp_mgr, disp_dev, (u32)output_type, (u32)mode);
			if((DISP_OUTPUT_TYPE_HDMI == output_type)
				|| (DISP_OUTPUT_TYPE_TV == output_type)) {
					printf("ready to set mode\n");
				if(dispdev->set_mode)
					dispdev->set_mode(dispdev, mode);
			}
			if(dispdev->enable)
				dispdev->enable(dispdev);
			return 0;
	}

	return -1;
}
Ejemplo n.º 9
0
s32 bsp_disp_get_screen_height(u32 screen_id)
{
	struct disp_manager *mgr;
	u32 width = 0, height = 0;

	mgr = disp_get_layer_manager(screen_id);
	if(mgr && (mgr->get_screen_size)) {
		mgr->get_screen_size(mgr, &width, &height);
		return height;
	}

	return DIS_FAIL;

}
Ejemplo n.º 10
0
static s32 disp_sync_all(u32 disp)
{
	struct disp_manager *mgr;

	mgr = disp_get_layer_manager(disp);
	if(!mgr) {
		DE_WRN("get mgr%d fail\n", disp);
	} else {
		if(mgr->sync)
			mgr->sync(mgr);
	}

	return 0;
}
Ejemplo n.º 11
0
s32 bsp_disp_get_output_type(u32 screen_id)
{
	struct disp_manager *mgr;
	u32 output_type = DISP_OUTPUT_TYPE_NONE;

	mgr = disp_get_layer_manager(screen_id);
	if(mgr && (mgr->get_output_type)) {
		mgr->get_output_type(mgr, &output_type);
	} else {
		DE_WRN("get mgr%d fail\n", screen_id);
	}

	return output_type;
}
Ejemplo n.º 12
0
s32 bsp_disp_set_color_key(u32 screen_id, disp_colorkey *ck)
{
	struct disp_manager *mgr;

	mgr = disp_get_layer_manager(screen_id);
	if(!mgr) {
		DE_WRN("get mgr%d fail\n", screen_id);
		return DIS_FAIL;
	}

	if(mgr->set_color_key)
		return mgr->set_color_key(mgr, ck);

	return DIS_FAIL;
}
Ejemplo n.º 13
0
/***********************************************************
 *
 * manager interface
 *
 ***********************************************************/
s32 bsp_disp_set_back_color(u32 screen_id, disp_color_info *bk_color)
{
	struct disp_manager *mgr;

	mgr = disp_get_layer_manager(screen_id);
	if(!mgr) {
		DE_WRN("get mgr%d fail\n", screen_id);
		return DIS_FAIL;
	}

	if(mgr->set_back_color)
		return mgr->set_back_color(mgr, bk_color);

	return DIS_FAIL;
}
Ejemplo n.º 14
0
s32 bsp_disp_lcd_pre_disable(u32 screen_id)
{
	struct disp_lcd* lcd;
	struct disp_manager *mgr;

	mgr = disp_get_layer_manager(screen_id);
	lcd = disp_get_lcd(screen_id);
	if(!mgr || !lcd) {
		DE_WRN("get lcd%d or mgr%d fail\n", screen_id, screen_id);
        return -1;
	}

	if(mgr->set_output_type)
		mgr->set_output_type(mgr, DISP_OUTPUT_TYPE_NONE);

	if(lcd->pre_disable) {
		return lcd->pre_disable(lcd);
	}
	return DIS_FAIL;
}
Ejemplo n.º 15
0
s32 bsp_disp_exit(u32 mode)
{
	u32 num_screens;
	u32 screen_id;
	u32 num_scalers;
	u32 scaler_id;
	struct disp_lcd *lcd;
	struct disp_manager *manager;

	num_screens = bsp_disp_feat_get_num_screens();
	num_scalers = bsp_disp_feat_get_num_scalers();

	if(mode == DISP_EXIT_MODE_CLEAN_ALL) {
		/* close all mod and unregister all irq */
		for(scaler_id = 0; scaler_id < num_scalers; scaler_id++) {
			scaler_close(scaler_id);
		}
		scaler_exit();

		for(screen_id = 0; screen_id < num_screens; screen_id++) {
			lcd = disp_get_lcd(screen_id);
			manager = disp_get_layer_manager(screen_id);

			manager->exit(manager);
			lcd->exit(lcd);
		}
	}	else if(mode == DISP_EXIT_MODE_CLEAN_PARTLY) {
		/* unregister all irq */
//		OSAL_InterruptDisable(AW_IRQ_DEBE0);
//		OSAL_UnRegISR(AW_IRQ_DEBE0, manager_event_proc, (void*)0);
		OSAL_InterruptDisable(AW_IRQ_LCD0);
		OSAL_UnRegISR(AW_IRQ_LCD0, disp_lcd_event_proc, (void*)0);

//		OSAL_InterruptDisable(AW_IRQ_DEBE1);
//		OSAL_UnRegISR(AW_IRQ_DEBE1, manager_event_proc, (void*)0);
		OSAL_InterruptDisable(AW_IRQ_LCD1);
		OSAL_UnRegISR(AW_IRQ_LCD1, disp_lcd_event_proc, (void*)0);
	}

	return DIS_SUCCESS;
}
Ejemplo n.º 16
0
s32 bsp_disp_lcd_post_disable(u32 screen_id)
{
	struct disp_lcd* lcd;
	struct disp_manager *mgr;
	s32 ret = -1;

	mgr = disp_get_layer_manager(screen_id);
	lcd = disp_get_lcd(screen_id);
	if(!mgr || !lcd) {
		DE_WRN("get lcd%d or mgr%d fail\n", screen_id, screen_id);
        return -1;
	}

	if(lcd->post_disable)
		ret = lcd->post_disable(lcd);

	if(mgr->disable)
		mgr->disable(mgr);

	return ret;
}
Ejemplo n.º 17
0
s32 bsp_disp_lcd_post_enable(u32 screen_id)
{
	struct disp_lcd* lcd;
	int ret = 0;
	struct disp_manager *mgr;

	mgr = disp_get_layer_manager(screen_id);
	lcd = disp_get_lcd(screen_id);
	if(!mgr || !lcd) {
		DE_WRN("get lcd%d or mgr%d fail\n", screen_id, screen_id);
        return -1;
	}

	if(lcd->post_enable)
		ret = lcd->post_enable(lcd);

	if(mgr->set_output_type)
		mgr->set_output_type(mgr, DISP_OUTPUT_TYPE_LCD);
#if defined(__LINUX_PLAT__)
	Display_set_fb_timming(screen_id);
#endif
	return ret;
}
Ejemplo n.º 18
0
s32 bsp_disp_get_screen_height_from_output_type(u32 disp, u32 output_type, u32 output_mode)
{
	u32 width = 800, height = 480;

	if(DISP_OUTPUT_TYPE_LCD == output_type) {
		struct disp_manager *mgr;
		mgr = disp_get_layer_manager(disp);
		if(mgr && mgr->device && mgr->device->get_resolution) {
			mgr->device->get_resolution(mgr->device, &width, &height);
		}
	} else if(DISP_OUTPUT_TYPE_HDMI == output_type) {
		switch(output_mode) {
		case DISP_TV_MOD_720P_50HZ:
		case DISP_TV_MOD_720P_60HZ:
			width = 1280;
			height = 720;
			break;
		case DISP_TV_MOD_1080P_50HZ:
		case DISP_TV_MOD_1080P_60HZ:
		case DISP_TV_MOD_1080P_30HZ:
		case DISP_TV_MOD_1080P_24HZ:
			width = 1920;
			height = 1080;
			break;
		case DISP_TV_MOD_3840_2160P_30HZ:
		case DISP_TV_MOD_3840_2160P_25HZ:
		case DISP_TV_MOD_3840_2160P_24HZ:
			width = 3840;
			height = 2160;
			break;
		}
	}
	/* FIXME: add other output device res */

	return height;
}
Ejemplo n.º 19
0
static void dispdbg_process(void)
{
	int start = simple_strtoul(dispdbg_priv.start,NULL,0);
	if(start != 1)
		return ;

	if(!strncmp(dispdbg_priv.name,"layer",5)) {
		char *p = dispdbg_priv.name + 5;
		int disp,chan,id;
		struct disp_layer *lyr = NULL;

		printk("%s,%s\n", dispdbg_priv.command, dispdbg_priv.name);

		disp = (unsigned int)simple_strtoul(p, &p, 10);
		p++;
		chan = (unsigned int)simple_strtoul(p, &p, 10);
		p++;
		id = (unsigned int)simple_strtoul(p, &p, 10);
		lyr = disp_get_layer(disp, chan, id);
		if(NULL == lyr) {
			sprintf(dispdbg_priv.info,"get %s fail!", dispdbg_priv.name);
			return ;
		}
		if(!strncmp(dispdbg_priv.command,"enable",6)) {
			//lyr->enable(lyr);
		} else if(!strncmp(dispdbg_priv.command,"disable",7)) {
			//lyr->disable(lyr);
		} else if(!strncmp(dispdbg_priv.command,"getinfo",7)) {
			lyr->dump(lyr, dispdbg_priv.info);
		} else {
			sprintf(dispdbg_priv.info,"not support command for %s!", dispdbg_priv.name);
			return ;
		}
	} else if(!strncmp(dispdbg_priv.name,"lcd",3)) {
		char *p = dispdbg_priv.name + 3;
		int disp;
		struct disp_device *lcd = NULL;

		disp = (unsigned int)simple_strtoul(p, &p, 10);
		lcd = disp_get_lcd(disp);
		if(NULL == lcd) {
			sprintf(dispdbg_priv.info,"get %s fail!", dispdbg_priv.name);
			return ;
		}
		if(!strncmp(dispdbg_priv.command,"enable",6)) {
			lcd->enable(lcd);
		} else if(!strncmp(dispdbg_priv.command,"disable",7)) {
			lcd->disable(lcd);
		} else if(!strncmp(dispdbg_priv.command,"setbl",6)) {
			int bl = (unsigned int)simple_strtoul(dispdbg_priv.param, NULL, 10);
			if(lcd->set_bright)
				lcd->set_bright(lcd, bl);
			else
				sprintf(dispdbg_priv.info,"set lcd%d backlight fail", disp);
		} else if(!strncmp(dispdbg_priv.command,"getbl",5)) {
		int bl;
			if(lcd->get_bright) {
				bl = lcd->get_bright(lcd);
				sprintf(dispdbg_priv.info,"%d", bl);
			} else
				sprintf(dispdbg_priv.info,"get lcd%d backlight fail", disp);
		} else {
				sprintf(dispdbg_priv.info,"not support command for %s!", dispdbg_priv.name);
				return ;
		}
	}	else if(!strncmp(dispdbg_priv.name,"disp",4)) {
		char *p = dispdbg_priv.name + 4;
		int disp;
		char* next;
		char* tosearch;
		struct disp_manager *mgr = NULL;

		disp = (unsigned int)simple_strtoul(p, &p, 10);
		mgr = disp_get_layer_manager(disp);
		if(NULL == mgr) {
			sprintf(dispdbg_priv.info,"get %s fail!", dispdbg_priv.name);
			return ;
		}
		if(!strncmp(dispdbg_priv.command,"getinfo",7)) {
			mgr->dump(mgr, dispdbg_priv.info);
		} else if(!strncmp(dispdbg_priv.command,"switch",6)) {
			u32 type,mode;
			tosearch = dispdbg_priv.param;
			next = strsep(&tosearch, " ");
			type = simple_strtoul(next,NULL,0);
			next = strsep(&tosearch, " ");
			mode = simple_strtoul(next,NULL,0);
			printk("disp %d, type %d, mode%d\n", disp, type, mode);
			bsp_disp_device_switch(disp, type, mode);
		} else if(!strncmp(dispdbg_priv.command,"blank",5)) {
			u32 level;
			struct disp_device *dispdev = mgr->device;

			if(NULL == dispdev) {
				sprintf(dispdbg_priv.info,"get device fail for disp %d!", disp);
				return ;
			}

			level = simple_strtoul(dispdbg_priv.param,NULL,0);
			printk("disp %d, blank%d\n", disp, level);
			if(0 == level)
				dispdev->enable(dispdev);
			else
				dispdev->disable(dispdev);
		} else if(!strncmp(dispdbg_priv.command,"getxres",7)) {
			u32 width, height;
			struct disp_device *dispdev = mgr->device;

			if(NULL == dispdev) {
				sprintf(dispdbg_priv.info,"get device fail for disp %d!", disp);
				return ;
			}
			dispdev->get_resolution(dispdev, &width, &height);

			sprintf(dispdbg_priv.info,"%d", width);
		} else if(!strncmp(dispdbg_priv.command,"getyres",7)) {
			u32 width, height;
			struct disp_device *dispdev = mgr->device;

			if(NULL == dispdev) {
				sprintf(dispdbg_priv.info,"get device fail for disp %d!", disp);
				return ;
			}
			dispdev->get_resolution(dispdev, &width, &height);

			sprintf(dispdbg_priv.info,"%d", height);
		}  else if(!strncmp(dispdbg_priv.command,"getfps",6)) {
			u32 fps = bsp_disp_get_fps(disp);
			u32 count = 0;

			count = sprintf(dispdbg_priv.info,"device:%d.%d fps\n", fps/10, fps%10);
			composer_dump(dispdbg_priv.info+count);
		} 
#if defined(SUPPORT_TV)
		else if(!strncmp(dispdbg_priv.command,"suspend",7)) {
			//dispdev = disp_device_get(dispdev, DISP_OUTPUT_TYPE_TV);
			if(mgr->device) {
				if((DISP_OUTPUT_TYPE_TV == mgr->device->type)) {
				disp_tv_suspend(mgr->device);
				}
			
			}

		} else if(!strncmp(dispdbg_priv.command,"resume",6)) {
			//dispdev = disp_device_get(dispdev, DISP_OUTPUT_TYPE_TV);
			if(mgr->device) {
				if((DISP_OUTPUT_TYPE_TV == mgr->device->type)) {
					disp_tv_resume(mgr->device);
				}
			}

		}
#endif	
		else {
			sprintf(dispdbg_priv.info,"not support command for %s!", dispdbg_priv.name);
			return ;
		}
	}
	else if(!strncmp(dispdbg_priv.name,"enhance",7)) {
		char *p = dispdbg_priv.name + 7;
		int disp;
		char* next;
		char* tosearch;
		struct disp_manager *mgr = NULL;
		struct disp_enhance *enhance = NULL;
		disp_enhance_para para;

		memset(&para, 0, sizeof(disp_enhance_para));
		disp = (unsigned int)simple_strtoul(p, &p, 10);
		mgr = disp_get_layer_manager(disp);
		if(NULL == mgr) {
			sprintf(dispdbg_priv.info,"get %s fail!", dispdbg_priv.name);
			return ;
		}
		enhance = mgr->enhance;
		if(NULL == enhance) {
			sprintf(dispdbg_priv.info,"get %s fail!", dispdbg_priv.name);
			return ;
		}
		if(!strncmp(dispdbg_priv.command,"setinfo",7)) {
			/* en */
			tosearch = dispdbg_priv.param;
			next = strsep(&tosearch, " ");
			para.enable = simple_strtoul(next,NULL,0);

			/* mode */
			next = strsep(&tosearch, " ");
			para.mode = simple_strtoul(next,NULL,0);

			/* bright/contrast/saturation/hue */
			next = strsep(&tosearch, " ");
			para.bright = simple_strtoul(next,NULL,0);
			next = strsep(&tosearch, " ");
			para.contrast = simple_strtoul(next,NULL,0);
			next = strsep(&tosearch, " ");
			para.saturation = simple_strtoul(next,NULL,0);
			next = strsep(&tosearch, " ");
			para.hue = simple_strtoul(next,NULL,0);

			/* sharp */
			next = strsep(&tosearch, " ");
			para.sharp = simple_strtoul(next,NULL,0);

			/* auto color */
			next = strsep(&tosearch, " ");
			para.auto_contrast = simple_strtoul(next,NULL,0);
			next = strsep(&tosearch, " ");
			para.auto_color = simple_strtoul(next,NULL,0);

			/* fancycolor */
			next = strsep(&tosearch, " ");
			para.fancycolor_red = simple_strtoul(next,NULL,0);
			next = strsep(&tosearch, " ");
			para.fancycolor_green = simple_strtoul(next,NULL,0);
			next = strsep(&tosearch, " ");
			para.fancycolor_blue = simple_strtoul(next,NULL,0);

			/* window */
			next = strsep(&tosearch, " ");
			if(!strncmp(next,"win",3)) {
				next = strsep(&tosearch, " ");
				para.window.x = simple_strtoul(next,NULL,0);
				next = strsep(&tosearch, " ");
				para.window.y = simple_strtoul(next,NULL,0);
				next = strsep(&tosearch, " ");
				para.window.width = simple_strtoul(next,NULL,0);
				next = strsep(&tosearch, " ");
				para.window.height = simple_strtoul(next,NULL,0);
			}
			printk("enhance %d, en(%d), mode(%d), bcsh(%d,%d,%d,%d), sharp(%d), autocolor(%d,%d), fancycolor(%d,%d,%d)\n",
				disp, para.enable, para.mode, para.bright, para.contrast, para.saturation,
				para.hue, para.sharp, para.auto_contrast, para.auto_color,
				para.fancycolor_red, para.fancycolor_green, para.fancycolor_blue);
			enhance->set_para(enhance, &para);
		}  else if(!strncmp(dispdbg_priv.command,"getinfo",7)) {
			if(enhance->dump)
				enhance->dump(enhance, dispdbg_priv.info);
		} else {
			sprintf(dispdbg_priv.info,"not support command for %s!", dispdbg_priv.name);
			return ;
		}
	}
	else if(!strncmp(dispdbg_priv.name,"smbl",4)) {
		char *p = dispdbg_priv.name + 4;
		int disp;
		struct disp_manager *mgr = NULL;
		struct disp_smbl *smbl = NULL;

		disp = (unsigned int)simple_strtoul(p, &p, 10);
		mgr = disp_get_layer_manager(disp);
		if(NULL == mgr) {
			sprintf(dispdbg_priv.info,"get %s fail!", dispdbg_priv.name);
			return ;
		}
		smbl = mgr->smbl;
		if(NULL == smbl) {
			sprintf(dispdbg_priv.info,"get %s fail!", dispdbg_priv.name);
			return ;
		}
		if(!strncmp(dispdbg_priv.command,"setinfo",7)) {

		} else if(!strncmp(dispdbg_priv.command,"getinfo",7)) {
			if(smbl->dump)
				smbl->dump(smbl, dispdbg_priv.info);
		} else {
			sprintf(dispdbg_priv.info,"not support command for %s!", dispdbg_priv.name);
			return ;
		}
	} else if(!strncmp(dispdbg_priv.name,"hdmi",4)) {
		char *p = dispdbg_priv.name + 4;
		int disp;
		unsigned int mode;

		disp = (unsigned int)simple_strtoul(p, &p, 10);
		if(!strncmp(dispdbg_priv.command,"is_support",10)) {
			int is_support = 0;
			mode = (unsigned int)simple_strtoul(dispdbg_priv.param, NULL, 10);
			is_support = bsp_disp_hdmi_check_support_mode(disp, (disp_tv_mode)mode);
			sprintf(dispdbg_priv.info,"%d", is_support);
		} else {
			sprintf(dispdbg_priv.info,"not support command for %s!", dispdbg_priv.name);
			return ;
		}
	}
}
Ejemplo n.º 20
0
s32 drv_disp_init(void)
{
#ifdef CONFIG_FPGA
    return 0;
#else
  disp_bsp_init_para para;
  int disp, num_screens;

	drv_disp_check_spec();
	sunxi_pwm_init();
	disp_sys_clk_init();

	memset(&para, 0, sizeof(disp_bsp_init_para));

	para.reg_base[DISP_MOD_DE]    = DE_BASE;
	para.reg_size[DISP_MOD_DE]    = DE_SIZE;
	para.reg_base[DISP_MOD_LCD0]   = LCD0_BASE;
	para.reg_size[DISP_MOD_LCD0]   = 0x3fc;
#ifdef DISP_DEVICE_NUM
	#if DISP_DEVICE_NUM == 2
	para.reg_base[DISP_MOD_LCD1]   = LCD1_BASE;
	para.reg_size[DISP_MOD_LCD1]   = 0x3fc;
#endif
#else
#	error "DEVICE_NUM undefined!"
#endif

#ifdef SUPPORT_DSI
	para.reg_base[DISP_MOD_DSI0]   = MIPI_DSI0_BASE;
	para.reg_size[DISP_MOD_DSI0]   = 0x2fc;
#endif

	para.irq_no[DISP_MOD_DE]         = AW_IRQ_DEIRQ0;
	para.irq_no[DISP_MOD_LCD0]        = AW_IRQ_LCD0;
#if defined(DISP_DEVICE_NUM)
	#if DISP_DEVICE_NUM == 2
	para.irq_no[DISP_MOD_LCD1]        = AW_IRQ_LCD1;
	#endif
#else
#	error "DEVICE_NUM undefined!"
#endif
#if defined(SUPPORT_DSI)
	para.irq_no[DISP_MOD_DSI0]        = AW_IRQ_MIPIDSI;
#endif

	memset(&g_disp_drv, 0, sizeof(disp_drv_info));

	bsp_disp_init(&para);
	num_screens = bsp_disp_feat_get_num_screens();
	for(disp=0; disp<num_screens; disp++) {
		g_disp_drv.mgr[disp] = disp_get_layer_manager(disp);
	}
#if defined(SUPPORT_HDMI)
	Hdmi_init();
#endif
#if defined(SUPPORT_TV)
	tv_init();
#endif

#if defined(CONFIG_USE_AC200)
	tv_ac200_init();
#endif

	bsp_disp_open();

	lcd_init();
#if defined(CVBS_MODE_USED_GM7121)
	gm7121_module_init();
#endif
	init_flag = 1;

	printf("DRV_DISP_Init end\n");
	return 0;
#endif
}
Ejemplo n.º 21
0
s32 disp_init_connections(void)
{
	u32 screen_id = 0;
	u32 num_screens = 0;

	DE_INF("disp_init_connections\n");

	num_screens = bsp_disp_feat_get_num_screens();
	for(screen_id=0; screen_id<num_screens; screen_id++) {
		struct disp_manager *mgr;
		struct disp_smbl *smbl;
		struct disp_capture *capture;
		struct disp_smcl *smcl;
#if defined(CONFIG_ARCH_SUN9IW1P1)
		struct disp_cursor *cursor;
#endif
		u32 num_layers, layer_id;

		num_layers = bsp_disp_feat_get_num_layers(screen_id);
		mgr = disp_get_layer_manager(screen_id);
		if(!mgr)
			continue;
		for(layer_id=0; layer_id<num_layers; layer_id++) {
			struct disp_layer *lyr;

			lyr = disp_get_layer(screen_id, layer_id);
			if(!lyr)
				continue;

			if(mgr->add_layer)
				mgr->add_layer(mgr, lyr);
			else
				DE_INF("mgr's add_layer is NULL\n");

			if(lyr->set_manager)
				lyr->set_manager(lyr, mgr);
			else
				DE_INF("lyr's set_manager is NULL\n");
		}

		smbl = disp_get_smbl(screen_id);
		if(smbl && smbl->set_manager)
			smbl->set_manager(smbl, mgr);
		else
			DE_INF("smbl's set manager is NULL\n");

		capture = disp_get_capture(screen_id);
		if(capture && capture->set_manager)
			capture->set_manager(capture, mgr);
		else
			DE_INF("capture's set manager is NULL\n");

		smcl = disp_get_smcl(screen_id);
		if(smcl && smcl->set_manager)
			smcl->set_manager(smcl, mgr);
		else
			DE_INF("smcl's set manager is NULL\n");

#if defined(CONFIG_ARCH_SUN9IW1P1)
		cursor = disp_get_cursor(screen_id);
		if(cursor && cursor->set_manager)
			cursor->set_manager(cursor, mgr);
		else
			DE_INF("cursor's set manager is NULL\n");
#endif
	}

	return 0;
}
Ejemplo n.º 22
0
s32 bsp_disp_shadow_protect(u32 disp, bool protect)
{
	s32 ret = -1;
	u32 cnt = 0;
	u32 max_cnt = 50;
	u32 delay = 10;//us
	//disp_video_timings tt;
	struct disp_manager *mgr = NULL;
#ifdef __LINUX_PLAT__
	unsigned long flags;
#endif
	__inf("sel=%d, protect:%d,  cnt=%d\n", disp, protect, gdisp.screen[disp].cfg_cnt);

	mgr = disp_get_layer_manager(disp);
	if(mgr && mgr->device) {
		if(DISP_OUTPUT_TYPE_LCD == mgr->device->type) {
			//FIXME
		} else if(DISP_OUTPUT_TYPE_HDMI == mgr->device->type) {
			//FIXME
		}
	}

	if(protect) {
		while((0 != ret) && (cnt < max_cnt)) {
#ifdef __LINUX_PLAT__
			spin_lock_irqsave(&gdisp.screen[disp].flag_lock, flags);
#endif
			cnt ++;
			if(gdisp.screen[disp].have_cfg_reg == false) {
				gdisp.screen[disp].cfg_cnt++;
				ret = 0;
			}
#ifdef __LINUX_PLAT__
			spin_unlock_irqrestore(&gdisp.screen[disp].flag_lock, flags);
#endif
			if(0 != ret)
				disp_delay_us(delay);
		}

		if(0 != ret) {
			DE_INF("wait for reg load finish time out\n");
#if defined(__LINUX_PLAT__)
			spin_lock_irqsave(&gdisp.screen[disp].flag_lock, flags);
#endif
			gdisp.screen[disp].cfg_cnt++;
#if defined(__LINUX_PLAT__)
			spin_unlock_irqrestore(&gdisp.screen[disp].flag_lock, flags);
#endif
		}
	} else {
#if defined(__LINUX_PLAT__)
			spin_lock_irqsave(&gdisp.screen[disp].flag_lock, flags);
#endif
			gdisp.screen[disp].cfg_cnt--;
#if defined(__LINUX_PLAT__)
			spin_unlock_irqrestore(&gdisp.screen[disp].flag_lock, flags);
#endif
	}
	__inf("sel=%d, protect:%d,  cnt=%d\n", disp, protect, gdisp.screen[disp].cfg_cnt);
	return DIS_SUCCESS;
}