Bug 255027 - [GTK] AcceleratedBackingStoreDMABuf compile error with GBM OFF
Summary: [GTK] AcceleratedBackingStoreDMABuf compile error with GBM OFF
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-05 04:09 PDT by Jim Mason
Modified: 2023-04-11 07:03 PDT (History)
2 users (show)

See Also:


Attachments
fix to compile with USE_GBM=OFF (641 bytes, patch)
2023-04-10 02:32 PDT, Jim Mason
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Mason 2023-04-05 04:09:33 PDT
-DUSE_GBM=OFF
Building from 262582@main

It appears AcceleratedBackingStoreDMABuf should be conditionally excluded by GBM=OFF.  However, it seems that it may not be guarded everywhere, as I am getting the following compile errors:

/build/rtutils/components/desktop/webkitgtk4-dev/build/amd64/DerivedSources/WebKit/AcceleratedBackingStoreDMABufMessageReceiver.cpp:40:6: error: 'AcceleratedBackingStoreDMABuf' has not been declared
   40 | void AcceleratedBackingStoreDMABuf::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/rtutils/components/desktop/webkitgtk4-dev/build/amd64/DerivedSources/WebKit/AcceleratedBackingStoreDMABufMessageReceiver.cpp: In function 'void WebKit::didReceiveMessage(IPC::Connection&, IPC::Decoder&)':
/build/rtutils/components/desktop/webkitgtk4-dev/build/amd64/DerivedSources/WebKit/AcceleratedBackingStoreDMABufMessageReceiver.cpp:43:108: error: invalid use of 'this' in non-member function
   43 |         return IPC::handleMessage<Messages::AcceleratedBackingStoreDMABuf::Configure>(connection, decoder, this, &AcceleratedBackingStoreDMABuf::configure);
      |                                                                                                            ^~~~
/build/rtutils/components/desktop/webkitgtk4-dev/build/amd64/DerivedSources/WebKit/AcceleratedBackingStoreDMABufMessageReceiver.cpp:43:115: error: 'AcceleratedBackingStoreDMABuf' has not been declared
   43 |         return IPC::handleMessage<Messages::AcceleratedBackingStoreDMABuf::Configure>(connection, decoder, this, &AcceleratedBackingStoreDMABuf::configure);
      |                                                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/rtutils/components/desktop/webkitgtk4-dev/build/amd64/DerivedSources/WebKit/AcceleratedBackingStoreDMABufMessageReceiver.cpp:45:109: error: invalid use of 'this' in non-member function
   45 |         return IPC::handleMessageAsync<Messages::AcceleratedBackingStoreDMABuf::Frame>(connection, decoder, this, &AcceleratedBackingStoreDMABuf::frame);
      |                                                                                                             ^~~~
/build/rtutils/components/desktop/webkitgtk4-dev/build/amd64/DerivedSources/WebKit/AcceleratedBackingStoreDMABufMessageReceiver.cpp:45:116: error: 'AcceleratedBackingStoreDMABuf' has not been declared
   45 |         return IPC::handleMessageAsync<Messages::AcceleratedBackingStoreDMABuf::Frame>(connection, decoder, this, &AcceleratedBackingStoreDMABuf::frame);
      |                                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[4877/5182] Building CXX object Source...es/WebKit/WebPageMessageReceiver.cpp.o
ninja: build stopped: subcommand failed.
gmake: *** [/build/rtutils/make-rules/justmake.mk:65: /build/rtutils/components/desktop/webkitgtk4-dev/build/amd64/.built] Error 1
Comment 1 Jim Mason 2023-04-05 04:53:28 PDT
NB: If I comment out the entire contents of the derived source file DerivedSources/WebKit/AcceleratedBackingStoreDMABufMessageReceiver.cpp, the build completes normally and runs fine.  In fact, I am posting this message from it.

It seems the file AcceleratedBackingStoreDMABufMessageReceiver.cpp should never have been generated nor included in the build when GBM is OFF.
Comment 2 Jim Mason 2023-04-10 02:32:00 PDT
Created attachment 465827 [details]
fix to compile with USE_GBM=OFF

For reference, attached is the patch I apply locally to clear the issue.

The patch conditionally excludes AcceleratedBackingStoreDMABuf when USE_GBM=OFF.

As I have no way to test the GBM case, I will leave landing a fix to the owner.
Comment 3 Adrian Perez 2023-04-10 05:35:25 PDT
(In reply to Jim Mason from comment #2)
> Created attachment 465827 [details]
> fix to compile with USE_GBM=OFF
> 
> For reference, attached is the patch I apply locally to clear the issue.
> 
> The patch conditionally excludes AcceleratedBackingStoreDMABuf when
> USE_GBM=OFF.
> 
> As I have no way to test the GBM case, I will leave landing a fix to the
> owner.

Submit a patch (see https://github.com/WebKit/WebKit/wiki/Contributing for
details) will make the EWS do a build, which will have GBM enabled. Do you
have the bandwidth to send the patch yourself, or shall I submit it giving
you proper credit?
Comment 4 Jim Mason 2023-04-10 07:46:14 PDT
(In reply to Adrian Perez from comment #3)
> Do you
> have the bandwidth to send the patch yourself, or shall I submit it giving
> you proper credit?

If you can do it, it will be most appreciated.  Thank you for all that you do to make the GTK port possible!
Comment 5 Adrian Perez 2023-04-10 13:29:54 PDT
Pull request: https://github.com/WebKit/WebKit/pull/12584
Comment 6 EWS 2023-04-10 15:12:09 PDT
Committed 262787@main (9f37ad0c30a2): <https://commits.webkit.org/262787@main>

Reviewed commits have been landed. Closing PR #12584 and removing active labels.
Comment 7 Jim Mason 2023-04-11 06:48:38 PDT
I can confirm, in the case of -DUSE_GBM=OFF, the build now completes and runs without issue.  Thank you!
Comment 8 Adrian Perez 2023-04-11 07:03:50 PDT
(In reply to Jim Mason from comment #7)
> I can confirm, in the case of -DUSE_GBM=OFF, the build now completes and
> runs without issue.  Thank you!

Excellent, thanks for confirming!