Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright 2004-2008  Luc Verhaegen <lverhaegen@novell.com>
  3.  * Copyright 2007, 2008 Matthias Hopf <mhopf@novell.com>
  4.  * Copyright 2007, 2008 Egbert Eich   <eich@novell.com>
  5.  * Copyright 2007, 2008 Advanced Micro Devices, Inc.
  6.  *
  7.  * Permission is hereby granted, free of charge, to any person obtaining a
  8.  * copy of this software and associated documentation files (the "Software"),
  9.  * to deal in the Software without restriction, including without limitation
  10.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  11.  * and/or sell copies of the Software, and to permit persons to whom the
  12.  * Software is furnished to do so, subject to the following conditions:
  13.  *
  14.  * The above copyright notice and this permission notice shall be included in
  15.  * all copies or substantial portions of the Software.
  16.  *
  17.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  20.  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  21.  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  22.  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  23.  * OTHER DEALINGS IN THE SOFTWARE.
  24.  */
  25.  
  26. #ifndef _RHD_OUTPUT_H
  27. #define _RHD_OUTPUT_H
  28.  
  29. /* Also needed for connector -> output mapping */
  30. typedef enum rhdOutputType {
  31.     RHD_OUTPUT_NONE  = 0,
  32.     RHD_OUTPUT_DAC_EXTERNAL = RHD_OUTPUT_NONE,
  33.     RHD_OUTPUT_DACA,
  34.     RHD_OUTPUT_DACB,
  35.     RHD_OUTPUT_TMDSA,
  36.     RHD_OUTPUT_LVTMA,
  37.     RHD_OUTPUT_DVO,
  38.     RHD_OUTPUT_KLDSKP_LVTMA,
  39.     RHD_OUTPUT_UNIPHYA,
  40.     RHD_OUTPUT_UNIPHYB,
  41.     RHD_OUTPUT_UNIPHYC,
  42.     RHD_OUTPUT_UNIPHYD,
  43.     RHD_OUTPUT_UNIPHYE,
  44.     RHD_OUTPUT_UNIPHYF,
  45.     RHD_OUTPUT_TMDSB = RHD_OUTPUT_NONE,
  46.     RHD_OUTPUT_LVDS = RHD_OUTPUT_NONE,
  47.     RHD_OUTPUT_LVTMB = RHD_OUTPUT_NONE
  48. } rhdOutputType;
  49.  
  50. typedef enum rhdSensedOutput {
  51.     RHD_SENSED_NONE = 0,
  52.     RHD_SENSED_VGA,
  53.     RHD_SENSED_DVI,
  54.     RHD_SENSED_TV_SVIDEO,
  55.     RHD_SENSED_TV_COMPOSITE,
  56.     RHD_SENSED_TV_COMPONENT
  57. } rhdSensedOutput;
  58.  
  59. enum rhdOutputProperty {
  60.     RHD_OUTPUT_BACKLIGHT,
  61.     RHD_OUTPUT_COHERENT
  62. };
  63.  
  64. enum rhdOutputAllocation {
  65.     RHD_OUTPUT_ALLOC,
  66.     RHD_OUTPUT_FREE
  67. };
  68.  
  69. char *rhdPowerString[4];
  70.  
  71. /*
  72.  *
  73.  * This structure should deal with everything output related.
  74.  *
  75.  */
  76. struct rhdOutput {
  77.     struct rhdOutput *Next;
  78.  
  79.     int scrnIndex;
  80.     RHDPtr rhdPtr;
  81.  
  82.     char *Name;
  83.     enum rhdOutputType Id;
  84.  
  85.     Bool Active;
  86.  
  87.     struct rhdCrtc *Crtc;
  88.     struct rhdConnector *Connector;
  89.  
  90.     enum rhdSensedOutput SensedType;
  91.  
  92.     enum rhdSensedOutput (*Sense) (struct rhdOutput *Output,
  93.                                    struct rhdConnector *Connector);
  94.     ModeStatus (*ModeValid) (struct rhdOutput *Output, DisplayModePtr Mode);
  95.     void (*Mode) (struct rhdOutput *Output, DisplayModePtr Mode);
  96.     void (*Power) (struct rhdOutput *Output, int Power);
  97.     void (*Save) (struct rhdOutput *Output);
  98.     void (*Restore) (struct rhdOutput *Output);
  99.     void (*Destroy) (struct rhdOutput *Output);
  100.     Bool (*Property) (struct rhdOutput *Output,
  101.                       enum rhdPropertyAction Action, enum rhdOutputProperty Property, union rhdPropertyData *val);
  102.     Bool (*AllocFree) (struct rhdOutput *Output, enum rhdOutputAllocation Alloc);
  103.     /* Driver Private data */
  104.     rhdOutputDriverPrivate *OutputDriverPrivate;
  105.     /* Output Private data */
  106.     void *Private;
  107. };
  108.  
  109. void RHDOutputAdd(RHDPtr rhdPtr, struct rhdOutput *Output);
  110. void RHDOutputsMode(RHDPtr rhdPtr, struct rhdCrtc *Crtc, DisplayModePtr Mode);
  111. void RHDOutputsPower(RHDPtr rhdPtr, int Power);
  112. void RHDOutputsShutdownInactive(RHDPtr rhdPtr);
  113. void RHDOutputsSave(RHDPtr rhdPtr);
  114. void RHDOutputsRestore(RHDPtr rhdPtr);
  115. void RHDOutputsDestroy(RHDPtr rhdPtr);
  116. void RHDOutputPrintSensedType(struct rhdOutput *Output);
  117.  
  118. /* output local functions. */
  119. struct rhdOutput *RHDDACAInit(RHDPtr rhdPtr);
  120. struct rhdOutput *RHDDACBInit(RHDPtr rhdPtr);
  121. struct rhdOutput *RHDTMDSAInit(RHDPtr rhdPtr);
  122. struct rhdOutput *RHDLVTMAInit(RHDPtr rhdPtr, CARD8 Type);
  123. struct rhdOutput *RHDDIGInit(RHDPtr rhdPtr,  enum rhdOutputType outputType, CARD8 ConnectorType);
  124. struct rhdOutput *RHDDDIAInit(RHDPtr rhdPtr);
  125. struct rhdOutput *RHDAtomOutputInit(RHDPtr rhdPtr, rhdConnectorType ConnectorType, rhdOutputType OutputType);
  126.  
  127. #endif /* _RHD_OUTPUT_H */
  128.