Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with nvidia web driver, 10.10.3 and Dell U2715H monitor #1

Closed
piermorel opened this issue May 12, 2015 · 6 comments
Closed

Comments

@piermorel
Copy link

On my build with your current tool, I could neither set nor read any parameters.
By replacing part of your code from DDCWrite() with code from this post, I manage to correctly modify all the settings on my Dell U2715H (connected to a GTX 970 by display port, using Nvidia Web drivers).

Here's the code for the modified DDCwrite

bool DDCWrite(CGDirectDisplayID displayID, struct DDCWriteCommand *write) {


    IOI2CRequest    request;
    UInt8           data[128];

    bzero( &request, sizeof(request));

    request.commFlags                       = 0;

    request.sendAddress                     = 0x6E;
    request.sendTransactionType             = kIOI2CSimpleTransactionType;
    request.sendBuffer                      = (vm_address_t) &data[0];
    request.sendBytes                       = 7;

    data[0] = 0x51;
    data[1] = 0x84;
    data[2] = 0x03;
    data[3] = write->control_id;
    data[4] = 0x64 ;
    data[5] = write->new_value ;
    data[6] = 0x6E ^ data[0] ^ data[1] ^ data[2] ^ data[3]^ data[4]^
    data[5];


    request.replyTransactionType    = kIOI2CNoTransactionType;
    request.replyBytes                      = 0;


    bool result = DisplayRequest(displayID, &request);
    return result;
}

I basically replaced the code that fills the request structure... To me it looks like instead of setting request.sendSubAddress to 0x51, this value of 0x51 is set in the first element of request.data (which is one element bigger). This code doesn't work well on a mac mini connected to another Dell monitor. I don't know what is the proper solution (looks like it could be depend on how this request structure is layed out in memory).

@kfix
Copy link
Owner

kfix commented May 28, 2015

soory, my emails been on the fritz, I'm gonna try this out. thanks for the report!

@kfix
Copy link
Owner

kfix commented May 28, 2015

So, your new function sets values on my DisplayPort monitor (LG Ultrawide) perfectly!
Reads don't work, so neither do relative re-settings (ddcctl -d 1 -b 20+).
I'll try out the linked read function and see if I can port that too and make a new release.

@kfix kfix closed this as completed in 1a4bc92 May 28, 2015
@piermorel
Copy link
Author

Hi, great that you implemented the fix, but as I said in my message, this fix breaks the functionality in other monitors, although I have no idea why each version of the code works on some setups and not on others (is it the port type, the graphic card brand, the monitor model ?). For example the "old" version works on a mac mini late 2012 with a dell monitor connected by a mini-dp->DVI adapter, and the "new" version works on a hackintosh with GTX 970, nvidia web driver and a dell monitor connected by displayport. When testing the "new" version on the mac mini and trying to change the brightness, the monitor goes to full brightness. When testing the "old" version on the hackintosh, nothing happens. It would be nice to find out when to use each version, or at least allow the user to pick which mode he wants to use.

@kfix
Copy link
Owner

kfix commented May 28, 2015

hmm, 1a4bc92 allows me to control both my DisplayPort and DVI monitor. I'm using an 2009 Mac Mini with a single Nvidia GPU with Apple drivers.

I do get occasional failures, but increasing the delays and kDelayBase seemed to minimize them.

@Kalvin126
Copy link
Contributor

The problem is dependent on hardware it seems. I, along with other developer who have post Haswell Mac, seem to be unable to send any messages to the monitor over DDC.

@kfix
Copy link
Owner

kfix commented May 28, 2015

Right and 10.10 deprecated one of the ioctls used. Its a very tenuous tool, and I only cobbled together the front-end of it.
Without diffing the structs sent/recieved of the last two revs, there's no way to implement a "mode" for DDC comms.
I don't have any other macs or hackintoshes to code against, nor am I inclined to get some right now.
PRs welcome if anyone can figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants