aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2016-06-07 06:49:30 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-06-07 09:30:09 -0400
commit7ea7728387820a21a89a7c3845dbe60926f82dc4 (patch)
treeec2bca8d99101cbd833d1ea63f7ca4269322dcbe /drivers/gpu/drm/vmwgfx
parentddac4b5a6c08f8800002517ea5352b3eb9451cfc (diff)
drm/core: Change declaration for gamma_set.
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 <alexander.deucher@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@linux.ie> Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Eric Anholt <eric@anholt.net> Cc: VMware Graphics <linux-graphics-maintainer@vmware.com> Cc: Mathieu Larouche <mathieu.larouche@matrox.com> Cc: Thierry Reding <treding@nvidia.com> Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [danvet: Improve commit message a bit more, mention that this fixes the helper.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/742944bc-9f41-1acb-df4f-0fd4c8a10168@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/vmwgfx')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_kms.c8
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_kms.h4
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index 55231cce73a0..8a69d4da40b5 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -1404,9 +1404,9 @@ static int vmw_du_update_layout(struct vmw_private *dev_priv, unsigned num,
1404 return 0; 1404 return 0;
1405} 1405}
1406 1406
1407void vmw_du_crtc_gamma_set(struct drm_crtc *crtc, 1407int vmw_du_crtc_gamma_set(struct drm_crtc *crtc,
1408 u16 *r, u16 *g, u16 *b, 1408 u16 *r, u16 *g, u16 *b,
1409 uint32_t start, uint32_t size) 1409 uint32_t size)
1410{ 1410{
1411 struct vmw_private *dev_priv = vmw_priv(crtc->dev); 1411 struct vmw_private *dev_priv = vmw_priv(crtc->dev);
1412 int i; 1412 int i;
@@ -1418,6 +1418,8 @@ void vmw_du_crtc_gamma_set(struct drm_crtc *crtc,
1418 vmw_write(dev_priv, SVGA_PALETTE_BASE + i * 3 + 1, g[i] >> 8); 1418 vmw_write(dev_priv, SVGA_PALETTE_BASE + i * 3 + 1, g[i] >> 8);
1419 vmw_write(dev_priv, SVGA_PALETTE_BASE + i * 3 + 2, b[i] >> 8); 1419 vmw_write(dev_priv, SVGA_PALETTE_BASE + i * 3 + 2, b[i] >> 8);
1420 } 1420 }
1421
1422 return 0;
1421} 1423}
1422 1424
1423int vmw_du_connector_dpms(struct drm_connector *connector, int mode) 1425int vmw_du_connector_dpms(struct drm_connector *connector, int mode)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
index 57203212c501..ff4803c107bc 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
@@ -195,9 +195,9 @@ struct vmw_display_unit {
195void vmw_du_cleanup(struct vmw_display_unit *du); 195void vmw_du_cleanup(struct vmw_display_unit *du);
196void vmw_du_crtc_save(struct drm_crtc *crtc); 196void vmw_du_crtc_save(struct drm_crtc *crtc);
197void vmw_du_crtc_restore(struct drm_crtc *crtc); 197void vmw_du_crtc_restore(struct drm_crtc *crtc);
198void vmw_du_crtc_gamma_set(struct drm_crtc *crtc, 198int vmw_du_crtc_gamma_set(struct drm_crtc *crtc,
199 u16 *r, u16 *g, u16 *b, 199 u16 *r, u16 *g, u16 *b,
200 uint32_t start, uint32_t size); 200 uint32_t size);
201int vmw_du_crtc_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv, 201int vmw_du_crtc_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv,
202 uint32_t handle, uint32_t width, uint32_t height, 202 uint32_t handle, uint32_t width, uint32_t height,
203 int32_t hot_x, int32_t hot_y); 203 int32_t hot_x, int32_t hot_y);