Commit b7c914b3 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Daniel Vetter

drm: Constify TV mode names

Make the mode names passed to drm_mode_create_tv_properties() const.

 drivers/gpu/drm/i2c/ch7006.ko:
-.rodata                       596
+.rodata                       664
-.data                        7064
+.data                        6992

 drivers/gpu/drm/nouveau/nouveau.ko:
-.rodata                      146808
+.rodata                      146904
-.data                        178624
+.data                        178528
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent a5b62374
...@@ -1519,7 +1519,7 @@ EXPORT_SYMBOL(drm_mode_create_dvi_i_properties); ...@@ -1519,7 +1519,7 @@ EXPORT_SYMBOL(drm_mode_create_dvi_i_properties);
*/ */
int drm_mode_create_tv_properties(struct drm_device *dev, int drm_mode_create_tv_properties(struct drm_device *dev,
unsigned int num_modes, unsigned int num_modes,
char *modes[]) const char * const modes[])
{ {
struct drm_property *tv_selector; struct drm_property *tv_selector;
struct drm_property *tv_subconnector; struct drm_property *tv_subconnector;
......
...@@ -119,8 +119,8 @@ static void ch7006_encoder_mode_set(struct drm_encoder *encoder, ...@@ -119,8 +119,8 @@ static void ch7006_encoder_mode_set(struct drm_encoder *encoder,
struct ch7006_encoder_params *params = &priv->params; struct ch7006_encoder_params *params = &priv->params;
struct ch7006_state *state = &priv->state; struct ch7006_state *state = &priv->state;
uint8_t *regs = state->regs; uint8_t *regs = state->regs;
struct ch7006_mode *mode = priv->mode; const struct ch7006_mode *mode = priv->mode;
struct ch7006_tv_norm_info *norm = &ch7006_tv_norms[priv->norm]; const struct ch7006_tv_norm_info *norm = &ch7006_tv_norms[priv->norm];
int start_active; int start_active;
ch7006_dbg(client, "\n"); ch7006_dbg(client, "\n");
...@@ -226,7 +226,7 @@ static int ch7006_encoder_get_modes(struct drm_encoder *encoder, ...@@ -226,7 +226,7 @@ static int ch7006_encoder_get_modes(struct drm_encoder *encoder,
struct drm_connector *connector) struct drm_connector *connector)
{ {
struct ch7006_priv *priv = to_ch7006_priv(encoder); struct ch7006_priv *priv = to_ch7006_priv(encoder);
struct ch7006_mode *mode; const struct ch7006_mode *mode;
int n = 0; int n = 0;
for (mode = ch7006_modes; mode->mode.clock; mode++) { for (mode = ch7006_modes; mode->mode.clock; mode++) {
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "ch7006_priv.h" #include "ch7006_priv.h"
char *ch7006_tv_norm_names[] = { const char * const ch7006_tv_norm_names[] = {
[TV_NORM_PAL] = "PAL", [TV_NORM_PAL] = "PAL",
[TV_NORM_PAL_M] = "PAL-M", [TV_NORM_PAL_M] = "PAL-M",
[TV_NORM_PAL_N] = "PAL-N", [TV_NORM_PAL_N] = "PAL-N",
...@@ -202,7 +202,7 @@ void ch7006_setup_levels(struct drm_encoder *encoder) ...@@ -202,7 +202,7 @@ void ch7006_setup_levels(struct drm_encoder *encoder)
struct i2c_client *client = drm_i2c_encoder_get_client(encoder); struct i2c_client *client = drm_i2c_encoder_get_client(encoder);
struct ch7006_priv *priv = to_ch7006_priv(encoder); struct ch7006_priv *priv = to_ch7006_priv(encoder);
uint8_t *regs = priv->state.regs; uint8_t *regs = priv->state.regs;
struct ch7006_tv_norm_info *norm = &ch7006_tv_norms[priv->norm]; const struct ch7006_tv_norm_info *norm = &ch7006_tv_norms[priv->norm];
int gain; int gain;
int black_level; int black_level;
......
...@@ -106,7 +106,7 @@ extern int ch7006_debug; ...@@ -106,7 +106,7 @@ extern int ch7006_debug;
extern char *ch7006_tv_norm; extern char *ch7006_tv_norm;
extern int ch7006_scale; extern int ch7006_scale;
extern char *ch7006_tv_norm_names[]; extern const char * const ch7006_tv_norm_names[];
extern struct ch7006_tv_norm_info ch7006_tv_norms[]; extern struct ch7006_tv_norm_info ch7006_tv_norms[];
extern struct ch7006_mode ch7006_modes[]; extern struct ch7006_mode ch7006_modes[];
......
...@@ -1579,7 +1579,7 @@ intel_tv_init(struct drm_device *dev) ...@@ -1579,7 +1579,7 @@ intel_tv_init(struct drm_device *dev)
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
struct intel_connector *intel_connector; struct intel_connector *intel_connector;
u32 tv_dac_on, tv_dac_off, save_tv_dac; u32 tv_dac_on, tv_dac_off, save_tv_dac;
char *tv_format_names[ARRAY_SIZE(tv_modes)]; const char *tv_format_names[ARRAY_SIZE(tv_modes)];
int i, initial_mode = 0; int i, initial_mode = 0;
if ((I915_READ(TV_CTL) & TV_FUSE_STATE_MASK) == TV_FUSE_STATE_DISABLED) if ((I915_READ(TV_CTL) & TV_FUSE_STATE_MASK) == TV_FUSE_STATE_DISABLED)
...@@ -1677,7 +1677,7 @@ intel_tv_init(struct drm_device *dev) ...@@ -1677,7 +1677,7 @@ intel_tv_init(struct drm_device *dev)
/* Create TV properties then attach current values */ /* Create TV properties then attach current values */
for (i = 0; i < ARRAY_SIZE(tv_modes); i++) for (i = 0; i < ARRAY_SIZE(tv_modes); i++)
tv_format_names[i] = (char *)tv_modes[i].name; tv_format_names[i] = tv_modes[i].name;
drm_mode_create_tv_properties(dev, drm_mode_create_tv_properties(dev,
ARRAY_SIZE(tv_modes), ARRAY_SIZE(tv_modes),
tv_format_names); tv_format_names);
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "hw.h" #include "hw.h"
#include "tvnv17.h" #include "tvnv17.h"
char *nv17_tv_norm_names[NUM_TV_NORMS] = { const char * const nv17_tv_norm_names[NUM_TV_NORMS] = {
[TV_NORM_PAL] = "PAL", [TV_NORM_PAL] = "PAL",
[TV_NORM_PAL_M] = "PAL-M", [TV_NORM_PAL_M] = "PAL-M",
[TV_NORM_PAL_N] = "PAL-N", [TV_NORM_PAL_N] = "PAL-N",
......
...@@ -85,7 +85,7 @@ struct nv17_tv_encoder { ...@@ -85,7 +85,7 @@ struct nv17_tv_encoder {
#define to_tv_enc(x) container_of(nouveau_encoder(x), \ #define to_tv_enc(x) container_of(nouveau_encoder(x), \
struct nv17_tv_encoder, base) struct nv17_tv_encoder, base)
extern char *nv17_tv_norm_names[NUM_TV_NORMS]; extern const char * const nv17_tv_norm_names[NUM_TV_NORMS];
extern struct nv17_tv_norm_params { extern struct nv17_tv_norm_params {
enum { enum {
......
...@@ -1390,7 +1390,7 @@ extern int drm_property_add_enum(struct drm_property *property, int index, ...@@ -1390,7 +1390,7 @@ extern int drm_property_add_enum(struct drm_property *property, int index,
extern int drm_mode_create_dvi_i_properties(struct drm_device *dev); extern int drm_mode_create_dvi_i_properties(struct drm_device *dev);
extern int drm_mode_create_tv_properties(struct drm_device *dev, extern int drm_mode_create_tv_properties(struct drm_device *dev,
unsigned int num_modes, unsigned int num_modes,
char *modes[]); const char * const modes[]);
extern int drm_mode_create_scaling_mode_property(struct drm_device *dev); extern int drm_mode_create_scaling_mode_property(struct drm_device *dev);
extern int drm_mode_create_aspect_ratio_property(struct drm_device *dev); extern int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
extern int drm_mode_create_dirty_info_property(struct drm_device *dev); extern int drm_mode_create_dirty_info_property(struct drm_device *dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment