• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Detecting video cards where physical screens are attached
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Detecting video cards where physical screens are attached


  • Subject: Detecting video cards where physical screens are attached
  • From: David Geldreich <email@hidden>
  • Date: Wed, 11 Jun 2008 23:34:30 +0200

Hi all,

I need to know when 2 displays are attached to the same video card or two different video cards.

Using "ioreg -S -w 0 -c NVDA", I see that my nVidia cards have an IOAccelTypes string which seems to correspond to the physical card.

I am wondering if this field is present for all driver (for example, does ATi cards presents this info) ?

If the string for 2 display is the same we could assume that they are on the same card ?

Thanks in advance.

David.

PS: My code for getting this string :

    CGDirectDisplayID *displays = NULL;
    io_service_t      *dspPorts = NULL;
    CGDisplayCount    count = 0;
    CGDisplayErr      err;
    CFTypeRef         typeCode;

    

    err = CGGetOnlineDisplayList (0, NULL, &count);
    displays = (CGDirectDisplayID*)calloc(count, sizeof(CGDirectDisplayID));
    dspPorts = (io_service_t*)calloc(count, sizeof(io_service_t));

    

    err = CGGetOnlineDisplayList (count, displays, &count);

        

    for (int i = 0; i < count; i++)
    {
        cout << "Display " << i << endl;

        

        dspPorts[i] = CGDisplayIOServicePort(displays[i]);
        // Get PCI card used
        typeCode = IORegistryEntryCreateCFProperty(dspPorts[i],
                                                   CFSTR("IOAccelTypes"),
                                                   kCFAllocatorDefault,
                                                   kNilOptions);

        

        // Ensure we have valid data from IOKit
        if(typeCode && CFGetTypeID(typeCode) == CFStringGetTypeID())
        {
            // If so, convert the CFString to a cstring
            const char *val = CFStringGetCStringPtr((CFStringRef)typeCode, kCFStringEncodingMacRoman);
            cout << "AccelType  : " << val << endl;
        }
        if(typeCode)
            CFRelease(typeCode);
    }

        

    free(displays);
    free(dspPorts);

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: 'lookupd' fails to query DNS
  • Next by Date: Mach-exception forwarding changed on Leopard?
  • Previous by thread: Re: 'lookupd' fails to query DNS
  • Next by thread: Mach-exception forwarding changed on Leopard?
  • Index(es):
    • Date
    • Thread