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.
18 #include "drmresources.h"
21 #include <xf86drmMode.h>
25 DrmCrtc::DrmCrtc(drmModeCrtcPtr c, unsigned pipe)
29 requires_modeset_(true),
35 mode_valid_(c->mode_valid) {
41 uint32_t DrmCrtc::id() const {
45 unsigned DrmCrtc::pipe() const {
49 bool DrmCrtc::requires_modeset() const {
50 return requires_modeset_;
53 void DrmCrtc::set_requires_modeset(bool requires_modeset) {
54 requires_modeset_ = requires_modeset;
57 int DrmCrtc::display() const {
61 void DrmCrtc::set_display(int display) {
63 requires_modeset_ = true;
66 bool DrmCrtc::can_bind(int display) const {
67 return display_ == -1 || display_ == display;