aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/sti
diff options
context:
space:
mode:
authorFabien Dessenne <fabien.dessenne@st.com>2016-09-06 03:42:25 -0400
committerVincent Abriou <vincent.abriou@st.com>2016-09-20 05:32:06 -0400
commitffdbb82ca4e01b468871dc683e6c3ae169995f0a (patch)
tree487c25b7b58ae393d36633ed8b4eb078d089dbd8 /drivers/gpu/drm/sti
parentae2178503d4237047db4afb5888aa7c8e8b820fb (diff)
drm/sti: use vtg array instead of vtg_main/aux
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>
Diffstat (limited to 'drivers/gpu/drm/sti')
-rw-r--r--drivers/gpu/drm/sti/sti_compositor.c4
-rw-r--r--drivers/gpu/drm/sti/sti_compositor.h6
-rw-r--r--drivers/gpu/drm/sti/sti_crtc.c12
-rw-r--r--drivers/gpu/drm/sti/sti_gdp.c3
4 files changed, 10 insertions, 15 deletions
diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c
index f5cc5a0d89a3..ac160b01478f 100644
--- a/drivers/gpu/drm/sti/sti_compositor.c
+++ b/drivers/gpu/drm/sti/sti_compositor.c
@@ -268,12 +268,12 @@ static int sti_compositor_probe(struct platform_device *pdev)
268 268
269 vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 0); 269 vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 0);
270 if (vtg_np) 270 if (vtg_np)
271 compo->vtg_main = of_vtg_find(vtg_np); 271 compo->vtg[STI_MIXER_MAIN] = of_vtg_find(vtg_np);
272 of_node_put(vtg_np); 272 of_node_put(vtg_np);
273 273
274 vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 1); 274 vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 1);
275 if (vtg_np) 275 if (vtg_np)
276 compo->vtg_aux = of_vtg_find(vtg_np); 276 compo->vtg[STI_MIXER_AUX] = of_vtg_find(vtg_np);
277 of_node_put(vtg_np); 277 of_node_put(vtg_np);
278 278
279 platform_set_drvdata(pdev, compo); 279 platform_set_drvdata(pdev, compo);
diff --git a/drivers/gpu/drm/sti/sti_compositor.h b/drivers/gpu/drm/sti/sti_compositor.h
index 177c57b74006..c9e7e3bf183e 100644
--- a/drivers/gpu/drm/sti/sti_compositor.h
+++ b/drivers/gpu/drm/sti/sti_compositor.h
@@ -60,8 +60,7 @@ struct sti_compositor_data {
60 * @rst_aux: reset control of the aux path 60 * @rst_aux: reset control of the aux path
61 * @mixer: array of mixers 61 * @mixer: array of mixers
62 * @vid: array of vids 62 * @vid: array of vids
63 * @vtg_main: vtg for main data path 63 * @vtg: array of vtgs
64 * @vtg_aux: vtg for auxillary data path
65 * @vtg_vblank_nb: array of callbacks for VTG VSYNC notification 64 * @vtg_vblank_nb: array of callbacks for VTG VSYNC notification
66 */ 65 */
67struct sti_compositor { 66struct sti_compositor {
@@ -76,8 +75,7 @@ struct sti_compositor {
76 struct reset_control *rst_aux; 75 struct reset_control *rst_aux;
77 struct sti_mixer *mixer[STI_MAX_MIXER]; 76 struct sti_mixer *mixer[STI_MAX_MIXER];
78 struct sti_vid *vid[STI_MAX_VID]; 77 struct sti_vid *vid[STI_MAX_VID];
79 struct sti_vtg *vtg_main; 78 struct sti_vtg *vtg[STI_MAX_MIXER];
80 struct sti_vtg *vtg_aux;
81 struct notifier_block vtg_vblank_nb[STI_MAX_MIXER]; 79 struct notifier_block vtg_vblank_nb[STI_MAX_MIXER];
82}; 80};
83 81
diff --git a/drivers/gpu/drm/sti/sti_crtc.c b/drivers/gpu/drm/sti/sti_crtc.c
index 2f41cbe03a38..96afe68cbdf7 100644
--- a/drivers/gpu/drm/sti/sti_crtc.c
+++ b/drivers/gpu/drm/sti/sti_crtc.c
@@ -86,8 +86,7 @@ sti_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode)
86 goto pix_error; 86 goto pix_error;
87 } 87 }
88 88
89 sti_vtg_set_config(mixer->id == STI_MIXER_MAIN ? 89 sti_vtg_set_config(compo->vtg[mixer->id], &crtc->mode);
90 compo->vtg_main : compo->vtg_aux, &crtc->mode);
91 90
92 if (sti_mixer_active_video_area(mixer, &crtc->mode)) { 91 if (sti_mixer_active_video_area(mixer, &crtc->mode)) {
93 DRM_ERROR("Can't set active video area\n"); 92 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)
297 struct sti_compositor *compo = dev_priv->compo; 296 struct sti_compositor *compo = dev_priv->compo;
298 struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb[pipe]; 297 struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb[pipe];
299 struct drm_crtc *crtc = &compo->mixer[pipe]->drm_crtc; 298 struct drm_crtc *crtc = &compo->mixer[pipe]->drm_crtc;
299 struct sti_vtg *vtg = compo->vtg[pipe];
300 300
301 DRM_DEBUG_DRIVER("\n"); 301 DRM_DEBUG_DRIVER("\n");
302 302
303 if (sti_vtg_register_client(pipe == STI_MIXER_MAIN ? 303 if (sti_vtg_register_client(vtg, vtg_vblank_nb, crtc)) {
304 compo->vtg_main : compo->vtg_aux,
305 vtg_vblank_nb, crtc)) {
306 DRM_ERROR("Cannot register VTG notifier\n"); 304 DRM_ERROR("Cannot register VTG notifier\n");
307 return -EINVAL; 305 return -EINVAL;
308 } 306 }
@@ -316,11 +314,11 @@ void sti_crtc_disable_vblank(struct drm_device *drm_dev, unsigned int pipe)
316 struct sti_compositor *compo = priv->compo; 314 struct sti_compositor *compo = priv->compo;
317 struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb[pipe]; 315 struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb[pipe];
318 struct drm_crtc *crtc = &compo->mixer[pipe]->drm_crtc; 316 struct drm_crtc *crtc = &compo->mixer[pipe]->drm_crtc;
317 struct sti_vtg *vtg = compo->vtg[pipe];
319 318
320 DRM_DEBUG_DRIVER("\n"); 319 DRM_DEBUG_DRIVER("\n");
321 320
322 if (sti_vtg_unregister_client(pipe == STI_MIXER_MAIN ? 321 if (sti_vtg_unregister_client(vtg, vtg_vblank_nb))
323 compo->vtg_main : compo->vtg_aux, vtg_vblank_nb))
324 DRM_DEBUG_DRIVER("Warning: cannot unregister VTG notifier\n"); 322 DRM_DEBUG_DRIVER("Warning: cannot unregister VTG notifier\n");
325 323
326 /* free the resources of the pending requests */ 324 /* free the resources of the pending requests */
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index 083c0aca57e2..5ba470b1517b 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -650,8 +650,7 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
650 650
651 if (!gdp->vtg) { 651 if (!gdp->vtg) {
652 /* Register gdp callback */ 652 /* Register gdp callback */
653 gdp->vtg = mixer->id == STI_MIXER_MAIN ? 653 gdp->vtg = compo->vtg[mixer->id];
654 compo->vtg_main : compo->vtg_aux;
655 if (sti_vtg_register_client(gdp->vtg, 654 if (sti_vtg_register_client(gdp->vtg,
656 &gdp->vtg_field_nb, crtc)) { 655 &gdp->vtg_field_nb, crtc)) {
657 DRM_ERROR("Cannot register VTG notifier\n"); 656 DRM_ERROR("Cannot register VTG notifier\n");