mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
Add atomic gamma lut size fetching
Legacy gamma lut size now uses the new legacy_crtc member of wlr_drm_crtc. This was Previously doen using old_crtc in wlr_drm_connector, but since this refers to the crtc that was connected to the ouput, this could give the wrong result.
This commit is contained in:
parent
cc1229e75e
commit
ab011406ad
7 changed files with 37 additions and 8 deletions
|
|
@ -226,10 +226,24 @@ static bool atomic_crtc_set_gamma(struct wlr_drm_backend *drm,
|
|||
return atomic_end(drm->fd, &atom);
|
||||
}
|
||||
|
||||
static uint32_t atomic_crtc_get_gamma_size(struct wlr_drm_backend *drm,
|
||||
struct wlr_drm_crtc *crtc) {
|
||||
uint64_t gamma_lut_size;
|
||||
|
||||
if (!wlr_drm_get_prop(drm->fd, crtc->id, crtc->props.gamma_lut_size,
|
||||
&gamma_lut_size)) {
|
||||
wlr_log(L_ERROR, "Unable to get gamma lut size");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (uint32_t) gamma_lut_size;
|
||||
}
|
||||
|
||||
const struct wlr_drm_interface atomic_iface = {
|
||||
.conn_enable = atomic_conn_enable,
|
||||
.crtc_pageflip = atomic_crtc_pageflip,
|
||||
.crtc_set_cursor = atomic_crtc_set_cursor,
|
||||
.crtc_move_cursor = atomic_crtc_move_cursor,
|
||||
.crtc_set_gamma = atomic_crtc_set_gamma,
|
||||
.crtc_get_gamma_size = atomic_crtc_get_gamma_size,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue