Lines Matching full:private
398 static bool mtk_drm_find_mmsys_comp(struct mtk_drm_private *private, int comp_id)
400 const struct mtk_mmsys_driver_data *drv_data = private->data;
423 struct mtk_drm_private *private = drm->dev_private;
449 for (i = 0; i < private->data->mmsys_dev_num; i++) {
450 drm->dev_private = private->all_drm_private[i];
451 ret = component_bind_all(private->all_drm_private[i]->dev, drm);
467 * different drm private data structures. Loop through crtc index to
472 for (j = 0; j < private->data->mmsys_dev_num; j++) {
473 priv_n = private->all_drm_private[j];
510 for (i = 0; i < private->data->mmsys_dev_num; i++)
511 private->all_drm_private[i]->dma_dev = dma_dev;
533 for (i = 0; i < private->data->mmsys_dev_num; i++)
534 component_unbind_all(private->all_drm_private[i]->dev, drm);
536 for (i = 0; i < private->data->mmsys_dev_num; i++)
537 put_device(private->all_drm_private[i]->mutex_dev);
559 struct mtk_drm_private *private = dev->dev_private;
561 return drm_gem_prime_import_dev(dev, dma_buf, private->dma_dev);
587 struct mtk_drm_private *private = dev_get_drvdata(dev);
595 pdev = of_find_device_by_node(private->mutex_node);
598 private->mutex_node);
599 of_node_put(private->mutex_node);
603 private->mutex_dev = &pdev->dev;
604 private->mtk_drm_bound = true;
605 private->dev = dev;
614 private->drm_master = true;
615 drm->dev_private = private;
616 for (i = 0; i < private->data->mmsys_dev_num; i++)
617 private->all_drm_private[i]->drm = drm;
634 private->drm = NULL;
636 for (i = 0; i < private->data->mmsys_dev_num; i++)
637 private->all_drm_private[i]->drm = NULL;
643 struct mtk_drm_private *private = dev_get_drvdata(dev);
646 if (private->drm_master) {
647 drm_dev_unregister(private->drm);
648 mtk_drm_kms_deinit(private->drm);
649 drm_dev_put(private->drm);
651 private->mtk_drm_bound = false;
652 private->drm_master = false;
653 private->drm = NULL;
786 struct mtk_drm_private *private;
793 private = devm_kzalloc(dev, sizeof(*private), GFP_KERNEL);
794 if (!private)
797 private->mmsys_dev = dev->parent;
798 if (!private->mmsys_dev) {
807 private->data = of_id->data;
809 private->all_drm_private = devm_kmalloc_array(dev, private->data->mmsys_dev_num,
810 sizeof(*private->all_drm_private),
812 if (!private->all_drm_private)
816 if (mtk_drm_find_mmsys_comp(private, DDP_COMPONENT_DRM_OVL_ADAPTOR)) {
819 (void *)private->mmsys_dev,
820 sizeof(*private->mmsys_dev));
821 private->ddp_comp[DDP_COMPONENT_DRM_OVL_ADAPTOR].dev = &ovl_adaptor->dev;
822 mtk_ddp_comp_init(NULL, &private->ddp_comp[DDP_COMPONENT_DRM_OVL_ADAPTOR],
849 if (id < 0 || id == private->data->mmsys_id) {
850 private->mutex_node = of_node_get(node);
851 dev_dbg(dev, "get mutex for mmsys %d", private->data->mmsys_id);
863 if (!mtk_drm_find_mmsys_comp(private, comp_id))
866 private->comp_node[comp_id] = of_node_get(node);
891 ret = mtk_ddp_comp_init(node, &private->ddp_comp[comp_id], comp_id);
898 if (!private->mutex_node) {
906 platform_set_drvdata(pdev, private);
917 of_node_put(private->mutex_node);
919 of_node_put(private->comp_node[i]);
925 struct mtk_drm_private *private = platform_get_drvdata(pdev);
930 of_node_put(private->mutex_node);
932 of_node_put(private->comp_node[i]);
937 struct mtk_drm_private *private = platform_get_drvdata(pdev);
939 drm_atomic_helper_shutdown(private->drm);
944 struct mtk_drm_private *private = dev_get_drvdata(dev);
945 struct drm_device *drm = private->drm;
947 if (private->drm_master)
955 struct mtk_drm_private *private = dev_get_drvdata(dev);
956 struct drm_device *drm = private->drm;
959 if (private->drm_master)