Bug 208814 - [GPUP][GTK] compile GPUProcess in GTK port
Summary: [GPUP][GTK] compile GPUProcess in GTK port
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Víctor M. Jáquez L.
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-09 08:44 PDT by Víctor M. Jáquez L.
Modified: 2020-04-30 10:51 PDT (History)
21 users (show)

See Also:


Attachments
WIP Patch (26.89 KB, patch)
2020-03-09 09:23 PDT, Víctor M. Jáquez L.
no flags Details | Formatted Diff | Diff
WIP Patch (39.46 KB, patch)
2020-03-10 11:55 PDT, Víctor M. Jáquez L.
no flags Details | Formatted Diff | Diff
Patch (15.76 KB, patch)
2020-03-25 02:26 PDT, Víctor M. Jáquez L.
no flags Details | Formatted Diff | Diff
Patch (15.93 KB, patch)
2020-03-25 03:11 PDT, Víctor M. Jáquez L.
no flags Details | Formatted Diff | Diff
Patch (17.46 KB, patch)
2020-03-25 05:00 PDT, Víctor M. Jáquez L.
no flags Details | Formatted Diff | Diff
Patch (26.88 KB, patch)
2020-04-07 10:17 PDT, Víctor M. Jáquez L.
no flags Details | Formatted Diff | Diff
Patch (26.28 KB, patch)
2020-04-07 10:40 PDT, Víctor M. Jáquez L.
no flags Details | Formatted Diff | Diff
Patch (23.26 KB, patch)
2020-04-08 02:52 PDT, Víctor M. Jáquez L.
no flags Details | Formatted Diff | Diff
Patch (23.53 KB, patch)
2020-04-08 08:10 PDT, Víctor M. Jáquez L.
no flags Details | Formatted Diff | Diff
Patch (24.04 KB, patch)
2020-04-22 02:12 PDT, Víctor M. Jáquez L.
no flags Details | Formatted Diff | Diff
Patch (24.21 KB, patch)
2020-04-28 09:56 PDT, Víctor M. Jáquez L.
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Víctor M. Jáquez L. 2020-03-09 08:44:12 PDT
Enable the compilation of GPUProcess infrastructure in GTK port
Comment 1 Víctor M. Jáquez L. 2020-03-09 09:23:00 PDT
Created attachment 393044 [details]
WIP Patch
Comment 2 Víctor M. Jáquez L. 2020-03-09 09:24:59 PDT
Right now the patch doesn't compile. But I would like to assure if I'm in the right direction. I'm quite newbie on these matters :)
Comment 3 Carlos Alberto Lopez Perez 2020-03-09 12:34:17 PDT
Comment on attachment 393044 [details]
WIP Patch

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

> Source/cmake/WebKitFeatures.cmake:237
> +    WEBKIT_OPTION_DEFINE(ENABLE_GPU_PROCESS "Whether to enable the GPU process" PRIVATE ON)

Thats would enable it for all ports using CMake by default.
Perhaps you want to set this general default value to OFF, and then change the default to ON only for platform GTK in OptionsGTK.cmake
Comment 4 Víctor M. Jáquez L. 2020-03-10 11:55:44 PDT
Created attachment 393170 [details]
WIP Patch
Comment 5 Carlos Alberto Lopez Perez 2020-03-11 16:25:03 PDT
See https://trac.webkit.org/changeset/258253
Comment 6 Michael Catanzaro 2020-03-11 18:55:37 PDT
Is the eventual goal to block the web process from accessing the GPU using the bubblewrap sandbox? Dropping the call to bindOpenGL in BubblewrapLauncher.cpp? If so, amazing! If not, what is the goal?
Comment 7 Víctor M. Jáquez L. 2020-03-12 10:24:12 PDT
(In reply to Carlos Alberto Lopez Perez from comment #5)
> See https://trac.webkit.org/changeset/258253

I was strip of all glory, but it got easier my work :)
Comment 8 Víctor M. Jáquez L. 2020-03-12 10:26:24 PDT
(In reply to Michael Catanzaro from comment #6)
> Is the eventual goal to block the web process from accessing the GPU using
> the bubblewrap sandbox? Dropping the call to bindOpenGL in
> BubblewrapLauncher.cpp? If so, amazing! If not, what is the goal?

The goal is to isolate multimedia in a process. It is not related with OpenGL or compositing, just multimedia and passing video frames to WebProcess. If I'm not getting it wrong.
Comment 9 Víctor M. Jáquez L. 2020-03-25 02:26:23 PDT
Created attachment 394477 [details]
Patch
Comment 10 Víctor M. Jáquez L. 2020-03-25 03:11:30 PDT
Created attachment 394479 [details]
Patch
Comment 11 Víctor M. Jáquez L. 2020-03-25 05:00:37 PDT
Created attachment 394483 [details]
Patch
Comment 12 Víctor M. Jáquez L. 2020-04-07 10:17:27 PDT
Created attachment 395701 [details]
Patch
Comment 13 Víctor M. Jáquez L. 2020-04-07 10:18:08 PDT
The patch is ready for review :)
Comment 14 Víctor M. Jáquez L. 2020-04-07 10:22:06 PDT
I spoke too fast
Comment 15 Víctor M. Jáquez L. 2020-04-07 10:40:52 PDT
Created attachment 395704 [details]
Patch
Comment 16 Don Olmstead 2020-04-07 10:49:35 PDT
Comment on attachment 395704 [details]
Patch

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

I feel like to start this should just be putting stub files in the directory and touching CMake files.

With regards to the #if PLATFORM(COCOA) stuff it really feels like its too early to guard things with COCOA. Once we have some implementations we should be able to figure out if LayerHostingContext should be shared or not.

> Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp:62
> +#if PLATFORM(COCOA)
> +#include "LayerHostingContext.h"

I added a LayerHostingContext.h to Source/WebKit/Platform/generic you can just include that and get rid of these COCOA changes.

> Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h:284
> +#if PLATFORM(COCOA)
>      std::unique_ptr<LayerHostingContext> m_inlineLayerHostingContext;
>      std::unique_ptr<LayerHostingContext> m_fullscreenLayerHostingContext;
> +#endif

Ditto

> Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in:29
> +#if PLATFORM(COCOA)
>      PrepareForPlayback(bool privateMode, enum:uint8_t WebCore::MediaPlayerEnums::Preload preload, bool preservesPitch, bool prepareForRendering, float videoContentScale) -> (Optional<WebKit::LayerHostingContextID> inlineLayerHostingContextId, Optional<WebKit::LayerHostingContextID> fullscreenLayerHostingContextId) Async
> +#endif

Ditto

> Source/WebKit/SourcesGTK.txt:26
> +GPUProcess/media/gstreamer/RemoteMediaPlayerProxyGStreamer.cpp

You're missing a blank line here.

> Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h:44
> +#if PLATFORM(COCOA)
> +#include "LayerHostingContext.h"
> +#endif

Ditto

> Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h:367
> +#if PLATFORM(COCOA)
>      Optional<LayerHostingContextID> m_fullscreenLayerHostingContextId;
> +#endif

Ditto
Comment 17 Víctor M. Jáquez L. 2020-04-08 02:52:52 PDT
Created attachment 395785 [details]
Patch
Comment 18 Víctor M. Jáquez L. 2020-04-08 02:55:08 PDT
Thanks Dom. I guess I've fixed what you commented.

I'm hesitant of VideoLayerRemoteGStreamer.cpp, since I'm not sure it is a GStreamer specific thing or rather something for the texturemapper or so.
Comment 19 Víctor M. Jáquez L. 2020-04-08 08:10:47 PDT
Created attachment 395809 [details]
Patch
Comment 20 Víctor M. Jáquez L. 2020-04-22 02:12:26 PDT
Created attachment 397179 [details]
Patch
Comment 21 Víctor M. Jáquez L. 2020-04-23 10:52:56 PDT
Ping :)

Any comment on this patch?
Comment 22 Don Olmstead 2020-04-23 11:23:39 PDT
Comment on attachment 397179 [details]
Patch

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

Is there a specific reason you decided to add PLATFORM(COCOA) guards? If all that needs to be done is fill out some stubs for gstreamer then I think you should do that. I'm just being a stickler with it because once there's PLATFORM guards they never really go away.

> Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:76
> +#if PLATFORM(COCOA) && ENABLE(MEDIA_STREAM)

Is there a reason why this should be Cocoa specific?

> Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:367
> +#if PLATFORM(COCOA) && ENABLE(MEDIA_STREAM)

Ditto

> Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:512
> +#if PLATFORM(COCOA)
>      userMediaCaptureManagerProxy().setOrientation(orientation);
> +#endif

Ditto
Comment 23 Víctor M. Jáquez L. 2020-04-27 01:29:47 PDT
Comment on attachment 397179 [details]
Patch

Thanks for the review :) 


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

>> Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:76
>> +#if PLATFORM(COCOA) && ENABLE(MEDIA_STREAM)
> 
> Is there a reason why this should be Cocoa specific?

Because UserMediaCaptureManagerProxy.h is Cocoa specific: https://trac.webkit.org/browser/webkit/trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h

Thus compilation breaks:

../../Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:77:10: fatal error: 'UserMediaCaptureManagerProxy.h' file not found
#include "UserMediaCaptureManagerProxy.h"

>> Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:367
>> +#if PLATFORM(COCOA) && ENABLE(MEDIA_STREAM)
> 
> Ditto

Because it is part of UserMediaCaptureManagerProxy
Comment 24 Don Olmstead 2020-04-27 10:09:14 PDT
(In reply to Víctor M. Jáquez L. from comment #23)
> Comment on attachment 397179 [details]
> Patch
> 
> Thanks for the review :) 
> 
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=397179&action=review
> 
> >> Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:76
> >> +#if PLATFORM(COCOA) && ENABLE(MEDIA_STREAM)
> > 
> > Is there a reason why this should be Cocoa specific?
> 
> Because UserMediaCaptureManagerProxy.h is Cocoa specific:
> https://trac.webkit.org/browser/webkit/trunk/Source/WebKit/UIProcess/Cocoa/
> UserMediaCaptureManagerProxy.h
> 
> Thus compilation breaks:
> 
> ../../Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:77:10: fatal
> error: 'UserMediaCaptureManagerProxy.h' file not found
> #include "UserMediaCaptureManagerProxy.h"
> 
> >> Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:367
> >> +#if PLATFORM(COCOA) && ENABLE(MEDIA_STREAM)
> > 
> > Ditto
> 
> Because it is part of UserMediaCaptureManagerProxy

Sorry my bad the platforms I enabled on don't enable media stream. I talked some with Eric Carlson and I opened https://bugs.webkit.org/show_bug.cgi?id=211085 for this since UserMediaCaptureManagerProxy doesn't seem to be Cocoa specific at all.

If you want to take that bug before landing that's fine if not can you just add FIXMEs referencing that bug around those changes?
Comment 25 Don Olmstead 2020-04-27 10:11:35 PDT
Comment on attachment 397179 [details]
Patch

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

r=me

Your call on how you want to address the UserMediaCaptureManagerProxy.

> Source/WebKit/ChangeLog:38
> +        New function that raise noImplemented()

Typo.

New function that raises notImplemented.
Comment 26 Víctor M. Jáquez L. 2020-04-28 09:56:34 PDT
Created attachment 397849 [details]
Patch
Comment 27 Víctor M. Jáquez L. 2020-04-28 09:57:46 PDT
(In reply to Don Olmstead from comment #25)
> Comment on attachment 397179 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=397179&action=review
> 
> r=me
> 
> Your call on how you want to address the UserMediaCaptureManagerProxy.

I added a FIXME :)

> 
> > Source/WebKit/ChangeLog:38
> > +        New function that raise noImplemented()
> 
> Typo.
> 
> New function that raises notImplemented.

Fixed
Comment 28 Xabier Rodríguez Calvar 2020-04-28 23:26:10 PDT
Comment on attachment 397849 [details]
Patch

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

LGTM but I would wait for the review of something with more knowledge of interprocess comms.

> Source/WebKit/ChangeLog:15
> +        (WebKit::GPUConnectionToWebProcess::dispatchMessage): guard

Sentences begin with a capital. Please check this in the rest of the changelo

> Source/cmake/OptionsGTK.cmake:-191
> -WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_PAINTING_API PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
> -WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_TYPED_OM PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
> -WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_CONIC_GRADIENTS PRIVATE ON)
> -WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOURCE_LOAD_STATISTICS PRIVATE ON)

Nit, I would leave these changes out of this patch, but won't be strongly against it.
Comment 29 Don Olmstead 2020-04-29 09:06:32 PDT
Comment on attachment 397849 [details]
Patch

r=me

In the future if you get a r+ with nits then you can just replace the NOBODY (OOPS!) with the reviewers name and then ask for cq+.
Comment 30 EWS 2020-04-29 09:09:07 PDT
Committed r260899: <https://trac.webkit.org/changeset/260899>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397849 [details].
Comment 31 Víctor M. Jáquez L. 2020-04-30 08:20:36 PDT
(In reply to Don Olmstead from comment #29)
> Comment on attachment 397849 [details]
> Patch
> 
> r=me
> 
> In the future if you get a r+ with nits then you can just replace the NOBODY
> (OOPS!) with the reviewers name and then ask for cq+.

Sorry. I should ask about it before uploading.

Thanks!
Comment 32 Don Olmstead 2020-04-30 10:51:32 PDT
(In reply to Víctor M. Jáquez L. from comment #31)
> (In reply to Don Olmstead from comment #29)
> > Comment on attachment 397849 [details]
> > Patch
> > 
> > r=me
> > 
> > In the future if you get a r+ with nits then you can just replace the NOBODY
> > (OOPS!) with the reviewers name and then ask for cq+.
> 
> Sorry. I should ask about it before uploading.
> 
> Thanks!

No worries I had no idea that you could do that when I started committing so figured I'd mention it to you.