Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/remoteaccess_manager.cpp
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | |||||
57 | { | 57 | { | ||
58 | int ret = close(buf->fd()); | 58 | int ret = close(buf->fd()); | ||
59 | if (Q_UNLIKELY(ret)) { | 59 | if (Q_UNLIKELY(ret)) { | ||
60 | qCWarning(KWIN_DRM) << "Couldn't close released GBM fd:" << strerror(errno); | 60 | qCWarning(KWIN_DRM) << "Couldn't close released GBM fd:" << strerror(errno); | ||
61 | } | 61 | } | ||
62 | delete buf; | 62 | delete buf; | ||
63 | } | 63 | } | ||
64 | 64 | | |||
65 | void RemoteAccessManager::passBuffer(DrmOutput *output, DrmBuffer *buffer) | 65 | void RemoteAccessManager::passBuffer(DrmOutput *output, DrmSurfaceBuffer *gbmbuf) | ||
zzag: Coding style: whitespace before `*`. | |||||
66 | { | 66 | { | ||
67 | DrmSurfaceBuffer* gbmbuf = static_cast<DrmSurfaceBuffer *>(buffer); | | |||
68 | | ||||
69 | // no connected RemoteAccess instance | 67 | // no connected RemoteAccess instance | ||
70 | if (!m_interface || !m_interface->isBound()) { | 68 | if (!m_interface || !m_interface->isBound()) { | ||
71 | return; | 69 | return; | ||
72 | } | 70 | } | ||
73 | 71 | | |||
74 | // first buffer may be null | 72 | // first buffer may be null | ||
75 | if (!gbmbuf || !gbmbuf->hasBo()) { | 73 | if (!gbmbuf || !gbmbuf->hasBo()) { | ||
76 | return; | 74 | return; | ||
77 | } | 75 | } | ||
78 | 76 | | |||
79 | auto buf = new BufferHandle; | 77 | auto buf = new BufferHandle; | ||
80 | auto bo = gbmbuf->getBo(); | 78 | auto bo = gbmbuf->getBo(); | ||
81 | buf->setFd(gbm_bo_get_fd(bo)); | 79 | buf->setFd(gbm_bo_get_fd(bo)); | ||
82 | buf->setSize(gbm_bo_get_width(bo), gbm_bo_get_height(bo)); | 80 | buf->setSize(gbm_bo_get_width(bo), gbm_bo_get_height(bo)); | ||
83 | buf->setStride(gbm_bo_get_stride(bo)); | 81 | buf->setStride(gbm_bo_get_stride(bo)); | ||
84 | buf->setFormat(gbm_bo_get_format(bo)); | 82 | buf->setFormat(gbm_bo_get_format(bo)); | ||
85 | 83 | | |||
86 | m_interface->sendBufferReady(output->waylandOutput().data(), buf); | 84 | m_interface->sendBufferReady(output->waylandOutput(), buf); | ||
87 | } | 85 | } | ||
88 | 86 | | |||
89 | } // KWin namespace | 87 | } // KWin namespace |
Coding style: whitespace before *.