1 #pragma once 2 3 #include <cstdint> 4 #include <string> 5 #include <map> 6 7 struct _drmModeAtomicReq; 8 9 #include "decls.h" 10 11 namespace kms 12 { 13 class AtomicReq 14 { 15 public: 16 AtomicReq(Card& card); 17 ~AtomicReq(); 18 19 AtomicReq(const AtomicReq& other) = delete; 20 AtomicReq& operator=(const AtomicReq& other) = delete; 21 22 void add(uint32_t ob_id, uint32_t prop_id, uint64_t value); 23 void add(DrmPropObject* ob, Property* prop, uint64_t value); 24 void add(DrmPropObject* ob, const std::string& prop, uint64_t value); 25 void add(DrmPropObject* ob, const std::map<std::string, uint64_t>& values); 26 27 void add_display(Connector* conn, Crtc* crtc, Blob* videomode, 28 Plane* primary, Framebuffer* fb); 29 30 int test(bool allow_modeset = false); 31 int commit(void* data, bool allow_modeset = false); 32 int commit_sync(bool allow_modeset = false); 33 34 private: 35 Card& m_card; 36 _drmModeAtomicReq* m_req; 37 }; 38 39 } // namespace kms 40