Lines Matching refs:gr3d
40 struct gr3d { struct
53 static inline struct gr3d *to_gr3d(struct tegra_drm_client *client) in to_gr3d() argument
55 return container_of(client, struct gr3d, client); in to_gr3d()
63 struct gr3d *gr3d = to_gr3d(drm); in gr3d_init() local
66 gr3d->channel = host1x_channel_request(client); in gr3d_init()
67 if (!gr3d->channel) in gr3d_init()
96 host1x_channel_put(gr3d->channel); in gr3d_init()
104 struct gr3d *gr3d = to_gr3d(drm); in gr3d_exit() local
116 host1x_channel_put(gr3d->channel); in gr3d_exit()
118 gr3d->channel = NULL; in gr3d_exit()
131 struct gr3d *gr3d = to_gr3d(client); in gr3d_open_channel() local
133 context->channel = host1x_channel_get(gr3d->channel); in gr3d_open_channel()
147 struct gr3d *gr3d = dev_get_drvdata(dev); in gr3d_is_addr_reg() local
160 if (test_bit(offset, gr3d->addr_regs)) in gr3d_is_addr_reg()
310 struct gr3d *gr3d = dev_get_drvdata(dev); in gr3d_power_up_legacy_domain() local
321 if (gr3d->nclocks == 1) { in gr3d_power_up_legacy_domain()
325 clk = gr3d->clocks[0].clk; in gr3d_power_up_legacy_domain()
327 for (i = 0; i < gr3d->nclocks; i++) { in gr3d_power_up_legacy_domain()
328 if (WARN_ON(!gr3d->clocks[i].id)) in gr3d_power_up_legacy_domain()
331 if (!strcmp(gr3d->clocks[i].id, name)) { in gr3d_power_up_legacy_domain()
332 clk = gr3d->clocks[i].clk; in gr3d_power_up_legacy_domain()
337 if (WARN_ON(i == gr3d->nclocks)) in gr3d_power_up_legacy_domain()
377 static int gr3d_init_power(struct device *dev, struct gr3d *gr3d) in gr3d_init_power() argument
443 static int gr3d_get_clocks(struct device *dev, struct gr3d *gr3d) in gr3d_get_clocks() argument
447 err = devm_clk_bulk_get_all(dev, &gr3d->clocks); in gr3d_get_clocks()
452 gr3d->nclocks = err; in gr3d_get_clocks()
454 if (gr3d->nclocks != gr3d->soc->num_clocks) { in gr3d_get_clocks()
455 dev_err(dev, "invalid number of clocks: %u\n", gr3d->nclocks); in gr3d_get_clocks()
462 static int gr3d_get_resets(struct device *dev, struct gr3d *gr3d) in gr3d_get_resets() argument
466 gr3d->resets[RST_MC].id = "mc"; in gr3d_get_resets()
467 gr3d->resets[RST_MC2].id = "mc2"; in gr3d_get_resets()
468 gr3d->resets[RST_GR3D].id = "3d"; in gr3d_get_resets()
469 gr3d->resets[RST_GR3D2].id = "3d2"; in gr3d_get_resets()
470 gr3d->nresets = gr3d->soc->num_resets; in gr3d_get_resets()
473 dev, gr3d->nresets, gr3d->resets); in gr3d_get_resets()
479 if (WARN_ON(!gr3d->resets[RST_GR3D].rstc) || in gr3d_get_resets()
480 WARN_ON(!gr3d->resets[RST_GR3D2].rstc && gr3d->nresets == 4)) in gr3d_get_resets()
489 struct gr3d *gr3d; in gr3d_probe() local
493 gr3d = devm_kzalloc(&pdev->dev, sizeof(*gr3d), GFP_KERNEL); in gr3d_probe()
494 if (!gr3d) in gr3d_probe()
497 platform_set_drvdata(pdev, gr3d); in gr3d_probe()
499 gr3d->soc = of_device_get_match_data(&pdev->dev); in gr3d_probe()
505 err = gr3d_get_clocks(&pdev->dev, gr3d); in gr3d_probe()
509 err = gr3d_get_resets(&pdev->dev, gr3d); in gr3d_probe()
513 err = gr3d_init_power(&pdev->dev, gr3d); in gr3d_probe()
517 INIT_LIST_HEAD(&gr3d->client.base.list); in gr3d_probe()
518 gr3d->client.base.ops = &gr3d_client_ops; in gr3d_probe()
519 gr3d->client.base.dev = &pdev->dev; in gr3d_probe()
520 gr3d->client.base.class = HOST1X_CLASS_GR3D; in gr3d_probe()
521 gr3d->client.base.syncpts = syncpts; in gr3d_probe()
522 gr3d->client.base.num_syncpts = 1; in gr3d_probe()
524 INIT_LIST_HEAD(&gr3d->client.list); in gr3d_probe()
525 gr3d->client.version = gr3d->soc->version; in gr3d_probe()
526 gr3d->client.ops = &gr3d_ops; in gr3d_probe()
532 err = host1x_client_register(&gr3d->client.base); in gr3d_probe()
541 set_bit(gr3d_addr_regs[i], gr3d->addr_regs); in gr3d_probe()
548 struct gr3d *gr3d = platform_get_drvdata(pdev); in gr3d_remove() local
551 host1x_client_unregister(&gr3d->client.base); in gr3d_remove()
556 struct gr3d *gr3d = dev_get_drvdata(dev); in gr3d_runtime_suspend() local
559 host1x_channel_stop(gr3d->channel); in gr3d_runtime_suspend()
561 err = reset_control_bulk_assert(gr3d->nresets, gr3d->resets); in gr3d_runtime_suspend()
575 clk_bulk_disable_unprepare(gr3d->nclocks, gr3d->clocks); in gr3d_runtime_suspend()
576 reset_control_bulk_release(gr3d->nresets, gr3d->resets); in gr3d_runtime_suspend()
583 struct gr3d *gr3d = dev_get_drvdata(dev); in gr3d_runtime_resume() local
586 err = reset_control_bulk_acquire(gr3d->nresets, gr3d->resets); in gr3d_runtime_resume()
592 err = clk_bulk_prepare_enable(gr3d->nclocks, gr3d->clocks); in gr3d_runtime_resume()
598 err = reset_control_bulk_deassert(gr3d->nresets, gr3d->resets); in gr3d_runtime_resume()
611 clk_bulk_disable_unprepare(gr3d->nclocks, gr3d->clocks); in gr3d_runtime_resume()
613 reset_control_bulk_release(gr3d->nresets, gr3d->resets); in gr3d_runtime_resume()