Lines Matching +full:matrix +full:- +full:connected

1 // SPDX-License-Identifier: GPL-2.0
131 #define to_sti_tvout(x) to_sti_tvout_encoder(x)->tvout
133 /* preformatter conversion matrix */
147 return readl(tvout->regs + offset); in tvout_read()
152 writel(val, tvout->regs + offset); in tvout_write()
156 * tvout_vip_set_color_order - Set the clipping mode of a VIP
180 * tvout_vip_set_clip_mode - Set the clipping mode of a VIP
196 * tvout_vip_set_rnd - Set the rounded value of a VIP
212 * tvout_vip_set_sel_input - Select the VIP input
250 * tvout_vip_set_in_vid_fmt - Select the input video signed or unsigned
267 * tvout_preformatter_set_matrix - Set preformatter matrix
278 if (mode->vdisplay >= TVO_MIN_HD_HEIGHT) in tvout_preformatter_set_matrix()
292 * tvout_dvo_start - Start VIP block for DVO output
303 dev_dbg(tvout->dev, "%s\n", __func__); in tvout_dvo_start()
334 /* Set round mode (rounded to 8-bit per component) */ in tvout_dvo_start()
346 * tvout_hdmi_start - Start VIP block for HDMI output
356 dev_dbg(tvout->dev, "%s\n", __func__); in tvout_hdmi_start()
383 /* set round mode (rounded to 8-bit per component) */ in tvout_hdmi_start()
395 * tvout_hda_start - Start HDF VIP and HD DAC
406 dev_dbg(tvout->dev, "%s\n", __func__); in tvout_hda_start()
435 /* set round mode (rounded to 10-bit per component) */ in tvout_hda_start()
449 #define DBGFS_DUMP(reg) seq_printf(s, "\n %-25s 0x%08X", #reg, \
450 readl(tvout->regs + reg))
458 char *const round[] = {"8-bit", "10-bit", "12-bit"}; in tvout_dbg_vip()
459 char *const input_sel[] = {"Main (color matrix enabled)", in tvout_dbg_vip()
460 "Main (color matrix by-passed)", in tvout_dbg_vip()
462 "Aux (color matrix enabled)", in tvout_dbg_vip()
463 "Aux (color matrix by-passed)", in tvout_dbg_vip()
473 seq_printf(s, "%-24s %s->%s %s->%s %s->%s\n", "Reorder:", in tvout_dbg_vip()
480 seq_printf(s, "%-24s %s\n", "Clipping:", clipping[tmp]); in tvout_dbg_vip()
484 seq_printf(s, "%-24s input data rounded to %s per component\n", in tvout_dbg_vip()
488 seq_printf(s, "%-24s %s", "Input selection:", input_sel[tmp]); in tvout_dbg_vip()
493 seq_printf(s, "\t%-24s %s", "HD DAC:", in tvout_dbg_hd_dac_cfg()
499 struct drm_info_node *node = s->private; in tvout_dbg_show()
500 struct sti_tvout *tvout = (struct sti_tvout *)node->info_ent->data; in tvout_dbg_show()
503 seq_printf(s, "TVOUT: (vaddr = 0x%p)", tvout->regs); in tvout_dbg_show()
506 crtc = tvout->hdmi->crtc; in tvout_dbg_show()
508 seq_printf(s, "connected to %s path", in tvout_dbg_show()
512 tvout_dbg_vip(s, readl(tvout->regs + TVO_VIP_HDMI)); in tvout_dbg_show()
518 crtc = tvout->dvo->crtc; in tvout_dbg_show()
520 seq_printf(s, "connected to %s path", in tvout_dbg_show()
525 tvout_dbg_vip(s, readl(tvout->regs + TVO_VIP_DVO)); in tvout_dbg_show()
531 crtc = tvout->hda->crtc; in tvout_dbg_show()
533 seq_printf(s, "connected to %s path", in tvout_dbg_show()
538 readl(tvout->regs + TVO_HD_DAC_CFG_OFF)); in tvout_dbg_show()
540 tvout_dbg_vip(s, readl(tvout->regs + TVO_VIP_HDF)); in tvout_dbg_show()
582 minor->debugfs_root, minor); in tvout_debugfs_init()
607 if (tvout->debugfs_registered) in sti_tvout_late_register()
610 tvout_debugfs_init(tvout, encoder->dev->primary); in sti_tvout_late_register()
612 tvout->debugfs_registered = true; in sti_tvout_late_register()
620 if (!tvout->debugfs_registered) in sti_tvout_early_unregister()
623 tvout->debugfs_registered = false; in sti_tvout_early_unregister()
636 tvout_preformatter_set_matrix(tvout, &encoder->crtc->mode); in sti_dvo_encoder_enable()
638 tvout_dvo_start(tvout, sti_crtc_is_main(encoder->crtc)); in sti_dvo_encoder_enable()
663 encoder = devm_kzalloc(tvout->dev, sizeof(*encoder), GFP_KERNEL); in sti_tvout_create_dvo_encoder()
667 encoder->tvout = tvout; in sti_tvout_create_dvo_encoder()
669 drm_encoder = &encoder->encoder; in sti_tvout_create_dvo_encoder()
671 drm_encoder->possible_crtcs = ENCODER_CRTC_MASK; in sti_tvout_create_dvo_encoder()
686 tvout_preformatter_set_matrix(tvout, &encoder->crtc->mode); in sti_hda_encoder_enable()
688 tvout_hda_start(tvout, sti_crtc_is_main(encoder->crtc)); in sti_hda_encoder_enable()
715 encoder = devm_kzalloc(tvout->dev, sizeof(*encoder), GFP_KERNEL); in sti_tvout_create_hda_encoder()
719 encoder->tvout = tvout; in sti_tvout_create_hda_encoder()
721 drm_encoder = &encoder->encoder; in sti_tvout_create_hda_encoder()
723 drm_encoder->possible_crtcs = ENCODER_CRTC_MASK; in sti_tvout_create_hda_encoder()
737 tvout_preformatter_set_matrix(tvout, &encoder->crtc->mode); in sti_hdmi_encoder_enable()
739 tvout_hdmi_start(tvout, sti_crtc_is_main(encoder->crtc)); in sti_hdmi_encoder_enable()
763 encoder = devm_kzalloc(tvout->dev, sizeof(*encoder), GFP_KERNEL); in sti_tvout_create_hdmi_encoder()
767 encoder->tvout = tvout; in sti_tvout_create_hdmi_encoder()
769 drm_encoder = &encoder->encoder; in sti_tvout_create_hdmi_encoder()
771 drm_encoder->possible_crtcs = ENCODER_CRTC_MASK; in sti_tvout_create_hdmi_encoder()
784 tvout->hdmi = sti_tvout_create_hdmi_encoder(dev, tvout); in sti_tvout_create_encoders()
785 tvout->hda = sti_tvout_create_hda_encoder(dev, tvout); in sti_tvout_create_encoders()
786 tvout->dvo = sti_tvout_create_dvo_encoder(dev, tvout); in sti_tvout_create_encoders()
788 tvout->hdmi->possible_clones = drm_encoder_mask(tvout->hdmi) | in sti_tvout_create_encoders()
789 drm_encoder_mask(tvout->hda) | drm_encoder_mask(tvout->dvo); in sti_tvout_create_encoders()
790 tvout->hda->possible_clones = drm_encoder_mask(tvout->hdmi) | in sti_tvout_create_encoders()
791 drm_encoder_mask(tvout->hda) | drm_encoder_mask(tvout->dvo); in sti_tvout_create_encoders()
792 tvout->dvo->possible_clones = drm_encoder_mask(tvout->hdmi) | in sti_tvout_create_encoders()
793 drm_encoder_mask(tvout->hda) | drm_encoder_mask(tvout->dvo); in sti_tvout_create_encoders()
798 if (tvout->hdmi) in sti_tvout_destroy_encoders()
799 drm_encoder_cleanup(tvout->hdmi); in sti_tvout_destroy_encoders()
800 tvout->hdmi = NULL; in sti_tvout_destroy_encoders()
802 if (tvout->hda) in sti_tvout_destroy_encoders()
803 drm_encoder_cleanup(tvout->hda); in sti_tvout_destroy_encoders()
804 tvout->hda = NULL; in sti_tvout_destroy_encoders()
806 if (tvout->dvo) in sti_tvout_destroy_encoders()
807 drm_encoder_cleanup(tvout->dvo); in sti_tvout_destroy_encoders()
808 tvout->dvo = NULL; in sti_tvout_destroy_encoders()
816 tvout->drm_dev = drm_dev; in sti_tvout_bind()
838 struct device *dev = &pdev->dev; in sti_tvout_probe()
839 struct device_node *node = dev->of_node; in sti_tvout_probe()
846 return -ENODEV; in sti_tvout_probe()
850 return -ENOMEM; in sti_tvout_probe()
852 tvout->dev = dev; in sti_tvout_probe()
855 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "tvout-reg"); in sti_tvout_probe()
858 return -ENOMEM; in sti_tvout_probe()
860 tvout->regs = devm_ioremap(dev, res->start, resource_size(res)); in sti_tvout_probe()
861 if (!tvout->regs) in sti_tvout_probe()
862 return -ENOMEM; in sti_tvout_probe()
865 tvout->reset = devm_reset_control_get(dev, "tvout"); in sti_tvout_probe()
867 if (!IS_ERR(tvout->reset)) in sti_tvout_probe()
868 reset_control_deassert(tvout->reset); in sti_tvout_probe()
877 component_del(&pdev->dev, &sti_tvout_ops); in sti_tvout_remove()
881 { .compatible = "st,stih407-tvout", },
888 .name = "sti-tvout",