mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
backend/drm: GAMMA_LUT_SIZE isn't atomic
GAMMA_LUT_SIZE isn't an atomic property. It can be used with the legacy interface too. So we can unify both codepaths and remove wlr_drm_interface.crtc_get_gamma_size. It's no guaranteed to exist though, so we still need to keep the fallback.
This commit is contained in:
parent
da63d11d34
commit
06d5aa5780
5 changed files with 17 additions and 31 deletions
|
|
@ -240,23 +240,6 @@ static bool atomic_crtc_commit(struct wlr_drm_backend *drm,
|
|||
return true;
|
||||
}
|
||||
|
||||
static size_t atomic_crtc_get_gamma_size(struct wlr_drm_backend *drm,
|
||||
struct wlr_drm_crtc *crtc) {
|
||||
if (crtc->props.gamma_lut_size == 0) {
|
||||
return legacy_iface.crtc_get_gamma_size(drm, crtc);
|
||||
}
|
||||
|
||||
uint64_t gamma_lut_size;
|
||||
if (!get_drm_prop(drm->fd, crtc->id, crtc->props.gamma_lut_size,
|
||||
&gamma_lut_size)) {
|
||||
wlr_log(WLR_ERROR, "Unable to get gamma lut size");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (size_t)gamma_lut_size;
|
||||
}
|
||||
|
||||
const struct wlr_drm_interface atomic_iface = {
|
||||
.crtc_commit = atomic_crtc_commit,
|
||||
.crtc_get_gamma_size = atomic_crtc_get_gamma_size,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue