Make Backend a member of DrmDisplayPipeline
Make Backend a member of DrmDisplayPipeline and move the creation of the Backend to where the DrmDisplayPipeline is created. Change-Id: Ib7b799df5a2ba16015b7072b0e5ce89a174932c3
This commit is contained in:
parent
b112216f38
commit
786939db2b
5 changed files with 10 additions and 16 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include "DrmDevice.h"
|
||||
#include "DrmEncoder.h"
|
||||
#include "DrmPlane.h"
|
||||
#include "backend/Backend.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/properties.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
namespace android::drm_hwcomposer {
|
||||
|
||||
class Backend;
|
||||
class DrmConnector;
|
||||
class DrmDevice;
|
||||
class DrmPlane;
|
||||
|
|
@ -105,6 +106,7 @@ struct DrmDisplayPipeline {
|
|||
std::shared_ptr<BindingOwner<DrmPlane>> primary_plane;
|
||||
|
||||
std::shared_ptr<DrmAtomicStateManager> atomic_state_manager;
|
||||
std::unique_ptr<Backend> backend;
|
||||
};
|
||||
|
||||
} // namespace android::drm_hwcomposer
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
#include "backend/Backend.h"
|
||||
#include "backend/BackendManager.h"
|
||||
#include "stats/CompositionStats.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/properties.h"
|
||||
|
|
@ -129,6 +129,8 @@ bool DrmHwc::BindDisplay(std::shared_ptr<DrmDisplayPipeline> pipeline) {
|
|||
pipeline->connector->Get()->GetName().c_str(), (int)disp_handle,
|
||||
disp_handle == kPrimaryDisplay ? " (Primary)" : "");
|
||||
|
||||
pipeline->backend = BackendManager::GetInstance().CreateBackendForConnector(
|
||||
pipeline->connector->Get());
|
||||
displays_[disp_handle]->SetPipeline(pipeline);
|
||||
display_handles_[pipeline] = disp_handle;
|
||||
|
||||
|
|
@ -183,6 +185,9 @@ std::optional<DisplayHandle> DrmHwc::CreateVirtualDisplay(uint32_t width,
|
|||
/* is_virtual */ true, this);
|
||||
|
||||
disp->SetVirtualDisplayResolution(width, height);
|
||||
virtual_pipeline->backend = BackendManager::GetInstance()
|
||||
.CreateBackendForConnector(
|
||||
virtual_pipeline->connector->Get());
|
||||
disp->SetPipeline(virtual_pipeline);
|
||||
displays_[new_display_handle] = std::move(disp);
|
||||
return new_display_handle;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
#include <utils/Trace.h>
|
||||
|
||||
#include "backend/Backend.h"
|
||||
#include "backend/BackendManager.h"
|
||||
#include "compositor/DisplayInfo.h"
|
||||
#include "drm/DrmConnector.h"
|
||||
#include "drm/DrmDisplayPipeline.h"
|
||||
|
|
@ -343,7 +342,7 @@ auto HwcDisplay::ValidateStagedComposition() -> std::vector<ChangedLayer> {
|
|||
flatcon_->NewFrame();
|
||||
}
|
||||
|
||||
validated_composition_.emplace(backend_->ValidateDisplay(this));
|
||||
validated_composition_.emplace(pipeline_->backend->ValidateDisplay(this));
|
||||
|
||||
// Iterate through the layers to find which layers actually changed.
|
||||
std::vector<ChangedLayer> changed_layers;
|
||||
|
|
@ -638,7 +637,6 @@ void HwcDisplay::Deinit() {
|
|||
GetPipe().atomic_state_manager->ExecuteAtomicCommit(a_args);
|
||||
|
||||
validated_composition_.reset();
|
||||
backend_.reset();
|
||||
flatcon_.reset();
|
||||
}
|
||||
|
||||
|
|
@ -660,12 +658,6 @@ bool HwcDisplay::Init() {
|
|||
}
|
||||
|
||||
if (!IsInHeadlessMode()) {
|
||||
backend_ = BackendManager::GetInstance().CreateBackendForConnector(
|
||||
pipeline_->connector->Get());
|
||||
if (!backend_) {
|
||||
ALOGE("Failed to set backend for d=%d\n", int(handle_));
|
||||
return false;
|
||||
}
|
||||
auto flatcbk = (struct FlatConCallbacks){
|
||||
.trigger = [this]() { hwc_->SendRefreshEventToClient(handle_); }};
|
||||
flatcon_ = std::make_unique<FlatteningController>(flatcbk,
|
||||
|
|
@ -1306,10 +1298,6 @@ void HwcDisplay::SetHdrOutputMetadata(ui::Hdr type) {
|
|||
m->white_point.y = ToU16ColorValue(whitePoint.y);
|
||||
}
|
||||
|
||||
const Backend *HwcDisplay::backend() const {
|
||||
return backend_.get();
|
||||
}
|
||||
|
||||
bool HwcDisplay::NeedsClientLayerUpdate() const {
|
||||
return std::any_of(layers_.begin(), layers_.end(), [](const auto &pair) {
|
||||
const auto &layer = pair.second;
|
||||
|
|
|
|||
|
|
@ -185,8 +185,6 @@ class HwcDisplay {
|
|||
return &it->second;
|
||||
}
|
||||
|
||||
const Backend *backend() const;
|
||||
|
||||
auto layers() -> std::map<ILayerId, HwcLayer> & {
|
||||
return layers_;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue