Skip to content

Linux: Add ozone/mus support as an alternative to X11 #2296

Closed

Description

@magreenblatt

Original report by santosh mahto (Bitbucket: Santosh_Collabora).


Currently Ozone builds in chromium doesn’t work as it has dependency on mus framework.
Ozone would work only when mus is enabled inside chromium.

At Collabora, we have already ported CEF[1] to use ozone platform(wayland) through mus and we want to upstream those changes to CEF main repository.
Once mus/ozone is enabled, CEF can be built for different ozone platforms(x11, wayland) by using ozone-wayland-dev branch. Wayland support is being actively developed in
ozone-wayland-dev branch and is going to merge in chromium main tree soon.

[1]
https://git.collabora.com/cgit/cef-wayland/

Activity

  1. magreenblatt commented on Nov 6, 2017

    @magreenblatt
    CollaboratorAuthor

    Original changes by santosh mahto (Bitbucket: Santosh_Collabora).


    • edited description
  2. magreenblatt commented on Nov 6, 2017

    @magreenblatt
    CollaboratorAuthor

    Thanks for sharing this, it sounds very interesting. We'll need to review your changes and the testing/support requirements to determine whether it makes sense to merge your changes into the main CEF repository. Please provide the following information to assist our review:

    1. An overview of the architectural changes that you made to CEF.
    2. A PR against current CEF master containing your changes.
    3. Instructions on how to build and test CEF with your changes.
  3. magreenblatt commented on Nov 8, 2017

    @magreenblatt
    CollaboratorAuthor

    Original comment by santosh mahto (Bitbucket: Santosh_Collabora).


    Thanks for showing interest.

    I prepared the branch for MUS support with latest CEF. It also covers issue #1989
    by putting X11 under compile time flags. There is no architectural changes in CEF,
    Mus is already supported in chromium and we need to implement missing bits in CEF
    (e.g adding service manifest, starting mus client and service registration).
    When CEF is built with use_ozone=true, it automatically uses MUS framework.

    Once Mus support is enabled, it can be built with ozone-wayland-dev branch for ozone/wayland.

    Since mus/ozone/wayland is done externally in ozone-wayland-dev we would have to port CEF a bit for ozone-wayland-dev
    until these work are merged with chromium main tree.

    So I have prepared specific branches where ozone/wayland/MUS can be tested.

    CEF:

    branch:https://bitbucket.org/Santosh_Collabora/cef/branch/Santosh/cef_mus_ozone_wayland
    This branch already have current changes for mus support(latest 3 CLs) with some additional patches
    required for ozone-wayland-dev, also it avoids applying CEF chromium patches instead all those patches
    are already commited on corresponding ozone-wayland-dev branch with fixup's.

    ozone-wayland-dev :

    origin: https://git.collabora.com/git/cef-wayland/chromium.git
    branch: cef-wayland-rebase
    As said,In this branch CEF patches are already applied with ozone-wayland-dev related fixup's
    There are some additonal commits some of they are not required but good to take.

    Build steps:

    Clone both the sources CEF & chromium and move to above mentioned branches.

    #!c++
    
    $mv cef  chromium/  (copy cef inside chromium)  
      $cd cef 
      $./build.sh 
    

    Launch:

    Install weston shell and Launch.

    #!c++
    
     $./out/Release_GN_x64/cefsimple --mus --use-views --ozone-platform=wayland
    

    Notes:
    Once launched with --use-views, CEF uses ozone/wayland.
    To use Cefsimple Without --use-views won't work as of now since it would require
    porting of browser_platform_delegate_native_linux.cc for wayland.

    Let me know if you have any questions.

  4. magreenblatt commented on Nov 8, 2017

    @magreenblatt
    CollaboratorAuthor

    @Santosh_Collabora Thanks for the detailed information. Given the complexity that you describe it sounds like we should wait for the ozone/wayland changes to land in Chromium before attempting to merge your changes to CEF. Is https://crbug.com/578890 the most relevant issue to watch for the ozone/wayland changes in Chromium?

    If you would like an initial review of your code changes you're welcome to submit a PR as described at https://bitbucket.org/chromiumembedded/cef/wiki/ContributingWithGit.md#markdown-header-creating-a-pull-request

    Once launched with --use-views, CEF uses ozone/wayland. To use Cefsimple Without --use-views won't work as of now since it would require porting of browser_platform_delegate_native_linux.cc for wayland.

    Requiring Views in combination with ozone/mus sounds reasonable to me.

  5. magreenblatt commented on Nov 8, 2017

    @magreenblatt
    CollaboratorAuthor

    Issue #1989 was marked as a duplicate of this issue.

  6. magreenblatt commented on Nov 8, 2017

    @magreenblatt
    CollaboratorAuthor
    • changed title from "Add MUS support in CEF" to "Linux: Add ozone/mus support as an alternative to X11"
  7. magreenblatt commented on Nov 8, 2017

    @magreenblatt
    CollaboratorAuthor

    Original comment by santosh mahto (Bitbucket: Santosh_Collabora).


    Apology, if I made it complex in explanation, It looks complex because I explained all the way to enable wayland platform working with CEF(When mus is available) and for that we need to depend on externally ozone-wayland-dev which is hard.

    But my idea here is to get only MUS support in CEF , which means upgrading CEF code for latest chromium architectural changes(MUS related) thus making CEF in sync with chromium. As obvious, I don't expect ozone/wayland to work straightway. Its advantage will be visible once chromium moves to MUS( ozone-wayland-dev branch is merged). As of now I recommend taking this patch as this will mantained over time and CEF will be ready for chromium MUS based architectural changes.

  8. magreenblatt commented on Nov 8, 2017

    @magreenblatt
    CollaboratorAuthor

    Original comment by santosh mahto (Bitbucket: Santosh_Collabora).


    Also MUS/Ozone/wayland can work with chromium without ozone-wayland-dev branch merge, Its broken right now but could be fixed with little effort. It actually works in linux chromium build with GN defines target_os=chromeos ( but building for linux) is used.

  9. magreenblatt commented on Nov 8, 2017

    @magreenblatt
    CollaboratorAuthor

    @Santosh_Collabora We generally only merge changes when they can be tested as part of CEF's normal development flow. Supporting Wayland (and providing automated builds for that platform) seems reasonable once the necessary support has been merged to Chromium. Prior to that point I think it's better for you to maintain the changes in your separate branch.

  10. magreenblatt commented on Nov 9, 2017

    @magreenblatt
    CollaboratorAuthor

    Original comment by santosh mahto (Bitbucket: Santosh_Collabora).


    @magreenblatt : Ok, I keep the branch in my private repo.
    Lets have initial review of PR. Pull request is here
    https://bitbucket.org/chromiumembedded/cef/pull-requests/128/santosh-cef-mus-support/diff

  11. magreenblatt commented on Jan 7, 2019

    @magreenblatt
    CollaboratorAuthor

    Original comment by santoshmahto (Bitbucket: santoshmahto, GitHub: santoshmahto).


    @magreenblatt :

    Since now chromium official repository supports ozone build, all the complicacy has been eliminated and I have pushed the fresh patch to support ozone build with CEF.
    With this now, CEF can be built with different ozone platform like Wayland, X11 etc.
    I would appreciate if you could review this patch.

    I have personally verified that it doesn't regress anything in CEF default build, and works fine with Wayland and X11 platform when --use-views is enabled.
    To test this patch, build CEF with following GN_DEFINES: use_ozone=true use_intel_minigbm = true (varies for gpu type).
    and then run as : $ ./out/Release/cefsimple --use-views --ozone-platform=wayland

  12. magreenblatt commented on Feb 20, 2019

    @magreenblatt
    CollaboratorAuthor

    Original comment by santoshmahto (Bitbucket: santoshmahto, GitHub: santoshmahto).


    @magreenblatt : I have updated the patch, It would be great if you could review patch again, as it would be nice to get it reviewed and land this patch which will enable ozone build of CEF to use wayland.

    https://bitbucket.org/chromiumembedded/cef/pull-requests/128/santosh-cef-mus-support/diff

  13. magreenblatt commented on Mar 5, 2019

    @magreenblatt
    CollaboratorAuthor
  14. magreenblatt commented on Mar 26, 2019

    @magreenblatt
    CollaboratorAuthor

    Original comment by santoshmahto (Bitbucket: santoshmahto, GitHub: santoshmahto).


    Here is screenshot of cefsimple ozone build run on wayland platform (weston shell)
    Screenshot from 2019-03-26 20-58-20.png

    Used build command :
    export GN_DEFINES = "use_ozone=true"

    ninja -C out/Release_GN_x64/ cefsimple

    Run : ../out/Release_GN_x64/cefsimple --use-views --ozone-platform=wayland

  15. magreenblatt commented on Apr 23, 2019

    @magreenblatt
    CollaboratorAuthor

    Linux: Add support for ozone builds (fixes issue #2296).

    Ozone builds can run with different platform backends (Wayland, X11, etc). Usage of the Views framework is required, and the cefclient sample application is not supported.

    Example usage:

    $ export GN_DEFINES="use_ozone=true"
    $ cd /path/to/chromium/src/cef
    $ ./cef_create_projects.sh
    $ cd /path/to/chromium/src
    $ ninja -C out/Release_GN_x64 cefsimple
    $ ./out/Release_GN_x64/cefsimple --use-views --ozone-platform=wayland

    Binary distributions can be created by passing the --ozone flag to make_distrib.py.

    → <<cset 491253fa0371 (bb)>>

  16. magreenblatt commented on Apr 23, 2019

    @magreenblatt
    CollaboratorAuthor
    • changed state from "new" to "resolved"
  17. magreenblatt commented on Oct 6, 2021

    @magreenblatt
    CollaboratorAuthor

    Original comment by Julien Isorce (Bitbucket: Julien Isorce).


    Hi, does it work with --ozone-platform=headless ? Thank you

  18. magreenblatt commented on Sep 26, 2024

    @magreenblatt
    CollaboratorAuthor

    export GN_DEFINES="use_ozone=true"

    This option has changed to ozone_platform_x11=false. All Linux builds currently use Ozone, and the X11 platform is enabled by default. However, Chromium no longer has a link-time dependency on libX11 so the practical results of adding ozone_platform_x11=false are:

    1. Remove --ozone-platform=X11 as a runtime option
    2. Default to Wayland as the Ozone platform
    3. Remove #define CEF_X11 1 from include/cef_config.h
    4. Exclude X11-specific code in CEF and Chromium (via defined(CEF_X11) or BUILDFLAG(IS_OZONE_X11))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Frameworklinuxproposal

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions