Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Accessing PCI video graphics card registers issue.



Dear all,

I have developed a kernel extension module for a monitor calibration
tool. The prime responsibilty of this module is to communicate to
graphics card which in turn communicates to the monitor through i2c
communication.

Video graphics card have set of registers for i2c communication - data
and clock. I need to communicate with a particular card, (ATI Rage 128
pro DVI) card but I do not have the base offsets and masking values
for the same.

So my query is to "how to find base offsets of i2c in a video graphics card ?"


Below is one of the method I planned to find the i2c data and clock offsets and want your expert comments for the same. I would be thankful if you could please review this idea and if possible share some better alternate ideas

///////////////////////////////

Step 1)  MAP PCI DEVICE MEMORY
         Map the PCI device memory and get the virtual address and
size of the address.

          /* code snippet */
          fRegisterMap = fPCIDevice->mapDeviceMemoryWithRegister(uladdr);
          deviceRegisters  = (ati_reg *)fRegisterMap->getVirtualAddress();
         /********************/

Step 2)  MAP MEMORY TO USER LEVEL APPLICATION
          To map i plan to use clientMemoryForType()  in my kext

           /* code snippet */
          fMemoryToShare->retain();
          *memory = fMemoryToShare;
          /*********************/

Step 3) USER LEVEL APPLICATION PROCESS
         The user level application will open the driver and
communicate with the driver and      get the mapped memory region. See
the memory region using Xcode debugger, it will print the address and
memory location

             /* code snippet */
            IOConnectMapMemory() // to get the  mapped memory at use level
             /*****************/


Step 4) I2C COMMUNICATION THROUGH COMMANDS In the application use i2c api;s to read EDID data. This will write/read parameters from the graphics card for i2c communication with monitor by writting/reading at some registers on the graphics card.

/*code for EDID can be taken from*/
http://darwinsource.opendarwin.org/Current/IOGraphics-179.2/tools/i2cexample.c

Step 4) Check the memory changes
The address whose memory location changes will be the offset of the
i2c for data/clock

///////////////////////////////

Can you please comment if this approcah feasible and correct way to
find offset in a video graphics card of a particular register ?

Or there is any alternate methods for the same ? Any ideas?

The main objective is to find the offset and masking values of i2c
registers in a video graphics card, all suggestions are most welcome.

Please comment

Thanks and Regards,
Rohit



--
Rohit Dhamija(M) 9818446545
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.