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