Skip to content

Commit d3d79e7

Browse files
committed
Merge branch 'flickerless-no-crtc' into flickerless-boot
2 parents 3203d20 + 6898e53 commit d3d79e7

File tree

12 files changed

+40
-22
lines changed

12 files changed

+40
-22
lines changed

debian/libmiral6.symbols

-5
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,5 @@ libmiral.so.6 libmiral6 #MINVER#
422422
(c++)"vtable for miral::MinimalWindowManager@MIRAL_4.0" 4.0.0
423423
(c++)"vtable for miral::WindowManagementPolicy@MIRAL_4.0" 4.0.0
424424
MIRAL_4.1@MIRAL_4.1 4.1.0
425-
(c++)"miral::SmoothBootSupport::SmoothBootSupport()@MIRAL_4.1" 4.1.0
426-
(c++)"miral::SmoothBootSupport::SmoothBootSupport(miral::SmoothBootSupport const&)@MIRAL_4.1" 4.1.0
427-
(c++)"miral::SmoothBootSupport::operator()(mir::Server&) const@MIRAL_4.1" 4.1.0
428-
(c++)"miral::SmoothBootSupport::operator=(miral::SmoothBootSupport const&)@MIRAL_4.1" 4.1.0
429-
(c++)"miral::SmoothBootSupport::~SmoothBootSupport()@MIRAL_4.1" 4.1.0
430425
(c++)"miral::WaylandExtensions::zwp_input_method_v1@MIRAL_4.1" 4.1.0
431426
(c++)"miral::WaylandExtensions::zwp_input_panel_v1@MIRAL_4.1" 4.1.0

src/miral/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ add_library(miral SHARED
6969
window_specification.cpp ${miral_include}/miral/window_specification.h
7070
internal_client.cpp ${miral_include}/miral/internal_client.h
7171
prepend_event_filter.cpp ${miral_include}/miral/prepend_event_filter.h
72-
smooth_boot_support.cpp ${miral_include}/miral/smooth_boot_support.h
7372
set_command_line_handler.cpp ${miral_include}/miral/set_command_line_handler.h
7473
set_terminator.cpp ${miral_include}/miral/set_terminator.h
7574
set_window_management_policy.cpp ${miral_include}/miral/set_window_management_policy.h

src/miral/symbols.map

-5
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,6 @@ global:
478478
extern "C++" {
479479
miral::WaylandExtensions::zwp_input_method_v1*;
480480
miral::WaylandExtensions::zwp_input_panel_v1*;
481-
miral::SmoothBootSupport::?SmoothBootSupport*;
482-
miral::SmoothBootSupport::SmoothBootSupport*;
483-
miral::SmoothBootSupport::operator*;
484-
typeinfo?for?miral::SmoothBootSupport;
485-
vtable?for?miral::SmoothBootSupport;
486481
};
487482

488483
} MIRAL_4.0;

src/platforms/gbm-kms/server/kms/display_buffer.cpp

