drm: sti: clear all mixer control
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>
Thu, 4 Dec 2014 10:17:32 +0000 (11:17 +0100)
committerBenjamin Gaignard <benjamin.gaignard@linaro.org>
Thu, 11 Dec 2014 12:58:19 +0000 (13:58 +0100)
Make sure that mixer control register is correctly reset
before use it.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
drivers/gpu/drm/sti/sti_drm_crtc.c
drivers/gpu/drm/sti/sti_mixer.c
drivers/gpu/drm/sti/sti_mixer.h

index 36a1ad3c482319e288c539bcbf7dfbe27a72074d..d42c63f756ef45caeb6859b81f1acfda2a7bc579 100644 (file)
@@ -38,6 +38,8 @@ static void sti_drm_crtc_prepare(struct drm_crtc *crtc)
                if (clk_prepare_enable(compo->clk_compo_aux))
                        DRM_INFO("Failed to prepare/enable compo_aux clk\n");
        }
+
+       sti_mixer_clear_all_layers(mixer);
 }
 
 static void sti_drm_crtc_commit(struct drm_crtc *crtc)
index 79f369db9fb601cbeac3b2d93c0b4f28584a9237..6bcdf3f86d225ffcd8ff5fb088ae24a61bec5c13 100644 (file)
@@ -215,6 +215,15 @@ int sti_mixer_set_layer_status(struct sti_mixer *mixer,
        return 0;
 }
 
+void sti_mixer_clear_all_layers(struct sti_mixer *mixer)
+{
+       u32 val;
+
+       DRM_DEBUG_DRIVER("%s clear all layer\n", sti_mixer_to_str(mixer));
+       val = sti_mixer_reg_read(mixer, GAM_MIXER_CTL) & 0xFFFF0000;
+       sti_mixer_reg_write(mixer, GAM_MIXER_CTL, val);
+}
+
 void sti_mixer_set_matrix(struct sti_mixer *mixer)
 {
        unsigned int i;
index 874372102e5237dae960acfb27b8c5a2030929a0..750e1fd5a8ce5c60226206daa16c61a1bd80197e 100644 (file)
@@ -39,6 +39,7 @@ struct sti_mixer *sti_mixer_create(struct device *dev, int id,
 
 int sti_mixer_set_layer_status(struct sti_mixer *mixer,
                struct sti_layer *layer, bool status);
+void sti_mixer_clear_all_layers(struct sti_mixer *mixer);
 int sti_mixer_set_layer_depth(struct sti_mixer *mixer, struct sti_layer *layer);
 int sti_mixer_active_video_area(struct sti_mixer *mixer,
                struct drm_display_mode *mode);