Lines Matching +full:mixer +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0
27 struct sti_mixer *mixer = to_sti_mixer(crtc); in sti_crtc_atomic_enable() local
31 mixer->status = STI_MIXER_READY; in sti_crtc_atomic_enable()
39 struct sti_mixer *mixer = to_sti_mixer(crtc); in sti_crtc_atomic_disable() local
43 mixer->status = STI_MIXER_DISABLING; in sti_crtc_atomic_disable()
49 sti_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode) in sti_crtc_mode_set() argument
51 struct sti_mixer *mixer = to_sti_mixer(crtc); in sti_crtc_mode_set() local
52 struct device *dev = mixer->dev; in sti_crtc_mode_set()
55 int rate = mode->clock * 1000; in sti_crtc_mode_set()
57 DRM_DEBUG_KMS("CRTC:%d (%s) mode: (%s)\n", in sti_crtc_mode_set()
58 crtc->base.id, sti_mixer_to_str(mixer), mode->name); in sti_crtc_mode_set()
60 DRM_DEBUG_KMS(DRM_MODE_FMT "\n", DRM_MODE_ARG(mode)); in sti_crtc_mode_set()
62 if (mixer->id == STI_MIXER_MAIN) { in sti_crtc_mode_set()
63 compo_clk = compo->clk_compo_main; in sti_crtc_mode_set()
64 pix_clk = compo->clk_pix_main; in sti_crtc_mode_set()
66 compo_clk = compo->clk_compo_aux; in sti_crtc_mode_set()
67 pix_clk = compo->clk_pix_aux; in sti_crtc_mode_set()
86 sti_vtg_set_config(compo->vtg[mixer->id], &crtc->mode); in sti_crtc_mode_set()
88 if (sti_mixer_active_video_area(mixer, &crtc->mode)) { in sti_crtc_mode_set()
100 return -EINVAL; in sti_crtc_mode_set()
105 struct sti_mixer *mixer = to_sti_mixer(crtc); in sti_crtc_disable() local
106 struct device *dev = mixer->dev; in sti_crtc_disable()
109 DRM_DEBUG_KMS("CRTC:%d (%s)\n", crtc->base.id, sti_mixer_to_str(mixer)); in sti_crtc_disable()
112 sti_mixer_set_background_status(mixer, false); in sti_crtc_disable()
117 if (mixer->id == STI_MIXER_MAIN) { in sti_crtc_disable()
118 clk_disable_unprepare(compo->clk_pix_main); in sti_crtc_disable()
119 clk_disable_unprepare(compo->clk_compo_main); in sti_crtc_disable()
121 clk_disable_unprepare(compo->clk_pix_aux); in sti_crtc_disable()
122 clk_disable_unprepare(compo->clk_compo_aux); in sti_crtc_disable()
125 mixer->status = STI_MIXER_DISABLED; in sti_crtc_disable()
131 sti_crtc_mode_set(crtc, &crtc->state->adjusted_mode); in sti_crtc_mode_set_nofb()
137 struct drm_device *drm_dev = crtc->dev; in sti_crtc_atomic_flush()
138 struct sti_mixer *mixer = to_sti_mixer(crtc); in sti_crtc_atomic_flush() local
139 struct sti_compositor *compo = dev_get_drvdata(mixer->dev); in sti_crtc_atomic_flush()
147 list_for_each_entry(p, &drm_dev->mode_config.plane_list, head) { in sti_crtc_atomic_flush()
150 switch (plane->status) { in sti_crtc_atomic_flush()
153 if (p->state->crtc != crtc) in sti_crtc_atomic_flush()
160 if (sti_mixer_set_plane_depth(mixer, plane)) { in sti_crtc_atomic_flush()
166 if (sti_mixer_set_plane_status(mixer, plane, true)) { in sti_crtc_atomic_flush()
167 DRM_ERROR("Cannot enable plane %s at mixer\n", in sti_crtc_atomic_flush()
173 if (plane->desc == STI_HQVDP_0) in sti_crtc_atomic_flush()
174 sti_vid_commit(compo->vid[0], p->state); in sti_crtc_atomic_flush()
176 plane->status = STI_PLANE_READY; in sti_crtc_atomic_flush()
181 DRM_DEBUG_DRIVER("disable plane %s from mixer\n", in sti_crtc_atomic_flush()
184 if (sti_mixer_set_plane_status(mixer, plane, false)) { in sti_crtc_atomic_flush()
185 DRM_ERROR("Cannot disable plane %s at mixer\n", in sti_crtc_atomic_flush()
190 if (plane->desc == STI_CURSOR) in sti_crtc_atomic_flush()
192 plane->status = STI_PLANE_DISABLED; in sti_crtc_atomic_flush()
195 plane->status = STI_PLANE_FLUSHING; in sti_crtc_atomic_flush()
198 if (plane->desc == STI_HQVDP_0) in sti_crtc_atomic_flush()
199 sti_vid_disable(compo->vid[0]); in sti_crtc_atomic_flush()
208 event = crtc->state->event; in sti_crtc_atomic_flush()
210 crtc->state->event = NULL; in sti_crtc_atomic_flush()
212 spin_lock_irqsave(&crtc->dev->event_lock, flags); in sti_crtc_atomic_flush()
217 spin_unlock_irqrestore(&crtc->dev->event_lock, flags); in sti_crtc_atomic_flush()
247 struct sti_mixer *mixer; in sti_crtc_vblank_cb() local
252 mixer = compo->mixer[pipe]; in sti_crtc_vblank_cb()
257 return -EINVAL; in sti_crtc_vblank_cb()
262 if (mixer->status == STI_MIXER_DISABLING) { in sti_crtc_vblank_cb()
265 /* Disable mixer only if all overlay planes (GDP and VDP) in sti_crtc_vblank_cb()
267 list_for_each_entry(p, &crtc->dev->mode_config.plane_list, in sti_crtc_vblank_cb()
271 if ((plane->desc & STI_PLANE_TYPE_MASK) <= STI_VDP) in sti_crtc_vblank_cb()
272 if (plane->status != STI_PLANE_DISABLED) in sti_crtc_vblank_cb()
283 struct drm_device *dev = crtc->dev; in sti_crtc_enable_vblank()
284 unsigned int pipe = crtc->index; in sti_crtc_enable_vblank()
285 struct sti_private *dev_priv = dev->dev_private; in sti_crtc_enable_vblank()
286 struct sti_compositor *compo = dev_priv->compo; in sti_crtc_enable_vblank()
287 struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb[pipe]; in sti_crtc_enable_vblank()
288 struct sti_vtg *vtg = compo->vtg[pipe]; in sti_crtc_enable_vblank()
294 return -EINVAL; in sti_crtc_enable_vblank()
302 struct drm_device *drm_dev = crtc->dev; in sti_crtc_disable_vblank()
303 unsigned int pipe = crtc->index; in sti_crtc_disable_vblank()
304 struct sti_private *priv = drm_dev->dev_private; in sti_crtc_disable_vblank()
305 struct sti_compositor *compo = priv->compo; in sti_crtc_disable_vblank()
306 struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb[pipe]; in sti_crtc_disable_vblank()
307 struct sti_vtg *vtg = compo->vtg[pipe]; in sti_crtc_disable_vblank()
317 struct sti_mixer *mixer = to_sti_mixer(crtc); in sti_crtc_late_register() local
318 struct sti_compositor *compo = dev_get_drvdata(mixer->dev); in sti_crtc_late_register()
321 sti_compositor_debugfs_init(compo, crtc->dev->primary); in sti_crtc_late_register()
341 struct sti_mixer *mixer = to_sti_mixer(crtc); in sti_crtc_is_main() local
343 if (mixer->id == STI_MIXER_MAIN) in sti_crtc_is_main()
349 int sti_crtc_init(struct drm_device *drm_dev, struct sti_mixer *mixer, in sti_crtc_init() argument
352 struct drm_crtc *crtc = &mixer->drm_crtc; in sti_crtc_init()
359 return -EINVAL; in sti_crtc_init()
365 crtc->base.id, sti_mixer_to_str(mixer)); in sti_crtc_init()