+22-1
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,29 @@ mgg::DisplayBuffer::DisplayBuffer(
125125
{
126126
listener->report_successful_setup_of_native_resources();
127127

128-
if (!smooth_transition)
128+
bool needs_crtc_set = false;
129+
for (auto& output : outputs)
130+
{
131+
try
132+
{
133+
geometry::Rectangle rectangle = output->get_rectangle();
134+
if (rectangle != area)
135+
{
136+
needs_crtc_set = true;
137+
break;
138+
}
139+
}
140+
catch (std::invalid_argument&)
141+
{
142+
needs_crtc_set = true;
143+
break;
144+
}
145+
}
146+
147+
if (needs_crtc_set)
129148
{
149+
mir::log_info("Clearing screen due to differing encountered and target modes");
150+
// TODO: Pull a supported format out of KMS rather than assuming XRGB8888
130151
auto initial_fb = std::make_shared<mgg::CPUAddressableFB>(
131152
std::move(drm_fd),
132153
false,

src/platforms/gbm-kms/server/kms/kms_output.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "mir/graphics/dmabuf_buffer.h"
2626
#include "mir/graphics/drm_formats.h"
2727
#include "mir_toolkit/common.h"
28-
2928
#include "kms-utils/drm_mode_resources.h"
3029

3130
#include <gbm.h>
@@ -75,6 +74,7 @@ class KMSOutput
7574
virtual int max_refresh_rate() const = 0;
7675

7776
virtual bool set_crtc(FBHandle const& fb) = 0;
77+
virtual auto get_rectangle() -> mir::geometry::Rectangle = 0;
7878
virtual void clear_crtc() = 0;
7979
virtual bool schedule_page_flip(FBHandle const& fb) = 0;
8080
virtual void wait_for_page_flip() = 0;

src/platforms/gbm-kms/server/kms/platform.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include "mir/options/option.h"
2929
#include "mir/options/configuration.h"
3030
#include "one_shot_device_observer.h"
31-
#include "mir/options/configuration.h"
32-
#include "mir/options/option.h"
3331
#include <gbm.h>
3432

3533
#define MIR_LOG_COMPONENT "platform-graphics-gbm-kms"
@@ -40,6 +38,7 @@
4038

4139
namespace mg = mir::graphics;
4240
namespace mgg = mg::gbm;
41+
namespace mo = mir::options;
4342

4443
namespace
4544
{
@@ -304,7 +303,7 @@ mir::UniqueModulePtr<mg::Display> mgg::Platform::create_display(
304303
std::shared_ptr<mir::options::Option> const& options,
305304
std::shared_ptr<GraphicBufferAllocator> const& allocator)
306305
{
307-
auto smooth_boot = options->is_set(options::smooth_boot_opt);
306+
auto smooth_boot = options->is_set(mo::smooth_boot_opt);
308307
return make_module_ptr<mgg::Display>(
309308
provider,
310309
drm_fd,

src/platforms/gbm-kms/server/kms/real_kms_output.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,19 @@ bool mgg::RealKMSOutput::set_crtc(FBHandle const& fb)
257257
return true;
258258
}
259259

260+
auto mgg::RealKMSOutput::get_rectangle() -> mir::geometry::Rectangle
261+
{
262+
if (!ensure_crtc())
263+
{
264+
mir::log_error("Output %s has no associated CRTC to get ", mgk::connector_name(connector).c_str());
265+
BOOST_THROW_EXCEPTION(std::invalid_argument("get_crtc: Output has no associated CRTC to get"));
266+
}
267+
268+
return mir::geometry::Rectangle(
269+
mir::geometry::Point(current_crtc->x, current_crtc->y),
270+
mir::geometry::Size(current_crtc->width, current_crtc->height));
271+
}
272+
260273
void mgg::RealKMSOutput::clear_crtc()
261274
{
262275
try

src/platforms/gbm-kms/server/kms/real_kms_output.h

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class RealKMSOutput : public KMSOutput
4949
int max_refresh_rate() const override;
5050

5151
bool set_crtc(FBHandle const& fb) override;
52+
auto get_rectangle() -> mir::geometry::Rectangle override;
5253
void clear_crtc() override;
5354
bool schedule_page_flip(FBHandle const& fb) override;
5455
void wait_for_page_flip() override;

tests/mir_test_framework/platform_graphics_throw.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ class ExceptionThrowingPlatform : public mg::DisplayPlatform, public mg::Renderi
9494

9595
return stub_display_platform->create_display(ptr, shared_ptr, options, allocator);
9696
}
97-
98-
private:
99-
enum ExceptionLocation : uint32_t
10097
{
10198
at_constructor,
10299
at_create_buffer_allocator,

tests/platform_test_harness/graphics_platform_test_harness.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "mir/graphics/display.h"
1919
#include "mir/graphics/display_buffer.h"
2020
#include "mir/graphics/graphic_buffer_allocator.h"
21-
#include "mir/options/option.h"
2221
#include "mir/options/program_option.h"
2322
#include "mir/shared_library.h"
2423
#include "mir/renderer/gl/context_source.h"

tests/unit-tests/platforms/gbm-kms/kms/mock_kms_output.h

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct MockKMSOutput : public graphics::gbm::KMSOutput
3939
return set_crtc_thunk(&fb);
4040
}
4141

42+
MOCK_METHOD0(get_rectangle, geometry::Rectangle());
4243
MOCK_METHOD1(set_crtc_thunk, bool(graphics::gbm::FBHandle const*));
4344
MOCK_METHOD0(clear_crtc, void());
4445

tests/unit-tests/platforms/gbm-kms/kms/test_display_generic.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "mir/test/doubles/mock_egl.h"
2222
#include "mir/test/doubles/mock_gl.h"
2323
#include "mir/test/doubles/stub_gl_config.h"
24-
#include "mir/test/doubles/mock_option.h"
2524
#include "mir/test/doubles/null_emergency_cleanup.h"
2625
#include "mir/test/doubles/stub_console_services.h"
2726
#include "mir/test/doubles/stub_buffer_allocator.h"
@@ -37,7 +36,6 @@
3736
#include <gtest/gtest.h>
3837
#include <gmock/gmock.h>
3938
#include <fcntl.h>
40-
#include <memory>
4139

4240
namespace mg = mir::graphics;
4341
namespace mgg = mg::gbm;

0 commit comments

Comments
 (0)