gr2d.c (0f563a4bf66e5182f0882efee398f7e6bc0bb1be) | gr2d.c (8474b02531c4881a762c52ef869c52429e38633f) |
---|---|
1/* 2 * Copyright (c) 2012-2013, NVIDIA Corporation. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as 6 * published by the Free Software Foundation. 7 */ 8 --- 24 unchanged lines hidden (view full) --- 33 struct gr2d *gr2d = to_gr2d(drm); 34 35 gr2d->channel = host1x_channel_request(client->dev); 36 if (!gr2d->channel) 37 return -ENOMEM; 38 39 client->syncpts[0] = host1x_syncpt_request(client->dev, flags); 40 if (!client->syncpts[0]) { | 1/* 2 * Copyright (c) 2012-2013, NVIDIA Corporation. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as 6 * published by the Free Software Foundation. 7 */ 8 --- 24 unchanged lines hidden (view full) --- 33 struct gr2d *gr2d = to_gr2d(drm); 34 35 gr2d->channel = host1x_channel_request(client->dev); 36 if (!gr2d->channel) 37 return -ENOMEM; 38 39 client->syncpts[0] = host1x_syncpt_request(client->dev, flags); 40 if (!client->syncpts[0]) { |
41 host1x_channel_free(gr2d->channel); | 41 host1x_channel_put(gr2d->channel); |
42 return -ENOMEM; 43 } 44 45 return tegra_drm_register_client(dev->dev_private, drm); 46} 47 48static int gr2d_exit(struct host1x_client *client) 49{ 50 struct tegra_drm_client *drm = host1x_to_drm_client(client); 51 struct drm_device *dev = dev_get_drvdata(client->parent); 52 struct gr2d *gr2d = to_gr2d(drm); 53 int err; 54 55 err = tegra_drm_unregister_client(dev->dev_private, drm); 56 if (err < 0) 57 return err; 58 59 host1x_syncpt_free(client->syncpts[0]); | 42 return -ENOMEM; 43 } 44 45 return tegra_drm_register_client(dev->dev_private, drm); 46} 47 48static int gr2d_exit(struct host1x_client *client) 49{ 50 struct tegra_drm_client *drm = host1x_to_drm_client(client); 51 struct drm_device *dev = dev_get_drvdata(client->parent); 52 struct gr2d *gr2d = to_gr2d(drm); 53 int err; 54 55 err = tegra_drm_unregister_client(dev->dev_private, drm); 56 if (err < 0) 57 return err; 58 59 host1x_syncpt_free(client->syncpts[0]); |
60 host1x_channel_free(gr2d->channel); | 60 host1x_channel_put(gr2d->channel); |
61 62 return 0; 63} 64 65static const struct host1x_client_ops gr2d_client_ops = { 66 .init = gr2d_init, 67 .exit = gr2d_exit, 68}; --- 159 unchanged lines hidden --- | 61 62 return 0; 63} 64 65static const struct host1x_client_ops gr2d_client_ops = { 66 .init = gr2d_init, 67 .exit = gr2d_exit, 68}; --- 159 unchanged lines hidden --- |