aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-01-26 04:49:47 -0500
committerDave Airlie <airlied@redhat.com>2011-02-22 20:13:11 -0500
commitb1f559ecdc6026ef783ccadc62a61e7da906fcb4 (patch)
tree0191b560a045c6490c326ef0c027797ba9886ffa /drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
parent60b212f8ddcdbbfa8595f40300756b9ea8dd387e (diff)
drm: Mark constant arrays of drm_display_mode const
... and fixup some methods to accept the constant argument. Now that constant module arrays are loaded into read-only memory, using const appropriately has some benefits beyond warning the programmer about likely mistakes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
index 29113c9b26a8..b3a2cd5118d7 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
@@ -345,7 +345,7 @@ static enum drm_connector_status
345 return connector_status_disconnected; 345 return connector_status_disconnected;
346} 346}
347 347
348static struct drm_display_mode vmw_ldu_connector_builtin[] = { 348static const struct drm_display_mode vmw_ldu_connector_builtin[] = {
349 /* 640x480@60Hz */ 349 /* 640x480@60Hz */
350 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25175, 640, 656, 350 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25175, 640, 656,
351 752, 800, 0, 480, 489, 492, 525, 0, 351 752, 800, 0, 480, 489, 492, 525, 0,
@@ -429,7 +429,6 @@ static int vmw_ldu_connector_fill_modes(struct drm_connector *connector,
429 struct drm_device *dev = connector->dev; 429 struct drm_device *dev = connector->dev;
430 struct vmw_private *dev_priv = vmw_priv(dev); 430 struct vmw_private *dev_priv = vmw_priv(dev);
431 struct drm_display_mode *mode = NULL; 431 struct drm_display_mode *mode = NULL;
432 struct drm_display_mode *bmode;
433 struct drm_display_mode prefmode = { DRM_MODE("preferred", 432 struct drm_display_mode prefmode = { DRM_MODE("preferred",
434 DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, 433 DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
435 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 434 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -459,6 +458,8 @@ static int vmw_ldu_connector_fill_modes(struct drm_connector *connector,
459 } 458 }
460 459
461 for (i = 0; vmw_ldu_connector_builtin[i].type != 0; i++) { 460 for (i = 0; vmw_ldu_connector_builtin[i].type != 0; i++) {
461 const struct drm_display_mode *bmode;
462
462 bmode = &vmw_ldu_connector_builtin[i]; 463 bmode = &vmw_ldu_connector_builtin[i];
463 if (bmode->hdisplay > max_width || 464 if (bmode->hdisplay > max_width ||
464 bmode->vdisplay > max_height) 465 bmode->vdisplay > max_height)