[OpenJDK 2D-Dev] <AWT Dev> [9] Review Request: JDK-8041900 [macosx] Java forces the use of discrete GPU

Semyon Sadetsky semyon.sadetsky at oracle.com
Tue Oct 20 11:52:49 UTC 2015


Hi Sergey,

I have two questions:

1.
As I read about NSOpenGLPFAAllowOfflineRenderers attribute here
https://developer.apple.com/library/mac/technotes/tn2229/_index.html

To support Mac OS X 10.4 or earlier, you will need to remove this 
attribute from your attribute list, as otherwise pixel format creation 
will fail.

Should we care about OS X < 10.4?

2.
As I understand, an important for the app to react on the card switching 
correctly. For example discrete card is switched to the integrated due 
to energy saving and then is switched back. Did you try this scenario?

--Semyon


On 10/20/2015 11:14 AM, Alexander Scherbatiy wrote:
>
>   The fix looks good to me.
>
> On 10/19/2015 4:36 PM, Sergey Bylokhov wrote:
>> Hello.
>> Please review an updated version of the fix:
>> http://cr.openjdk.java.net/~serb/8041900/webrev.00
>>
>> This version fix the problem of incorrect scale under retina display 
>> after gpu is switched. The problem is that we use Quartz based 
>> API(displayid+CGDisplayRemoveReconfigurationCallbac) to handle update 
>> of gpu, but in this callback the information about a current screen 
>> in [NSScreen screens] can be outdated and we cannot properly get the 
>> scale factor of the new device.
>>
>> There are two options to fix the problem:
>> - Use cocoa based 
>> api+NSApplicationDidChangeScreenParametersNotification. But currently 
>> most of our methods uses displayid and quartz.
>> - Postpone the callback for one iteration and wait when [NSScreen ..] 
>> will be updated.
>>
>> The second approach is selected since the fix will be backported to 8.
>
>    Does it have sense to revisit the fix to use the Cocoa based API in 
> JDK 9 only after the fix?
>
>   Thanks,
>   Alexandr.
>
>>
>> On 02.08.15 21:58, Sergey Bylokhov wrote:
>>> Hi, Denis.
>>> On 27.05.15 18:08, Denis Fokin wrote:
>>>> Hi, Sergey,
>>>>
>>>> Basically, you should close all apps that can switch the vc including
>>>> the utility for switching video cards. Make sure in About This Mac ->
>>>> Displays that the integrated card is enabled. Start an application
>>>> with the patched version of Java. Check About This Mac -> Displays.
>>>> Integrated video card should be still active.
>>> These steps are not enough. additionally this should be done also
>>> (tested on Idea/JEdit and some other applications):
>>>   - All old jdk should be removed
>>>   - The patched jdk should be re/installed
>>>   - The application should be reinstalled and to Info.plist these lines
>>> should be added:
>>> <key>NSSupportsAutomaticGraphicsSwitching</key>
>>>      <true/>
>>>
>>>   - The fix doesn't work for applets, javapanel, javaws, and also with
>>> applications which are running via command line (./bin/java -jar xxx).
>>> Not sure that it can be fixed.
>>>   - It also does not work for some bundled applications which contain
>>> NSSupportsAutomaticGraphicsSwitching in the Info.plist. Netbeans for
>>> example. This should be investigated. But for now the fix looks fine.
>>>
>>>>
>>>>
>>>>
>>>>> 27 мая 2015 г., в 17:30, Sergey Bylokhov <Sergey.Bylokhov at oracle.com>
>>>>> написал(а):
>>>>>
>>>>> Hi, Denis.
>>>>> Can you describe the steps on how to test it. On my mac it still
>>>>> change the vc.
>>>>>
>>>>>> On 27.05.15 17:16, Denis Fokin wrote:
>>>>>> Please review the fix for jdk9
>>>>>>
>>>>>> The fix allows do not force discrete video card usage on MacBook Pro
>>>>>> models with two video cards. I have tested the fix on several MPBs.
>>>>>>
>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8041900
>>>>>> Webrev: http://cr.openjdk.java.net/~denis/8041900/webrev.00
>>>>>> <http://cr.openjdk.java.net/%7Edenis/8041900/webrev.00>
>>>>>
>>>>> -- 
>>>>> Best regards, Sergey.
>>>>>
>>>
>>>
>>
>>
>




More information about the 2d-dev mailing list