190b17f1bSmrg/*
290b17f1bSmrg * Copyright 2004-2005 The Unichrome Project  [unichrome.sf.net]
390b17f1bSmrg * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
490b17f1bSmrg * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
590b17f1bSmrg *
690b17f1bSmrg * Permission is hereby granted, free of charge, to any person obtaining a
790b17f1bSmrg * copy of this software and associated documentation files (the "Software"),
890b17f1bSmrg * to deal in the Software without restriction, including without limitation
990b17f1bSmrg * the rights to use, copy, modify, merge, publish, distribute, sub license,
1090b17f1bSmrg * and/or sell copies of the Software, and to permit persons to whom the
1190b17f1bSmrg * Software is furnished to do so, subject to the following conditions:
1290b17f1bSmrg *
1390b17f1bSmrg * The above copyright notice and this permission notice (including the
1490b17f1bSmrg * next paragraph) shall be included in all copies or substantial portions
1590b17f1bSmrg * of the Software.
1690b17f1bSmrg *
1790b17f1bSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1890b17f1bSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1990b17f1bSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
2090b17f1bSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2190b17f1bSmrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2290b17f1bSmrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2390b17f1bSmrg * DEALINGS IN THE SOFTWARE.
2490b17f1bSmrg */
2590b17f1bSmrg
2690b17f1bSmrg#ifndef _VIA_SWOV_H_
2790b17f1bSmrg#define _VIA_SWOV_H_ 1
2890b17f1bSmrg
2990b17f1bSmrg/*#define XV_DEBUG 1 write log msg to /var/log/XFree86.0.log */
3090b17f1bSmrg
3190b17f1bSmrg#ifdef XV_DEBUG
3290b17f1bSmrg# define DBG_DD(x) (x)
3390b17f1bSmrg#else
3490b17f1bSmrg# define DBG_DD(x)
3590b17f1bSmrg#endif
3690b17f1bSmrg
3790b17f1bSmrg#include "via_priv.h"
3890b17f1bSmrg#include "via_xvpriv.h"
3990b17f1bSmrg
4090b17f1bSmrg/* Definition for VideoStatus */
4190b17f1bSmrg#define VIDEO_NULL              0x00000000
4290b17f1bSmrg#define VIDEO_SWOV_SURFACE_CREATED  0x00000001
4390b17f1bSmrg#define VIDEO_SWOV_ON               0x00000002
4490b17f1bSmrg
4590b17f1bSmrg/*For Video HW Difference */
4690b17f1bSmrg#define VID_HWDIFF_TRUE           0x00000001
4790b17f1bSmrg#define VID_HWDIFF_FALSE          0x00000000
4890b17f1bSmrg
4990b17f1bSmrg/*
5090b17f1bSmrg *	Video HW Difference Structure
5190b17f1bSmrg */
5290b17f1bSmrgtypedef struct __VIAHWDiff
5390b17f1bSmrg{
5490b17f1bSmrg    unsigned long dwThreeHQVBuffer;    /* Use Three HQV Buffers */
5590b17f1bSmrg    /* unsigned long dwV3SrcHeightSetting; *//* Set Video Source Width and Height */
5690b17f1bSmrg    /* unsigned long dwSupportExtendFIFO; *//* Support Extend FIFO */
5790b17f1bSmrg    unsigned long dwHQVFetchByteUnit;  /* HQV Fetch Count unit is byte */
5890b17f1bSmrg    unsigned long dwHQVInitPatch;      /* Initialize HQV Engine 2 times */
5990b17f1bSmrg    /*unsigned long dwSupportV3Gamma; *//* Support V3 Gamma */
6090b17f1bSmrg    /*unsigned long dwUpdFlip; *//* Set HQV3D0[15] to flip video */
6190b17f1bSmrg    unsigned long dwHQVDisablePatch;   /* Change Video Engine Clock setting for HQV disable bug */
6290b17f1bSmrg    /*unsigned long dwSUBFlip; *//* Set HQV3D0[15] to flip video for sub-picture blending */
6390b17f1bSmrg    unsigned long dwNeedV1Prefetch;             /*V1 pre-fetch function for K8*/
6490b17f1bSmrg    /*unsigned long dwNeedV3Prefetch; *//* V3 pre-fetch function for K8 */
6590b17f1bSmrg    /*unsigned long dwNeedV4Prefetch; *//* V4 pre-fetch function for K8 */
6690b17f1bSmrg    /*unsigned long dwUseSystemMemory; *//* Use system memory for DXVA compressed data buffers */
6790b17f1bSmrg    /*unsigned long dwExpandVerPatch; *//* Patch video HW bug in expand SIM mode or same display path */
6890b17f1bSmrg    /*unsigned long dwExpandVerHorPatch; *//* Patch video HW bug in expand SAMM mode or same display path */
6990b17f1bSmrg    /*unsigned long dwV3ExpireNumTune; *//* Change V3 expire number setting for V3 bandwidth issue */
7090b17f1bSmrg    /*unsigned long dwV3FIFOThresholdTune; *//* Change V3 FIFO, Threshold and Pre-threshold setting for V3 bandwidth issue */
7190b17f1bSmrg    /*unsigned long dwCheckHQVFIFOEmpty; *//* HW Flip path, need to check HQV FIFO status */
7290b17f1bSmrg    /*unsigned long dwUseMPEGAGP; *//* Use MPEG AGP function */
7390b17f1bSmrg    /*unsigned long dwV3FIFOPatch; *//* For CLE V3 FIFO Bug (srcWidth <= 8) */
7490b17f1bSmrg    unsigned long dwSupportTwoColorKey;	/* Support two color key */
7590b17f1bSmrg    /* unsigned long dwCxColorSpace; *//* CLE_Cx ColorSpace */
7690b17f1bSmrg    unsigned dwNewScaleCtl; /* Use new HQV scale engine code */
7790b17f1bSmrg    const unsigned *HQVCmeRegs; /* Which set of CME regs to use for newer chipsets */
7890b17f1bSmrg} VIAHWDiff;
7990b17f1bSmrg
8090b17f1bSmrgvoid VIAVidHWDiffInit(ScrnInfoPtr pScrn);
8190b17f1bSmrgint ViaSwovSurfaceCreate(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv,
8290b17f1bSmrg    CARD32 FourCC, CARD16 Width, CARD16 Height);
8390b17f1bSmrgvoid ViaSwovSurfaceDestroy(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv);
8490b17f1bSmrgBool VIAVidUpdateOverlay(xf86CrtcPtr crtc, LPDDUPDATEOVERLAY pUpdate);
8590b17f1bSmrgvoid ViaOverlayHide(ScrnInfoPtr pScrn);
8690b17f1bSmrg
8790b17f1bSmrg#endif /* _VIA_SWOV_H_ */
88