From 7ea7728387820a21a89a7c3845dbe60926f82dc4 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Tue, 7 Jun 2016 12:49:30 +0200 Subject: drm/core: Change declaration for gamma_set. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change return value to int to propagate errors from gamma_set, and remove start parameter. Updates always use the full size, and some drivers even ignore the start parameter altogether. This is needed for atomic drivers, where an atomic commit can fail with -EINTR or -ENOMEM and should be restarted. This is already and issue for drm_atomic_helper_legacy_set_gamma, which this patch fixes up. Changes since v1: - Fix compiler warning. (Emil) - Fix commit message (Daniel) Cc: Alex Deucher Acked-by: Alex Deucher Cc: Christian König Cc: David Airlie Cc: Patrik Jakobsson Cc: Ben Skeggs Cc: Eric Anholt Cc: VMware Graphics Cc: Mathieu Larouche Cc: Thierry Reding Acked-by: Patrik Jakobsson Signed-off-by: Maarten Lankhorst [danvet: Improve commit message a bit more, mention that this fixes the helper.] Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/742944bc-9f41-1acb-df4f-0fd4c8a10168@linux.intel.com --- drivers/gpu/drm/cirrus/cirrus_mode.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/drm/cirrus') diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index 0b1a411cb89e..17c915d9a03e 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c @@ -325,18 +325,20 @@ static void cirrus_crtc_commit(struct drm_crtc *crtc) * use this for 8-bit mode so can't perform smooth fades on deeper modes, * but it's a requirement that we provide the function */ -static void cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, - u16 *blue, uint32_t start, uint32_t size) +static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, + u16 *blue, uint32_t size) { struct cirrus_crtc *cirrus_crtc = to_cirrus_crtc(crtc); int i; - for (i = 0; i < CIRRUS_LUT_SIZE; i++) { + for (i = 0; i < size; i++) { cirrus_crtc->lut_r[i] = red[i]; cirrus_crtc->lut_g[i] = green[i]; cirrus_crtc->lut_b[i] = blue[i]; } cirrus_crtc_load_lut(crtc); + + return 0; } /* Simple cleanup function */ -- cgit v1.2.3