vulkan/wsi: unset GAMMA_LUT, CTM and DEGAMMA_LUT when doing a modeset

Another drm master may have previously set these to non-zero values, which
can change the image in undesired ways.

Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
Backport-to: 24.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32670>
This commit is contained in:
Xaver Hugl 2024-12-17 02:04:25 +01:00 committed by Marge Bot
parent ee5017a0fa
commit 9f0567b2ab

View file

@ -1963,6 +1963,27 @@ _wsi_display_queue_next(struct wsi_swapchain *drv_chain)
wsi_display_debug("failed to hide cursor err %d %s\n", ret, strerror(-ret));
}
/* unset some properties another drm master might've set
* which can mess up the image
*/
drmModeObjectPropertiesPtr properties =
drmModeObjectGetProperties(wsi->fd,
connector->crtc_id,
DRM_MODE_OBJECT_CRTC);
for (uint32_t i = 0; i < properties->count_props; i++) {
drmModePropertyPtr prop =
drmModeGetProperty(wsi->fd, properties->props[i]);
if (strcmp(prop->name, "GAMMA_LUT") == 0 ||
strcmp(prop->name, "CTM") == 0 ||
strcmp(prop->name, "DEGAMMA_LUT") == 0) {
drmModeObjectSetProperty(wsi->fd, connector->crtc_id,
DRM_MODE_OBJECT_CRTC,
properties->props[i], 0);
}
drmModeFreeProperty(prop);
}
drmModeFreeObjectProperties(properties);
/* Assume that the mode set is synchronous and that any
* previous image is now idle.
*/