mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-12 08:21:33 -04:00
backend/drm: generalize color transform handling
This commit is contained in:
parent
f9a27c5b6f
commit
2984b011b6
7 changed files with 194 additions and 15 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include <wlr/util/log.h>
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
#include "backend/drm/color.h"
|
||||
#include "backend/drm/drm.h"
|
||||
#include "backend/drm/fb.h"
|
||||
#include "backend/drm/iface.h"
|
||||
|
|
@ -128,11 +129,9 @@ static bool legacy_crtc_commit(const struct wlr_drm_connector_state *state,
|
|||
if (state->base->committed & WLR_OUTPUT_STATE_COLOR_TRANSFORM) {
|
||||
size_t dim = 0;
|
||||
uint16_t *lut = NULL;
|
||||
if (state->base->color_transform != NULL) {
|
||||
struct wlr_color_transform_lut_3x1d *tr =
|
||||
color_transform_lut_3x1d_from_base(state->base->color_transform);
|
||||
dim = tr->dim;
|
||||
lut = tr->lut_3x1d;
|
||||
if (state->crtc_color_transform != NULL) {
|
||||
dim = state->crtc_color_transform->lut_3x1d->dim;
|
||||
lut = state->crtc_color_transform->lut_3x1d->lut_3x1d;
|
||||
}
|
||||
|
||||
if (!drm_legacy_crtc_set_gamma(drm, crtc, dim, lut)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue