コード例 #1
0
void ipc_init(ipc_source ipc_src, ipc_destination ipc_dst, ipc_controlvariable ipc_convar)
{
		 
	ipc_swreset();
	ipc_enable_ip(OFF);

	ipc_setpostprocessing_onoff(OFF);
		
	//Initialize the Image Information
	ipc_setmode_and_imgsize(ipc_src, ipc_dst, ipc_convar);

	//Initialize Enhancement 
	ipc_init_enhancing_parameter();
	ipc_setcontrast(ipc_enh_var.contrast); 
	ipc_setbrightness(ipc_enh_var.brightness);
	ipc_setbright_offset(ipc_enh_var.brightoffset);
	ipc_setsaturation(ipc_enh_var.saturation);
	ipc_setsharpness(ipc_enh_var.sharpness, ipc_enh_var.thhnoise);

	//Initialize the Poly-Phase Filter Coefficients
	ipc_setfilter();

	writel(S3C_IPC_PEL_RATE_SET, s3c_ipc->regs + S3C_IPC_PEL_RATE_CTRL);

	shadow_update();
}
コード例 #2
0
void ipc_setmode_and_imgsize(ipc_source ipc_src, ipc_destination ipc_dst, ipc_controlvariable ipc_convar)
{
	u32 v_ratio, h_ratio;

	ipc_field_id_control(IPC_BOTTOM_FIELD);
	ipc_field_id_mode(CAM_FIELD_SIG, AUTO);
	ipc_2d_enable(ipc_convar.modeval);	// Enalbed : 2D IPC , Disabled : Horizon Double Scailing

	writel(S3C_IPC_SRC_WIDTH_SET(ipc_src.srchsz), s3c_ipc->regs + S3C_IPC_SRC_WIDTH);
	writel(S3C_IPC_SRC_HEIGHT_SET(ipc_src.srcvsz), s3c_ipc->regs + S3C_IPC_SRC_HEIGHT);

	writel(S3C_IPC_DST_WIDTH_SET(ipc_dst.dsthsz), s3c_ipc->regs + S3C_IPC_DST_WIDTH);
	writel(S3C_IPC_DST_HEIGHT_SET(ipc_dst.dstvsz), s3c_ipc->regs + S3C_IPC_DST_HEIGHT);

	if (1 == ipc_convar.modeval)
		h_ratio = IPC_2D_ENABLE;
	else
		h_ratio = IPC_HOR_SCALING_ENABLE;		

	writel(h_ratio, s3c_ipc->regs + S3C_IPC_H_RATIO);

	v_ratio = IPC_2D_ENABLE;
	writel(v_ratio, s3c_ipc->regs + S3C_IPC_V_RATIO);
	
	shadow_update();	
}
コード例 #3
0
ファイル: ipc.c プロジェクト: rubensollie/Eclair-Kernel
void ipc_2d_enable(enum ipc_enoff onoff)
{
	u32 cfg;

	cfg = readl(ipc->regs + S3C_IPC_MODE);
	cfg &= ~S3C_IPC_2D_MASK;
	cfg |= S3C_IPC_2D_CTRL(onoff);
	writel(cfg, ipc->regs + S3C_IPC_MODE);

	shadow_update();
}
コード例 #4
0
ファイル: ipc.c プロジェクト: rubensollie/Eclair-Kernel
void ipc_set_brightness(u32 *brightness)
{
	u32 i, line_eq[8];

	for(i = 0; i < 8; i++) {
		line_eq[i] = readl(ipc->regs + (S3C_IPC_PP_LINE_EQ0 + 4 * i));
		line_eq[i] &= ~S3C_IPC_PP_LINE_BRIGTHNESS_MASK;
		line_eq[i] |= S3C_IPC_PP_LINE_BRIGHT(brightness[i]);
		writel(line_eq[i], ipc->regs + (S3C_IPC_PP_LINE_EQ0 + 4 * i));
	}

	shadow_update();
}
コード例 #5
0
ファイル: ipc.c プロジェクト: rubensollie/Eclair-Kernel
void ipc_enable_postprocessing(u32 onoff)
{
	u32 cfg = readl(ipc->regs + S3C_IPC_BYPASS);

	if (!onoff)
		cfg |= S3C_IPC_PP_BYPASS_DISABLE;
	else
		cfg &= S3C_IPC_PP_BYPASS_ENABLE;
	
	writel(cfg, ipc->regs + S3C_IPC_BYPASS);

	shadow_update();
}
コード例 #6
0
ファイル: ipc.c プロジェクト: rubensollie/Eclair-Kernel
void ipc_set_contrast(u32 *contrast)
{
	u32 i, line_eq[8];

	for(i = 0; i < 8; i++) {
		line_eq[i] = readl(ipc->regs + (S3C_IPC_PP_LINE_EQ0 + 4 * i));
		line_eq[i] &= ~S3C_IPC_PP_LINE_CONTRAST_MASK;
		line_eq[i] |= S3C_IPC_PP_LINE_CONTRAST(contrast[i]);
		writel(line_eq[i], ipc->regs + (S3C_IPC_PP_LINE_EQ0 + 4 * i));
	}

	shadow_update();
}
コード例 #7
0
void ipc_field_id_mode(ipc_field_id_sel sel, ipc_field_id_togl toggle)
{
	u32 cfg;

	cfg = readl(s3c_ipc->regs + S3C_IPC_MODE);
	cfg |= S3C_IPC_FIELD_ID_SELECTION(sel);
	writel(cfg, s3c_ipc->regs + S3C_IPC_MODE);	

	cfg = readl(s3c_ipc->regs + S3C_IPC_MODE);
	cfg |= S3C_IPC_FIELD_ID_AUTO_TOGGLING(toggle);
	writel(cfg, s3c_ipc->regs + S3C_IPC_MODE);

	shadow_update();	
}
コード例 #8
0
ファイル: ipc.c プロジェクト: rubensollie/Eclair-Kernel
void ipc_set_imgsize(struct ipc_source src, struct ipc_destination dst)
{
	writel(S3C_IPC_SRC_WIDTH_SET(src.srchsz), 
						ipc->regs + S3C_IPC_SRC_WIDTH);
	writel(S3C_IPC_SRC_HEIGHT_SET(src.srcvsz), 
						ipc->regs + S3C_IPC_SRC_HEIGHT);

	writel(S3C_IPC_DST_WIDTH_SET(dst.dsthsz), 
						ipc->regs + S3C_IPC_DST_WIDTH);
	writel(S3C_IPC_DST_HEIGHT_SET(dst.dstvsz), 
						ipc->regs + S3C_IPC_DST_HEIGHT);

	shadow_update();
}
コード例 #9
0
void ipc_setpostprocessing_onoff(u32 onoff)
{
	u32 cfg;

	cfg = readl(s3c_ipc->regs + S3C_IPC_BYPASS);
	if (!onoff)
		cfg |= S3C_IPC_PP_BYPASS_DISABLE; // 1
	else
		cfg &= S3C_IPC_PP_BYPASS_ENABLE; // 0
	
	writel(cfg, s3c_ipc->regs + S3C_IPC_BYPASS);

	shadow_update();

}
コード例 #10
0
void ipc_setcontrast(u32 *contrast)
{
	u32 i, line_eq[8];

	for(i = 0; i < 8; i++)
	{
		line_eq[i] = readl(s3c_ipc->regs + (S3C_IPC_PP_LINE_EQ0 + 4 * i)); 

		line_eq[i] &= ~(S3C_IPC_PP_LINE_CONTRAST_MASK << 0);
		line_eq[i] |= ((contrast[i] & S3C_IPC_PP_LINE_CONTRAST_MASK) << 0);

		writel(line_eq[i], s3c_ipc->regs + (S3C_IPC_PP_LINE_EQ0 + 4 * i));
	}

	shadow_update();
}
コード例 #11
0
void ipc_setbrightness(u32 *brightness)
{
	u32 i, line_eq[8];

	for(i = 0; i < 8; i++)
	{
		line_eq[i] = readl(s3c_ipc->regs + (S3C_IPC_PP_LINE_EQ0 + 4 * i)); 

		line_eq[i] &= ~(S3C_IPC_PP_LINE_BRIGTHNESS_MASK << 8);
		line_eq[i] |= ((brightness[i] & S3C_IPC_PP_LINE_BRIGTHNESS_MASK) << 8);

		writel(line_eq[i], s3c_ipc->regs + (S3C_IPC_PP_LINE_EQ0 + 4 * i));
	}

	shadow_update();
}
コード例 #12
0
ファイル: ipc.c プロジェクト: rubensollie/Eclair-Kernel
void ipc_set_mode(struct ipc_controlvariable con_var)
{
	u32 cfg = 0;

	/* Enalbed : 2D IPC , Disabled : Horizon Double Scailing */
	ipc_field_id_control(IPC_BOTTOM_FIELD);
	ipc_field_id_mode(CAM_FIELD_SIG, AUTO);
	ipc_2d_enable(con_var.modeval);

	if (con_var.modeval == IPC_2D)
		cfg = IPC_2D_ENABLE;
	else
		cfg = IPC_HOR_SCALING_ENABLE;
	writel(cfg, ipc->regs + S3C_IPC_H_RATIO);

	cfg = IPC_2D_ENABLE;
	writel(cfg, ipc->regs + S3C_IPC_V_RATIO);
	
	shadow_update();
}
コード例 #13
0
void ipc_setsharpness(ipc_sharpness Sharpness, u32 threshold)
{
	u32 sharpval;

	switch (Sharpness) {
	case NO_EFFECT:
		sharpval = (0x0<<0);
		break;
	case MIN_EDGE:
		sharpval = (0x1<<0);
		break;
	case MODERATE_EDGE:
		sharpval = (0x2<<0);
		break;
	default:
		sharpval = (0x3<<0);
		break;		
	}

	writel(S3C_IPC_PP_TH_HNOISE_SET(threshold) | sharpval, s3c_ipc->regs + S3C_IPC_PP_SHARPNESS);

	shadow_update();	
}
コード例 #14
0
ファイル: ipc.c プロジェクト: rubensollie/Eclair-Kernel
void ipc_set_sharpness(enum ipc_sharpness sharpness, u32 threshold)
{
	u32 sharpval;

	switch (sharpness) {
	case NO_EFFECT:
		sharpval = 0x0;
		break;
	case MIN_EDGE:
		sharpval = 0x1;
		break;
	case MODERATE_EDGE:
		sharpval = 0x2;
		break;
	default:
		sharpval = 0x3;
		break;		
	}

	writel(S3C_IPC_PP_TH_HNOISE_SET(threshold) | sharpval, 
					ipc->regs + S3C_IPC_PP_SHARPNESS);

	shadow_update();
}
コード例 #15
0
ファイル: control.c プロジェクト: Kampbell/isode-8.0
int 
dsa_control (Attr_Sequence as, struct DSError *error, DN dn)
{
	char * str;
	DN dn2;
	Entry theentry;
	extern Entry database_root;
	SFD attempt_restart();

	if ( ! manager(dn) ) {
		error->dse_type = DSE_SECURITYERROR;
		error->ERR_SECURITY.DSE_sc_problem = DSE_SC_ACCESSRIGHTS;
		return (DS_ERROR_REMOTE);
	}

	str = (char *) as->attr_value->avseq_av.av_struct;

#ifndef NO_STATS
	LLOG (log_stat,LLOG_NOTICE,("DSA control: %s",str));
#endif

	switch (*str) {
	case 'd':	/* -dump <directory> */
		str = SkipSpace (++str);
		/*
				directory_dump (str, database_root);
		*/
		return (DS_OK);
	case 't':	/* -tailor <string> */
		str = SkipSpace (++str);
		if (dsa_tai_string (str) == OK) {
			isodexport (NULLCP);
			return (DS_OK);
		}
		break;
	case 'a':	/* -abort */
		LLOG (log_dsap,LLOG_FATAL,("*** abort signal ***"));
		dsa_abort(-1);
		exit(0);
	case 'b':	/* -restart */
		LLOG (log_dsap,LLOG_FATAL,("*** restart signal ***"));
		attempt_restart (NOTOK);
		exit(0);		/* should not be reached */
	case 'r':	/* -refresh <entry> */
		str = SkipSpace (++str);
		if (lexequ (str,"root") == 0)
			dn2= NULLDN;
		else if ((dn2 = str2dn (str)) == NULLDN)
			break;

		if (refresh_from_disk (dn2) == OK)
			return (DS_OK);
		break;
	case 'f':	/* -resync <entry> */
		str = SkipSpace (++str);
		if (lexequ (str,"root") == 0)
			dn2= NULLDN;
		else if ((dn2 = str2dn (str)) == NULLDN)
			break;

		if ((theentry = local_find_entry (dn2,FALSE)) != NULLENTRY)
#ifdef TURBO_DISK
		{
			Entry akid = (Entry) avl_getone(theentry->e_children);
			if (turbo_writeall (akid) == OK)
				return (DS_OK);
		}
#else
		{
			Entry akid = (Entry) avl_getone(theentry->e_children);
			if (journal (akid) == OK)
				return (DS_OK);
		}
#endif
		break;
	case 'l':	/* -lock <entry> */
		str = SkipSpace (++str);
		if (lexequ (str,"root") == 0)
			dn2 = NULLDN;
		else if ((dn2 = str2dn (str)) == NULLDN)
			break;

		if ((theentry = local_find_entry (dn2,FALSE)) != NULLENTRY) {
			theentry->e_lock = TRUE;
			return (DS_OK);
		}
		break;
	case 'u':	/* -unlock <entry> */
		str = SkipSpace (++str);
		if (lexequ (str,"root") == 0)
			dn2 = NULLDN;
		else if ((dn2 = str2dn (str)) == NULLDN)
			break;

		if ((theentry = local_find_entry (dn2,FALSE)) != NULLENTRY) {
			theentry->e_lock = FALSE;
			return (DS_OK);
		}
		break;
	case 's':	/* -slave */
		/*
		 * When we go async return of OK will mean that a getedb
		 * operation has been scheduled, NOT that it has succeeded.
		 */
		str = SkipSpace (++str);
		if (*str == NULL) {
			slave_update();
			return DS_OK;
		}

		if (lexequ (str, "shadow") == 0) {
			shadow_update();
			return DS_OK;
		}

		if (lexequ (str, "root") == 0)
			dn2 = NULLDN;
		else if ((dn2 = str2dn (str)) == NULLDN)
			break;

		if (update_aux (dn2, dn2 == NULLDN) == OK)
			return DS_OK;
		break;
	default:
		break;
	}

	error->dse_type = DSE_SERVICEERROR;
	error->ERR_SERVICE.DSE_sv_problem = DSE_SV_UNWILLINGTOPERFORM;
	return (DS_ERROR_REMOTE);
}
コード例 #16
0
ファイル: control.c プロジェクト: Kampbell/isode-8.0
int 
new_dsa_control (Attr_Sequence as, struct DSError *error, DN dn)
{
	struct dsa_control * item ;
	char * tmp_ptr ;
	DN dn2;
	Entry theentry;
	extern Entry database_root;
	SFD attempt_restart();

	/* Return some silly error to distinguish it from the other dsa_control */
	if ( ! manager(dn) ) {
		error->dse_type = DSE_SECURITYERROR ;
		error->ERR_SECURITY.DSE_sc_problem = DSE_SC_PROTECTIONREQUIRED ;
		return (DS_ERROR_REMOTE) ;
	}

	item = (struct dsa_control *) as->attr_value->avseq_av.av_struct ;

	switch (item->dsa_control_option) {
	case (CONTROL_CHANGETAILOR) : {	/* -tailor <string> */
		tmp_ptr = qb2str(item->un.changeTailor) ;
		if (dsa_tai_string (tmp_ptr) == OK) {
			isodexport (NULLCP);
			return (DS_OK);
		}
		break;
	}
	case(CONTROL_STOPDSA): {	/* -abort */
		LLOG(log_dsap,LLOG_FATAL,("*** abort signal ***")) ;
		stop_listeners() ;
		exit(0) ;
	}
	case (CONTROL_REFRESH): {	/* -refresh <entry> */
		if (item->un.refresh->offset == DN_PRESENT)
			if (refresh_from_disk (item->un.refresh->un.selectedDN) == OK)
				return (DS_OK);
		break;
	}
	case(CONTROL_RESYNCH): {	/* -resync <entry> */
		if (item->un.resynch->offset == DN_PRESENT)
			dn2 = item->un.resynch->un.selectedDN ;
		else
			break ;

		if ((theentry = local_find_entry (dn2, FALSE)) != NULLENTRY)
#ifdef TURBO_DISK
		{
			Entry akid = (Entry) avl_getone(theentry->e_children);
			if (turbo_writeall (akid) == OK)
				return (DS_OK);
		}
#else
		{
			Entry akid = (Entry) avl_getone(theentry->e_children);
			if (journal (akid) == OK)
				return (DS_OK);
		}
#endif
		break;
	}
	case (CONTROL_LOCKDSA): {	/* -lock <entry> */
		if (item->un.resynch->offset == DN_PRESENT)
			dn2 = item->un.resynch->un.selectedDN ;
		else
			break ;

		if ((theentry = local_find_entry (dn2,FALSE)) != NULLENTRY) {
			theentry->e_lock = TRUE;
			return (DS_OK);
		}
		break;
	}
	case (CONTROL_UNLOCK): {	/* -unlock <entry> */
		if (item->un.resynch->offset == DN_PRESENT)
			dn2 = item->un.resynch->un.selectedDN ;
		else
			break ;

		if ((theentry = local_find_entry (dn2,FALSE)) != NULLENTRY) {
			theentry->e_lock = FALSE;
			return (DS_OK);
		}
		break;
	}
	case (CONTROL_SETLOGLEVEL): {	/* Set the Logging Level */
		tmp_ptr = qb2str(item->un.setLogLevel) ;
		/* What kind of stuff is needed here?!! */
		return (DS_OK);
		break;
	}
	case (CONTROL_UPDATESLAVEEDBS): {	/* -slave */
		/*
		 * When we go async return of OK will mean that a getedb
		 * operation has been scheduled, NOT that it has succeeded.
		 */
		tmp_ptr = qb2str(item->un.updateSlaveEDBs) ;

		if (lexequ (tmp_ptr, "all") == 0) {
			slave_update();
			return DS_OK;
		}

		if (lexequ (tmp_ptr, "shadow") == 0) {
			shadow_update();
			return DS_OK;
		}

		if (lexequ (tmp_ptr, "root") == 0) {
			dn2 = NULLDN;
		} else {
			if ((dn2 = str2dn (tmp_ptr)) == NULLDN)
				break;
		}

		if (update_aux (dn2, dn2 == NULLDN) == OK)
			return DS_OK;
		break;
	}
	default:
		break;
	}

	error->dse_type = DSE_SERVICEERROR;
	error->ERR_SERVICE.DSE_sv_problem = DSE_SV_UNWILLINGTOPERFORM;
	return (DS_ERROR_REMOTE);
}
コード例 #17
0
ファイル: ipc.c プロジェクト: rubensollie/Eclair-Kernel
void ipc_field_id_control(enum ipc_field_id id)
{
	writel(id, ipc->regs + S3C_IPC_FIELD_ID);
	shadow_update();
}
コード例 #18
0
ファイル: ipc.c プロジェクト: rubensollie/Eclair-Kernel
void ipc_set_pixel_rate(void)
{
	writel(S3C_IPC_PEL_RATE_SET, ipc->regs + S3C_IPC_PEL_RATE_CTRL);
	shadow_update();
}
コード例 #19
0
ファイル: ipc.c プロジェクト: rubensollie/Eclair-Kernel
void ipc_set_saturation(u32 saturation)
{
	writel(S3C_IPC_PP_SATURATION_SET(saturation), 
					ipc->regs + S3C_IPC_PP_SATURATION);
	shadow_update();
}
コード例 #20
0
ファイル: ipc.c プロジェクト: rubensollie/Eclair-Kernel
void ipc_set_bright_offset(u32 offset)
{
	writel(S3C_IPC_PP_BRIGHT_OFFSET_SET(offset), 
					ipc->regs + S3C_IPC_PP_BRIGHT_OFFSET);
	shadow_update();
}