backends/drm: zero metadata for unused planes
The kernel may fail requests if data for unused planes is non-zero.
This commit is contained in:
parent
14cf7524b6
commit
788ae5891a
1 changed files with 15 additions and 3 deletions
|
@ -32,27 +32,39 @@ namespace KWin
|
|||
static std::array<uint32_t, 4> getHandles(gbm_bo *bo)
|
||||
{
|
||||
std::array<uint32_t, 4> ret;
|
||||
for (int i = 0; i < gbm_bo_get_plane_count(bo); i++) {
|
||||
int i = 0;
|
||||
for (; i < gbm_bo_get_plane_count(bo); i++) {
|
||||
ret[i] = gbm_bo_get_handle(bo).u32;
|
||||
}
|
||||
for (; i < 4; i++) {
|
||||
ret[i] = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static std::array<uint32_t, 4> getStrides(gbm_bo *bo)
|
||||
{
|
||||
std::array<uint32_t, 4> ret;
|
||||
for (int i = 0; i < gbm_bo_get_plane_count(bo); i++) {
|
||||
int i = 0;
|
||||
for (; i < gbm_bo_get_plane_count(bo); i++) {
|
||||
ret[i] = gbm_bo_get_stride_for_plane(bo, i);
|
||||
}
|
||||
for (; i < 4; i++) {
|
||||
ret[i] = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static std::array<uint32_t, 4> getOffsets(gbm_bo *bo)
|
||||
{
|
||||
std::array<uint32_t, 4> ret;
|
||||
for (int i = 0; i < gbm_bo_get_plane_count(bo); i++) {
|
||||
int i = 0;
|
||||
for (; i < gbm_bo_get_plane_count(bo); i++) {
|
||||
ret[i] = gbm_bo_get_offset(bo, i);
|
||||
}
|
||||
for (; i < 4; i++) {
|
||||
ret[i] = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue