Add api of ddca_check_brightness_support
ddcutil is inaccurate in determining whether a display supports brightness adjustment, which leads to some displays using ddcutil getvcp to query for brightness adjustment, but in reality, ddcutil setvcp all fail. Therefore, a new interface for determining whether the display supports adjusting the brightness has been added
The new interface determines whether the setting is successful by using ddcutil setvcp and then ddcutil getvcp. This way, it can basically be determined whether the display supports adjusting the brightness
First off, let me say that your work is quite impressive. The code is cleanly structured and well documented, and you've clearly gone to considerable effort to understand a complex code base. I'm still reviewing what you've done, but I want you to know that your work has not gone off into the ether.
How did you come the point of wanting to add an API function? I appears you're working on a major libddcutil application that I'm not aware of. Please tell me about it.
My primary concern is that this function is not always accurate, which is what putting it in the API would imply. There are many setvcp failure modes, many corner cases that I become aware of only when someone files a bug report for their particular setup. There are monitors that correctly change the screen brightness, but still report the old value. Conversely, there are monitors that report the new value but in fact have not changed their brightness. We've even seen a monitor that modifies low brightness requests to prevent the screen from going dark (see the description of Dell 2407WFP in the wiki). If this API function is useful to you then it may be appropriate to put a similar function in your code (assuming it is written in C or C++).
One small question. Why to did you put the 50ms wait in step 6? Did you actually observe errors without it, or is it there simply because of your reading of the DDC/CI spec?
Why to did you put the 50ms wait in step 6? -> To ensure that the set data can be obtained normally after setting it. At present, the deletion does not have much impact.This function call is mainly called when accessing a new monitor and it is not frequently called. Therefore, an additional 50ms waiting period is added to ensure the accuracy of the obtained data.
Currently, in our projects, only this method can accurately determine whether the monitor supports adjusting brightness.
If not use this method, is there any other more accurate way to identify the monitor that supports adjusting brightness?
My problem is the issues: https://github.com/rockowitz/ddcutil/issues/538