drm: Make the .mode_fixup() operations mode argument a const pointer
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 17 Jul 2012 15:56:50 +0000 (17:56 +0200)
committerDave Airlie <airlied@redhat.com>
Fri, 20 Jul 2012 01:52:38 +0000 (21:52 -0400)
The passed mode must not be modified by the operation, make it const.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
55 files changed:
drivers/gpu/drm/ast/ast_mode.c
drivers/gpu/drm/cirrus/cirrus_mode.c
drivers/gpu/drm/exynos/exynos_drm_crtc.c
drivers/gpu/drm/exynos/exynos_drm_drv.h
drivers/gpu/drm/exynos/exynos_drm_encoder.c
drivers/gpu/drm/exynos/exynos_drm_hdmi.c
drivers/gpu/drm/exynos/exynos_drm_hdmi.h
drivers/gpu/drm/exynos/exynos_hdmi.c
drivers/gpu/drm/gma500/cdv_intel_crt.c
drivers/gpu/drm/gma500/cdv_intel_display.c
drivers/gpu/drm/gma500/cdv_intel_hdmi.c
drivers/gpu/drm/gma500/cdv_intel_lvds.c
drivers/gpu/drm/gma500/mdfld_dsi_dpi.c
drivers/gpu/drm/gma500/mdfld_dsi_dpi.h
drivers/gpu/drm/gma500/mdfld_intel_display.c
drivers/gpu/drm/gma500/oaktrail_crtc.c
drivers/gpu/drm/gma500/oaktrail_hdmi.c
drivers/gpu/drm/gma500/psb_intel_display.c
drivers/gpu/drm/gma500/psb_intel_drv.h
drivers/gpu/drm/gma500/psb_intel_lvds.c
drivers/gpu/drm/gma500/psb_intel_sdvo.c
drivers/gpu/drm/i2c/ch7006_drv.c
drivers/gpu/drm/i2c/ch7006_mode.c
drivers/gpu/drm/i2c/ch7006_priv.h
drivers/gpu/drm/i2c/sil164_drv.c
drivers/gpu/drm/i915/dvo.h
drivers/gpu/drm/i915/intel_crt.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_dvo.c
drivers/gpu/drm/i915/intel_hdmi.c
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/i915/intel_sdvo.c
drivers/gpu/drm/i915/intel_tv.c
drivers/gpu/drm/mgag200/mgag200_mode.c
drivers/gpu/drm/nouveau/nv04_crtc.c
drivers/gpu/drm/nouveau/nv04_dac.c
drivers/gpu/drm/nouveau/nv04_dfp.c
drivers/gpu/drm/nouveau/nv17_tv.c
drivers/gpu/drm/nouveau/nv50_crtc.c
drivers/gpu/drm/nouveau/nv50_dac.c
drivers/gpu/drm/nouveau/nv50_sor.c
drivers/gpu/drm/nouveau/nvd0_display.c
drivers/gpu/drm/radeon/atombios_crtc.c
drivers/gpu/drm/radeon/atombios_dp.c
drivers/gpu/drm/radeon/atombios_encoders.c
drivers/gpu/drm/radeon/radeon_display.c
drivers/gpu/drm/radeon/radeon_legacy_crtc.c
drivers/gpu/drm/radeon/radeon_legacy_encoders.c
drivers/gpu/drm/radeon/radeon_mode.h
drivers/gpu/drm/udl/udl_encoder.c
drivers/gpu/drm/udl/udl_modeset.c
drivers/staging/omapdrm/omap_crtc.c
drivers/staging/omapdrm/omap_encoder.c
include/drm/drm_crtc_helper.h
include/drm/drm_encoder_slave.h

index 65f9d231af142875882bbb287f87836842f381fa..7282c081fb53000397346d6c34879c06f940a4bd 100644 (file)
@@ -460,8 +460,8 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode)
 }
 
 static bool ast_crtc_mode_fixup(struct drm_crtc *crtc,
-                                 struct drm_display_mode *mode,
-                                 struct drm_display_mode *adjusted_mode)
+                               const struct drm_display_mode *mode,
+                               struct drm_display_mode *adjusted_mode)
 {
        return true;
 }
