summaryrefslogtreecommitdiff
path: root/src/i830_video.h
blob: 91f767f9f3466df778aadc772ebee49e63881f96 (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
/***************************************************************************
 
Copyright 2000 Intel Corporation.  All Rights Reserved. 

Permission is hereby granted, free of charge, to any person obtaining a 
copy of this software and associated documentation files (the 
"Software"), to deal in the Software without restriction, including 
without limitation the rights to use, copy, modify, merge, publish, 
distribute, sub license, and/or sell copies of the Software, and to 
permit persons to whom the Software is furnished to do so, subject to 
the following conditions: 

The above copyright notice and this permission notice (including the 
next paragraph) shall be included in all copies or substantial portions 
of the Software. 

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 
IN NO EVENT SHALL INTEL, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, 
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 
THE USE OR OTHER DEALINGS IN THE SOFTWARE.

**************************************************************************/

#include "xf86.h"
#include "xf86_OSproc.h"

typedef struct {
   uint32_t YBuf0offset;
   uint32_t UBuf0offset;
   uint32_t VBuf0offset;

   uint32_t YBuf1offset;
   uint32_t UBuf1offset;
   uint32_t VBuf1offset;

   unsigned char currentBuf;

   int brightness;
   int contrast;
   int saturation;
   xf86CrtcPtr current_crtc;
   xf86CrtcPtr desired_crtc;
   int doubleBuffer;

   RegionRec clip;
   uint32_t colorKey;

   uint32_t gamma0;
   uint32_t gamma1;
   uint32_t gamma2;
   uint32_t gamma3;
   uint32_t gamma4;
   uint32_t gamma5;

   uint32_t videoStatus;
   Time offTime;
   Time freeTime;
   i830_memory *buf; /** YUV data buffer */
   unsigned int extra_offset;

   Bool overlayOK;
   int oneLineMode;
   int scaleRatio;
   Bool textured;
   Rotation rotation; /* should remove I830->rotation later*/
} I830PortPrivRec, *I830PortPrivPtr;

#define GET_PORT_PRIVATE(pScrn) \
   (I830PortPrivPtr)((I830PTR(pScrn))->adaptor->pPortPrivates[0].ptr)

/*
 * Broadwater requires a bit of extra video memory for state information
 */
#define BRW_LINEAR_EXTRA	(36*1024)

void I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv,
			      int id, RegionPtr dstRegion, short width,
			      short height, int video_pitch, int video_pitch2,
			      int x1, int y1, int x2, int y2,
			      short src_w, short src_h,
			      short drw_w, short drw_h,
			      PixmapPtr pPixmap);

void I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv,
			      int id, RegionPtr dstRegion, short width,
			      short height, int video_pitch,
			      int x1, int y1, int x2, int y2,
			      short src_w, short src_h,
			      short drw_w, short drw_h,
			      PixmapPtr pPixmap);

void I830VideoBlockHandler(int i, pointer blockData, pointer pTimeout,
			   pointer pReadmask);