Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_object_crtc.cpp
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 63 | for (int j = 0; j < propCount; ++j) { | |||
---|---|---|---|---|---|
64 | initProp(j, properties); | 64 | initProp(j, properties); | ||
65 | } | 65 | } | ||
66 | drmModeFreeObjectProperties(properties); | 66 | drmModeFreeObjectProperties(properties); | ||
67 | return true; | 67 | return true; | ||
68 | } | 68 | } | ||
69 | 69 | | |||
70 | void DrmCrtc::flipBuffer() | 70 | void DrmCrtc::flipBuffer() | ||
71 | { | 71 | { | ||
72 | if (m_currentBuffer && m_currentBuffer->deleteAfterPageFlip() && m_currentBuffer != m_nextBuffer) { | 72 | if (m_currentBuffer && m_output->m_backend->deleteBufferAfterPageFlip() && m_currentBuffer != m_nextBuffer) { | ||
73 | delete m_currentBuffer; | 73 | delete m_currentBuffer; | ||
74 | } | 74 | } | ||
75 | m_currentBuffer = m_nextBuffer; | 75 | m_currentBuffer = m_nextBuffer; | ||
76 | m_nextBuffer = nullptr; | 76 | m_nextBuffer = nullptr; | ||
77 | 77 | | |||
78 | delete m_blackBuffer; | 78 | delete m_blackBuffer; | ||
79 | m_blackBuffer = nullptr; | 79 | m_blackBuffer = nullptr; | ||
80 | } | 80 | } | ||
81 | 81 | | |||
82 | bool DrmCrtc::blank() | 82 | bool DrmCrtc::blank() | ||
83 | { | 83 | { | ||
84 | if (!m_blackBuffer) { | 84 | if (!m_blackBuffer) { | ||
85 | DrmBuffer *blackBuffer = m_output->m_backend->createBuffer(m_output->pixelSize()); | 85 | DrmDumbBuffer *blackBuffer = m_output->m_backend->createBuffer(m_output->pixelSize()); | ||
86 | if (!blackBuffer->map()) { | 86 | if (!blackBuffer->map()) { | ||
87 | delete blackBuffer; | 87 | delete blackBuffer; | ||
88 | return false; | 88 | return false; | ||
89 | } | 89 | } | ||
90 | blackBuffer->image()->fill(Qt::black); | 90 | blackBuffer->image()->fill(Qt::black); | ||
91 | m_blackBuffer = blackBuffer; | 91 | m_blackBuffer = blackBuffer; | ||
92 | } | 92 | } | ||
93 | 93 | | |||
94 | // TODO: Do this atomically | 94 | // TODO: Do this atomically | ||
95 | if (m_output->setModeLegacy(m_blackBuffer)) { | 95 | if (m_output->setModeLegacy(m_blackBuffer)) { | ||
96 | if (m_currentBuffer && m_currentBuffer->deleteAfterPageFlip()) { | 96 | if (m_currentBuffer && m_output->m_backend->deleteBufferAfterPageFlip()) { | ||
97 | delete m_currentBuffer; | 97 | delete m_currentBuffer; | ||
98 | delete m_nextBuffer; | 98 | delete m_nextBuffer; | ||
99 | } | 99 | } | ||
100 | m_currentBuffer = nullptr; | 100 | m_currentBuffer = nullptr; | ||
101 | m_nextBuffer = nullptr; | 101 | m_nextBuffer = nullptr; | ||
102 | return true; | 102 | return true; | ||
103 | } | 103 | } | ||
104 | return false; | 104 | return false; | ||
105 | } | 105 | } | ||
106 | 106 | | |||
107 | } | 107 | } |