2 * Copyright (C) 2015 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef ANDROID_DRM_COMPOSITION_H_
18 #define ANDROID_DRM_COMPOSITION_H_
20 #include "drm_hwcomposer.h"
21 #include "drmdisplaycomposition.h"
29 #include <hardware/hardware.h>
30 #include <hardware/hwcomposer.h>
34 class DrmComposition {
36 DrmComposition(DrmResources *drm, Importer *importer);
41 unsigned GetRemainingLayers(int display, unsigned num_needed) const;
42 int AddLayer(int display, hwc_layer_1_t *layer, hwc_drm_bo_t *bo);
43 int AddDpmsMode(int display, uint32_t dpms_mode);
45 int DisableUnusedPlanes();
47 std::unique_ptr<DrmDisplayComposition> TakeDisplayComposition(int display);
48 DrmDisplayComposition *GetDisplayComposition(int display);
51 DrmComposition(const DrmComposition &) = delete;
56 std::vector<DrmPlane *> primary_planes_;
57 std::vector<DrmPlane *> overlay_planes_;
60 * This _must_ be read-only after it's passed to QueueComposition. Otherwise
61 * locking is required to maintain consistency across the compositor threads.
63 std::map<int, std::unique_ptr<DrmDisplayComposition>> composition_map_;
68 #endif // ANDROID_DRM_COMPOSITION_H_