1 /* 2 * Copyright (C) 2015 The Android Open Source Project 3 * 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 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 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. 15 */ 16 17 #ifndef ANDROID_DRM_CRTC_H_ 18 #define ANDROID_DRM_CRTC_H_ 19 20 #include "drmmode.h" 21 #include "drmproperty.h" 22 23 #include <stdint.h> 24 #include <xf86drmMode.h> 25 26 namespace android { 27 28 class DrmDevice; 29 30 class DrmCrtc { 31 public: 32 DrmCrtc(DrmDevice *drm, drmModeCrtcPtr c, unsigned pipe); 33 DrmCrtc(const DrmCrtc &) = delete; 34 DrmCrtc &operator=(const DrmCrtc &) = delete; 35 36 int Init(); 37 38 uint32_t id() const; 39 unsigned pipe() const; 40 41 const std::vector<int>& displays() const; 42 bool has_display(const int display) const; 43 void set_display(int display); 44 45 bool can_bind(int display) const; 46 47 const DrmProperty &active_property() const; 48 const DrmProperty &mode_property() const; 49 const DrmProperty &out_fence_ptr_property() const; 50 const DrmProperty &cgc_lut_property() const; 51 const DrmProperty °amma_lut_property() const; 52 const DrmProperty °amma_lut_size_property() const; 53 const DrmProperty &gamma_lut_property() const; 54 const DrmProperty &gamma_lut_size_property() const; 55 const DrmProperty &linear_matrix_property() const; 56 const DrmProperty &gamma_matrix_property() const; 57 const DrmProperty &partial_region_property() const; 58 const DrmProperty &force_bpc_property() const; 59 const DrmProperty &disp_dither_property() const; 60 const DrmProperty &cgc_dither_property() const; 61 DrmProperty &adjusted_vblank_property(); 62 const DrmProperty &ppc_property() const; 63 const DrmProperty &max_disp_freq_property() const; 64 const DrmProperty &dqe_enabled_property() const; 65 const DrmProperty &color_mode_property() const; 66 properties()67 const std::vector<DrmProperty *> &properties() const { 68 return properties_; 69 } 70 71 private: 72 DrmDevice *drm_; 73 74 uint32_t id_; 75 unsigned pipe_; 76 std::vector<int> displays_; 77 78 DrmMode mode_; 79 80 DrmProperty active_property_; 81 DrmProperty mode_property_; 82 DrmProperty out_fence_ptr_property_; 83 DrmProperty cgc_lut_property_; 84 DrmProperty degamma_lut_property_; 85 DrmProperty degamma_lut_size_property_; 86 DrmProperty gamma_lut_property_; 87 DrmProperty gamma_lut_size_property_; 88 DrmProperty linear_matrix_property_; 89 DrmProperty gamma_matrix_property_; 90 DrmProperty partial_region_property_; 91 DrmProperty force_bpc_property_; 92 DrmProperty disp_dither_property_; 93 DrmProperty cgc_dither_property_; 94 DrmProperty adjusted_vblank_property_; 95 DrmProperty ppc_property_; 96 DrmProperty max_disp_freq_property_; 97 DrmProperty dqe_enabled_property_; 98 DrmProperty color_mode_property_; 99 std::vector<DrmProperty *> properties_; 100 }; 101 } // namespace android 102 103 #endif // ANDROID_DRM_CRTC_H_ 104