1/*
2 * Copyright 2004-2005 The Unichrome Project  [unichrome.sf.net]
3 * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
4 * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sub license,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
24 */
25
26#ifndef _VIA_SWOV_H_
27#define _VIA_SWOV_H_ 1
28
29/*#define XV_DEBUG 1 write log msg to /var/log/XFree86.0.log */
30
31#ifdef XV_DEBUG
32# define DBG_DD(x) (x)
33#else
34# define DBG_DD(x)
35#endif
36
37#include "via_priv.h"
38#include "via_xvpriv.h"
39
40/* Definition for VideoStatus */
41#define VIDEO_NULL              0x00000000
42#define VIDEO_SWOV_SURFACE_CREATED  0x00000001
43#define VIDEO_SWOV_ON               0x00000002
44
45/*For Video HW Difference */
46#define VID_HWDIFF_TRUE           0x00000001
47#define VID_HWDIFF_FALSE          0x00000000
48
49/*
50 *	Video HW Difference Structure
51 */
52typedef struct __VIAHWDiff
53{
54    unsigned long dwThreeHQVBuffer;    /* Use Three HQV Buffers */
55    /* unsigned long dwV3SrcHeightSetting; *//* Set Video Source Width and Height */
56    /* unsigned long dwSupportExtendFIFO; *//* Support Extend FIFO */
57    unsigned long dwHQVFetchByteUnit;  /* HQV Fetch Count unit is byte */
58    unsigned long dwHQVInitPatch;      /* Initialize HQV Engine 2 times */
59    /*unsigned long dwSupportV3Gamma; *//* Support V3 Gamma */
60    /*unsigned long dwUpdFlip; *//* Set HQV3D0[15] to flip video */
61    unsigned long dwHQVDisablePatch;   /* Change Video Engine Clock setting for HQV disable bug */
62    /*unsigned long dwSUBFlip; *//* Set HQV3D0[15] to flip video for sub-picture blending */
63    unsigned long dwNeedV1Prefetch;             /*V1 pre-fetch function for K8*/
64    /*unsigned long dwNeedV3Prefetch; *//* V3 pre-fetch function for K8 */
65    /*unsigned long dwNeedV4Prefetch; *//* V4 pre-fetch function for K8 */
66    /*unsigned long dwUseSystemMemory; *//* Use system memory for DXVA compressed data buffers */
67    /*unsigned long dwExpandVerPatch; *//* Patch video HW bug in expand SIM mode or same display path */
68    /*unsigned long dwExpandVerHorPatch; *//* Patch video HW bug in expand SAMM mode or same display path */
69    /*unsigned long dwV3ExpireNumTune; *//* Change V3 expire number setting for V3 bandwidth issue */
70    /*unsigned long dwV3FIFOThresholdTune; *//* Change V3 FIFO, Threshold and Pre-threshold setting for V3 bandwidth issue */
71    /*unsigned long dwCheckHQVFIFOEmpty; *//* HW Flip path, need to check HQV FIFO status */
72    /*unsigned long dwUseMPEGAGP; *//* Use MPEG AGP function */
73    /*unsigned long dwV3FIFOPatch; *//* For CLE V3 FIFO Bug (srcWidth <= 8) */
74    unsigned long dwSupportTwoColorKey;	/* Support two color key */
75    /* unsigned long dwCxColorSpace; *//* CLE_Cx ColorSpace */
76    unsigned dwNewScaleCtl; /* Use new HQV scale engine code */
77    const unsigned *HQVCmeRegs; /* Which set of CME regs to use for newer chipsets */
78} VIAHWDiff;
79
80void VIAVidHWDiffInit(ScrnInfoPtr pScrn);
81int ViaSwovSurfaceCreate(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv,
82    CARD32 FourCC, CARD16 Width, CARD16 Height);
83void ViaSwovSurfaceDestroy(ScrnInfoPtr pScrn, viaPortPrivPtr pPriv);
84Bool VIAVidUpdateOverlay(xf86CrtcPtr crtc, LPDDUPDATEOVERLAY pUpdate);
85void ViaOverlayHide(ScrnInfoPtr pScrn);
86
87#endif /* _VIA_SWOV_H_ */
88