Lines Matching full:private
395 static bool mtk_drm_find_mmsys_comp(struct mtk_drm_private *private, int comp_id) in mtk_drm_find_mmsys_comp() argument
397 const struct mtk_mmsys_driver_data *drv_data = private->data; in mtk_drm_find_mmsys_comp()
420 struct mtk_drm_private *private = drm->dev_private; in mtk_drm_kms_init() local
445 for (i = 0; i < private->data->mmsys_dev_num; i++) { in mtk_drm_kms_init()
446 drm->dev_private = private->all_drm_private[i]; in mtk_drm_kms_init()
447 ret = component_bind_all(private->all_drm_private[i]->dev, drm); in mtk_drm_kms_init()
463 * different drm private data structures. Loop through crtc index to in mtk_drm_kms_init()
468 for (j = 0; j < private->data->mmsys_dev_num; j++) { in mtk_drm_kms_init()
469 priv_n = private->all_drm_private[j]; in mtk_drm_kms_init()
504 for (i = 0; i < private->data->mmsys_dev_num; i++) in mtk_drm_kms_init()
505 private->all_drm_private[i]->dma_dev = dma_dev; in mtk_drm_kms_init()
527 for (i = 0; i < private->data->mmsys_dev_num; i++) in mtk_drm_kms_init()
528 component_unbind_all(private->all_drm_private[i]->dev, drm); in mtk_drm_kms_init()
530 for (i = 0; i < private->data->mmsys_dev_num; i++) in mtk_drm_kms_init()
531 put_device(private->all_drm_private[i]->mutex_dev); in mtk_drm_kms_init()
553 struct mtk_drm_private *private = dev->dev_private; in mtk_drm_gem_prime_import() local
555 return drm_gem_prime_import_dev(dev, dma_buf, private->dma_dev); in mtk_drm_gem_prime_import()
581 struct mtk_drm_private *private = dev_get_drvdata(dev); in mtk_drm_bind() local
589 pdev = of_find_device_by_node(private->mutex_node); in mtk_drm_bind()
592 private->mutex_node); in mtk_drm_bind()
593 of_node_put(private->mutex_node); in mtk_drm_bind()
597 private->mutex_dev = &pdev->dev; in mtk_drm_bind()
598 private->mtk_drm_bound = true; in mtk_drm_bind()
599 private->dev = dev; in mtk_drm_bind()
608 private->drm_master = true; in mtk_drm_bind()
609 drm->dev_private = private; in mtk_drm_bind()
610 for (i = 0; i < private->data->mmsys_dev_num; i++) in mtk_drm_bind()
611 private->all_drm_private[i]->drm = drm; in mtk_drm_bind()
628 private->drm = NULL; in mtk_drm_bind()
635 struct mtk_drm_private *private = dev_get_drvdata(dev); in mtk_drm_unbind() local
638 if (private->drm_master) { in mtk_drm_unbind()
639 drm_dev_unregister(private->drm); in mtk_drm_unbind()
640 mtk_drm_kms_deinit(private->drm); in mtk_drm_unbind()
641 drm_dev_put(private->drm); in mtk_drm_unbind()
643 private->mtk_drm_bound = false; in mtk_drm_unbind()
644 private->drm_master = false; in mtk_drm_unbind()
645 private->drm = NULL; in mtk_drm_unbind()
776 struct mtk_drm_private *private; in mtk_drm_probe() local
783 private = devm_kzalloc(dev, sizeof(*private), GFP_KERNEL); in mtk_drm_probe()
784 if (!private) in mtk_drm_probe()
787 private->mmsys_dev = dev->parent; in mtk_drm_probe()
788 if (!private->mmsys_dev) { in mtk_drm_probe()
797 private->data = of_id->data; in mtk_drm_probe()
799 private->all_drm_private = devm_kmalloc_array(dev, private->data->mmsys_dev_num, in mtk_drm_probe()
800 sizeof(*private->all_drm_private), in mtk_drm_probe()
802 if (!private->all_drm_private) in mtk_drm_probe()
806 if (mtk_drm_find_mmsys_comp(private, DDP_COMPONENT_DRM_OVL_ADAPTOR)) { in mtk_drm_probe()
809 (void *)private->mmsys_dev, in mtk_drm_probe()
810 sizeof(*private->mmsys_dev)); in mtk_drm_probe()
811 private->ddp_comp[DDP_COMPONENT_DRM_OVL_ADAPTOR].dev = &ovl_adaptor->dev; in mtk_drm_probe()
812 mtk_ddp_comp_init(NULL, &private->ddp_comp[DDP_COMPONENT_DRM_OVL_ADAPTOR], in mtk_drm_probe()
839 if (id < 0 || id == private->data->mmsys_id) { in mtk_drm_probe()
840 private->mutex_node = of_node_get(node); in mtk_drm_probe()
841 dev_dbg(dev, "get mutex for mmsys %d", private->data->mmsys_id); in mtk_drm_probe()
853 if (!mtk_drm_find_mmsys_comp(private, comp_id)) in mtk_drm_probe()
856 private->comp_node[comp_id] = of_node_get(node); in mtk_drm_probe()
881 ret = mtk_ddp_comp_init(node, &private->ddp_comp[comp_id], comp_id); in mtk_drm_probe()
888 if (!private->mutex_node) { in mtk_drm_probe()
896 platform_set_drvdata(pdev, private); in mtk_drm_probe()
907 of_node_put(private->mutex_node); in mtk_drm_probe()
909 of_node_put(private->comp_node[i]); in mtk_drm_probe()
915 struct mtk_drm_private *private = platform_get_drvdata(pdev); in mtk_drm_remove() local
920 of_node_put(private->mutex_node); in mtk_drm_remove()
922 of_node_put(private->comp_node[i]); in mtk_drm_remove()
927 struct mtk_drm_private *private = dev_get_drvdata(dev); in mtk_drm_sys_prepare() local
928 struct drm_device *drm = private->drm; in mtk_drm_sys_prepare()
930 if (private->drm_master) in mtk_drm_sys_prepare()
938 struct mtk_drm_private *private = dev_get_drvdata(dev); in mtk_drm_sys_complete() local
939 struct drm_device *drm = private->drm; in mtk_drm_sys_complete()
942 if (private->drm_master) in mtk_drm_sys_complete()