/**
 * Represent to OVL0/0VL1 each layer's refresh rate
 */
static void ddp_inout_info_tag(unsigned int index) {
	static unsigned long sLayerBufAddr[OVL_NUM][OVL_LAYER_NUM];
	static unsigned int  sLayerBufFmt[OVL_NUM][OVL_LAYER_NUM];
	static unsigned int  sLayerBufWidth[OVL_NUM][OVL_LAYER_NUM];
	static unsigned int  sLayerBufHeight[OVL_NUM][OVL_LAYER_NUM];

	OVL_BASIC_STRUCT ovlInfo[OVL_LAYER_NUM];
	unsigned int flag, i, enLayerCnt;
	unsigned int width, height, bpp, fmt;
	char* fmtStr;
	char tag_name[30] = { '\0' };
	memset((void*)ovlInfo, 0, sizeof(ovlInfo));
	ovl_get_info(index, ovlInfo);

	//Any layer enable bit changes , new frame refreshes
	enLayerCnt = 0;

	for (i = 0; i < OVL_LAYER_NUM; i++) {

		fmtStr = parse_color_format(ovlInfo[i].fmt);

		if (ovlInfo[i].layer_en) {
			enLayerCnt++;
			if (sLayerBufAddr[index][i] != ovlInfo[i].addr) {
				sLayerBufAddr[index][i] = ovlInfo[i].addr;
				sprintf(tag_name, "OVL%dL%d_InFps", index, i);
				met_tag_oneshot(DDP_IRQ_LAYER_FPS_ID, tag_name, i+1);
			}
			if (sLayerBufFmt[index][i] != ovlInfo[i].fmt) {
				sLayerBufFmt[index][i] = ovlInfo[i].fmt;
				sprintf(tag_name, "OVL%dL%d_Fmt_%s", index, i, fmtStr);
				met_tag_oneshot(DDP_IRQ_LAYER_FORMAT_ID, tag_name, i+1);
			}
			if (sLayerBufWidth[index][i] != ovlInfo[i].src_w) {
				sLayerBufWidth[index][i] = ovlInfo[i].src_w;
				sprintf(tag_name, "OVL%dL%d_Width", index, i);
				met_tag_oneshot(DDP_IRQ_LAYER_SIZE_ID, tag_name, ovlInfo[i].src_w);
			}
			if (sLayerBufHeight[index][i] != ovlInfo[i].src_h) {
				sLayerBufHeight[index][i] = ovlInfo[i].src_h;
				sprintf(tag_name, "OVL%dL%d_Height", index, i);
				met_tag_oneshot(DDP_IRQ_LAYER_SIZE_ID, tag_name, ovlInfo[i].src_h);
			}
		} else {
			sLayerBufAddr[index][i] = 0;
			sLayerBufFmt[index][i] = 0;
			sLayerBufWidth[index][i] = 0;
			sLayerBufHeight[index][i] = 0;
		}
	}
	if (enLayerCnt) {
		sprintf(tag_name, "OVL%d_OutFps", index);
		met_tag_oneshot(DDP_IRQ_LAYER_FPS_ID, tag_name, index);
	}
	return;
}
Ejemplo n.º 2
0
/**
 * Represent to OVL0/0VL1 each layer's refresh rate
 */
static void ddp_inout_info_tag(unsigned int index) {
	static unsigned long sLayerBufAddr[OVL_NUM][OVL_LAYER_NUM_PER_OVL];
	static unsigned int  sLayerBufFmt[OVL_NUM][OVL_LAYER_NUM_PER_OVL];
	static unsigned int  sLayerBufWidth[OVL_NUM][OVL_LAYER_NUM_PER_OVL];
	static unsigned int  sLayerBufHeight[OVL_NUM][OVL_LAYER_NUM_PER_OVL];

	OVL_BASIC_STRUCT ovlInfo[OVL_LAYER_NUM];
	unsigned int flag, i, idx, enLayerCnt, layerCnt;
	unsigned int width, height, bpp, fmt;
	char* fmtStr;
	char tag_name[30] = { '\0' };
	memset((void*)ovlInfo, 0, sizeof(ovlInfo));
	ovl_get_info(index, ovlInfo);

	//Any layer enable bit changes , new frame refreshes
	enLayerCnt = 0;
	if (ovl_get_status() == DDP_OVL1_STATUS_PRIMARY) {
		layerCnt = OVL_LAYER_NUM;
	} else {
		layerCnt = OVL_LAYER_NUM_PER_OVL;
	}

	for (i = 0; i < layerCnt; i++) {
		if (ovl_get_status() == DDP_OVL1_STATUS_PRIMARY) {
			index = 1 - i / OVL_LAYER_NUM_PER_OVL;
		}
		idx = i % OVL_LAYER_NUM_PER_OVL;

		fmtStr = parse_color_format(ovlInfo[i].fmt);

		if (ovlInfo[i].layer_en) {
			enLayerCnt++;
			if (sLayerBufAddr[index][idx] != ovlInfo[i].addr) {
				sLayerBufAddr[index][idx] = ovlInfo[i].addr;
				sprintf(tag_name, "OVL%dL%d_InFps", index, idx);
				met_tag_oneshot(DDP_IRQ_LAYER_FPS_ID, tag_name, i+1);
			}
#if 0
			if (sLayerBufFmt[index][idx] != ovlInfo[i].fmt) {
				sLayerBufFmt[index][idx] = ovlInfo[i].fmt;
				sprintf(tag_name, "OVL%dL%d_Fmt_%s", index, idx, fmtStr);
				met_tag_oneshot(DDP_IRQ_LAYER_FORMAT_ID, tag_name, i+1);
			}
			if (sLayerBufWidth[index][idx] != ovlInfo[i].src_w) {
				sLayerBufWidth[index][idx] = ovlInfo[i].src_w;
				sprintf(tag_name, "OVL%dL%d_Width", index, idx);
				met_tag_oneshot(DDP_IRQ_LAYER_SIZE_ID, tag_name, ovlInfo[i].src_w);
			}
			if (sLayerBufHeight[index][idx] != ovlInfo[i].src_h) {
				sLayerBufHeight[index][idx] = ovlInfo[i].src_h;
				sprintf(tag_name, "OVL%dL%d_Height", index, idx);
				met_tag_oneshot(DDP_IRQ_LAYER_SIZE_ID, tag_name, ovlInfo[i].src_h);
			}
#endif
		} else {
			sLayerBufAddr[index][idx] = 0;
			sLayerBufFmt[index][idx] = 0;
			sLayerBufWidth[index][idx] = 0;
			sLayerBufHeight[index][idx] = 0;
		}

		if ( (i == (OVL_LAYER_NUM_PER_OVL-1)) || (i == (OVL_LAYER_NUM-1)) ) {
			if (enLayerCnt) {
				enLayerCnt = 0;
				sprintf(tag_name, "OVL%d_OutFps", index);
				met_tag_oneshot(DDP_IRQ_LAYER_FPS_ID, tag_name, index);
			}
		}
	}

}