Bug 188072 - Match GraphicsContext3D with correct virtual screen using registryID
Summary: Match GraphicsContext3D with correct virtual screen using registryID
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Justin Fan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-07-26 12:50 PDT by Justin Fan
Modified: 2018-07-30 12:52 PDT (History)
7 users (show)

See Also:


Attachments
Patch (12.57 KB, patch)
2018-07-26 13:26 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (15.51 KB, patch)
2018-07-26 14:58 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (15.50 KB, patch)
2018-07-26 15:14 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews205 for win-future (12.88 MB, application/zip)
2018-07-26 18:27 PDT, EWS Watchlist
no flags Details
Patch (15.81 KB, patch)
2018-07-27 12:16 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (16.02 KB, patch)
2018-07-27 12:42 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (18.64 KB, patch)
2018-07-27 14:56 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (16.02 KB, patch)
2018-07-27 15:53 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (15.88 KB, patch)
2018-07-27 18:12 PDT, Justin Fan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Fan 2018-07-26 12:50:13 PDT
Match GraphicsContext3D with correct virtual screen using registryID
Comment 1 Radar WebKit Bug Importer 2018-07-26 13:02:15 PDT
<rdar://problem/42634940>
Comment 2 Justin Fan 2018-07-26 13:26:39 PDT
Created attachment 345861 [details]
Patch
Comment 3 Justin Fan 2018-07-26 14:44:40 PDT
Going to add in Per Arne's original displayMask-matching path for versions of macOS older than 10.13 that cannot use kCGLRegistryID.
Comment 4 Justin Fan 2018-07-26 14:58:59 PDT
Created attachment 345874 [details]
Patch
Comment 5 Justin Fan 2018-07-26 15:14:12 PDT
Created attachment 345879 [details]
Patch
Comment 6 EWS Watchlist 2018-07-26 18:27:02 PDT
Comment on attachment 345879 [details]
Patch

Attachment 345879 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/8667685

New failing tests:
http/tests/security/canvas-remote-read-remote-video-blocked-no-crossorigin.html
Comment 7 EWS Watchlist 2018-07-26 18:27:14 PDT
Created attachment 345892 [details]
Archive of layout-test-results from ews205 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews205  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 8 Simon Fraser (smfr) 2018-07-26 18:27:18 PDT
Comment on attachment 345879 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=345879&action=review

> Source/WebCore/platform/PlatformScreen.h:107
> +int64_t primaryRegistryID();
> +int64_t registryIDForDisplay(PlatformDisplayID);
> +int64_t registryIDForDisplayMask(uint32_t);

Can we use a typedef for the registryID? We have way too many bare int64_t things.
Comment 9 Justin Fan 2018-07-27 12:16:47 PDT
Created attachment 345933 [details]
Patch
Comment 10 Dean Jackson 2018-07-27 12:21:53 PDT
Comment on attachment 345933 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=345933&action=review

> Source/WebCore/platform/ScreenProperties.h:49
> +    int64_t registryID { 0 };

Shouldn't this use the PlatformRegistryID typedef?

> Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm:216
> +    // When the WebProcess does not have access to the WindowServer, there is no way for OpenGL to tell which GPU is connected to a display.
> +    // See code example at https://developer.apple.com/library/content/technotes/tn2229/_index.html#//apple_ref/doc/uid/DTS40008924-CH1-SUBSECTION7

Do we have access to the window server on 10.12?
Comment 11 Justin Fan 2018-07-27 12:40:49 PDT
(In reply to Dean Jackson from comment #10)
> Comment on attachment 345933 [details]
> Patch
> 
> Shouldn't this use the PlatformRegistryID typedef?

Updated!

> Do we have access to the window server on 10.12?

Looked into it and we have access to window server before 10.14. I've added a comment for now and will ask Per Arne if he would do anything differently in that case.
Comment 12 Justin Fan 2018-07-27 12:42:23 PDT
Created attachment 345939 [details]
Patch
Comment 13 Simon Fraser (smfr) 2018-07-27 13:17:44 PDT
Comment on attachment 345933 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=345933&action=review

> Source/WebCore/platform/PlatformScreen.h:61
> +using PlatformRegistryID = int64_t;

What is a platform registry? A registry of platforms? I think this needs a comment saying what it represents.
Comment 14 Justin Fan 2018-07-27 14:56:57 PDT
Created attachment 345958 [details]
Patch
Comment 15 Justin Fan 2018-07-27 15:49:24 PDT
Looks like I had a git mix-up. That test wasn't supposed to be in this patch :X
Comment 16 Justin Fan 2018-07-27 15:53:58 PDT
Created attachment 345963 [details]
Patch
Comment 17 Simon Fraser (smfr) 2018-07-27 16:33:48 PDT
Comment on attachment 345963 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=345963&action=review

> Source/WebCore/platform/PlatformScreen.h:61
> +using GPURegistryID = int64_t; // A global identifier for a GPU used by CGL and Metal.

Can we call this a GPUIdentifier? We don't have to follow the bad naming choices for other frameworks.
Comment 18 Justin Fan 2018-07-27 18:12:55 PDT
Created attachment 345982 [details]
Patch
Comment 19 WebKit Commit Bot 2018-07-30 12:52:57 PDT
Comment on attachment 345982 [details]
Patch

Clearing flags on attachment: 345982

Committed r234377: <https://trac.webkit.org/changeset/234377>
Comment 20 WebKit Commit Bot 2018-07-30 12:52:59 PDT
All reviewed patches have been landed.  Closing bug.