@@ -680,7 +680,7 @@ static void ast_encoder_dpms(struct drm_encoder *encoder, int mode)
 }
 
 static bool ast_mode_fixup(struct drm_encoder *encoder,
-                          struct drm_display_mode *mode,
+                          const struct drm_display_mode *mode,
                           struct drm_display_mode *adjusted_mode)
 {
        return true;
index 100f6308c5099bf1156312bd6190fdf395f7eb28..a44d31aa4e3c649bf53d5d4507a2ba2bceb0c96b 100644 (file)
@@ -97,7 +97,7 @@ static void cirrus_crtc_dpms(struct drm_crtc *crtc, int mode)
  * to just pass that straight through, so this does nothing
  */
 static bool cirrus_crtc_mode_fixup(struct drm_crtc *crtc,
-                                  struct drm_display_mode *mode,
+                                  const struct drm_display_mode *mode,
                                   struct drm_display_mode *adjusted_mode)
 {
        return true;
@@ -429,8 +429,8 @@ void cirrus_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
 
 
 static bool cirrus_encoder_mode_fixup(struct drm_encoder *encoder,
-                                 struct drm_display_mode *mode,
-                                 struct drm_display_mode *adjusted_mode)
+                                     const struct drm_display_mode *mode,
+                                     struct drm_display_mode *adjusted_mode)
 {
        return true;
 }
index 4afb625128d787bc5824f3737c92f9885f38b3bb..32a34c85899bb08aa0cf95d492830af66af6041c 100644 (file)
@@ -237,7 +237,7 @@ static void exynos_drm_crtc_commit(struct drm_crtc *crtc)
 
 static bool
 exynos_drm_crtc_mode_fixup(struct drm_crtc *crtc,
-                           struct drm_display_mode *mode,
+                           const struct drm_display_mode *mode,
                            struct drm_display_mode *adjusted_mode)
 {
        DRM_DEBUG_KMS("%s\n", __FILE__);
index c82c90c443e724436dfc2efe456ce052d4f6be9e..277653d5fda0704dcbad615b1ec1d64f7bedc5f7 100644 (file)
@@ -174,7 +174,7 @@ struct exynos_drm_manager_ops {
        void (*apply)(struct device *subdrv_dev);
        void (*mode_fixup)(struct device *subdrv_dev,
                                struct drm_connector *connector,
-                               struct drm_display_mode *mode,
+                               const struct drm_display_mode *mode,
                                struct drm_display_mode *adjusted_mode);
        void (*mode_set)(struct device *subdrv_dev, void *mode);
        void (*get_max_resol)(struct device *subdrv_dev, unsigned int *width,
index 23d5ad379f86743a1be36effb214d43f0ff17456..4a13a747f5d4930d06d495503190ee80ea4d532d 100644 (file)
@@ -108,7 +108,7 @@ static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode)
 
 static bool
 exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder,
-                              struct drm_display_mode *mode,
+                              const struct drm_display_mode *mode,
                               struct drm_display_mode *adjusted_mode)
 {
        struct drm_device *dev = encoder->dev;
index 5d9d2c2f8f3f63a90c6b6c2901bcd7e0d390795d..8ffcdf8b9e223ffdfe7552aa1d57b4334cba19cc 100644 (file)
@@ -142,7 +142,7 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)
 
 static void drm_hdmi_mode_fixup(struct device *subdrv_dev,
                                struct drm_connector *connector,
-                               struct drm_display_mode *mode,
+                               const struct drm_display_mode *mode,
                                struct drm_display_mode *adjusted_mode)
 {
        struct drm_hdmi_context *ctx = to_context(subdrv_dev);
index bd8126996e527dc30c19323efe47b7e1bddd61cb..a91c42088e42f528d91d7216ac9e912e8a4c35ab 100644 (file)
@@ -51,7 +51,7 @@ struct exynos_hdmi_ops {
 
        /* manager */
        void (*mode_fixup)(void *ctx, struct drm_connector *connector,
-                               struct drm_display_mode *mode,
+                               const struct drm_display_mode *mode,
                                struct drm_display_mode *adjusted_mode);
        void (*mode_set)(void *ctx, void *mode);
        void (*get_max_resol)(void *ctx, unsigned int *width,
index a137e9e39a33baa89e7bf33203b87a9c47f8d3c6..066bde3f19c4fb97642b178c27b072519a4c1b10 100644 (file)
@@ -1940,7 +1940,7 @@ static void hdmi_conf_apply(struct hdmi_context *hdata)
 }
 
 static void hdmi_mode_fixup(void *ctx, struct drm_connector *connector,
-                               struct drm_display_mode *mode,
+                               const struct drm_display_mode *mode,
                                struct drm_display_mode *adjusted_mode)
 {
        struct drm_display_mode *m;
index 187422018601354e656e626ac1198f731aa94923..8c175345d85c8fca1b88703d019e4a90717900a7 100644 (file)
@@ -82,7 +82,7 @@ static int cdv_intel_crt_mode_valid(struct drm_connector *connector,
 }
 
 static bool cdv_intel_crt_mode_fixup(struct drm_encoder *encoder,
-                                struct drm_display_mode *mode,
+                                const struct drm_display_mode *mode,
                                 struct drm_display_mode *adjusted_mode)
 {
        return true;
index c3e9a0f701df4fe56d1b427419db3492c839ada0..a68509ba22a8ae705421307e17c6a9c13d08331c 100644 (file)
@@ -913,7 +913,7 @@ static void cdv_intel_crtc_commit(struct drm_crtc *crtc)
 }
 
 static bool cdv_intel_crtc_mode_fixup(struct drm_crtc *crtc,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 {
        return true;
index 88b59d4a7b7fceb11bda72d60b52ad662525e11b..a86f87b9ddde8cc1595c3980263a1261c8aefc4b 100644 (file)
@@ -90,7 +90,7 @@ static void cdv_hdmi_mode_set(struct drm_encoder *encoder,
 }
 
 static bool cdv_hdmi_mode_fixup(struct drm_encoder *encoder,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 {
        return true;
index ff5b58eb878c9f60c6a6c11229429386fdbbd462..c7f9468b74ba8d5fab7b5cc6d1066dca10a97d8f 100644 (file)
@@ -270,7 +270,7 @@ static int cdv_intel_lvds_mode_valid(struct drm_connector *connector,
 }
 
 static bool cdv_intel_lvds_mode_fixup(struct drm_encoder *encoder,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 {
        struct drm_device *dev = encoder->dev;
index b34ff097b97936a0017b348517e25466f609c270..d4813e03f5ee687a6f4f5c2566e21d8e281907bc 100644 (file)
@@ -684,7 +684,7 @@ void mdfld_dsi_dpi_dpms(struct drm_encoder *encoder, int mode)
 }
 
 bool mdfld_dsi_dpi_mode_fixup(struct drm_encoder *encoder,
-                                    struct drm_display_mode *mode,
+                                    const struct drm_display_mode *mode,
                                     struct drm_display_mode *adjusted_mode)
 {
        struct mdfld_dsi_encoder *dsi_encoder = mdfld_dsi_encoder(encoder);
index 6f762478b959c1f00d7ba76d62185c13b92e29b4..2b40663e16964dba0a038e3a55493bc137034616 100644 (file)
@@ -65,7 +65,7 @@ extern struct mdfld_dsi_encoder *mdfld_dsi_dpi_init(struct drm_device *dev,
 /* MDFLD DPI helper functions */
 extern void mdfld_dsi_dpi_dpms(struct drm_encoder *encoder, int mode);
 extern bool mdfld_dsi_dpi_mode_fixup(struct drm_encoder *encoder,
-                               struct drm_display_mode *mode,
+                               const struct drm_display_mode *mode,
                                struct drm_display_mode *adjusted_mode);
 extern void mdfld_dsi_dpi_prepare(struct drm_encoder *encoder);
 extern void mdfld_dsi_dpi_commit(struct drm_encoder *encoder);
index 3f3cd619c79f87895243c8885c52fe7a066ce82f..dec6a9aea3c62eddb6c65e09aa33032d73e95f23 100644 (file)
@@ -117,7 +117,7 @@ static void psb_intel_crtc_commit(struct drm_crtc *crtc)
 }
 
 static bool psb_intel_crtc_mode_fixup(struct drm_crtc *crtc,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 {
        return true;
index f821c835ca907aec23e5b6a4a1e96f9fe25d8426..cdafd2acc72f7f28c0698b1d567c74d1664334fe 100644 (file)
@@ -487,7 +487,7 @@ oaktrail_crtc_mode_set_exit:
 }
 
 static bool oaktrail_crtc_mode_fixup(struct drm_crtc *crtc,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 {
        return true;
index c10899c953b9f9d9fb7ef84bb17335465c032cea..2eb3dc4e9c9b03186c2734a5818aacec70892f47 100644 (file)
@@ -191,7 +191,7 @@ static int oaktrail_hdmi_mode_valid(struct drm_connector *connector,
 }
 
 static bool oaktrail_hdmi_mode_fixup(struct drm_encoder *encoder,
-                                struct drm_display_mode *mode,
+                                const struct drm_display_mode *mode,
                                 struct drm_display_mode *adjusted_mode)
 {
        return true;
index 36c3c99612f6e04715e249ecfb33c11ee62998bb..30dc22a7156ce88446d1a11ff2d484c2581c82e6 100644 (file)
@@ -543,7 +543,7 @@ void psb_intel_encoder_destroy(struct drm_encoder *encoder)
 }
 
 static bool psb_intel_crtc_mode_fixup(struct drm_crtc *crtc,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 {
        return true;
index 2515f83248cb8d62d9fe914b08ea5734d1bb50c3..ebe1a28f60e1502240c798a0eccdb4a6b799c800 100644 (file)
@@ -268,7 +268,7 @@ extern struct drm_framebuffer *psb_intel_framebuffer_create(struct drm_device
                                                        *mode_cmd,
                                                        void *mm_private);
 extern bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder,
-                                     struct drm_display_mode *mode,
+                                     const struct drm_display_mode *mode,
                                      struct drm_display_mode *adjusted_mode);
 extern int psb_intel_lvds_mode_valid(struct drm_connector *connector,
                                     struct drm_display_mode *mode);
index c83f5b5d1057edea5d419c3996dc38d5441fcc14..37adc9edf9744ec44e779503eaefc336e34013ca 100644 (file)
@@ -375,7 +375,7 @@ int psb_intel_lvds_mode_valid(struct drm_connector *connector,
 }
 
 bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 {
        struct drm_device *dev = encoder->dev;
index d39b15be76496362570ba6fa4b71eefc9bda883d..0466c7b985f849bba2b7adf6faa7d022e4a19f88 100644 (file)
@@ -901,7 +901,7 @@ static bool psb_intel_sdvo_set_tv_format(struct psb_intel_sdvo *psb_intel_sdvo)
 
 static bool
 psb_intel_sdvo_set_output_timings_from_mode(struct psb_intel_sdvo *psb_intel_sdvo,
-                                       struct drm_display_mode *mode)
+                                       const struct drm_display_mode *mode)
 {
        struct psb_intel_sdvo_dtd output_dtd;
 
@@ -918,7 +918,7 @@ psb_intel_sdvo_set_output_timings_from_mode(struct psb_intel_sdvo *psb_intel_sdv
 
 static bool
 psb_intel_sdvo_set_input_timings_for_mode(struct psb_intel_sdvo *psb_intel_sdvo,
-                                       struct drm_display_mode *mode,
+                                       const struct drm_display_mode *mode,
                                        struct drm_display_mode *adjusted_mode)
 {
        /* Reset the input timing to the screen. Assume always input 0. */
@@ -942,7 +942,7 @@ psb_intel_sdvo_set_input_timings_for_mode(struct psb_intel_sdvo *psb_intel_sdvo,
 }
 
 static bool psb_intel_sdvo_mode_fixup(struct drm_encoder *encoder,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 {
        struct psb_intel_sdvo *psb_intel_sdvo = to_psb_intel_sdvo(encoder);
index d3f2e87850107130e20561b2951bdf86e8aa35fc..36d952280c506d0e808fc924f9b15751862d5395 100644 (file)
@@ -88,7 +88,7 @@ static void ch7006_encoder_restore(struct drm_encoder *encoder)
 }
 
 static bool ch7006_encoder_mode_fixup(struct drm_encoder *encoder,
-                                     struct drm_display_mode *mode,
+                                     const struct drm_display_mode *mode,
                                      struct drm_display_mode *adjusted_mode)
 {
        struct ch7006_priv *priv = to_ch7006_priv(encoder);
index c860f24a5afc5281bccaf7ddcfccf6e50bb2dfea..9b83574141a63243ba232b5c1ab0da0c1874e68f 100644 (file)
@@ -172,7 +172,7 @@ struct ch7006_mode ch7006_modes[] = {
 };
 
 struct ch7006_mode *ch7006_lookup_mode(struct drm_encoder *encoder,
-                                      struct drm_display_mode *drm_mode)
+                                      const struct drm_display_mode *drm_mode)
 {
        struct ch7006_priv *priv = to_ch7006_priv(encoder);
        struct ch7006_mode *mode;
index 17667b7d57e78b130836751f03c27d0f138cc8e7..09599f4c0c9aff5dd532692ade74e0a82e169489 100644 (file)
@@ -111,7 +111,7 @@ extern struct ch7006_tv_norm_info ch7006_tv_norms[];
 extern struct ch7006_mode ch7006_modes[];
 
 struct ch7006_mode *ch7006_lookup_mode(struct drm_encoder *encoder,
-                                      struct drm_display_mode *drm_mode);
+                                      const struct drm_display_mode *drm_mode);
 
 void ch7006_setup_levels(struct drm_encoder *encoder);
 void ch7006_setup_subcarrier(struct drm_encoder *encoder);
index b7d45ab4ba699d12590ab74489ebf6f58ba25cfe..30b8ae5e5c4a228eb43e38f81021eaf3bc757171 100644 (file)
@@ -254,7 +254,7 @@ sil164_encoder_restore(struct drm_encoder *encoder)
 
 static bool
 sil164_encoder_mode_fixup(struct drm_encoder *encoder,
-                         struct drm_display_mode *mode,
+                         const struct drm_display_mode *mode,
                          struct drm_display_mode *adjusted_mode)
 {
        return true;
index 8c2ad014c47f0a550ec403c9a3231c5b57431499..58914691a77b83e6ab9a3569f813962a2a922ca0 100644 (file)
@@ -86,7 +86,7 @@ struct intel_dvo_dev_ops {
         * buses with clock limitations.
         */
        bool (*mode_fixup)(struct intel_dvo_device *dvo,
-                          struct drm_display_mode *mode,
+                          const struct drm_display_mode *mode,
                           struct drm_display_mode *adjusted_mode);
 
        /*
index 61d55d3141c7bbb9e0ecf00a085872e54fcfbc88..48e3b76e0ab2a046b8ab74d04a32aad84ecfcce3 100644 (file)
@@ -132,7 +132,7 @@ static int intel_crt_mode_valid(struct drm_connector *connector,
 }
 
 static bool intel_crt_mode_fixup(struct drm_encoder *encoder,
-                                struct drm_display_mode *mode,
+                                const struct drm_display_mode *mode,
                                 struct drm_display_mode *adjusted_mode)
 {
        return true;
index 95817c4edbe95e4816decfd49a773f8226094dc0..2bc1505132c3cf5a7559fde008dfe8a0a0455356 100644 (file)
@@ -703,7 +703,8 @@ intel_dp_i2c_init(struct intel_dp *intel_dp,
 }
 
 static bool
-intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
+intel_dp_mode_fixup(struct drm_encoder *encoder,
+                   const struct drm_display_mode *mode,
                    struct drm_display_mode *adjusted_mode)
 {
        struct drm_device *dev = encoder->dev;
index 60ba50b956f22c9478318d4fa3a54e20de86b179..36c542e5036b915e40eb2444608835ade5458027 100644 (file)
@@ -136,7 +136,7 @@ static int intel_dvo_mode_valid(struct drm_connector *connector,
 }
 
 static bool intel_dvo_mode_fixup(struct drm_encoder *encoder,
-                                struct drm_display_mode *mode,
+                                const struct drm_display_mode *mode,
                                 struct drm_display_mode *adjusted_mode)
 {
        struct intel_dvo *intel_dvo = enc_to_intel_dvo(encoder);
index 5b2c88ca6edbee20f094cf6204f98fe49f6b6389..98f602427eb8cb8fe9a8cc975ff1b4128ce68ae6 100644 (file)
@@ -685,7 +685,7 @@ static int intel_hdmi_mode_valid(struct drm_connector *connector,
 }
 
 static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 {
        return true;
index 9b706a540d70f779a56021b5d2582db8ec2a9975..49f09a8b05e91c47b339e3a71933e1b892f0b4f9 100644 (file)
@@ -229,7 +229,7 @@ static inline u32 panel_fitter_scaling(u32 source, u32 target)
 }
 
 static bool intel_lvds_mode_fixup(struct drm_encoder *encoder,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 {
        struct drm_device *dev = encoder->dev;
index 2f5106a488c511be29f63d482ce0828ae05187bb..26a6a4d0d0788b536de65f3b4ca6261768115179 100644 (file)
@@ -935,7 +935,7 @@ static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo)
 
 static bool
 intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,
-                                       struct drm_display_mode *mode)
+                                       const struct drm_display_mode *mode)
 {
        struct intel_sdvo_dtd output_dtd;
 
@@ -954,7 +954,7 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,
  * Unfortunately we have to set up the full output mode to do that. */
 static bool
 intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,
-                                   struct drm_display_mode *mode,
+                                   const struct drm_display_mode *mode,
                                    struct drm_display_mode *adjusted_mode)
 {
        struct intel_sdvo_dtd input_dtd;
@@ -979,7 +979,7 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,
 }
 
 static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 {
        struct intel_sdvo *intel_sdvo = to_intel_sdvo(encoder);
index 3b413c9042c03629879c3be0fc21497232bb9a92..befce6c4970496a821e2a84b8b4e6bda29c04f9d 100644 (file)
@@ -891,7 +891,8 @@ intel_tv_mode_valid(struct drm_connector *connector,
 
 
 static bool
-intel_tv_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
+intel_tv_mode_fixup(struct drm_encoder *encoder,
+                   const struct drm_display_mode *mode,
                    struct drm_display_mode *adjusted_mode)
 {
        struct drm_device *dev = encoder->dev;
index d303061b251e600569b43c56fa9c1d61cf89ddea..a4d7c500c97b7f43d049a8ed8cc6bca59b20c100 100644 (file)
@@ -78,8 +78,8 @@ static inline void mga_wait_busy(struct mga_device *mdev)
  * to just pass that straight through, so this does nothing
  */
 static bool mga_crtc_mode_fixup(struct drm_crtc *crtc,
-                                  struct drm_display_mode *mode,
-                                  struct drm_display_mode *adjusted_mode)
+                               const struct drm_display_mode *mode,
+                               struct drm_display_mode *adjusted_mode)
 {
        return true;
 }
@@ -1322,8 +1322,8 @@ void mga_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
  * to handle any encoder-specific limitations
  */
 static bool mga_encoder_mode_fixup(struct drm_encoder *encoder,
-                                 struct drm_display_mode *mode,
-                                 struct drm_display_mode *adjusted_mode)
+                                  const struct drm_display_mode *mode,
+                                  struct drm_display_mode *adjusted_mode)
 {
        return true;
 }
index 4c31c63e5528be6e6164d68e07f179cec342121d..43accc11102f551e85882db7d150cf64e93ce895 100644 (file)
@@ -215,7 +215,7 @@ nv_crtc_dpms(struct drm_crtc *crtc, int mode)
 }
 
 static bool
-nv_crtc_mode_fixup(struct drm_crtc *crtc, struct drm_display_mode *mode,
+nv_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode,
                   struct drm_display_mode *adjusted_mode)
 {
        return true;
index 8300266ffaea2722ea5009510e70d211caf84a17..38f19479417c8948c3c684814fdacb9c645b1c8f 100644 (file)
@@ -332,7 +332,7 @@ nv17_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector)
 }
 
 static bool nv04_dac_mode_fixup(struct drm_encoder *encoder,
-                               struct drm_display_mode *mode,
+                               const struct drm_display_mode *mode,
                                struct drm_display_mode *adjusted_mode)
 {
        if (nv04_dac_in_use(encoder))
index 2258746016f8e82919b23d2ac0897c8bb02a9da7..c2675623b7cdf16af4e70ff93f8d959c208cfb47 100644 (file)
@@ -179,7 +179,7 @@ static struct drm_encoder *get_tmds_slave(struct drm_encoder *encoder)
 }
 
 static bool nv04_dfp_mode_fixup(struct drm_encoder *encoder,
-                               struct drm_display_mode *mode,
+                               const struct drm_display_mode *mode,
                                struct drm_display_mode *adjusted_mode)
 {
        struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
index 696d7e7dc2a07facbfed838a637600ad5c15d880..67be5db021f5579c1e31cefe9feb802920e19c51 100644 (file)
@@ -338,7 +338,7 @@ static int nv17_tv_mode_valid(struct drm_encoder *encoder,
 }
 
 static bool nv17_tv_mode_fixup(struct drm_encoder *encoder,
-                              struct drm_display_mode *mode,
+                              const struct drm_display_mode *mode,
                               struct drm_display_mode *adjusted_mode)
 {
        struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder);
index 97a477b3d52d8d41ecff7b560df389496b510a9d..22cebd5dd694ecd584a3243bc45a21064a9293e7 100644 (file)
@@ -527,7 +527,7 @@ nv50_crtc_commit(struct drm_crtc *crtc)
 }
 
 static bool
-nv50_crtc_mode_fixup(struct drm_crtc *crtc, struct drm_display_mode *mode,
+nv50_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode,
                     struct drm_display_mode *adjusted_mode)
 {
        return true;
index eb216a446b894a90a59b0d100fc64963d2f0d80d..2c36a6b92c53b554e8b98ca58321902f197991bd 100644 (file)
@@ -175,7 +175,8 @@ nv50_dac_restore(struct drm_encoder *encoder)
 }
 
 static bool
-nv50_dac_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
+nv50_dac_mode_fixup(struct drm_encoder *encoder,
+                   const struct drm_display_mode *mode,
                    struct drm_display_mode *adjusted_mode)
 {
        struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
index a9514eaa74c15f1d5a72e0e9a8937d703a14a125..93240bde891b11c6fff2fa857121a4ce7934d1ad 100644 (file)
@@ -327,7 +327,8 @@ nv50_sor_restore(struct drm_encoder *encoder)
 }
 
 static bool
-nv50_sor_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
+nv50_sor_mode_fixup(struct drm_encoder *encoder,
+                   const struct drm_display_mode *mode,
                    struct drm_display_mode *adjusted_mode)
 {
        struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
index c486d3ce3c2cf4eb9ec6e588b0bd7bc734b20a9f..d0d60e1e7f95bf74c7209f81f6cd205edd8d71a5 100644 (file)
@@ -607,7 +607,7 @@ nvd0_crtc_commit(struct drm_crtc *crtc)
 }
 
 static bool
-nvd0_crtc_mode_fixup(struct drm_crtc *crtc, struct drm_display_mode *mode,
+nvd0_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode,
                     struct drm_display_mode *adjusted_mode)
 {
        return true;
@@ -938,7 +938,8 @@ nvd0_dac_dpms(struct drm_encoder *encoder, int mode)
 }
 
 static bool
-nvd0_dac_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
+nvd0_dac_mode_fixup(struct drm_encoder *encoder,
+                   const struct drm_display_mode *mode,
                    struct drm_display_mode *adjusted_mode)
 {
        struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
@@ -1377,7 +1378,8 @@ nvd0_sor_dpms(struct drm_encoder *encoder, int mode)
 }
 
 static bool
-nvd0_sor_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
+nvd0_sor_mode_fixup(struct drm_encoder *encoder,
+                   const struct drm_display_mode *mode,
                    struct drm_display_mode *adjusted_mode)
 {
        struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
index a4664e015a6f1e76b5ea4bfd66255c5d787be313..9e6f76fec52789b4931e4e1098b9b52df765c270 100644 (file)
@@ -1624,7 +1624,7 @@ int atombios_crtc_mode_set(struct drm_crtc *crtc,
 }
 
 static bool atombios_crtc_mode_fixup(struct drm_crtc *crtc,
-                                    struct drm_display_mode *mode,
+                                    const struct drm_display_mode *mode,
                                     struct drm_display_mode *adjusted_mode)
 {
        if (!radeon_crtc_scaling_mode_fixup(crtc, mode, adjusted_mode))
index 5131b3b0f7d23d25cb9ab7bbb263ec5233da85b6..0355536f61e437dc3e7e2795be4e8b34cbb85d69 100644 (file)
@@ -608,7 +608,7 @@ int radeon_dp_get_panel_mode(struct drm_encoder *encoder,
 }
 
 void radeon_dp_set_link_config(struct drm_connector *connector,
-                              struct drm_display_mode *mode)
+                              const struct drm_display_mode *mode)
 {
        struct radeon_connector *radeon_connector = to_radeon_connector(connector);
        struct radeon_connector_atom_dig *dig_connector;
index 486ccdf4aacda9b66681346e744b463bea046089..7dfc62fae6a62f8ddb222a6270957149d630b619 100644 (file)
@@ -58,7 +58,7 @@ static inline bool radeon_encoder_is_digital(struct drm_encoder *encoder)
 }
 
 static bool radeon_atom_mode_fixup(struct drm_encoder *encoder,
-                                  struct drm_display_mode *mode,
+                                  const struct drm_display_mode *mode,
                                   struct drm_display_mode *adjusted_mode)
 {
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
@@ -2234,7 +2234,7 @@ radeon_atom_ext_dpms(struct drm_encoder *encoder, int mode)
 }
 
 static bool radeon_atom_ext_mode_fixup(struct drm_encoder *encoder,
-                                      struct drm_display_mode *mode,
+                                      const struct drm_display_mode *mode,
                                       struct drm_display_mode *adjusted_mode)
 {
        return true;
index 64a008d14493f16410342084bf0b2c7e9441e0ae..7ddef8f30d0ed96459f7c87d52eb7136a677c9f8 100644 (file)
@@ -1401,7 +1401,7 @@ void radeon_modeset_fini(struct radeon_device *rdev)
        radeon_i2c_fini(rdev);
 }
 
-static bool is_hdtv_mode(struct drm_display_mode *mode)
+static bool is_hdtv_mode(const struct drm_display_mode *mode)
 {
        /* try and guess if this is a tv or a monitor */
        if ((mode->vdisplay == 480 && mode->hdisplay == 720) || /* 480p */
@@ -1414,7 +1414,7 @@ static bool is_hdtv_mode(struct drm_display_mode *mode)
 }
 
 bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
-                               struct drm_display_mode *mode,
+                               const struct drm_display_mode *mode,
                                struct drm_display_mode *adjusted_mode)
 {
        struct drm_device *dev = crtc->dev;
index 210317c7045ef11daf4565f66d471fa04043dbbf..d5fd615897ec75ad13d8b1b1e7ddd1e85a1a859b 100644 (file)
@@ -990,7 +990,7 @@ static void radeon_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
 }
 
 static bool radeon_crtc_mode_fixup(struct drm_crtc *crtc,
-                                  struct drm_display_mode *mode,
+                                  const struct drm_display_mode *mode,
                                   struct drm_display_mode *adjusted_mode)
 {
        if (!radeon_crtc_scaling_mode_fixup(crtc, mode, adjusted_mode))
index a0c82229e8f07203b2fd0bb41a928d637e521f65..670e9910f869ed0e9dee41c8bc05e332f7dd9408 100644 (file)
@@ -244,7 +244,7 @@ static void radeon_legacy_lvds_mode_set(struct drm_encoder *encoder,
 }
 
 static bool radeon_legacy_mode_fixup(struct drm_encoder *encoder,
-                                    struct drm_display_mode *mode,
+                                    const struct drm_display_mode *mode,
                                     struct drm_display_mode *adjusted_mode)
 {
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
index 5b10ffd7bb2fbae7519010749f9bf2ca67630537..f380d59c5763425f0fc0bd79a8733d15bcfdca33 100644 (file)
@@ -488,7 +488,7 @@ extern void radeon_connector_hotplug(struct drm_connector *connector);
 extern int radeon_dp_mode_valid_helper(struct drm_connector *connector,
                                       struct drm_display_mode *mode);
 extern void radeon_dp_set_link_config(struct drm_connector *connector,
-                                     struct drm_display_mode *mode);
+                                     const struct drm_display_mode *mode);
 extern void radeon_dp_link_train(struct drm_encoder *encoder,
                                 struct drm_connector *connector);
 extern bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector);
@@ -678,7 +678,7 @@ void radeon_enc_destroy(struct drm_encoder *encoder);
 void radeon_copy_fb(struct drm_device *dev, struct drm_gem_object *dst_obj);
 void radeon_combios_asic_init(struct drm_device *dev);
 bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
-                                       struct drm_display_mode *mode,
+                                       const struct drm_display_mode *mode,
                                        struct drm_display_mode *adjusted_mode);
 void radeon_panel_mode_fixup(struct drm_encoder *encoder,
                             struct drm_display_mode *adjusted_mode);
index 56e75f0f1df5979bea1c6a9a31d9e813435e36bb..0731ab2e6c06e1c4c6d7369b9648031f3f36805e 100644 (file)
@@ -27,7 +27,7 @@ static void udl_encoder_disable(struct drm_encoder *encoder)
 }
 
 static bool udl_mode_fixup(struct drm_encoder *encoder,
-                          struct drm_display_mode *mode,
+                          const struct drm_display_mode *mode,
                           struct drm_display_mode *adjusted_mode)
 {
        return true;
index 0d7816789da1460625491c9104d82e1d80fb07d7..ac2d717714ce63cdf2191910cc9010ffe8772ce6 100644 (file)
@@ -251,7 +251,7 @@ static void udl_crtc_dpms(struct drm_crtc *crtc, int mode)
 }
 
 static bool udl_crtc_mode_fixup(struct drm_crtc *crtc,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 
 {
index 8b864afb40b6a9e531e883f5d7d3c393c74efadc..62e0022561bc51679961e83fd7f3045ced437958 100644 (file)
@@ -60,7 +60,7 @@ static void omap_crtc_dpms(struct drm_crtc *crtc, int mode)
 }
 
 static bool omap_crtc_mode_fixup(struct drm_crtc *crtc,
-               struct drm_display_mode *mode,
+               const struct drm_display_mode *mode,
                struct drm_display_mode *adjusted_mode)
 {
        return true;
index 06c52cb62d2f0e78666b13b02ba8c300031d3088..31c735d3921767cf681552f25a8e2280d8b182be 100644 (file)
@@ -48,7 +48,7 @@ static void omap_encoder_dpms(struct drm_encoder *encoder, int mode)
 }
 
 static bool omap_encoder_mode_fixup(struct drm_encoder *encoder,
-                                 struct drm_display_mode *mode,
+                                 const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
 {
        struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
index 7988e55c98d0623a5820ad65324bf6f8676c0569..e01cc80c9c30bf954c4839778b0a704f05aa222d 100644 (file)
@@ -62,7 +62,7 @@ struct drm_crtc_helper_funcs {
 
        /* Provider can fixup or change mode timings before modeset occurs */
        bool (*mode_fixup)(struct drm_crtc *crtc,
-                          struct drm_display_mode *mode,
+                          const struct drm_display_mode *mode,
                           struct drm_display_mode *adjusted_mode);
        /* Actually set the mode */
        int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode,
@@ -96,7 +96,7 @@ struct drm_encoder_helper_funcs {
        void (*restore)(struct drm_encoder *encoder);
 
        bool (*mode_fixup)(struct drm_encoder *encoder,
-                          struct drm_display_mode *mode,
+                          const struct drm_display_mode *mode,
                           struct drm_display_mode *adjusted_mode);
        void (*prepare)(struct drm_encoder *encoder);
        void (*commit)(struct drm_encoder *encoder);
index 2f65633d28a74e4c826fdda33e58793149220c54..7dc3852338053debc337c8ae732504f6a88a2c92 100644 (file)
@@ -54,7 +54,7 @@ struct drm_encoder_slave_funcs {
        void (*save)(struct drm_encoder *encoder);
        void (*restore)(struct drm_encoder *encoder);
        bool (*mode_fixup)(struct drm_encoder *encoder,
-                          struct drm_display_mode *mode,
+                          const struct drm_display_mode *mode,
                           struct drm_display_mode *adjusted_mode);
        int (*mode_valid)(struct drm_encoder *encoder,
                          struct drm_display_mode *mode);