[haiku-commits] r42708 - haiku/trunk/src/add-ons/accelerants/radeon_hd

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 2 Sep 2011 19:47:15 +0200 (CEST)

Author: kallisti5
Date: 2011-09-02 19:47:14 +0200 (Fri, 02 Sep 2011)
New Revision: 42708
Changeset: https://dev.haiku-os.org/changeset/42708

Modified:
   haiku/trunk/src/add-ons/accelerants/radeon_hd/accelerant.h
   haiku/trunk/src/add-ons/accelerants/radeon_hd/display.cpp
Log:
* find GPIO pin connector i2c is on for DDC / EDID
* add i2c_bus to connector information


Modified: haiku/trunk/src/add-ons/accelerants/radeon_hd/accelerant.h
===================================================================
--- haiku/trunk/src/add-ons/accelerants/radeon_hd/accelerant.h  2011-09-02 
16:27:35 UTC (rev 42707)
+++ haiku/trunk/src/add-ons/accelerants/radeon_hd/accelerant.h  2011-09-02 
17:47:14 UTC (rev 42708)
@@ -144,6 +144,7 @@
        uint16 connector_flags;
        uint32 connector_type;
        uint16 connector_object_id;
+       i2c_bus connector_i2c;
        uint32 encoder_type;
        uint16 encoder_object_id;
        // TODO struct radeon_i2c_bus_rec ddc_bus;

Modified: haiku/trunk/src/add-ons/accelerants/radeon_hd/display.cpp
===================================================================
--- haiku/trunk/src/add-ons/accelerants/radeon_hd/display.cpp   2011-09-02 
16:27:35 UTC (rev 42707)
+++ haiku/trunk/src/add-ons/accelerants/radeon_hd/display.cpp   2011-09-02 
17:47:14 UTC (rev 42708)
@@ -537,8 +537,58 @@
                                }
                        }
 
-                       // TODO : look up gpio for ddc, hpd
+                       // Set up information buses such as ddc
+                       if ((connector_flags
+                               & (ATOM_DEVICE_TV_SUPPORT | 
ATOM_DEVICE_CV_SUPPORT)) == 0) {
+                               for (j = 0; j < con_obj->ucNumberOfObjects; 
j++) {
+                                       if 
(B_LENDIAN_TO_HOST_INT16(path->usConnObjectId)
+                                               == B_LENDIAN_TO_HOST_INT16(
+                                               
con_obj->asObjects[j].usObjectID)) {
+                                               ATOM_COMMON_RECORD_HEADER 
*record
+                                                       = 
(ATOM_COMMON_RECORD_HEADER*)(gAtomContext->bios
+                                                       + data_offset + 
B_LENDIAN_TO_HOST_INT16(
+                                                       
con_obj->asObjects[j].usRecordOffset));
+                                               while (record->ucRecordSize > 0
+                                                       && record->ucRecordType 
> 0
+                                                       && record->ucRecordType
+                                                               <= 
ATOM_MAX_OBJECT_RECORD_NUMBER) {
+                                                       ATOM_I2C_RECORD 
*i2c_record;
+                                                       
ATOM_I2C_ID_CONFIG_ACCESS *i2c_config;
+                                                       //ATOM_HPD_INT_RECORD 
*hpd_record;
 
+                                                       switch 
(record->ucRecordType) {
+                                                               case 
ATOM_I2C_RECORD_TYPE:
+                                                                       
i2c_record
+                                                                               
= (ATOM_I2C_RECORD *)record;
+                                                                       
i2c_config
+                                                                               
= (ATOM_I2C_ID_CONFIG_ACCESS *)
+                                                                               
&i2c_record->sucI2cId;
+
+                                                                       // 
i2c_config->ucAccess is gpio_id
+
+                                                                       // 
ddc_bus = radeon_lookup_i2c_gpio(rdev,
+                                                                       //      
i2c_config->ucAccess);
+
+                                                                       
TRACE("Found i2c record: GPIO: 0x%"
+                                                                               
B_PRIx32 "\n", i2c_config->ucAccess);
+
+                                                                       // 
ddc2_init_timing(
+                                                                       //      
&gConnector[connector_index]->connector_i2c);
+
+                                                                       break;
+                                                               case 
ATOM_HPD_INT_RECORD_TYPE:
+                                                                       // TODO 
: HPD (Hot Plug)
+                                                                       break;
+                                                       }
+
+                                                       // move to next record
+                                                       record = 
(ATOM_COMMON_RECORD_HEADER *)
+                                                               ((char *)record 
+ record->ucRecordSize);
+                                               }
+                                       }
+                               }
+                       }
+
                        // TODO : aux chan transactions
 
                        TRACE("%s: Path #%" B_PRId32 ": Found %s (0x%" B_PRIX32 
")\n",


Other related posts:

  • » [haiku-commits] r42708 - haiku/trunk/src/add-ons/accelerants/radeon_hd - kallisti5