radeon_video.h revision 209ff23f
1#ifndef __RADEON_VIDEO_H__
2#define __RADEON_VIDEO_H__
3
4#include "xf86i2c.h"
5#include "fi1236.h"
6#include "msp3430.h"
7#include "tda9885.h"
8#include "uda1380.h"
9#include "i2c_def.h"
10
11#include "generic_bus.h"
12#include "theatre.h"
13
14#include "xf86Crtc.h"
15
16/* Xvideo port struct */
17typedef struct {
18   uint32_t	 transform_index;
19   uint32_t	 gamma; /* gamma value x 1000 */
20   int           brightness;
21   int           saturation;
22   int           hue;
23   int           contrast;
24   int           red_intensity;
25   int           green_intensity;
26   int           blue_intensity;
27
28	/* overlay composition mode */
29   int		 alpha_mode; /* 0 = key mode, 1 = global mode */
30   int		 ov_alpha;
31   int		 gr_alpha;
32
33     /* i2c bus and devices */
34   I2CBusPtr     i2c;
35   uint32_t      radeon_i2c_timing;
36   uint32_t      radeon_M;
37   uint32_t      radeon_N;
38   uint32_t      i2c_status;
39   uint32_t      i2c_cntl;
40
41   FI1236Ptr     fi1236;
42   uint8_t       tuner_type;
43   MSP3430Ptr    msp3430;
44   TDA9885Ptr    tda9885;
45   UDA1380Ptr    uda1380;
46
47   /* VIP bus and devices */
48   GENERIC_BUS_Ptr  VIP;
49   TheatrePtr       theatre;
50
51   Bool          video_stream_active;
52   int           encoding;
53   uint32_t      frequency;
54   int           volume;
55   Bool          mute;
56   int           sap_channel;
57   int           v;
58   uint32_t      adjustment; /* general purpose variable */
59
60#define METHOD_BOB      0
61#define METHOD_SINGLE   1
62#define METHOD_WEAVE    2
63#define METHOD_ADAPTIVE 3
64
65   int           overlay_deinterlacing_method;
66
67   int           capture_vbi_data;
68
69   int           dec_brightness;
70   int           dec_saturation;
71   int           dec_hue;
72   int           dec_contrast;
73
74   Bool          doubleBuffer;
75   unsigned char currentBuffer;
76   RegionRec     clip;
77   uint32_t      colorKey;
78   uint32_t      videoStatus;
79   Time          offTime;
80   Time          freeTime;
81   Bool          autopaint_colorkey;
82   xf86CrtcPtr   desired_crtc;
83
84   int           size;
85#ifdef USE_EXA
86   ExaOffscreenArea *off_screen;
87#endif
88
89   void         *video_memory;
90   int           video_offset;
91
92   Atom          device_id, location_id, instance_id;
93
94    /* textured video */
95    Bool textured;
96    DrawablePtr pDraw;
97    PixmapPtr pPixmap;
98
99    uint32_t src_offset;
100    uint32_t src_pitch;
101    uint8_t *src_addr;
102
103    int id;
104    int src_w, src_h, dst_w, dst_h;
105    int w, h;
106    int drw_x, drw_y;
107} RADEONPortPrivRec, *RADEONPortPrivPtr;
108
109
110void RADEONInitI2C(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv);
111void RADEONResetI2C(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv);
112
113void RADEONVIP_init(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv);
114void RADEONVIP_reset(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv);
115
116uint32_t
117RADEONAllocateMemory(ScrnInfoPtr pScrn, void **mem_struct, int size);
118void
119RADEONFreeMemory(ScrnInfoPtr pScrn, void *mem_struct);
120
121int  RADEONSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
122int  RADEONGetPortAttribute(ScrnInfoPtr, Atom ,INT32 *, pointer);
123void RADEONStopVideo(ScrnInfoPtr, pointer, Bool);
124void RADEONQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short,
125			 unsigned int *, unsigned int *, pointer);
126int  RADEONQueryImageAttributes(ScrnInfoPtr, int, unsigned short *,
127			unsigned short *,  int *, int *);
128
129XF86VideoAdaptorPtr
130RADEONSetupImageTexturedVideo(ScreenPtr pScreen);
131
132void
133RADEONCopyData(ScrnInfoPtr pScrn,
134	       unsigned char *src, unsigned char *dst,
135	       unsigned int srcPitch, unsigned int dstPitch,
136	       unsigned int h, unsigned int w, unsigned int bpp);
137
138void
139RADEONCopyMungedData(ScrnInfoPtr pScrn,
140		     unsigned char *src1, unsigned char *src2,
141		     unsigned char *src3, unsigned char *dst1,
142		     unsigned int srcPitch, unsigned int srcPitch2,
143		     unsigned int dstPitch, unsigned int h, unsigned int w);
144
145#endif
146