Files
BPI-CM9-Linux/aml-comp/vendor/amlogic/meson_videoserver/display/MesonDisplayPipe.h
T
2026-08-24 10:03:24 +08:00

66 lines
1.7 KiB
C++

/*
* Copyright (C) 2024 Amlogic Corporation.
*
* 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.
*/
#ifndef MESON_DISPLAY_PIPE_H
#define MESON_DISPLAY_PIPE_H
#include <cstdint>
#include <memory>
#include <unordered_map>
#include "DrmCrtc.h"
#include "DrmConnector.h"
#include "DrmEncoder.h"
#include "DrmVideoPlane.h"
class MesonDisplayPipe {
public:
MesonDisplayPipe(int dispId);
~MesonDisplayPipe();
public:
int32_t getCrtc(std::shared_ptr<DrmCrtc> & crtc);
int32_t getPlanes(std::vector<std::shared_ptr<DrmVideoPlane>> & planes);
int32_t getConnector(std::shared_ptr<DrmConnector> & connector);
void getSize(int32_t &width, int32_t &height);
void enablePrimaryPlane();
protected:
int32_t init();
int32_t openDrmDevice();
int32_t loadDrmResources();
protected:
int mPipeId;
int mDrmFd;
bool mEnablePrimaryPlane;
std::shared_ptr<DrmCrtc> mCrtc;
std::shared_ptr<DrmConnector> mConnector;
std::unordered_multimap<uint32_t, std::shared_ptr<DrmVideoPlane>> mPlanesForPipe;
std::map<uint32_t, std::shared_ptr<DrmCrtc>> mCrtcs;
std::map<uint32_t, std::shared_ptr<DrmEncoder>> mEncoders;
std::map<uint32_t, std::shared_ptr<DrmConnector>> mConnectors;
};
#endif