Navigation

    UBports Robot Logo

    UBports Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    2019: Time to make Unity8 great again?

    Lomiri (was Unity8)
    6
    18
    3563
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • alan_g
      alan_g @doniks last edited by

      @doniks said in 2019: Time to make Unity8 great again?:

      Wouldn't it then be more logical to have a greeter that is a wayland client? Or maybe the login managers from some other desktop environment could be used.

      Curious what you think.

      The Canonical design was for unity-system-compositor [USC] to be a system wide Mir server that supported both the greeter and login session based shells. Only USC would interact with the hardware, it would see the greeter and session shells as Mir clients. The session shells would use the mirclient API (a.k.a. "Mir-on-Mir") but that requires "Mir EGL" and is no longer possible.

      This architecture has a number of desirable features: only one system-wide task has to negotiate access to the hardware, and that task also controls transitions between user sessions, login screens and lock screens.

      Once Mir has a Mir-on-Wayland platform it will be possible to retain that architecture and use Wayland instead of the mirclient API.

      F 1 Reply Last reply Reply Quote 1
      • dobey
        dobey last edited by

        @alan_g said in 2019: Time to make Unity8 great again?:

        Once Mir has a Mir-on-Wayland platform it will be possible to retain that architecture and use Wayland instead of the mirclient API.

        Per our discussion on Telegram, I think the best place to start with this is to enumerate the list of Mir protocol features we depend on in Unity 8, so that we can get Wayland protocol extensions or alternate methods of use implemented.

        To start, the two things I am most aware of that we need mirclient API for, are:

        • Greeter
        • "trusted prompt sessions" (app overlays, like content-hub)

        There might be more, but I"m not sure what they are. If we could get solutions for these two implemented first though, I think we'd be a long way back toward getting a decent Unity 8 setup with the new Mir.

        1 Reply Last reply Reply Quote 2
        • F
          fossMan @alan_g last edited by

          @alan_g said in 2019: Time to make Unity8 great again?:

          Once Mir has a Mir-on-Wayland platform it will be possible to retain that architecture and use Wayland instead of the mirclient API.

          Naive question alert, sorry:
          is it possible to estimate/ quantify the amount of work for that task in any way? E.g, how many skilled developers will need to work on this problem fulltime in order to have a solution in one year? 50, 100, 4...?

          alan_g 1 Reply Last reply Reply Quote 0
          • alan_g
            alan_g @fossMan last edited by

            @fossMan said in 2019: Time to make Unity8 great again?:

            @alan_g said in 2019: Time to make Unity8 great again?:

            Once Mir has a Mir-on-Wayland platform it will be possible to retain that architecture and use Wayland instead of the mirclient API.

            Naive question alert, sorry:
            is it possible to estimate/ quantify the amount of work for that task in any way? E.g, how many skilled developers will need to work on this problem fulltime in order to have a solution in one year? 50, 100, 4...?

            Almost all the code concerned is here:

            $ wc -l src/server/graphics/nested/*
               253 src/server/graphics/nested/buffer.cpp
                64 src/server/graphics/nested/buffer.h
                20 src/server/graphics/nested/CMakeLists.txt
                54 src/server/graphics/nested/cursor.cpp
                51 src/server/graphics/nested/cursor.h
               225 src/server/graphics/nested/display_buffer.cpp
               105 src/server/graphics/nested/display_buffer.h
               442 src/server/graphics/nested/display.cpp
               178 src/server/graphics/nested/display.h
               183 src/server/graphics/nested/host_buffer.cpp
                73 src/server/graphics/nested/host_buffer.h
                54 src/server/graphics/nested/host_chain.h
                95 src/server/graphics/nested/host_connection.h
                50 src/server/graphics/nested/host_stream.h
                52 src/server/graphics/nested/host_surface.h
                49 src/server/graphics/nested/host_surface_spec.h
               528 src/server/graphics/nested/input_platform.cpp
                84 src/server/graphics/nested/input_platform.h
                92 src/server/graphics/nested/ipc_operations.cpp
                48 src/server/graphics/nested/ipc_operations.h
               825 src/server/graphics/nested/mir_client_host_connection.cpp
               134 src/server/graphics/nested/mir_client_host_connection.h
                74 src/server/graphics/nested/native_buffer.h
               234 src/server/graphics/nested/nested_display_configuration.cpp
                78 src/server/graphics/nested/nested_display_configuration.h
                35 src/server/graphics/nested/passthrough_option.h
               227 src/server/graphics/nested/platform.cpp
               117 src/server/graphics/nested/platform.h
              4424 total
            

            That needs re-implementing to use Wayland protocol extensions instead of the mirclient API.

            It isn't a lot of code, and not a lot of work. But it does need someone that can read mirclient code and write Wayland code. I've done that a few times (for the "internal" clients in the example shells) and the concepts correspond well.

            There are few other parts of the system that would need touching (e.g. the configuration to set it up) but that is less of a problem.

            I think it would take me a couple of days (but the unexpected could happen). However, that's probably the fastest it could be: there are not many that know the Mir codebase as well as I do.

            tl;dr: Depending on the developer's background, anywhere from a few days to a month.

            1 Reply Last reply Reply Quote 5
            • F
              fossMan last edited by fossMan

              Thanks @alan_g.
              What exactly is the "mirclient API", is that an abstraction or a specific set of files? Could you give a small example e.g a line of code showing dependence on that API, and perhaps how a Wayland extension could replace it?

              alan_g 1 Reply Last reply Reply Quote 0
              • alan_g
                alan_g @fossMan last edited by alan_g

                @fossMan said in 2019: Time to make Unity8 great again?:

                What exactly is the "mirclient API", is that an abstraction or a specific set of files? Could you give a small example e.g a line of code showing dependence on that API, and perhaps how a Wayland extension could replace it?

                The mirclient API is the API provided by libmirclient.so. It is the API through which Mir proposed to support "Convergent" application toolkits. There are various bits of UBports relying on this API that need rework to Wayland (so learning to do that will remain useful after this exercise).

                Here's some mirclient API code:

                            Surface surface{mir_connection_create_render_surface_sync(DecorationProvider::connection, width, height)};
                
                            auto const buffer_stream =
                                mir_render_surface_get_buffer_stream(surface, width, height, mir_pixel_format_xrgb_8888);
                
                            auto window = WindowSpec::for_gloss(DecorationProvider::connection, width, height)
                                .set_fullscreen_on_output(output_id)
                                .set_event_handler(&handle_event_for_background, this)
                                .add_surface(surface, width, height, 0, 0)
                                .set_name(wallpaper_name).create_window();
                

                and some equivalent Wayland code:

                        ctx.surface = wl_compositor_create_surface(globals.compositor);
                ...
                        ctx.shell_surface = wl_shell_get_shell_surface(globals.shell, ctx.surface);
                        wl_shell_surface_set_fullscreen(
                            ctx.shell_surface,
                            WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
                            0,
                            ctx.output.output);
                ...
                        auto const shm_pool = make_scoped(
                            make_shm_pool(globals.shm, stride * height, &ctx.content_area),
                            &wl_shm_pool_destroy);
                
                        ctx.buffer = wl_shm_pool_create_buffer(
                                shm_pool.get(),
                                0,
                                width, height, stride,
                                WL_SHM_FORMAT_ARGB8888);
                

                https://github.com/MirServer/mir/pull/669/files#diff-ea35a63c157fb0d09e5713c6ee0b1dbe

                F 1 Reply Last reply Reply Quote 2
                • F
                  fossMan @alan_g last edited by fossMan

                  @alan_g said in 2019: Time to make Unity8 great again?:

                  The mirclient API is the API provided by libmirclient.so.

                  Thanks for the example. Is there any way to download an example of a libmirclient.so file without installing anything? The closest I got was a mention on this Ubuntu package

                  EDIT: or perhaps there is some documentation of the libmirclient API in order to understand better exactly what parts of the code is addressing the API?

                  alan_g 1 Reply Last reply Reply Quote 0
                  • alan_g
                    alan_g @fossMan last edited by

                    @fossMan https://mir-server.io/doc/group__mir__toolkit.html

                    1 Reply Last reply Reply Quote 1
                    • F
                      fossMan last edited by

                      I would like to look at these issues but can't spare the focus time until start of June.

                      alan_g 1 Reply Last reply Reply Quote 0
                      • alan_g
                        alan_g @fossMan last edited by

                        @fossMan said in 2019: Time to make Unity8 great again?:

                        I would like to look at these issues but can't spare the focus time until start of June.

                        I imagine there will still be issues left for you when you have the time. 😎

                        dobey 1 Reply Last reply Reply Quote 2
                        • dobey
                          dobey @alan_g last edited by

                          @alan_g I see in the Mir 1.4.0 release discourse mention of the layer-shell extension. If I understand correctly how this extension works, we should be able to use it for re-implementing the trusted overlays, no?

                          If we could do that, and get it done soon, that would be a huge step forward in being able to use unity8 on wayland.

                          alan_g 1 Reply Last reply Reply Quote 1
                          • alan_g
                            alan_g @dobey last edited by

                            @dobey said in 2019: Time to make Unity8 great again?:

                            @alan_g I see in the Mir 1.4.0 release discourse mention of the layer-shell extension. If I understand correctly how this extension works, we should be able to use it for re-implementing the trusted overlays, no?

                            I agree we should map out Wayland protocols that can help replace mirclient functionality. But in this specific case, I don't think layer-shell addresses the same concerns as trusted prompts, so I don't immediately see how you imagine using it.

                            I'll have a closer look at this idea after the holiday weekend to see what I've missed.

                            1 Reply Last reply Reply Quote 0
                            • G
                              GizmoChicken @alan_g last edited by

                              @alan_g said in 2019: Time to make Unity8 great again?:

                              2019: Time to make Unity8 great again?

                              Given recent progress, how about 2020Q1: Time to make Unity8 great again?

                              alan_g 1 Reply Last reply Reply Quote 0
                              • alan_g
                                alan_g @GizmoChicken last edited by

                                @GizmoChicken said in 2019: Time to make Unity8 great again?:

                                Given recent progress, how about 2020Q1: Time to make Unity8 great again?

                                I like it! Maybe we can just rename this thread?

                                1 Reply Last reply Reply Quote 2
                                • First post
                                  Last post