1
0
Fork 0

Extract GenericPipelineCreator to its own files

Separate GenericPipelineCreator from the GenericCompositionPlanner
class.

Change-Id: I20db30d9473c808e0f2e2516fb2a1f03ebf93e01
This commit is contained in:
Drew Davenport 2025-10-30 11:47:38 -06:00
parent 47fab44195
commit d04968bf87
5 changed files with 74 additions and 18 deletions

View file

@ -95,6 +95,7 @@ filegroup {
"backend/GenericCompositionPlanner.cpp",
"backend/ClientCompositionPlanner.cpp",
"backend/BackendManager.cpp",
"backend/GenericPipelineCreator.cpp",
"hwc/HwcDisplay.cpp",
"hwc/HwcDisplayConfigs.cpp",

View file

@ -266,22 +266,4 @@ std::tuple<size_t, size_t> GenericCompositionPlanner::GetExtraClientRange(
return std::make_tuple(client_start, client_size);
}
class GenericBackendPipelineCreator : public BackendManager::PipelineCreator {
public:
GenericBackendPipelineCreator() : BackendManager::PipelineCreator("generic") {
}
std::unique_ptr<DrmDisplayPipeline> CreatePipeline(
DrmConnector& connector) override {
auto pipeline = DrmDisplayPipeline::CreatePipeline(connector);
if (pipeline) {
pipeline->backend = std::make_unique<GenericCompositionPlanner>();
}
return pipeline;
}
};
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables,
// cert-err58-cpp)
static GenericBackendPipelineCreator generic_backend;
} // namespace android::drm_hwcomposer

View file

@ -0,0 +1,40 @@
/*
* Copyright (C) 2025 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.
*/
#include "backend/GenericPipelineCreator.h"
#include "backend/GenericCompositionPlanner.h"
#include "drm/DrmDisplayPipeline.h"
namespace android::drm_hwcomposer {
GenericPipelineCreator::GenericPipelineCreator()
: BackendManager::PipelineCreator("generic") {
}
std::unique_ptr<DrmDisplayPipeline> GenericPipelineCreator::CreatePipeline(
DrmConnector& connector) {
auto pipeline = DrmDisplayPipeline::CreatePipeline(connector);
if (pipeline) {
pipeline->backend = std::make_unique<GenericCompositionPlanner>();
}
return pipeline;
}
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static GenericPipelineCreator generic_pipeline_creator;
} // namespace android::drm_hwcomposer

View file

@ -0,0 +1,32 @@
/*
* Copyright (C) 2025 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 "backend/BackendManager.h"
namespace android::drm_hwcomposer {
// Implement the PipelineCreator interface by creating a DrmDisplayPipeline
// using generic heuristics on top of upstream drm uAPI.
class GenericPipelineCreator : public BackendManager::PipelineCreator {
public:
GenericPipelineCreator();
std::unique_ptr<DrmDisplayPipeline> CreatePipeline(
DrmConnector& connector) override;
};
} // namespace android::drm_hwcomposer

View file

@ -15,6 +15,7 @@ src_common = files(
'backend/BackendManager.cpp',
'backend/GenericCompositionPlanner.cpp',
'backend/ClientCompositionPlanner.cpp',
'backend/GenericPipelineCreator.cpp',
'hwc/HwcDisplayConfigs.cpp',
'hwc/HwcDisplay.cpp',
'hwc/HwcLayer.cpp',