コード例 #1
0
ファイル: KEYTESTS.CPP プロジェクト: gondur/mig_src
//컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴
//Procedure		KeyFake3d
//Author		Jim Taylor
//Date			Fri 3 Nov 1995
//
//Description	Fakes a key press to the 3d
//
//Inputs		Alias to fake
//				set or clear bits
//
//Returns		TRUE	if just pressed
//
//------------------------------------------------------------------------------
void	keytests::KeyFake3d(	KeyVal3D keyval,	//combo to fake
								Bool	held,		//set/clear held flag
								Bool	hit)		//set/clear oneshot flag
{
KeyMap3d*
		keymap=(KeyMap3d*) reftable3d.flat;
		if (held)
			BITSET((keymap->bitflags),keyval);
		else
			BITRESET((keymap->bitflags),keyval);
		if (hit)
			BITSET((keymap->bitflags),keyval+1);
		else
			BITRESET((keymap->bitflags),keyval+1);

}
コード例 #2
0
ファイル: KEYTESTS.CPP プロジェクト: gondur/mig_src
Bool	keytests::KeyHeld3d(KeyVal3D keyval)
{
KeyMap3d*
		keymap=(KeyMap3d*) reftable3d.flat;
		if (BITRESET((keymap->bitflags),keyval+1))
			return(TRUE);
		return	(BITTEST((keymap->bitflags),keyval));
}
コード例 #3
0
ファイル: GRID.CPP プロジェクト: gondur/BOB_Src
void Grid_Bit::set( int x, int y, bool v )
{
	// dead simple method, compression done at save time
	// get the byte that holds the bit value we are interested in...
	char *row = &data[ header[x>>6][y>>6] ][x&63][0]; 
	if ( v )
		BITSET( row, y&63 );
	else 
		BITRESET( row, y&63 );
}
コード例 #4
0
/*
 * vdce_enable : Function to enable the	ge module
 */
int vdce_enable(vdce_hw_config_t * register_config)
{
	dev_dbg(vdce_device, " vdce_enable E\n");
	/* enabling the resizer the setting enable bit */
	register_config->vdce_ctrl =
	    BITSET(register_config->vdce_ctrl, VDCE_ENABLE);

	regw(register_config->vdce_ctrl, VDCE_CTRL);

	register_config->vdce_ctrl =
	    BITRESET(register_config->vdce_ctrl, VDCE_ENABLE);

	dev_dbg(vdce_device, "vdce enable L\n");

	return 0;
}
コード例 #5
0
ファイル: KEYTESTS.CPP プロジェクト: gondur/mig_src
//컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴
//Procedure		KeyPress3d
//Author		Jim Taylor
//Date			Fri 3 Nov 1995
//
//Description	Check if a key has been pressed since last test
//
//Inputs		Alias to test for
//
//Returns		TRUE	if just pressed
//
//------------------------------------------------------------------------------
Bool	keytests::KeyPress3d(KeyVal3D keyval)
{
KeyMap3d*
		keymap=(KeyMap3d*) reftable3d.flat;
		return(BITRESET((keymap->bitflags),keyval+1));
}
コード例 #6
0
/**
 * rsz_set_ratio - Set ratio
 * @rsz_conf_chan: Structure containing channel configuration
 *
 * Returns 0 if successful, -EINVAL if invalid output size, upscaling ratio is
 * being requested, or other ratio configuration value is out of bounds
 **/
static int rsz_set_ratio(struct rsz_mult *multipass,
				struct channel_config *rsz_conf_chan)
{
	int alignment = 0;

	rsz_conf_chan->register_config.rsz_cnt = 0;

	if ((multipass->out_hsize > MAX_IMAGE_WIDTH) ||
			(multipass->out_vsize > MAX_IMAGE_WIDTH)) {
		dev_err(rsz_device, "Invalid output size!");
		goto err_einval;
	}
	if (multipass->cbilin) {
		rsz_conf_chan->register_config.rsz_cnt =
				BITSET(rsz_conf_chan->register_config.rsz_cnt,
				SET_BIT_CBLIN);
	}
	if (INPUT_RAM) {
		rsz_conf_chan->register_config.rsz_cnt =
				BITSET(rsz_conf_chan->register_config.rsz_cnt,
				SET_BIT_INPUTRAM);
	}
	if (multipass->inptyp == RSZ_INTYPE_PLANAR_8BIT) {
		rsz_conf_chan->register_config.rsz_cnt =
				BITSET(rsz_conf_chan->register_config.rsz_cnt,
				SET_BIT_INPTYP);
	} else {
		rsz_conf_chan->register_config.rsz_cnt =
				BITRESET(rsz_conf_chan->register_config.
				rsz_cnt, SET_BIT_INPTYP);

		if (multipass->pix_fmt == RSZ_PIX_FMT_UYVY) {
			rsz_conf_chan->register_config.rsz_cnt =
				BITRESET(rsz_conf_chan->register_config.
				rsz_cnt, SET_BIT_YCPOS);
		} else if (multipass->pix_fmt == RSZ_PIX_FMT_YUYV) {
			rsz_conf_chan->register_config.rsz_cnt =
					BITSET(rsz_conf_chan->register_config.
					rsz_cnt, SET_BIT_YCPOS);
		}

	}
	multipass->vrsz =
		(multipass->in_vsize * RATIO_MULTIPLIER) / multipass->out_vsize;
	multipass->hrsz =
		(multipass->in_hsize * RATIO_MULTIPLIER) / multipass->out_hsize;
	if (UP_RSZ_RATIO > multipass->vrsz || UP_RSZ_RATIO > multipass->hrsz) {
		dev_err(rsz_device, "Upscaling ratio not supported!");
		goto err_einval;
	}
	multipass->vrsz = (multipass->in_vsize - NUM_D2TAPS) * RATIO_MULTIPLIER
						/ (multipass->out_vsize - 1);
	multipass->hrsz = ((multipass->in_hsize - NUM_D2TAPS)
						* RATIO_MULTIPLIER) /
						(multipass->out_hsize - 1);

	if (multipass->hrsz <= 512) {
		multipass->hrsz = (multipass->in_hsize - NUM_TAPS)
						* RATIO_MULTIPLIER
						/ (multipass->out_hsize - 1);
		if (multipass->hrsz < 64)
			multipass->hrsz = 64;
		if (multipass->hrsz > 512)
			multipass->hrsz = 512;
		if (multipass->hstph > NUM_PHASES)
			goto err_einval;
		multipass->num_htap = 1;
	} else if (multipass->hrsz >= 513 && multipass->hrsz <= 1024) {
		if (multipass->hstph > NUM_D2PH)
			goto err_einval;
		multipass->num_htap = 0;
	}

	if (multipass->vrsz <= 512) {
		multipass->vrsz = (multipass->in_vsize - NUM_TAPS)
						* RATIO_MULTIPLIER
						/ (multipass->out_vsize - 1);
		if (multipass->vrsz < 64)
			multipass->vrsz = 64;
		if (multipass->vrsz > 512)
			multipass->vrsz = 512;
		if (multipass->vstph > NUM_PHASES)
			goto err_einval;
		multipass->num_vtap = 1;
	} else if (multipass->vrsz >= 513 && multipass->vrsz <= 1024) {
		if (multipass->vstph > NUM_D2PH)
			goto err_einval;
		multipass->num_vtap = 0;
	}

	if ((multipass->in_pitch) % ALIGN32) {
		dev_err(rsz_device, "Invalid input pitch: %d \n",
							multipass->in_pitch);
		goto err_einval;
	}
	if ((multipass->out_pitch) % ALIGN32) {
		dev_err(rsz_device, "Invalid output pitch %d \n",
							multipass->out_pitch);
		goto err_einval;
	}

	if (multipass->vrsz < 256 &&
			(multipass->in_vsize < multipass->out_vsize)) {
		if (multipass->inptyp == RSZ_INTYPE_PLANAR_8BIT)
			alignment = ALIGNMENT;
		else if (multipass->inptyp == RSZ_INTYPE_YCBCR422_16BIT)
			alignment = (ALIGNMENT / 2);
		else
			dev_err(rsz_device, "Invalid input type\n");

		if (!(((multipass->out_hsize % PIXEL_EVEN) == 0)
				&& (multipass->out_hsize % alignment) == 0)) {
			dev_err(rsz_device, "wrong hsize\n");
			goto err_einval;
		}
	}
	if (multipass->hrsz >= 64 && multipass->hrsz <= 1024) {
		if (multipass->out_hsize > MAX_IMAGE_WIDTH) {
			dev_err(rsz_device, "wrong width\n");
			goto err_einval;
		}
		multipass->active = 0;

	} else if (multipass->hrsz > 1024) {
		if (multipass->out_hsize > MAX_IMAGE_WIDTH) {
			dev_err(rsz_device, "wrong width\n");
			goto err_einval;
		}
		if (multipass->hstph > NUM_D2PH)
			goto err_einval;
		multipass->num_htap = 0;
		multipass->out_hsize = multipass->in_hsize * 256 / 1024;
		if (multipass->out_hsize % ALIGN32) {
			multipass->out_hsize +=
				abs((multipass->out_hsize % ALIGN32) - ALIGN32);
		}
		multipass->out_pitch = ((multipass->inptyp) ?
						multipass->out_hsize :
						(multipass->out_hsize * 2));
		multipass->hrsz = ((multipass->in_hsize - NUM_D2TAPS)
						* RATIO_MULTIPLIER)
						/ (multipass->out_hsize - 1);
		multipass->active = 1;

	}

	if (multipass->vrsz > 1024) {
		if (multipass->out_vsize > MAX_IMAGE_WIDTH_HIGH) {
			dev_err(rsz_device, "wrong width\n");
			goto err_einval;
		}

		multipass->out_vsize = multipass->in_vsize * 256 / 1024;
		multipass->vrsz = ((multipass->in_vsize - NUM_D2TAPS)
						* RATIO_MULTIPLIER)
						/ (multipass->out_vsize - 1);
		multipass->active = 1;
		multipass->num_vtap = 0;

	}
	rsz_conf_chan->register_config.rsz_out_size =
						multipass->out_hsize
						& ISPRSZ_OUT_SIZE_HORZ_MASK;

	rsz_conf_chan->register_config.rsz_out_size |=
						(multipass->out_vsize
						<< ISPRSZ_OUT_SIZE_VERT_SHIFT)
						& ISPRSZ_OUT_SIZE_VERT_MASK;

	rsz_conf_chan->register_config.rsz_sdr_inoff =
						multipass->in_pitch
						& ISPRSZ_SDR_INOFF_OFFSET_MASK;

	rsz_conf_chan->register_config.rsz_sdr_outoff =
					multipass->out_pitch
					& ISPRSZ_SDR_OUTOFF_OFFSET_MASK;

	if (multipass->hrsz >= 64 && multipass->hrsz <= 512) {
		if (multipass->hstph > NUM_PHASES)
			goto err_einval;
	} else if (multipass->hrsz >= 64 && multipass->hrsz <= 512) {
		if (multipass->hstph > NUM_D2PH)
			goto err_einval;
	}

	rsz_conf_chan->register_config.rsz_cnt |=
						(multipass->hstph
						<< ISPRSZ_CNT_HSTPH_SHIFT)
						& ISPRSZ_CNT_HSTPH_MASK;

	if (multipass->vrsz >= 64 && multipass->hrsz <= 512) {
		if (multipass->vstph > NUM_PHASES)
			goto err_einval;
	} else if (multipass->vrsz >= 64 && multipass->vrsz <= 512) {
		if (multipass->vstph > NUM_D2PH)
			goto err_einval;
	}

	rsz_conf_chan->register_config.rsz_cnt |=
						(multipass->vstph
						<< ISPRSZ_CNT_VSTPH_SHIFT)
						& ISPRSZ_CNT_VSTPH_MASK;

	rsz_conf_chan->register_config.rsz_cnt |=
						(multipass->hrsz - 1)
						& ISPRSZ_CNT_HRSZ_MASK;

	rsz_conf_chan->register_config.rsz_cnt |=
						((multipass->vrsz - 1)
						<< ISPRSZ_CNT_VRSZ_SHIFT)
						& ISPRSZ_CNT_VRSZ_MASK;

	return 0;
err_einval:
	return -EINVAL;
}