1/***************************************************************************
2
3Copyright 2000 Intel Corporation.  All Rights Reserved.
4
5Permission is hereby granted, free of charge, to any person obtaining a
6copy of this software and associated documentation files (the
7"Software"), to deal in the Software without restriction, including
8without limitation the rights to use, copy, modify, merge, publish,
9distribute, sub license, and/or sell copies of the Software, and to
10permit persons to whom the Software is furnished to do so, subject to
11the following conditions:
12
13The above copyright notice and this permission notice (including the
14next paragraph) shall be included in all copies or substantial portions
15of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20IN NO EVENT SHALL INTEL, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
21DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
23THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
25**************************************************************************/
26
27#include "xf86.h"
28#include "xf86_OSproc.h"
29
30typedef struct {
31   uint32_t YBuf0offset;
32   uint32_t UBuf0offset;
33   uint32_t VBuf0offset;
34
35   uint32_t YBuf1offset;
36   uint32_t UBuf1offset;
37   uint32_t VBuf1offset;
38
39   unsigned char currentBuf;
40
41   int brightness;
42   int contrast;
43   int saturation;
44   xf86CrtcPtr current_crtc;
45   xf86CrtcPtr desired_crtc;
46   int doubleBuffer;
47
48   RegionRec clip;
49   uint32_t colorKey;
50
51   uint32_t gamma0;
52   uint32_t gamma1;
53   uint32_t gamma2;
54   uint32_t gamma3;
55   uint32_t gamma4;
56   uint32_t gamma5;
57
58   uint32_t videoStatus;
59   Time offTime;
60   Time freeTime;
61   drm_intel_bo *buf; /** YUV data buffer */
62
63   Bool overlayOK;
64   int oneLineMode;
65   int scaleRatio;
66   Bool textured;
67   Rotation rotation; /* should remove I830->rotation later*/
68
69   int SyncToVblank; /* -1: auto, 0: off, 1: on */
70} I830PortPrivRec, *I830PortPrivPtr;
71
72#define GET_PORT_PRIVATE(pScrn) \
73   (I830PortPrivPtr)((I830PTR(pScrn))->adaptor->pPortPrivates[0].ptr)
74
75void I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv,
76			      int id, RegionPtr dstRegion, short width,
77			      short height, int video_pitch, int video_pitch2,
78			      int x1, int y1, int x2, int y2,
79			      short src_w, short src_h,
80			      short drw_w, short drw_h,
81			      PixmapPtr pPixmap);
82
83void I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv,
84			      int id, RegionPtr dstRegion, short width,
85			      short height, int video_pitch,
86			      int x1, int y1, int x2, int y2,
87			      short src_w, short src_h,
88			      short drw_w, short drw_h,
89			      PixmapPtr pPixmap);
90
91void I830VideoBlockHandler(int i, pointer blockData, pointer pTimeout,
92			   pointer pReadmask);
93void i965_free_video(ScrnInfoPtr scrn);
94