Lines Matching refs:private

423 static bool mtk_drm_find_mmsys_comp(struct mtk_drm_private *private, int comp_id)  in mtk_drm_find_mmsys_comp()  argument
425 const struct mtk_mmsys_driver_data *drv_data = private->data; in mtk_drm_find_mmsys_comp()
453 struct mtk_drm_private *private = drm->dev_private; in mtk_drm_kms_init() local
479 for (i = 0; i < private->data->mmsys_dev_num; i++) { in mtk_drm_kms_init()
480 drm->dev_private = private->all_drm_private[i]; in mtk_drm_kms_init()
481 ret = component_bind_all(private->all_drm_private[i]->dev, drm); in mtk_drm_kms_init()
502 for (j = 0; j < private->data->mmsys_dev_num; j++) { in mtk_drm_kms_init()
503 priv_n = private->all_drm_private[j]; in mtk_drm_kms_init()
555 for (i = 0; i < private->data->mmsys_dev_num; i++) in mtk_drm_kms_init()
556 private->all_drm_private[i]->dma_dev = dma_dev; in mtk_drm_kms_init()
574 for (i = 0; i < private->data->mmsys_dev_num; i++) in mtk_drm_kms_init()
575 component_unbind_all(private->all_drm_private[i]->dev, drm); in mtk_drm_kms_init()
577 for (i = 0; i < private->data->mmsys_dev_num; i++) in mtk_drm_kms_init()
578 put_device(private->all_drm_private[i]->mutex_dev); in mtk_drm_kms_init()
600 struct mtk_drm_private *private = dev->dev_private; in mtk_gem_prime_import() local
602 return drm_gem_prime_import_dev(dev, dma_buf, private->dma_dev); in mtk_gem_prime_import()
628 struct mtk_drm_private *private = dev_get_drvdata(dev); in mtk_drm_bind() local
633 pdev = of_find_device_by_node(private->mutex_node); in mtk_drm_bind()
636 private->mutex_node); in mtk_drm_bind()
637 of_node_put(private->mutex_node); in mtk_drm_bind()
641 private->mutex_dev = &pdev->dev; in mtk_drm_bind()
642 private->mtk_drm_bound = true; in mtk_drm_bind()
643 private->dev = dev; in mtk_drm_bind()
652 private->drm_master = true; in mtk_drm_bind()
653 drm->dev_private = private; in mtk_drm_bind()
654 for (i = 0; i < private->data->mmsys_dev_num; i++) in mtk_drm_bind()
655 private->all_drm_private[i]->drm = drm; in mtk_drm_bind()
672 private->drm = NULL; in mtk_drm_bind()
679 struct mtk_drm_private *private = dev_get_drvdata(dev); in mtk_drm_unbind() local
682 if (private->drm_master) { in mtk_drm_unbind()
683 drm_dev_unregister(private->drm); in mtk_drm_unbind()
684 mtk_drm_kms_deinit(private->drm); in mtk_drm_unbind()
685 drm_dev_put(private->drm); in mtk_drm_unbind()
687 private->mtk_drm_bound = false; in mtk_drm_unbind()
688 private->drm_master = false; in mtk_drm_unbind()
689 private->drm = NULL; in mtk_drm_unbind()
826 struct mtk_drm_private *private; in mtk_drm_probe() local
833 private = devm_kzalloc(dev, sizeof(*private), GFP_KERNEL); in mtk_drm_probe()
834 if (!private) in mtk_drm_probe()
837 private->mmsys_dev = dev->parent; in mtk_drm_probe()
838 if (!private->mmsys_dev) { in mtk_drm_probe()
847 private->data = of_id->data; in mtk_drm_probe()
849 private->all_drm_private = devm_kmalloc_array(dev, private->data->mmsys_dev_num, in mtk_drm_probe()
850 sizeof(*private->all_drm_private), in mtk_drm_probe()
852 if (!private->all_drm_private) in mtk_drm_probe()
856 if (mtk_drm_find_mmsys_comp(private, DDP_COMPONENT_DRM_OVL_ADAPTOR)) { in mtk_drm_probe()
859 (void *)private->mmsys_dev, in mtk_drm_probe()
860 sizeof(*private->mmsys_dev)); in mtk_drm_probe()
861 private->ddp_comp[DDP_COMPONENT_DRM_OVL_ADAPTOR].dev = &ovl_adaptor->dev; in mtk_drm_probe()
862 mtk_ddp_comp_init(NULL, &private->ddp_comp[DDP_COMPONENT_DRM_OVL_ADAPTOR], in mtk_drm_probe()
889 if (id < 0 || id == private->data->mmsys_id) { in mtk_drm_probe()
890 private->mutex_node = of_node_get(node); in mtk_drm_probe()
891 dev_dbg(dev, "get mutex for mmsys %d", private->data->mmsys_id); in mtk_drm_probe()
903 if (!mtk_drm_find_mmsys_comp(private, comp_id)) in mtk_drm_probe()
906 private->comp_node[comp_id] = of_node_get(node); in mtk_drm_probe()
931 ret = mtk_ddp_comp_init(node, &private->ddp_comp[comp_id], comp_id); in mtk_drm_probe()
938 if (!private->mutex_node) { in mtk_drm_probe()
946 platform_set_drvdata(pdev, private); in mtk_drm_probe()
957 of_node_put(private->mutex_node); in mtk_drm_probe()
959 of_node_put(private->comp_node[i]); in mtk_drm_probe()
965 struct mtk_drm_private *private = platform_get_drvdata(pdev); in mtk_drm_remove() local
970 of_node_put(private->mutex_node); in mtk_drm_remove()
972 of_node_put(private->comp_node[i]); in mtk_drm_remove()
977 struct mtk_drm_private *private = platform_get_drvdata(pdev); in mtk_drm_shutdown() local
979 drm_atomic_helper_shutdown(private->drm); in mtk_drm_shutdown()
984 struct mtk_drm_private *private = dev_get_drvdata(dev); in mtk_drm_sys_prepare() local
985 struct drm_device *drm = private->drm; in mtk_drm_sys_prepare()
987 if (private->drm_master) in mtk_drm_sys_prepare()
995 struct mtk_drm_private *private = dev_get_drvdata(dev); in mtk_drm_sys_complete() local
996 struct drm_device *drm = private->drm; in mtk_drm_sys_complete()
999 if (private->drm_master) in mtk_drm_sys_complete()