mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-25 07:29:48 +01:00
some format fixes
This commit is contained in:
parent
9c7c9a47f3
commit
ef65500874
2 changed files with 21 additions and 6 deletions
|
@ -24,13 +24,11 @@ static std::optional<dev_t> devIDFromFD(int fd) {
|
|||
|
||||
CCompiledDMABUFFeedback::CCompiledDMABUFFeedback(dev_t device, std::vector<SDMABufTranche> tranches_) {
|
||||
std::set<std::pair<uint32_t, uint64_t>> formats;
|
||||
for (auto& t : tranches_) {
|
||||
for (auto& fmt : t.formats) {
|
||||
for (auto& fmt : g_pHyprOpenGL->getDRMFormats()) {
|
||||
for (auto& mod : fmt.modifiers) {
|
||||
formats.insert(std::make_pair<>(fmt.drmFormat, mod));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tableLen = formats.size() * sizeof(SDMABUFFeedbackTableEntry);
|
||||
int fds[2] = {0};
|
||||
|
|
|
@ -60,10 +60,27 @@ CMesaDRMResource::CMesaDRMResource(SP<CWlDrm> resource_) : resource(resource_) {
|
|||
return;
|
||||
}
|
||||
|
||||
uint64_t mod = DRM_FORMAT_MOD_INVALID;
|
||||
|
||||
auto fmts = g_pHyprOpenGL->getDRMFormats();
|
||||
for (auto& f : fmts) {
|
||||
if (f.drmFormat != fmt)
|
||||
continue;
|
||||
|
||||
for (auto& m : f.modifiers) {
|
||||
if (m == DRM_FORMAT_MOD_LINEAR)
|
||||
continue;
|
||||
|
||||
mod = m;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Aquamarine::SDMABUFAttrs attrs;
|
||||
attrs.success = true;
|
||||
attrs.size = {w, h};
|
||||
attrs.modifier = DRM_FORMAT_MOD_INVALID;
|
||||
attrs.modifier = mod;
|
||||
attrs.planes = 1;
|
||||
attrs.offsets[0] = off0;
|
||||
attrs.strides[0] = str0;
|
||||
|
|
Loading…
Reference in a new issue