mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 04:40:07 +01:00
libweston: remove set_gamma()
The plugins cms-static and cms-colord have been deprecated and removed from our code. They were the only thing holding set_gamma() from being removed. So remove set_gamma() from the code. Users can have the same results tweaking the output color profile that they use. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
parent
6b1b3d167d
commit
3cad1c7716
5 changed files with 9 additions and 49 deletions
|
|
@ -437,13 +437,6 @@ struct weston_output {
|
|||
void (*set_backlight)(struct weston_output *output, uint32_t value);
|
||||
void (*set_dpms)(struct weston_output *output, enum dpms_enum level);
|
||||
|
||||
uint16_t gamma_size;
|
||||
void (*set_gamma)(struct weston_output *output,
|
||||
uint16_t size,
|
||||
uint16_t *r,
|
||||
uint16_t *g,
|
||||
uint16_t *b);
|
||||
|
||||
bool enabled; /**< is in the output_list, not pending list */
|
||||
|
||||
struct weston_color_profile *color_profile;
|
||||
|
|
|
|||
|
|
@ -586,8 +586,8 @@ struct drm_output {
|
|||
unsigned max_bpc;
|
||||
enum wdrm_colorspace connector_colorspace;
|
||||
|
||||
bool deprecated_gamma_is_set;
|
||||
bool legacy_gamma_not_supported;
|
||||
uint16_t legacy_gamma_size;
|
||||
|
||||
/* Plane being displayed directly on the CRTC */
|
||||
struct drm_plane *scanout_plane;
|
||||
|
|
@ -794,10 +794,6 @@ drm_pending_state_apply(struct drm_pending_state *pending_state);
|
|||
int
|
||||
drm_pending_state_apply_sync(struct drm_pending_state *pending_state);
|
||||
|
||||
void
|
||||
drm_output_set_gamma(struct weston_output *output_base,
|
||||
uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b);
|
||||
|
||||
void
|
||||
drm_output_update_msc(struct drm_output *output, unsigned int seq);
|
||||
void
|
||||
|
|
|
|||
|
|
@ -318,8 +318,6 @@ drm_virtual_output_enable(struct weston_output *output_base)
|
|||
output->base.assign_planes = drm_assign_planes;
|
||||
output->base.set_dpms = NULL;
|
||||
output->base.switch_mode = NULL;
|
||||
output->base.gamma_size = 0;
|
||||
output->base.set_gamma = NULL;
|
||||
|
||||
weston_compositor_stack_plane(b->compositor,
|
||||
&output->scanout_plane->base,
|
||||
|
|
|
|||
|
|
@ -2045,7 +2045,7 @@ drm_output_set_content_type(struct weston_output *base,
|
|||
}
|
||||
|
||||
static int
|
||||
drm_output_init_gamma_size(struct drm_output *output)
|
||||
drm_output_init_legacy_gamma_size(struct drm_output *output)
|
||||
{
|
||||
struct drm_device *device = output->device;
|
||||
drmModeCrtc *crtc;
|
||||
|
|
@ -2056,7 +2056,7 @@ drm_output_init_gamma_size(struct drm_output *output)
|
|||
if (!crtc)
|
||||
return -1;
|
||||
|
||||
output->base.gamma_size = crtc->gamma_size;
|
||||
output->legacy_gamma_size = crtc->gamma_size;
|
||||
|
||||
drmModeFreeCrtc(crtc);
|
||||
|
||||
|
|
@ -2507,7 +2507,7 @@ drm_output_enable(struct weston_output *base)
|
|||
if (ret < 0)
|
||||
goto err_crtc;
|
||||
|
||||
if (drm_output_init_gamma_size(output) < 0)
|
||||
if (drm_output_init_legacy_gamma_size(output) < 0)
|
||||
goto err_planes;
|
||||
|
||||
if (b->pageflip_timeout)
|
||||
|
|
@ -2536,7 +2536,6 @@ drm_output_enable(struct weston_output *base)
|
|||
output->base.assign_planes = drm_assign_planes;
|
||||
output->base.set_dpms = drm_set_dpms;
|
||||
output->base.switch_mode = drm_output_switch_mode;
|
||||
output->base.set_gamma = drm_output_set_gamma;
|
||||
|
||||
if (device->atomic_modeset)
|
||||
weston_output_update_capture_info(base, WESTON_OUTPUT_CAPTURE_SOURCE_WRITEBACK,
|
||||
|
|
|
|||
|
|
@ -703,28 +703,6 @@ drm_plane_supports_color_range(struct drm_plane *plane,
|
|||
return enum_info->valid;
|
||||
}
|
||||
|
||||
void
|
||||
drm_output_set_gamma(struct weston_output *output_base,
|
||||
uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b)
|
||||
{
|
||||
int rc;
|
||||
struct drm_output *output = to_drm_output(output_base);
|
||||
struct drm_device *device = output->device;
|
||||
|
||||
assert(output);
|
||||
|
||||
/* check */
|
||||
if (output_base->gamma_size != size)
|
||||
return;
|
||||
|
||||
output->deprecated_gamma_is_set = true;
|
||||
rc = drmModeCrtcSetGamma(device->drm.fd,
|
||||
output->crtc->crtc_id,
|
||||
size, r, g, b);
|
||||
if (rc)
|
||||
weston_log("set gamma failed: %s\n", strerror(errno));
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark an output state as current on the output, i.e. it has been
|
||||
* submitted to the kernel. The mode argument determines whether this
|
||||
|
|
@ -842,7 +820,7 @@ err:
|
|||
static void
|
||||
drm_output_reset_legacy_gamma(struct drm_output *output)
|
||||
{
|
||||
uint32_t len = output->base.gamma_size;
|
||||
uint32_t len = output->legacy_gamma_size;
|
||||
uint16_t *lut;
|
||||
uint32_t i;
|
||||
int ret;
|
||||
|
|
@ -955,8 +933,7 @@ drm_output_apply_state_legacy(struct drm_output_state *state)
|
|||
goto err;
|
||||
}
|
||||
|
||||
if (!output->deprecated_gamma_is_set)
|
||||
drm_output_reset_legacy_gamma(output);
|
||||
drm_output_reset_legacy_gamma(output);
|
||||
}
|
||||
|
||||
pinfo = scanout_state->fb->format;
|
||||
|
|
@ -1344,12 +1321,9 @@ drm_output_apply_state_atomic(struct drm_output_state *state,
|
|||
current_mode->blob_id);
|
||||
ret |= crtc_add_prop(req, crtc, WDRM_CRTC_ACTIVE, 1);
|
||||
|
||||
if (!output->deprecated_gamma_is_set) {
|
||||
ret |= crtc_add_prop_zero_ok(req, crtc,
|
||||
WDRM_CRTC_GAMMA_LUT, 0);
|
||||
ret |= crtc_add_prop_zero_ok(req, crtc,
|
||||
WDRM_CRTC_DEGAMMA_LUT, 0);
|
||||
}
|
||||
ret |= crtc_add_prop_zero_ok(req, crtc, WDRM_CRTC_GAMMA_LUT, 0);
|
||||
ret |= crtc_add_prop_zero_ok(req, crtc, WDRM_CRTC_DEGAMMA_LUT, 0);
|
||||
|
||||
ret |= crtc_add_prop_zero_ok(req, crtc, WDRM_CRTC_CTM, 0);
|
||||
ret |= crtc_add_prop_zero_ok(req, crtc, WDRM_CRTC_VRR_ENABLED,
|
||||
wdrm_vrr_enabled_from_output(output));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue