]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/sti: use vtg array instead of vtg_main/aux
authorFabien Dessenne <fabien.dessenne@st.com>
Tue, 6 Sep 2016 07:42:25 +0000 (09:42 +0200)
committerVincent Abriou <vincent.abriou@st.com>
Tue, 20 Sep 2016 09:32:06 +0000 (11:32 +0200)
This is more generic and more consistent with the other members of the
sti_compositor struct.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Vincent Abriou <vincent.abriou@st.com>
drivers/gpu/drm/sti/sti_compositor.c
drivers/gpu/drm/sti/sti_compositor.h
drivers/gpu/drm/sti/sti_crtc.c
drivers/gpu/drm/sti/sti_gdp.c

index f5cc5a0d89a3ccadb453728f557a1618d6eef19c..ac160b01478fda6e8f6086cb3e44fbf6e14da082 100644 (file)
@@ -268,12 +268,12 @@ static int sti_compositor_probe(struct platform_device *pdev)
 
        vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 0);
        if (vtg_np)
-               compo->vtg_main = of_vtg_find(vtg_np);
+               compo->vtg[STI_MIXER_MAIN] = of_vtg_find(vtg_np);
        of_node_put(vtg_np);
 
        vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 1);
        if (vtg_np)
-               compo->vtg_aux = of_vtg_find(vtg_np);
+               compo->vtg[STI_MIXER_AUX] = of_vtg_find(vtg_np);
        of_node_put(vtg_np);
 
        platform_set_drvdata(pdev, compo);
index 177c57b74006d15d14d88391a1a3292de936c029..c9e7e3bf183e5459994836a5066dcfb8ac1b607e 100644 (file)
@@ -60,8 +60,7 @@ struct sti_compositor_data {
  * @rst_aux: reset control of the aux path
  * @mixer: array of mixers
  * @vid: array of vids
- * @vtg_main: vtg for main data path
- * @vtg_aux: vtg for auxillary data path
+ * @vtg: array of vtgs
  * @vtg_vblank_nb: array of callbacks for VTG VSYNC notification
  */
 struct sti_compositor {
@@ -76,8 +75,7 @@ struct sti_compositor {
        struct reset_control *rst_aux;
        struct sti_mixer *mixer[STI_MAX_MIXER];
        struct sti_vid *vid[STI_MAX_VID];
-       struct sti_vtg *vtg_main;
-       struct sti_vtg *vtg_aux;
+       struct sti_vtg *vtg[STI_MAX_MIXER];
        struct notifier_block vtg_vblank_nb[STI_MAX_MIXER];
 };
 
index 2f41cbe03a3827735b3adc773f1166831cb11558..96afe68cbdf7d34e5b66cdcbbe716e743889f8d1 100644 (file)
@@ -86,8 +86,7 @@ sti_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode)
                goto pix_error;
        }
 
-       sti_vtg_set_config(mixer->id == STI_MIXER_MAIN ?
-                       compo->vtg_main : compo->vtg_aux, &crtc->mode);
+       sti_vtg_set_config(compo->vtg[mixer->id], &crtc->mode);
 
        if (sti_mixer_active_video_area(mixer, &crtc->mode)) {
                DRM_ERROR("Can't set active video area\n");
@@ -297,12 +296,11 @@ int sti_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe)
        struct sti_compositor *compo = dev_priv->compo;
        struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb[pipe];
        struct drm_crtc *crtc = &compo->mixer[pipe]->drm_crtc;
+       struct sti_vtg *vtg = compo->vtg[pipe];
 
        DRM_DEBUG_DRIVER("\n");
 
-       if (sti_vtg_register_client(pipe == STI_MIXER_MAIN ?
-                       compo->vtg_main : compo->vtg_aux,
-                       vtg_vblank_nb, crtc)) {
+       if (sti_vtg_register_client(vtg, vtg_vblank_nb, crtc)) {
                DRM_ERROR("Cannot register VTG notifier\n");
                return -EINVAL;
        }
@@ -316,11 +314,11 @@ void sti_crtc_disable_vblank(struct drm_device *drm_dev, unsigned int pipe)
        struct sti_compositor *compo = priv->compo;
        struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb[pipe];
        struct drm_crtc *crtc = &compo->mixer[pipe]->drm_crtc;
+       struct sti_vtg *vtg = compo->vtg[pipe];
 
        DRM_DEBUG_DRIVER("\n");
 
-       if (sti_vtg_unregister_client(pipe == STI_MIXER_MAIN ?
-                       compo->vtg_main : compo->vtg_aux, vtg_vblank_nb))
+       if (sti_vtg_unregister_client(vtg, vtg_vblank_nb))
                DRM_DEBUG_DRIVER("Warning: cannot unregister VTG notifier\n");
 
        /* free the resources of the pending requests */
index 083c0aca57e2be1432290e79ef9db92eac178b42..5ba470b1517b5e09aaf921ed1a3d5b684eaeb173 100644 (file)
@@ -650,8 +650,7 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
 
        if (!gdp->vtg) {
                /* Register gdp callback */
-               gdp->vtg = mixer->id == STI_MIXER_MAIN ?
-                                       compo->vtg_main : compo->vtg_aux;
+               gdp->vtg = compo->vtg[mixer->id];
                if (sti_vtg_register_client(gdp->vtg,
                                            &gdp->vtg_field_nb, crtc)) {
                        DRM_ERROR("Cannot register VTG notifier\n");