17104f784Smrg/* 27104f784SmrgCopyright (C) 2008 Francisco Jerez. All Rights Reserved. 37104f784Smrg 47104f784SmrgPermission is hereby granted, free of charge, to any person obtaining a copy of 57104f784Smrgthis software and associated documentation files (the "Software"), to deal in 67104f784Smrgthe Software without restriction, including without limitation the rights to 77104f784Smrguse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 87104f784Smrgof the Software, and to permit persons to whom the Software is furnished to do 97104f784Smrgso, subject to the following conditions: 107104f784Smrg 117104f784SmrgThe above copyright notice and this permission notice shall be included in all 127104f784Smrgcopies or substantial portions of the Software. 137104f784Smrg 147104f784SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 157104f784SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- 167104f784SmrgNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 177104f784SmrgXFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 187104f784SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 197104f784SmrgWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 207104f784Smrg*/ 217104f784Smrg 227104f784Smrg#ifndef _SMI_CRTC_H 237104f784Smrg#define _SMI_CRTC_H 247104f784Smrg 257104f784Smrg#include "xf86Crtc.h" 267104f784Smrg 277104f784Smrgtypedef struct { 287104f784Smrg /* Memory copy of the CRTC color palette */ 297104f784Smrg CARD16 lut_r[256],lut_g[256],lut_b[256]; 307104f784Smrg /* Allocated memory area used as shadow pixmap (for rotation) */ 317104f784Smrg void* shadowArea; 327104f784Smrg 337104f784Smrg /* Setup the CRTC registers to show the specified framebuffer location*/ 347104f784Smrg void (*adjust_frame)(xf86CrtcPtr crtc, int x, int y); 357104f784Smrg /* Setup the CRTC framebuffer format. Called when the FB is 367104f784Smrg resized to modify the screen stride */ 377104f784Smrg void (*video_init)(xf86CrtcPtr crtc); 387104f784Smrg /* Load the LUT fields above to the hardware */ 397104f784Smrg void (*load_lut)(xf86CrtcPtr crtc); 407104f784Smrg 417104f784Smrg#if SMI_CURSOR_ALPHA_PLANE 427104f784Smrg Bool argb_cursor; 437104f784Smrg#endif 447104f784Smrg} SMICrtcPrivateRec, *SMICrtcPrivatePtr; 457104f784Smrg 467104f784Smrg#define SMICRTC(crtc) ((SMICrtcPrivatePtr)(crtc)->driver_private) 477104f784Smrg 487104f784Smrg/* smi_crtc.c */ 497104f784Smrg/* Initialize the xf86CrtcFuncsRec with functions common to all the hardware */ 507104f784Smrgvoid SMI_CrtcFuncsInit_base(xf86CrtcFuncsPtr* crtcFuncs, SMICrtcPrivatePtr* crtcPriv); 517104f784Smrg/* Create and initialize the display controllers. */ 527104f784SmrgBool SMI_CrtcPreInit(ScrnInfoPtr pScrn); 537104f784Smrg 547104f784Smrg/* smi_output.c */ 557104f784Smrg/* Initialize the xf86OutputFuncsRec with functions common to all the hardware */ 567104f784Smrgvoid SMI_OutputFuncsInit_base(xf86OutputFuncsPtr* outputFuncs); 577104f784Smrg/* Create and initialize the video outputs. */ 587104f784SmrgBool SMI_OutputPreInit(ScrnInfoPtr pScrn); 597104f784Smrg 607104f784Smrg/* Output detect dummy implementation that always returns connected. */ 617104f784Smrgxf86OutputStatus SMI_OutputDetect_lcd(xf86OutputPtr output); 627104f784Smrg/* Output get_modes implementation that returns the LCD native mode */ 637104f784SmrgDisplayModePtr SMI_OutputGetModes_native(xf86OutputPtr output); 647104f784Smrg 657104f784Smrg#endif 66