diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-26 09:49:47 +0000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-02-23 11:13:11 +1000 |
commit | b1f559ecdc6026ef783ccadc62a61e7da906fcb4 (patch) | |
tree | 0191b560a045c6490c326ef0c027797ba9886ffa /drivers/gpu/drm/nouveau | |
parent | 60b212f8ddcdbbfa8595f40300756b9ea8dd387e (diff) | |
download | kernel_goldelico_gta04-b1f559ecdc6026ef783ccadc62a61e7da906fcb4.zip kernel_goldelico_gta04-b1f559ecdc6026ef783ccadc62a61e7da906fcb4.tar.gz kernel_goldelico_gta04-b1f559ecdc6026ef783ccadc62a61e7da906fcb4.tar.bz2 |
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/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv17_tv.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv17_tv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv17_tv_modes.c | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nv17_tv.c b/drivers/gpu/drm/nouveau/nv17_tv.c index 28119fd..3900ceb 100644 --- a/drivers/gpu/drm/nouveau/nv17_tv.c +++ b/drivers/gpu/drm/nouveau/nv17_tv.c @@ -197,10 +197,12 @@ static int nv17_tv_get_ld_modes(struct drm_encoder *encoder, struct drm_connector *connector) { struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); - struct drm_display_mode *mode, *tv_mode; + const struct drm_display_mode *tv_mode; int n = 0; for (tv_mode = nv17_tv_modes; tv_mode->hdisplay; tv_mode++) { + struct drm_display_mode *mode; + mode = drm_mode_duplicate(encoder->dev, tv_mode); mode->clock = tv_norm->tv_enc_mode.vrefresh * diff --git a/drivers/gpu/drm/nouveau/nv17_tv.h b/drivers/gpu/drm/nouveau/nv17_tv.h index 6bf0384..622e722 100644 --- a/drivers/gpu/drm/nouveau/nv17_tv.h +++ b/drivers/gpu/drm/nouveau/nv17_tv.h @@ -112,7 +112,7 @@ extern struct nv17_tv_norm_params { } nv17_tv_norms[NUM_TV_NORMS]; #define get_tv_norm(enc) (&nv17_tv_norms[to_tv_enc(enc)->tv_norm]) -extern struct drm_display_mode nv17_tv_modes[]; +extern const struct drm_display_mode nv17_tv_modes[]; static inline int interpolate(int y0, int y1, int y2, int x) { diff --git a/drivers/gpu/drm/nouveau/nv17_tv_modes.c b/drivers/gpu/drm/nouveau/nv17_tv_modes.c index 9d3893c..4d1d29f 100644 --- a/drivers/gpu/drm/nouveau/nv17_tv_modes.c +++ b/drivers/gpu/drm/nouveau/nv17_tv_modes.c @@ -438,7 +438,7 @@ void nv17_tv_state_load(struct drm_device *dev, struct nv17_tv_state *state) /* Timings similar to the ones the blob sets */ -struct drm_display_mode nv17_tv_modes[] = { +const struct drm_display_mode nv17_tv_modes[] = { { DRM_MODE("320x200", DRM_MODE_TYPE_DRIVER, 0, 320, 344, 392, 560, 0, 200, 200, 202, 220, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |