Loading services/surfaceflinger/Scheduler/MessageQueue.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -17,12 +17,12 @@ #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include <binder/IPCThreadState.h> #include <gui/DisplayEventReceiver.h> #include <utils/Log.h> #include <utils/Timers.h> #include <utils/threads.h> #include <gui/DisplayEventReceiver.h> #include <scheduler/interface/ICompositor.h> #include "EventThread.h" #include "FrameTimeline.h" Loading services/surfaceflinger/Scheduler/MessageQueue.h +1 −9 Original line number Diff line number Diff line Loading @@ -37,15 +37,7 @@ namespace android { struct ICompositor { virtual void configure() = 0; virtual bool commit(TimePoint frameTime, VsyncId, TimePoint expectedVsyncTime) = 0; virtual void composite(TimePoint frameTime, VsyncId) = 0; virtual void sample() = 0; protected: ~ICompositor() = default; }; struct ICompositor; template <typename F> class Task : public MessageHandler { Loading services/surfaceflinger/Scheduler/Scheduler.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ #include <utils/Trace.h> #include <FrameTimeline/FrameTimeline.h> #include <scheduler/interface/ICompositor.h> #include <algorithm> #include <cinttypes> #include <cstdint> Loading services/surfaceflinger/Scheduler/include/scheduler/interface/CompositionCoverage.h 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <cstdint> #include <ftl/flags.h> namespace android { // Whether composition was covered by HWC and/or GPU. enum class CompositionCoverage : std::uint8_t { Hwc = 1 << 0, // Mutually exclusive: The composition either used the GPU, or reused a buffer that had been // composited on the GPU. Gpu = 1 << 1, GpuReuse = 1 << 2, }; using CompositionCoverageFlags = ftl::Flags<CompositionCoverage>; } // namespace android services/surfaceflinger/Scheduler/include/scheduler/interface/ICompositor.h 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <scheduler/Time.h> #include <scheduler/VsyncId.h> namespace android { struct ICompositor { // Configures physical displays, processing hotplug and/or mode setting via the Composer HAL. virtual void configure() = 0; // Commits transactions for layers and displays. Returns whether any state has been invalidated, // i.e. whether a frame should be composited for each display. virtual bool commit(TimePoint frameTime, VsyncId, TimePoint expectedVsyncTime) = 0; // Composites a frame for each display. CompositionEngine performs GPU and/or HAL composition // via RenderEngine and the Composer HAL, respectively. virtual void composite(TimePoint frameTime, VsyncId) = 0; // Samples the composited frame via RegionSamplingThread. virtual void sample() = 0; protected: ~ICompositor() = default; }; } // namespace android Loading
services/surfaceflinger/Scheduler/MessageQueue.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -17,12 +17,12 @@ #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include <binder/IPCThreadState.h> #include <gui/DisplayEventReceiver.h> #include <utils/Log.h> #include <utils/Timers.h> #include <utils/threads.h> #include <gui/DisplayEventReceiver.h> #include <scheduler/interface/ICompositor.h> #include "EventThread.h" #include "FrameTimeline.h" Loading
services/surfaceflinger/Scheduler/MessageQueue.h +1 −9 Original line number Diff line number Diff line Loading @@ -37,15 +37,7 @@ namespace android { struct ICompositor { virtual void configure() = 0; virtual bool commit(TimePoint frameTime, VsyncId, TimePoint expectedVsyncTime) = 0; virtual void composite(TimePoint frameTime, VsyncId) = 0; virtual void sample() = 0; protected: ~ICompositor() = default; }; struct ICompositor; template <typename F> class Task : public MessageHandler { Loading
services/surfaceflinger/Scheduler/Scheduler.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ #include <utils/Trace.h> #include <FrameTimeline/FrameTimeline.h> #include <scheduler/interface/ICompositor.h> #include <algorithm> #include <cinttypes> #include <cstdint> Loading
services/surfaceflinger/Scheduler/include/scheduler/interface/CompositionCoverage.h 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <cstdint> #include <ftl/flags.h> namespace android { // Whether composition was covered by HWC and/or GPU. enum class CompositionCoverage : std::uint8_t { Hwc = 1 << 0, // Mutually exclusive: The composition either used the GPU, or reused a buffer that had been // composited on the GPU. Gpu = 1 << 1, GpuReuse = 1 << 2, }; using CompositionCoverageFlags = ftl::Flags<CompositionCoverage>; } // namespace android
services/surfaceflinger/Scheduler/include/scheduler/interface/ICompositor.h 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <scheduler/Time.h> #include <scheduler/VsyncId.h> namespace android { struct ICompositor { // Configures physical displays, processing hotplug and/or mode setting via the Composer HAL. virtual void configure() = 0; // Commits transactions for layers and displays. Returns whether any state has been invalidated, // i.e. whether a frame should be composited for each display. virtual bool commit(TimePoint frameTime, VsyncId, TimePoint expectedVsyncTime) = 0; // Composites a frame for each display. CompositionEngine performs GPU and/or HAL composition // via RenderEngine and the Composer HAL, respectively. virtual void composite(TimePoint frameTime, VsyncId) = 0; // Samples the composited frame via RegionSamplingThread. virtual void sample() = 0; protected: ~ICompositor() = default; }; } // namespace android