Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / ozone / platform / drm / gpu / hardware_display_plane_atomic.h
blobda958abfc3f9fca953922e66c99afa3db9ff0319
1 // Copyright 2015 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_DRM_GPU_HARDWARE_DISPLAY_PLANE_ATOMIC_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_ATOMIC_H_
8 #include "ui/ozone/platform/drm/gpu/hardware_display_plane.h"
10 #include <xf86drmMode.h>
12 namespace ui {
14 class CrtcController;
15 class DrmDevice;
17 class HardwareDisplayPlaneAtomic : public HardwareDisplayPlane {
18 public:
19 HardwareDisplayPlaneAtomic(uint32_t plane_id, uint32_t possible_crtcs);
20 ~HardwareDisplayPlaneAtomic() override;
22 bool SetPlaneData(drmModeAtomicReq* property_set,
23 uint32_t crtc_id,
24 uint32_t framebuffer,
25 const gfx::Rect& crtc_rect,
26 const gfx::Rect& src_rect);
28 void set_crtc(CrtcController* crtc) { crtc_ = crtc; }
29 CrtcController* crtc() const { return crtc_; }
31 private:
32 bool InitializeProperties(
33 DrmDevice* drm,
34 const ScopedDrmObjectPropertyPtr& plane_props) override;
36 struct Property {
37 Property();
38 bool Initialize(DrmDevice* drm,
39 const char* name,
40 const ScopedDrmObjectPropertyPtr& plane_properties);
41 uint32_t id = 0;
44 Property crtc_prop_;
45 Property fb_prop_;
46 Property crtc_x_prop_;
47 Property crtc_y_prop_;
48 Property crtc_w_prop_;
49 Property crtc_h_prop_;
50 Property src_x_prop_;
51 Property src_y_prop_;
52 Property src_w_prop_;
53 Property src_h_prop_;
54 CrtcController* crtc_ = nullptr;
57 } // namespace ui
59 #endif // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_ATOMIC_H_