Subversion Repositories Kolibri OS

Rev

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

  1. /*
  2.  * Copyright 2007  Luc Verhaegen <lverhaegen@novell.com>
  3.  * Copyright 2007  Matthias Hopf <mhopf@novell.com>
  4.  * Copyright 2007  Egbert Eich   <eich@novell.com>
  5.  * Copyright 2007  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_CONNECTOR_H
  27. #define _RHD_CONNECTOR_H
  28.  
  29. /* so that we can map which is which */
  30. typedef enum rhdConnectorType {
  31.     RHD_CONNECTOR_NONE  = 0,
  32.     RHD_CONNECTOR_VGA,
  33.     RHD_CONNECTOR_DVI,
  34.     RHD_CONNECTOR_DVI_SINGLE,
  35.     RHD_CONNECTOR_PANEL,
  36.     RHD_CONNECTOR_TV,
  37.     RHD_CONNECTOR_PCIE
  38. } rhdConnectorType;
  39. /* add whatever */
  40.  
  41. /* map which DDC bus is where */
  42. typedef enum _rhdDDC {
  43.     RHD_DDC_0 = 0,
  44.     RHD_DDC_1,
  45.     RHD_DDC_2,
  46.     RHD_DDC_3,
  47.     RHD_DDC_4,
  48.     RHD_DDC_MAX,
  49.     RHD_DDC_NONE  = 0xFF,
  50.     RHD_DDC_GPIO = RHD_DDC_NONE
  51. } rhdDDC;
  52.  
  53. /* map which HPD plug is used where */
  54. typedef enum _rhdHPD {
  55.     RHD_HPD_NONE  = 0,
  56.     RHD_HPD_0,
  57.     RHD_HPD_1,
  58.     RHD_HPD_2,
  59.     RHD_HPD_3
  60. } rhdHPD;
  61.  
  62. #define MAX_OUTPUTS_PER_CONNECTOR 2
  63.  
  64. struct rhdConnector {
  65.     int scrnIndex;
  66.  
  67.     CARD8 Type;
  68.     char *Name;
  69.  
  70.     struct _I2CBusRec *DDC;
  71.  
  72.     /* HPD handling here */
  73.     int  HPDMask;
  74.     Bool HPDAttached;
  75.     Bool (*HPDCheck) (struct rhdConnector *Connector);
  76.  
  77.     /* Add rhdMonitor pointer here. */
  78.     /* This is created either from default, config or from EDID */
  79.     struct rhdMonitor *Monitor;
  80.  
  81.     /* Point back to our Outputs, so we can handle sensing better */
  82.     struct rhdOutput *Output[MAX_OUTPUTS_PER_CONNECTOR];
  83. };
  84.  
  85. Bool RHDConnectorsInit(RHDPtr rhdPtr, struct rhdCard *Card);
  86. void RHDHPDSave(RHDPtr rhdPtr);
  87. void RHDHPDRestore(RHDPtr rhdPtr);
  88. void RHDConnectorsDestroy(RHDPtr rhdPtr);
  89. Bool RHDConnectorEnableHDMI(struct rhdConnector *Connector);
  90.  
  91. #endif /* _RHD_CONNECTOR_H */
  92.