Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platform/DisplaySink: Remove pixel_size() accessor #3134

Merged
merged 5 commits into from
Nov 23, 2023

Conversation

RAOF
Copy link
Contributor

@RAOF RAOF commented Nov 17, 2023

Because each DisplaySink knows how big the buffers it needs, and each DisplayAllocator is easily associated with a single DisplaySink, we can let the DisplayAllocator allocate buffers of the correct size.

RAOF added 2 commits November 16, 2023 17:56
…its own size

Since each `DisplayAllocator` is now associated with a specific `DisplaySink`,
and the `DisplaySink` knows the size of the buffers it can accept, make allocating
the right sized buffer a responsibility of the `DisplayAllocator`.
@Saviq
Copy link
Collaborator

Saviq commented Nov 17, 2023

@RAOF this looks like what Alan was thinking?

ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DEGL_NO_X11 -DLTTNG_UST_HAVE_SDT_INTEGRATION -DMIR_LOG_COMPONENT_FALLBACK=\"mirserver\" -DMIR_SERVER_GRAPHICS_PLATFORM_VERSION=\"MIR_GRAPHICS_PLATFORM_2.8\" -DMIR_SERVER_INPUT_PLATFORM_VERSION=\"MIR_INPUT_PLATFORM_0.27\" -DMIR_SERVER_PLATFORM_PATH=\"/usr/local/lib/mir/server-platform\" -DMIR_VERSION=\"2.15.0\" -DMIR_VERSION_MAJOR=2 -DMIR_VERSION_MICRO=0 -DMIR_VERSION_MINOR=15 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/home/runner/work/mir/mir/src/include/common -I/home/runner/work/mir/mir/include/server -I/home/runner/work/mir/mir/include/renderer -I/home/runner/work/mir/mir/include/renderers/gl -I/home/runner/work/mir/mir/include/renderers/sw -I/home/runner/work/mir/mir/src/include/platform -I/home/runner/work/mir/mir/src/include/client -I/home/runner/work/mir/mir/src/include/server -I/home/runner/work/mir/mir/src/include/cookie -I/home/runner/work/mir/mir/src/include/wayland -I/home/runner/work/mir/mir/src/renderers -I/home/runner/work/mir/mir/build/src/platform/graphics -I/home/runner/work/mir/mir/include/platform -I/home/runner/work/mir/mir/include/wayland -I/home/runner/work/mir/mir/build/src/wayland -I/home/runner/work/mir/mir/include/core -I/home/runner/work/mir/mir/include/common -I/home/runner/work/mir/mir/include/cookie -isystem /usr/include/libdrm -pthread -g -Wall -fno-strict-aliasing -pedantic -Wnon-virtual-dtor -Wextra -fPIC -Werror -Wno-mismatched-tags -Wno-psabi -ftest-coverage -fprofile-arcs -std=c++23 -MD -MT src/server/compositor/CMakeFiles/mircompositor.dir/basic_screen_shooter.cpp.o -MF src/server/compositor/CMakeFiles/mircompositor.dir/basic_screen_shooter.cpp.o.d -o src/server/compositor/CMakeFiles/mircompositor.dir/basic_screen_shooter.cpp.o -c /home/runner/work/mir/mir/src/server/compositor/basic_screen_shooter.cpp
/home/runner/work/mir/mir/src/server/compositor/basic_screen_shooter.cpp:125:10: error: ‘mir::geometry::Size OffscreenDisplaySink::pixel_size() const’ marked ‘override’, but does not override
  125 |     auto pixel_size() const -> mir::geometry::Size override
      |          ^~~~~~~~~~
/home/runner/work/mir/mir/src/server/compositor/basic_screen_shooter.cpp: In member function ‘mir::renderer::Renderer& mir::compositor::BasicScreenShooter::Self::renderer_for_buffer(std::shared_ptr<mir::renderer::software::WriteMappableBuffer>)’:
/home/runner/work/mir/mir/src/server/compositor/basic_screen_shooter.cpp:210:60: error: ‘class mir::graphics::DisplaySink’ has no member named ‘pixel_size’
  210 |     if (!offscreen_sink || (buffer_size != offscreen_sink->pixel_size()))
      |                                                            ^~~~~~~~~~

@RAOF
Copy link
Contributor Author

RAOF commented Nov 23, 2023

Well, I don't know what happened there. I could have sworn I was testing this code locally!

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Attention: 35 lines in your changes are missing coverage. Please review.

Comparison is base (248f5b2) 77.82% compared to head (fbc62f3) 77.80%.
Report is 36 commits behind head on main.

Files Patch % Lines
src/platforms/gbm-kms/server/buffer_allocator.cpp 0.00% 10 Missing ⚠️
...latforms/common/server/cpu_copy_output_surface.cpp 0.00% 7 Missing ⚠️
...platforms/gbm-kms/server/gbm_display_allocator.cpp 0.00% 5 Missing ⚠️
src/server/compositor/basic_screen_shooter.cpp 55.55% 4 Missing ⚠️
...on/server/kms_cpu_addressable_display_provider.cpp 75.00% 2 Missing ⚠️
...latforms/eglstream-kms/server/buffer_allocator.cpp 0.00% 2 Missing ⚠️
src/platforms/eglstream-kms/server/display.cpp 0.00% 2 Missing ⚠️
...rc/platforms/gbm-kms/server/kms/display_buffer.cpp 50.00% 1 Missing ⚠️
...latforms/renderer-generic-egl/buffer_allocator.cpp 0.00% 1 Missing ⚠️
src/platforms/wayland/displayclient.cpp 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3134      +/-   ##
==========================================
- Coverage   77.82%   77.80%   -0.02%     
==========================================
  Files        1064     1064              
  Lines       74416    74445      +29     
==========================================
+ Hits        57914    57925      +11     
- Misses      16502    16520      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@AlanGriffiths AlanGriffiths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, builds and works

@AlanGriffiths AlanGriffiths added this pull request to the merge queue Nov 23, 2023
Merged via the queue into main with commit 7426ea9 Nov 23, 2023
35 checks passed
@AlanGriffiths AlanGriffiths deleted the remove-pixel-size branch November 23, 2023 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants