@@ -42,14 +42,6 @@ static void armada_drm_slave_destroy(struct drm_encoder *enc)
kfree(slave);
}
-static void armada_drm_slave_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
-{
- drm_i2c_encoder_mode_set(encoder, mode, adjusted_mode);
-}
-
-
static const struct drm_encoder_funcs armada_drm_slave_encoder_funcs = {
.destroy = armada_drm_slave_destroy,
};
@@ -67,7 +59,7 @@ static const struct drm_encoder_helper_funcs drm_slave_encoder_helpers = {
.mode_fixup = drm_i2c_encoder_mode_fixup,
.prepare = drm_i2c_encoder_prepare,
.commit = drm_i2c_encoder_commit,
- .mode_set = armada_drm_slave_mode_set,
+ .mode_set = drm_i2c_encoder_mode_set,
.detect = drm_i2c_encoder_detect,
};
@@ -743,8 +743,8 @@ static bool ast_mode_fixup(struct drm_encoder *encoder,
}
static void ast_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
}
@@ -114,8 +114,8 @@ atmel_hlcdc_panel_encoder_mode_fixup(struct drm_encoder *encoder,
static void
atmel_hlcdc_rgb_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted)
{
struct atmel_hlcdc_rgb_output *rgb =
drm_encoder_to_atmel_hlcdc_rgb_output(encoder);
@@ -160,8 +160,8 @@ static bool bochs_encoder_mode_fixup(struct drm_encoder *encoder,
}
static void bochs_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
}
@@ -439,8 +439,8 @@ static bool cirrus_encoder_mode_fixup(struct drm_encoder *encoder,
}
static void cirrus_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
}
@@ -137,7 +137,7 @@ struct exynos_drm_display_ops {
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode);
void (*mode_set)(struct exynos_drm_display *display,
- struct drm_display_mode *mode);
+ const struct drm_display_mode *mode);
int (*check_mode)(struct exynos_drm_display *display,
const struct drm_display_mode *mode);
void (*dpms)(struct exynos_drm_display *display, int mode);
@@ -1518,7 +1518,7 @@ static int exynos_dsi_create_connector(struct exynos_drm_display *display,
}
static void exynos_dsi_mode_set(struct exynos_drm_display *display,
- struct drm_display_mode *mode)
+ const struct drm_display_mode *mode)
{
struct exynos_dsi *dsi = display_to_dsi(display);
struct videomode *vm = &dsi->vm;
@@ -66,8 +66,8 @@ exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder,
}
static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
struct exynos_drm_display *display = exynos_encoder->display;
@@ -1762,14 +1762,13 @@ static void hdmi_set_reg(u8 *reg_pair, int num_bytes, u32 value)
}
static void hdmi_v13_mode_set(struct hdmi_context *hdata,
- struct drm_display_mode *m)
+ const struct drm_display_mode *m)
{
struct hdmi_v13_core_regs *core = &hdata->mode_conf.conf.v13_conf.core;
struct hdmi_tg_regs *tg = &hdata->mode_conf.conf.v13_conf.tg;
unsigned int val;
- hdata->mode_conf.cea_video_id =
- drm_match_cea_mode((struct drm_display_mode *)m);
+ hdata->mode_conf.cea_video_id = drm_match_cea_mode(m);
hdata->mode_conf.pixel_clock = m->clock * 1000;
hdata->mode_conf.aspect_ratio = m->picture_aspect_ratio;
@@ -1859,14 +1858,13 @@ static void hdmi_v13_mode_set(struct hdmi_context *hdata,
}
static void hdmi_v14_mode_set(struct hdmi_context *hdata,
- struct drm_display_mode *m)
+ const struct drm_display_mode *m)
{
struct hdmi_tg_regs *tg = &hdata->mode_conf.conf.v14_conf.tg;
struct hdmi_v14_core_regs *core =
&hdata->mode_conf.conf.v14_conf.core;
- hdata->mode_conf.cea_video_id =
- drm_match_cea_mode((struct drm_display_mode *)m);
+ hdata->mode_conf.cea_video_id = drm_match_cea_mode(m);
hdata->mode_conf.pixel_clock = m->clock * 1000;
hdata->mode_conf.aspect_ratio = m->picture_aspect_ratio;
@@ -1971,10 +1969,9 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata,
}
static void hdmi_mode_set(struct exynos_drm_display *display,
- struct drm_display_mode *mode)
+ const struct drm_display_mode *m)
{
struct hdmi_context *hdata = display_to_hdmi(display);
- struct drm_display_mode *m = mode;
DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%s\n",
m->hdisplay, m->vdisplay,
@@ -1982,12 +1979,12 @@ static void hdmi_mode_set(struct exynos_drm_display *display,
"INTERLACED" : "PROGERESSIVE");
/* preserve mode information for later use. */
- drm_mode_copy(&hdata->current_mode, mode);
+ drm_mode_copy(&hdata->current_mode, m);
if (hdata->type == HDMI_TYPE13)
- hdmi_v13_mode_set(hdata, mode);
+ hdmi_v13_mode_set(hdata, m);
else
- hdmi_v14_mode_set(hdata, mode);
+ hdmi_v14_mode_set(hdata, m);
}
static void hdmi_commit(struct exynos_drm_display *display)
@@ -82,8 +82,8 @@ static int cdv_intel_crt_mode_valid(struct drm_connector *connector,
}
static void cdv_intel_crt_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
@@ -1036,8 +1036,9 @@ cdv_intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
}
static void
-cdv_intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+cdv_intel_dp_mode_set(struct drm_encoder *encoder,
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct gma_encoder *intel_encoder = to_gma_encoder(encoder);
struct drm_crtc *crtc = encoder->crtc;
@@ -60,8 +60,8 @@ struct mid_intel_hdmi_priv {
};
static void cdv_hdmi_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct gma_encoder *gma_encoder = to_gma_encoder(encoder);
@@ -351,8 +351,8 @@ static void cdv_intel_lvds_commit(struct drm_encoder *encoder)
}
static void cdv_intel_lvds_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private;
@@ -810,8 +810,8 @@ static void mdfld_set_pipe_timing(struct mdfld_dsi_config *dsi_config, int pipe)
/* End for TC35876X */
void mdfld_dsi_dpi_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct mdfld_dsi_encoder *dsi_encoder = mdfld_dsi_encoder(encoder);
struct mdfld_dsi_dpi_output *dpi_output =
@@ -70,8 +70,8 @@ extern bool mdfld_dsi_dpi_mode_fixup(struct drm_encoder *encoder,
extern void mdfld_dsi_dpi_prepare(struct drm_encoder *encoder);
extern void mdfld_dsi_dpi_commit(struct drm_encoder *encoder);
extern void mdfld_dsi_dpi_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode);
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode);
extern void mdfld_dsi_dpi_turn_on(struct mdfld_dsi_dpi_output *output,
int pipe);
extern void mdfld_dsi_dpi_controller_init(struct mdfld_dsi_config *dsi_config,
@@ -585,8 +585,8 @@ static int oaktrail_hdmi_get_modes(struct drm_connector *connector)
}
static void oaktrail_hdmi_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
@@ -89,8 +89,8 @@ static void oaktrail_lvds_dpms(struct drm_encoder *encoder, int mode)
}
static void oaktrail_lvds_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private;
@@ -467,8 +467,8 @@ static void psb_intel_lvds_commit(struct drm_encoder *encoder)
}
static void psb_intel_lvds_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct drm_psb_private *dev_priv = dev->dev_private;
@@ -985,8 +985,8 @@ static bool psb_intel_sdvo_mode_fixup(struct drm_encoder *encoder,
}
static void psb_intel_sdvo_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct drm_crtc *crtc = encoder->crtc;
@@ -840,8 +840,8 @@ static int tda998x_encoder_mode_valid(struct tda998x_priv *priv,
static void
tda998x_encoder_mode_set(struct tda998x_priv *priv,
- const struct drm_display_mode *mode,
- const struct drm_display_mode *adjusted_mode)
+ const const struct drm_display_mode *mode,
+ const const struct drm_display_mode *adjusted_mode)
{
uint16_t ref_pix, ref_line, n_pix, n_line;
uint16_t hs_pix_s, hs_pix_e;
@@ -1413,8 +1413,8 @@ static void tda998x_encoder_commit(struct drm_encoder *encoder)
}
static void tda998x_encoder2_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct tda998x_priv2 *priv = enc_to_tda998x_priv2(encoder);
@@ -106,8 +106,8 @@ static bool dw_hdmi_imx_encoder_mode_fixup(struct drm_encoder *encoder,
}
static void dw_hdmi_imx_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adj_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adj_mode)
{
}
@@ -226,8 +226,8 @@ static void imx_ldb_encoder_commit(struct drm_encoder *encoder)
}
static void imx_ldb_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *orig_mode,
- struct drm_display_mode *mode)
+ const struct drm_display_mode *orig_mode,
+ const struct drm_display_mode *mode)
{
struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
struct imx_ldb *ldb = imx_ldb_ch->ldb;
@@ -311,8 +311,8 @@ static void imx_tve_encoder_prepare(struct drm_encoder *encoder)
}
static void imx_tve_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *orig_mode,
- struct drm_display_mode *mode)
+ const struct drm_display_mode *orig_mode,
+ const struct drm_display_mode *mode)
{
struct imx_tve *tve = enc_to_tve(encoder);
unsigned long rounded_rate;
@@ -130,8 +130,8 @@ static void imx_pd_encoder_commit(struct drm_encoder *encoder)
}
static void imx_pd_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *orig_mode,
- struct drm_display_mode *mode)
+ const struct drm_display_mode *orig_mode,
+ const struct drm_display_mode *mode)
{
}
@@ -1380,8 +1380,8 @@ static bool mga_encoder_mode_fixup(struct drm_encoder *encoder,
}
static void mga_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
}
@@ -102,8 +102,8 @@ static bool mdp4_dtv_encoder_mode_fixup(struct drm_encoder *encoder,
}
static void mdp4_dtv_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *drm_mode,
+ const struct drm_display_mode *mode)
{
struct mdp4_dtv_encoder *mdp4_dtv_encoder = to_mdp4_dtv_encoder(encoder);
struct mdp4_kms *mdp4_kms = get_kms(encoder);
@@ -111,8 +111,6 @@ static void mdp4_dtv_encoder_mode_set(struct drm_encoder *encoder,
uint32_t display_v_start, display_v_end;
uint32_t hsync_start_x, hsync_end_x;
- mode = adjusted_mode;
-
DBG("set mode: %d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x",
mode->base.id, mode->name,
mode->vrefresh, mode->clock,
@@ -267,8 +267,8 @@ static bool mdp4_lcdc_encoder_mode_fixup(struct drm_encoder *encoder,
}
static void mdp4_lcdc_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *drm_mode,
+ const struct drm_display_mode *mode)
{
struct mdp4_lcdc_encoder *mdp4_lcdc_encoder =
to_mdp4_lcdc_encoder(encoder);
@@ -277,8 +277,6 @@ static void mdp4_lcdc_encoder_mode_set(struct drm_encoder *encoder,
uint32_t display_v_start, display_v_end;
uint32_t hsync_start_x, hsync_end_x;
- mode = adjusted_mode;
-
DBG("set mode: %d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x",
mode->base.id, mode->name,
mode->vrefresh, mode->clock,
@@ -119,8 +119,8 @@ static bool mdp5_encoder_mode_fixup(struct drm_encoder *encoder,
}
static void mdp5_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *drm_mode,
+ const struct drm_display_mode *mode)
{
struct mdp5_encoder *mdp5_encoder = to_mdp5_encoder(encoder);
struct mdp5_kms *mdp5_kms = get_kms(encoder);
@@ -133,8 +133,6 @@ static void mdp5_encoder_mode_set(struct drm_encoder *encoder,
uint32_t format = 0x2100;
unsigned long flags;
- mode = adjusted_mode;
-
DBG("set mode: %d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x",
mode->base.id, mode->name,
mode->vrefresh, mode->clock,
@@ -368,8 +368,8 @@ static void nv04_dac_prepare(struct drm_encoder *encoder)
}
static void nv04_dac_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct nouveau_drm *drm = nouveau_drm(dev);
@@ -277,8 +277,8 @@ static void nv04_dfp_prepare(struct drm_encoder *encoder)
static void nv04_dfp_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct nvif_device *device = &nouveau_drm(dev)->device;
@@ -135,8 +135,8 @@ static void nv04_tv_prepare(struct drm_encoder *encoder)
}
static void nv04_tv_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc);
@@ -463,8 +463,8 @@ static void nv17_tv_prepare(struct drm_encoder *encoder)
}
static void nv17_tv_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *drm_mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *drm_mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct nouveau_drm *drm = nouveau_drm(dev);
@@ -1549,8 +1549,9 @@ nv50_dac_commit(struct drm_encoder *encoder)
}
static void
-nv50_dac_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+nv50_dac_mode_set(struct drm_encoder *encoder,
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct nv50_mast *mast = nv50_mast(encoder->dev);
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
@@ -1703,7 +1704,8 @@ nv50_dac_create(struct drm_connector *connector, struct dcb_output *dcbe)
* Audio
*****************************************************************************/
static void
-nv50_audio_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode)
+nv50_audio_mode_set(struct drm_encoder *encoder,
+ const struct drm_display_mode *mode)
{
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc);
@@ -1757,7 +1759,8 @@ nv50_audio_disconnect(struct drm_encoder *encoder, struct nouveau_crtc *nv_crtc)
* HDMI
*****************************************************************************/
static void
-nv50_hdmi_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode)
+nv50_hdmi_mode_set(struct drm_encoder *encoder,
+ const struct drm_display_mode *mode)
{
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc);
@@ -1905,8 +1908,9 @@ nv50_sor_commit(struct drm_encoder *encoder)
}
static void
-nv50_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode,
- struct drm_display_mode *mode)
+nv50_sor_mode_set(struct drm_encoder *encoder,
+ const struct drm_display_mode *umode,
+ const struct drm_display_mode *mode)
{
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc);
@@ -2135,8 +2139,9 @@ nv50_pior_commit(struct drm_encoder *encoder)
}
static void
-nv50_pior_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+nv50_pior_mode_set(struct drm_encoder *encoder,
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct nv50_mast *mast = nv50_mast(encoder->dev);
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
@@ -88,8 +88,8 @@ static bool omap_encoder_mode_fixup(struct drm_encoder *encoder,
}
static void omap_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
@@ -795,8 +795,8 @@ static void qxl_enc_commit(struct drm_encoder *encoder)
}
static void qxl_enc_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
DRM_DEBUG("\n");
}
@@ -1957,7 +1957,7 @@ atombios_set_encoder_crtc_source(struct drm_encoder *encoder)
static void
atombios_apply_encoder_quirks(struct drm_encoder *encoder,
- struct drm_display_mode *mode)
+ const struct drm_display_mode *mode)
{
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
@@ -2137,8 +2137,8 @@ radeon_atom_encoder_init(struct radeon_device *rdev)
static void
radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
@@ -2483,8 +2483,8 @@ static void radeon_atom_ext_commit(struct drm_encoder *encoder)
static void
radeon_atom_ext_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
}
@@ -57,9 +57,11 @@ void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
void dce6_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
u8 *sadb, int sad_count);
void dce4_afmt_write_latency_fields(struct drm_encoder *encoder,
- struct drm_connector *connector, struct drm_display_mode *mode);
+ struct drm_connector *connector,
+ const struct drm_display_mode *mode);
void dce6_afmt_write_latency_fields(struct drm_encoder *encoder,
- struct drm_connector *connector, struct drm_display_mode *mode);
+ struct drm_connector *connector,
+ const struct drm_display_mode *mode);
struct r600_audio_pin* r600_audio_get_pin(struct radeon_device *rdev);
struct r600_audio_pin* dce6_audio_get_pin(struct radeon_device *rdev);
void dce6_afmt_select_pin(struct drm_encoder *encoder);
@@ -96,9 +98,9 @@ void r600_set_mute(struct drm_encoder *encoder, u32 offset, bool mute);
void dce3_2_set_mute(struct drm_encoder *encoder, u32 offset, bool mute);
void dce4_set_mute(struct drm_encoder *encoder, u32 offset, bool mute);
static void radeon_audio_hdmi_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode);
+ const struct drm_display_mode *mode);
static void radeon_audio_dp_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode);
+ const struct drm_display_mode *mode);
void r600_hdmi_enable(struct drm_encoder *encoder, bool enable);
void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable);
void evergreen_dp_enable(struct drm_encoder *encoder, bool enable);
@@ -400,7 +402,7 @@ static void radeon_audio_write_speaker_allocation(struct drm_encoder *encoder)
}
static void radeon_audio_write_latency_fields(struct drm_encoder *encoder,
- struct drm_display_mode *mode)
+ const struct drm_display_mode *mode)
{
struct radeon_encoder *radeon_encoder;
struct drm_connector *connector;
@@ -515,7 +517,7 @@ static void radeon_audio_set_dto(struct drm_encoder *encoder, unsigned int clock
}
static int radeon_audio_set_avi_packet(struct drm_encoder *encoder,
- struct drm_display_mode *mode)
+ const struct drm_display_mode *mode)
{
struct radeon_device *rdev = encoder->dev->dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
@@ -691,7 +693,7 @@ static void radeon_audio_set_mute(struct drm_encoder *encoder, bool mute)
* update the info frames with the data from the current display mode
*/
static void radeon_audio_hdmi_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode)
+ const struct drm_display_mode *mode)
{
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
@@ -718,7 +720,7 @@ static void radeon_audio_hdmi_mode_set(struct drm_encoder *encoder,
}
static void radeon_audio_dp_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode)
+ const struct drm_display_mode *mode)
{
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
@@ -747,7 +749,7 @@ static void radeon_audio_dp_mode_set(struct drm_encoder *encoder,
}
void radeon_audio_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode)
+ const struct drm_display_mode *mode)
{
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
@@ -46,7 +46,8 @@ struct radeon_audio_funcs
void (*select_pin)(struct drm_encoder *encoder);
struct r600_audio_pin* (*get_pin)(struct radeon_device *rdev);
void (*write_latency_fields)(struct drm_encoder *encoder,
- struct drm_connector *connector, struct drm_display_mode *mode);
+ struct drm_connector *connector,
+ const struct drm_display_mode *mode);
void (*write_sad_regs)(struct drm_encoder *encoder,
struct cea_sad *sads, int sad_count);
void (*write_speaker_allocation)(struct drm_encoder *encoder,
@@ -62,7 +63,7 @@ struct radeon_audio_funcs
void (*set_audio_packet)(struct drm_encoder *encoder, u32 offset);
void (*set_mute)(struct drm_encoder *encoder, u32 offset, bool mute);
void (*mode_set)(struct drm_encoder *encoder,
- struct drm_display_mode *mode);
+ const struct drm_display_mode *mode);
void (*dpms)(struct drm_encoder *encoder, bool mode);
};
@@ -78,7 +79,7 @@ void radeon_audio_enable(struct radeon_device *rdev,
struct r600_audio_pin *pin, u8 enable_mask);
void radeon_audio_fini(struct radeon_device *rdev);
void radeon_audio_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode);
+ const struct drm_display_mode *mode);
void radeon_audio_dpms(struct drm_encoder *encoder, int mode);
#endif
@@ -174,8 +174,8 @@ static void radeon_legacy_lvds_commit(struct drm_encoder *encoder)
}
static void radeon_legacy_lvds_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
@@ -574,8 +574,8 @@ static void radeon_legacy_primary_dac_commit(struct drm_encoder *encoder)
}
static void radeon_legacy_primary_dac_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
@@ -771,8 +771,8 @@ static void radeon_legacy_tmds_int_commit(struct drm_encoder *encoder)
}
static void radeon_legacy_tmds_int_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
@@ -936,8 +936,8 @@ static void radeon_legacy_tmds_ext_commit(struct drm_encoder *encoder)
}
static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
@@ -1142,8 +1142,8 @@ static void radeon_legacy_tv_dac_commit(struct drm_encoder *encoder)
}
static void radeon_legacy_tv_dac_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
@@ -529,8 +529,8 @@ static bool radeon_legacy_tv_init_restarts(struct drm_encoder *encoder)
}
void radeon_legacy_tv_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
@@ -911,8 +911,8 @@ void radeon_legacy_tv_adjust_pll2(struct drm_encoder *encoder,
uint32_t *htotal2_cntl, uint32_t *p2pll_ref_div,
uint32_t *p2pll_div_0, uint32_t *pixclks_cntl);
void radeon_legacy_tv_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode);
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode);
/* fmt blocks */
void avivo_program_fmt(struct drm_encoder *encoder);
@@ -100,8 +100,8 @@ static int rcar_du_encoder_atomic_check(struct drm_encoder *encoder,
}
static void rcar_du_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct rcar_du_encoder *renc = to_rcar_encoder(encoder);
@@ -85,8 +85,8 @@ static int rcar_du_hdmienc_atomic_check(struct drm_encoder *encoder,
}
static void rcar_du_hdmienc_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
struct rcar_du_hdmienc *hdmienc = to_rcar_hdmienc(encoder);
struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder);
@@ -190,8 +190,8 @@ dw_hdmi_rockchip_encoder_mode_fixup(struct drm_encoder *encoder,
}
static void dw_hdmi_rockchip_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adj_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adj_mode)
{
}
@@ -575,8 +575,8 @@ static void shmob_drm_encoder_mode_prepare(struct drm_encoder *encoder)
}
static void shmob_drm_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
/* No-op, everything is handled in the CRTC code. */
}
@@ -448,8 +448,8 @@ static bool sti_tvout_encoder_mode_fixup(struct drm_encoder *encoder,
}
static void sti_tvout_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
}
@@ -795,8 +795,8 @@ static void tegra_dsi_encoder_commit(struct drm_encoder *encoder)
}
static void tegra_dsi_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted)
{
struct tegra_output *output = encoder_to_output(encoder);
struct tegra_dc *dc = to_tegra_dc(encoder->crtc);
@@ -638,7 +638,7 @@ static void tegra_hdmi_write_infopack(struct tegra_hdmi *hdmi, const void *data,
}
static void tegra_hdmi_setup_avi_infoframe(struct tegra_hdmi *hdmi,
- struct drm_display_mode *mode)
+ const struct drm_display_mode *mode)
{
struct hdmi_avi_infoframe frame;
u8 buffer[17];
@@ -831,8 +831,8 @@ static void tegra_hdmi_encoder_commit(struct drm_encoder *encoder)
}
static void tegra_hdmi_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted)
{
unsigned int h_sync_width, h_front_porch, h_back_porch, i, rekey;
struct tegra_output *output = encoder_to_output(encoder);
@@ -138,8 +138,8 @@ static void tegra_rgb_encoder_commit(struct drm_encoder *encoder)
}
static void tegra_rgb_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted)
{
struct tegra_output *output = encoder_to_output(encoder);
struct tegra_rgb *rgb = to_rgb(output);
@@ -384,7 +384,7 @@ static int tegra_sor_compute_params(struct tegra_sor *sor,
}
static int tegra_sor_calc_config(struct tegra_sor *sor,
- struct drm_display_mode *mode,
+ const struct drm_display_mode *mode,
struct tegra_sor_config *config,
struct drm_dp_link *link)
{
@@ -781,8 +781,8 @@ static void tegra_sor_encoder_commit(struct drm_encoder *encoder)
}
static void tegra_sor_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted)
{
struct tegra_output *output = encoder_to_output(encoder);
struct tegra_dc *dc = to_tegra_dc(encoder->crtc);
@@ -91,8 +91,8 @@ static void panel_encoder_commit(struct drm_encoder *encoder)
}
static void panel_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
/* nothing needed */
}
@@ -96,13 +96,6 @@ static bool slave_encoder_fixup(struct drm_encoder *encoder,
return drm_i2c_encoder_mode_fixup(encoder, mode, adjusted_mode);
}
-static void slave_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
-{
- drm_i2c_encoder_mode_set(encoder, mode, adjusted_mode);
-}
-
static const struct drm_encoder_funcs slave_encoder_funcs = {
.destroy = slave_encoder_destroy,
};
@@ -112,7 +105,7 @@ static const struct drm_encoder_helper_funcs slave_encoder_helper_funcs = {
.mode_fixup = slave_encoder_fixup,
.prepare = slave_encoder_prepare,
.commit = drm_i2c_encoder_commit,
- .mode_set = slave_encoder_mode_set,
+ .mode_set = drm_i2c_encoder_mode_set,
.save = drm_i2c_encoder_save,
.restore = drm_i2c_encoder_restore,
};
@@ -100,8 +100,8 @@ static void tfp410_encoder_commit(struct drm_encoder *encoder)
}
static void tfp410_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
/* nothing needed */
}
@@ -42,8 +42,8 @@ static void udl_encoder_commit(struct drm_encoder *encoder)
}
static void udl_encoder_mode_set(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode)
{
}
@@ -147,8 +147,8 @@ struct drm_encoder_helper_funcs {
void (*prepare)(struct drm_encoder *encoder);
void (*commit)(struct drm_encoder *encoder);
void (*mode_set)(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode);
+ const struct drm_display_mode *mode,
+ const struct drm_display_mode *adjusted_mode);
struct drm_crtc *(*get_crtc)(struct drm_encoder *encoder);
/* detect for DAC style encoders */
enum drm_connector_status (*detect)(struct drm_encoder *encoder,
Enforce the existing rules on when modes can be modified (never modify the passed-in mode; only modify adjusted_mode in mode_fixup), by adding const. This removes the interim mode_set helper functions introduced in tilcdc and armada during the encoder-slave mode_set constification, as the encoder and encoder-slave types are now compatible. Signed-off-by: Daniel Stone <daniels@collabora.com> --- drivers/gpu/drm/armada/armada_slave.c | 10 +--------- drivers/gpu/drm/ast/ast_mode.c | 4 ++-- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 4 ++-- drivers/gpu/drm/bochs/bochs_kms.c | 4 ++-- drivers/gpu/drm/cirrus/cirrus_mode.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 +- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 4 ++-- drivers/gpu/drm/exynos/exynos_hdmi.c | 19 ++++++++----------- drivers/gpu/drm/gma500/cdv_intel_crt.c | 4 ++-- drivers/gpu/drm/gma500/cdv_intel_dp.c | 5 +++-- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 4 ++-- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 4 ++-- drivers/gpu/drm/gma500/mdfld_dsi_dpi.c | 4 ++-- drivers/gpu/drm/gma500/mdfld_dsi_dpi.h | 4 ++-- drivers/gpu/drm/gma500/oaktrail_hdmi.c | 4 ++-- drivers/gpu/drm/gma500/oaktrail_lvds.c | 4 ++-- drivers/gpu/drm/gma500/psb_intel_lvds.c | 4 ++-- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 4 ++-- drivers/gpu/drm/i2c/tda998x_drv.c | 8 ++++---- drivers/gpu/drm/imx/dw_hdmi-imx.c | 4 ++-- drivers/gpu/drm/imx/imx-ldb.c | 4 ++-- drivers/gpu/drm/imx/imx-tve.c | 4 ++-- drivers/gpu/drm/imx/parallel-display.c | 4 ++-- drivers/gpu/drm/mgag200/mgag200_mode.c | 4 ++-- drivers/gpu/drm/msm/mdp/mdp4/mdp4_dtv_encoder.c | 6 ++---- drivers/gpu/drm/msm/mdp/mdp4/mdp4_lcdc_encoder.c | 6 ++---- drivers/gpu/drm/msm/mdp/mdp5/mdp5_encoder.c | 6 ++---- drivers/gpu/drm/nouveau/dispnv04/dac.c | 4 ++-- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 4 ++-- drivers/gpu/drm/nouveau/dispnv04/tvnv04.c | 4 ++-- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 4 ++-- drivers/gpu/drm/nouveau/nv50_display.c | 21 +++++++++++++-------- drivers/gpu/drm/omapdrm/omap_encoder.c | 4 ++-- drivers/gpu/drm/qxl/qxl_display.c | 4 ++-- drivers/gpu/drm/radeon/atombios_encoders.c | 10 +++++----- drivers/gpu/drm/radeon/radeon_audio.c | 20 +++++++++++--------- drivers/gpu/drm/radeon/radeon_audio.h | 7 ++++--- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 20 ++++++++++---------- drivers/gpu/drm/radeon/radeon_legacy_tv.c | 4 ++-- drivers/gpu/drm/radeon/radeon_mode.h | 4 ++-- drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 4 ++-- drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c | 4 ++-- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 4 ++-- drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 4 ++-- drivers/gpu/drm/sti/sti_tvout.c | 4 ++-- drivers/gpu/drm/tegra/dsi.c | 4 ++-- drivers/gpu/drm/tegra/hdmi.c | 6 +++--- drivers/gpu/drm/tegra/rgb.c | 4 ++-- drivers/gpu/drm/tegra/sor.c | 6 +++--- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 4 ++-- drivers/gpu/drm/tilcdc/tilcdc_slave.c | 9 +-------- drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 4 ++-- drivers/gpu/drm/udl/udl_encoder.c | 4 ++-- include/drm/drm_crtc_helper.h | 4 ++-- 55 files changed, 150 insertions(+), 165 deletions(-)