1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_OZONE_PLATFORM_DRI_CRTC_STATE_H_
6 #define UI_OZONE_PLATFORM_DRI_CRTC_STATE_H_
10 #include "ui/ozone/platform/dri/scoped_drm_types.h"
16 // Represents the state of a CRTC.
18 // One CRTC can be paired up with one or more connectors. The simplest
19 // configuration represents one CRTC driving one monitor, while pairing up a
20 // CRTC with multiple connectors results in hardware mirroring.
23 CrtcState(DriWrapper* drm, uint32_t crtc, uint32_t connector);
26 uint32_t crtc() const { return crtc_; }
27 uint32_t connector() const { return connector_; }
28 bool is_disabled() const { return is_disabled_; }
30 void set_is_disabled(bool state) { is_disabled_ = state; }
33 DriWrapper* drm_; // Not owned.
37 // TODO(dnicoara) Add support for hardware mirroring (multiple connectors).
40 // Store the state of the CRTC before we took over. Used to restore the CRTC
41 // once we no longer need it.
42 ScopedDrmCrtcPtr saved_crtc_;
44 // Keeps track of the CRTC state. If a surface has been bound, then the value
45 // is set to false. Otherwise it is true.
48 DISALLOW_COPY_AND_ASSIGN(CrtcState);
53 #endif // UI_OZONE_PLATFORM_DRI_CRTC_STATE_H_