/* Set Overlay format to default value */
tmp = STG_READ_REG(DACPixelFormat);
CLEAR_BITS_FRM_TO(4, 7);
CLEAR_BITS_FRM_TO(16, 22);
STG_WRITE_REG(DACPixelFormat, tmp);
/* Set Vertical scaling to default */
tmp = STG_READ_REG(DACVerticalScal);
CLEAR_BITS_FRM_TO(0, 11);
CLEAR_BITS_FRM_TO(16, 22);
tmp |= STG4000_NO_SCALING; /* Set to no scaling */
STG_WRITE_REG(DACVerticalScal, tmp);
/* Set Horizontal Scaling to default */
tmp = STG_READ_REG(DACHorizontalScal);
CLEAR_BITS_FRM_TO(0, 11);
CLEAR_BITS_FRM_TO(16, 17);
tmp |= STG4000_NO_SCALING; /* Set to no scaling */
STG_WRITE_REG(DACHorizontalScal, tmp);
/* Set Blend mode to Alpha Blend */ /* ????? SG 08/11/2001 Surely this isn't the alpha blend mode, hopefullyitsoverwrite
*/
tmp = STG_READ_REG(DACBlendCtrl);
CLEAR_BITS_FRM_TO(0, 30);
tmp = (GRAPHICS_MODE << 28);
STG_WRITE_REG(DACBlendCtrl, tmp);
/* Stride in 16 byte words - 16Bpp */ if (bLinear) { /* Format is 16bits so num 16 byte words is width/8 */ if ((inWidth & 0x7) == 0) { /* inWidth % 8 */
ulStride = (inWidth / 8);
} else { /* Round up to next 16byte boundary */
ulStride = ((inWidth + 8) / 8);
}
} else { /* Y component is 8bits so num 16 byte words is width/16 */ if ((inWidth & 0xf) == 0) { /* inWidth % 16 */
ulStride = (inWidth / 16);
} else { /* Round up to next 16byte boundary */
ulStride = ((inWidth + 16) / 16);
}
}
/* Set Overlay address and Format mode */
tmp = STG_READ_REG(DACOverlayAddr);
CLEAR_BITS_FRM_TO(0, 20); if (bLinear) {
CLEAR_BIT(31); /* Overlay format to Linear */
} else {
tmp |= SET_BIT(31); /* Overlay format to Planer */
}
/* Only bits 24:4 of the Overlay address */
tmp |= (ulOverlayOffset >> 4);
STG_WRITE_REG(DACOverlayAddr, tmp);
if (!bLinear) {
u32 uvSize =
(inWidth & 0x1) ? (inWidth + 1 / 2) : (inWidth / 2);
u32 uvStride;
u32 ulOffset; /* Y component is 8bits so num 32 byte words is width/32 */ if ((uvSize & 0xf) == 0) { /* inWidth % 16 */
uvStride = (uvSize / 16);
} else { /* Round up to next 32byte boundary */
uvStride = ((uvSize + 16) / 16);
}
ulOffset = ulOverlayOffset + (inHeight * (ulStride * 16)); /* Align U,V data to 32byte boundary */ if ((ulOffset & 0x1f) != 0)
ulOffset = (ulOffset + 32L) & 0xffffffE0L;
/* Set Overlay YUV pixel format *MakesurethatLUTnotused-??????
*/
tmp = STG_READ_REG(DACPixelFormat); /* Only support Planer or UYVY linear formats */
CLEAR_BITS_FRM_TO(4, 9);
STG_WRITE_REG(DACPixelFormat, tmp);
/* First work out the position we are to display as offset from the *sourceofthebuffer
*/
ulFxScale = (ulDest << 11) / ulSrc; /* fixed point scale factor */
ulFxOffset = (srcDest.lDstY2 - srcDest.ulDstY2) << 11;
ulPattern = adwDecim8[ulBits];
ulDecimated =
(ulBits * ulApplied) + Overlap((ulSrc % 32),
ulPattern);
ulSrc = ulSrc - ulDecimated; /* the number number of lines that will go into the scaler */
}
/* shift fxscale until it is in the range of the scaler */
ulhDecim = 0;
ulScale = (((ulSrcRight - ulSrcLeft) - 1) << (11 - ulhDecim)) / (ulRight - ulLeft + 2);
/* Calculate new output line stride, this is always the number of 422 wordsinthelinebuffer,soitdoesn'tmatterifthe modeis420.Thensettheverticalscaleregister.
*/
ulStride = (ulWidth >> (ulhDecim + 3)) + ulsAdd;
tmp |= ((ulStride << 16) | (ulDacYScale)); /* DAC_LS_CTRL = stride */
STG_WRITE_REG(DACVerticalScal, tmp);
/* Now set up the overlay size using the modified width and height fromdecimateandscalingcalculations
*/
tmp = STG_READ_REG(DACOverlaySize);
CLEAR_BITS_FRM_TO(0, 10);
CLEAR_BITS_FRM_TO(12, 31);
/* Set Video Window Start */
tmp = ((ulLeft << 16)) | (srcDest.ulDstY1);
STG_WRITE_REG(DACVidWinStart, tmp);
/* Set Video Window End */
tmp = ((ulRight) << 16) | (srcDest.ulDstY2);
STG_WRITE_REG(DACVidWinEnd, tmp);
/* Finally set up the rest of the overlay regs in the order doneintheIMGdriver
*/
tmp = STG_READ_REG(DACPixelFormat);
tmp = ((ulExcessPixels << 16) | tmp) & 0x7fffffff;
STG_WRITE_REG(DACPixelFormat, tmp);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.