diff options
Diffstat (limited to 'sde-drm/drm_manager.cpp')
-rw-r--r-- | sde-drm/drm_manager.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/sde-drm/drm_manager.cpp b/sde-drm/drm_manager.cpp index 81c1465c..c943d633 100644 --- a/sde-drm/drm_manager.cpp +++ b/sde-drm/drm_manager.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. +* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -132,8 +132,15 @@ int DRMManager::Init(int drm_fd) { dpps_mgr_intf_ = GetDppsManagerIntf(); if (dpps_mgr_intf_) dpps_mgr_intf_->Init(fd_, resource); - drmModeFreeResources(resource); + panel_feature_mgr_intf_ = GetPanelFeatureManagerIntf(); + if (!panel_feature_mgr_intf_) { + DRM_LOGE("Failed to get Panel feature Mgr"); + return DRM_ERR_INVALID; + } + panel_feature_mgr_intf_->Init(fd_, resource); + + drmModeFreeResources(resource); return 0; } @@ -336,6 +343,9 @@ DRMManager::~DRMManager() { delete plane_mgr_; plane_mgr_ = NULL; } + if (panel_feature_mgr_intf_) { + panel_feature_mgr_intf_->DeInit(); + } } int DRMManager::CreateAtomicReq(const DRMDisplayToken &token, DRMAtomicReqInterface **intf) { @@ -375,4 +385,24 @@ void DRMManager::GetDppsFeatureInfo(DRMDppsFeatureInfo *info) { dpps_mgr_intf_->GetDppsFeatureInfo(info); } +DRMPanelFeatureMgrIntf *DRMManager::GetPanelFeatureMgrIntf() { + return panel_feature_mgr_intf_; +} + +void DRMManager::GetPanelFeature(DRMPanelFeatureInfo *info) { + if (panel_feature_mgr_intf_) { + panel_feature_mgr_intf_->GetPanelFeatureInfo(info); + } else { + DRM_LOGE("Failed, panel feature mgr not available"); + } +} + +void DRMManager::SetPanelFeature(const DRMPanelFeatureInfo &info) { + if (panel_feature_mgr_intf_) { + panel_feature_mgr_intf_->CachePanelFeature(info); + } else { + DRM_LOGE("Failed, panel feature mgr not available"); + } +} + } // namespace sde_drm |