1 /* 2 * Copyright (C) 2021–2022 Beijing OSWare Technology Co., Ltd 3 * This file contains confidential and proprietary information of 4 * OSWare Technology Co., Ltd 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 #ifndef DRM_ENCODER_H 20 #define DRM_ENCODER_H 21 #include <string> 22 #include <memory> 23 #include <xf86drm.h> 24 #include <xf86drmMode.h> 25 #include <display_type.h> 26 #include <drm_crtc.h> 27 28 namespace OHOS { 29 namespace HDI { 30 namespace DISPLAY { 31 class DrmEncoder { 32 public: 33 explicit DrmEncoder(drmModeEncoder e); ~DrmEncoder()34 virtual ~DrmEncoder() {} GetCrtcId()35 uint32_t GetCrtcId() const 36 { 37 return mCrtcId; 38 } SetCrtcId(uint32_t id)39 void SetCrtcId(uint32_t id) 40 { 41 mCrtcId = id; 42 } GetPossibleCrtcs()43 uint32_t GetPossibleCrtcs() const 44 { 45 return mPossibleCrtcs; 46 } 47 int32_t PickIdleCrtcId(IdMapPtr<DrmCrtc> &crtcs, uint32_t &crtcId); GetId()48 uint32_t GetId() const 49 { 50 return mEncoderId; 51 } 52 53 private: 54 uint32_t mEncoderId; 55 uint32_t mCrtcId; 56 uint32_t mPossibleCrtcs; 57 }; 58 } // namespace OHOS 59 } // namespace HDI 60 } // namespace DISPLAY 61 62 #endif // DRM_ENCODER_H