summaryrefslogtreecommitdiff
path: root/src/rdc_video.h
blob: f6d19cbdd85ff3504f256577e14beba436380171 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/* 
 * Copyright (C) 2009 RDC Semiconductor Co.,Ltd
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * For technical support : 
 *     <jason.lin@rdc.com.tw>
 */

#include "xf86.h"

// VIDEO Register definition VDISP
#define VDP_CTL                         0x700
#define VDP_REG_UPDATE_MOD_SELECT       0x704
#define VDP_FIFO_THRESHOLD              0x708
#define VDP_FETCH_COUNT                 0x70C
#define VDP_START_OFFSET                0x710
#define VDP_SRC_DISP_COUNT_ON_SCR       0x714
#define VDP_START_LOCATION              0x718
#define VDP_END_LOCATION                0x71C
#define VDP_FIRST_COLORKEY              0x720
#define VDP_CHROMA_KEY_LOW              0x724
#define VDP_CHROMA_KEY_UPPER            0x728
#define VDP_ZOOM_CTL                    0x72C
#define VDP_FB0                         0x730
#define VDP_FB1                         0x734
#define VDP_FB2                         0x738
#define VDP_FB_STRIDE                   0x73C
#define VDP_COLOR_ENHANCE_CTL1          0x740
#define VDP_COLOR_ENHANCE_CTL2          0x744
#define VDP_COLOR_ENHANCE_CTL3          0x748
#define VDP_COLOR_ENHANCE_CTL4          0x74C
#define VDP_SECOND_COLORKEY             0x750

#define VID_Enable                      1
#define VID_Disable                     0

// VIDEO states
#define VDPS_ENABLE                     BIT0
#define VDPS_SW_FLIP                    0x00010000
#define VDPS_HW_FLIP                    0
#define VDPS_DISP_REQ_EXPIRE            0x00000140
#define VDPS_DISP_PRE_FETCH             BIT20
#define VDPS_DISP1                      0x0
#define VDPS_DISP2                      BIT18
#define VDPS_FIRE                       BIT7
#define VDPS_FIFO_THRESHOLD             0x60006000
#define VDPS_ENABLE_CK                  BIT30
#define VDPS_ENABLE_CHK                 BIT31
#define VDPS_H_ZOOM_ENABLE              BIT31
#define VDPS_H_INTERP                   BIT30
#define VDPS_V_ZOOM_ENABLE              BIT15
#define VDPS_V_INTERP                   BIT14

typedef struct {
     // overlay reg                                
     ULONG dwVidCtl;                               
     ULONG dwVideoSrcOffset;                             
     ULONG dwFetch;                  // Video engine fetch count
     ULONG dwVDisplayCount;          // Video engine display count 0x26c,0x27c
     ULONG dwVSrcPitch;                 // Video engine stride
     ULONG dwWinStartXY;
     ULONG dwWinEndXY;
     ULONG dwzoomCtl;
     ULONG dwColorKey;
     ULONG dwVIDBuffer[3];
} VIDHWINFO, *VIDHWINFOPtr;

/*
 * structure for passing information to UpdateOverlay fn
 */
typedef struct _OV_RECTL
{
    unsigned long     left;
    unsigned long     top;
    unsigned long     right;
    unsigned long     bottom;
} OV_RECTL, *OV_RECTLPtr;


/*
 *  Xv port specific struct, each port has it's own struct
 */
typedef struct {
    long            brightness;
    long            saturation;
    long            contrast;
    long            hue;
    RegionRec       clip;
    CARD32          colorkey;

    VIDHWINFO       VidhwInfo;
	FBLinearPtr     PackedBuf0;
	unsigned long   Packed0Offset;
	
    OV_RECTL        rDst;
    OV_RECTL        rSrc;
    unsigned long   SrcPitch;
} RDCPortPrivRec, *RDCPortPrivPtr;