mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-04 20:55:58 +01:00
backend/drm: fail instead of stripping a modifier
We shouldn't strip a modifiers from buffers, because the will make the kernel re-interpret the data as LINEAR on most drivers, resulting in an incorrect output on screen.
This commit is contained in:
parent
1a5530d14d
commit
f9f90b4173
1 changed files with 8 additions and 0 deletions
|
@ -228,6 +228,14 @@ uint32_t get_fb_for_bo(struct gbm_bo *bo, bool with_modifiers) {
|
|||
wlr_log_errno(WLR_ERROR, "Unable to add DRM framebuffer");
|
||||
}
|
||||
} else {
|
||||
if (gbm_bo_get_modifier(bo) != DRM_FORMAT_MOD_INVALID &&
|
||||
gbm_bo_get_modifier(bo) != DRM_FORMAT_MOD_LINEAR) {
|
||||
wlr_log(WLR_ERROR, "Failed to add DRM frame-buffer: "
|
||||
"BO has modifier 0x%"PRIX64" but KMS doesn't support modifiers",
|
||||
gbm_bo_get_modifier(bo));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (drmModeAddFB2(fd, width, height, format, handles, strides,
|
||||
offsets, &id, 0)) {
|
||||
wlr_log_errno(WLR_DEBUG,
|
||||
|
|
Loading…
Reference in a new issue