blob: 8c8cbe837e61b41e900e26c3f3f19143e832c49a [file] [log] [blame]
Mark Yao2048e322014-08-22 18:36:26 +08001/*
2 * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
3 * Author:Mark Yao <mark.yao@rock-chips.com>
4 *
5 * based on exynos_drm_drv.c
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <asm/dma-iommu.h>
18
19#include <drm/drmP.h>
20#include <drm/drm_crtc_helper.h>
21#include <drm/drm_fb_helper.h>
Daniel Vetter80f67cd2016-05-30 19:53:12 +020022#include <drm/drm_gem_cma_helper.h>
Mark Yao2048e322014-08-22 18:36:26 +080023#include <linux/dma-mapping.h>
24#include <linux/pm_runtime.h>
Paul Gortmaker00fe6142015-05-01 20:02:30 -040025#include <linux/module.h>
Mark Yao2048e322014-08-22 18:36:26 +080026#include <linux/of_graph.h>
27#include <linux/component.h>
Tomeu Vizoso5a587382016-06-06 16:53:32 +020028#include <linux/console.h>
Mark Yao2048e322014-08-22 18:36:26 +080029
30#include "rockchip_drm_drv.h"
31#include "rockchip_drm_fb.h"
32#include "rockchip_drm_fbdev.h"
33#include "rockchip_drm_gem.h"
34
35#define DRIVER_NAME "rockchip"
36#define DRIVER_DESC "RockChip Soc DRM"
37#define DRIVER_DATE "20140818"
38#define DRIVER_MAJOR 1
39#define DRIVER_MINOR 0
40
Mark Yao2d90d4772016-04-19 10:13:27 +080041static bool is_support_iommu = true;
Tomeu Vizosof7069742016-06-10 13:14:13 +020042static struct drm_driver rockchip_drm_driver;
Mark Yao2d90d4772016-04-19 10:13:27 +080043
Mark Yao2048e322014-08-22 18:36:26 +080044/*
45 * Attach a (component) device to the shared drm dma mapping from master drm
46 * device. This is used by the VOPs to map GEM buffers to a common DMA
47 * mapping.
48 */
49int rockchip_drm_dma_attach_device(struct drm_device *drm_dev,
50 struct device *dev)
51{
52 struct dma_iommu_mapping *mapping = drm_dev->dev->archdata.mapping;
53 int ret;
54
Mark Yao2d90d4772016-04-19 10:13:27 +080055 if (!is_support_iommu)
56 return 0;
57
Mark Yao2048e322014-08-22 18:36:26 +080058 ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
59 if (ret)
60 return ret;
61
62 dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
63
64 return arm_iommu_attach_device(dev, mapping);
65}
Mark Yao2048e322014-08-22 18:36:26 +080066
67void rockchip_drm_dma_detach_device(struct drm_device *drm_dev,
68 struct device *dev)
69{
Mark Yao2d90d4772016-04-19 10:13:27 +080070 if (!is_support_iommu)
71 return;
72
Mark Yao2048e322014-08-22 18:36:26 +080073 arm_iommu_detach_device(dev);
74}
Mark Yao2048e322014-08-22 18:36:26 +080075
Mark Yaob5f7b752015-11-23 15:21:08 +080076int rockchip_register_crtc_funcs(struct drm_crtc *crtc,
77 const struct rockchip_crtc_funcs *crtc_funcs)
Mark Yao2048e322014-08-22 18:36:26 +080078{
Mark Yaob5f7b752015-11-23 15:21:08 +080079 int pipe = drm_crtc_index(crtc);
80 struct rockchip_drm_private *priv = crtc->dev->dev_private;
Mark Yao2048e322014-08-22 18:36:26 +080081
Dan Carpenter15da7802016-07-13 13:15:04 +030082 if (pipe >= ROCKCHIP_MAX_CRTC)
Mark Yao2048e322014-08-22 18:36:26 +080083 return -EINVAL;
84
85 priv->crtc_funcs[pipe] = crtc_funcs;
86
87 return 0;
88}
Mark Yao2048e322014-08-22 18:36:26 +080089
Mark Yaob5f7b752015-11-23 15:21:08 +080090void rockchip_unregister_crtc_funcs(struct drm_crtc *crtc)
Mark Yao2048e322014-08-22 18:36:26 +080091{
Mark Yaob5f7b752015-11-23 15:21:08 +080092 int pipe = drm_crtc_index(crtc);
93 struct rockchip_drm_private *priv = crtc->dev->dev_private;
Mark Yao2048e322014-08-22 18:36:26 +080094
Dan Carpenter15da7802016-07-13 13:15:04 +030095 if (pipe >= ROCKCHIP_MAX_CRTC)
Mark Yao2048e322014-08-22 18:36:26 +080096 return;
97
98 priv->crtc_funcs[pipe] = NULL;
99}
Mark Yao2048e322014-08-22 18:36:26 +0800100
101static struct drm_crtc *rockchip_crtc_from_pipe(struct drm_device *drm,
102 int pipe)
103{
104 struct drm_crtc *crtc;
105 int i = 0;
106
107 list_for_each_entry(crtc, &drm->mode_config.crtc_list, head)
108 if (i++ == pipe)
109 return crtc;
110
111 return NULL;
112}
113
Thierry Reding88e72712015-09-24 18:35:31 +0200114static int rockchip_drm_crtc_enable_vblank(struct drm_device *dev,
115 unsigned int pipe)
Mark Yao2048e322014-08-22 18:36:26 +0800116{
117 struct rockchip_drm_private *priv = dev->dev_private;
118 struct drm_crtc *crtc = rockchip_crtc_from_pipe(dev, pipe);
119
120 if (crtc && priv->crtc_funcs[pipe] &&
121 priv->crtc_funcs[pipe]->enable_vblank)
122 return priv->crtc_funcs[pipe]->enable_vblank(crtc);
123
124 return 0;
125}
126
Thierry Reding88e72712015-09-24 18:35:31 +0200127static void rockchip_drm_crtc_disable_vblank(struct drm_device *dev,
128 unsigned int pipe)
Mark Yao2048e322014-08-22 18:36:26 +0800129{
130 struct rockchip_drm_private *priv = dev->dev_private;
131 struct drm_crtc *crtc = rockchip_crtc_from_pipe(dev, pipe);
132
133 if (crtc && priv->crtc_funcs[pipe] &&
134 priv->crtc_funcs[pipe]->enable_vblank)
135 priv->crtc_funcs[pipe]->disable_vblank(crtc);
136}
137
Tomeu Vizosof7069742016-06-10 13:14:13 +0200138static int rockchip_drm_bind(struct device *dev)
Mark Yao2048e322014-08-22 18:36:26 +0800139{
Tomeu Vizosof7069742016-06-10 13:14:13 +0200140 struct drm_device *drm_dev;
Mark Yao2048e322014-08-22 18:36:26 +0800141 struct rockchip_drm_private *private;
Mark Yao2d90d4772016-04-19 10:13:27 +0800142 struct dma_iommu_mapping *mapping = NULL;
Mark Yao2048e322014-08-22 18:36:26 +0800143 int ret;
144
Tomeu Vizosof7069742016-06-10 13:14:13 +0200145 drm_dev = drm_dev_alloc(&rockchip_drm_driver, dev);
Tom Gundersen0f288602016-09-21 16:59:19 +0200146 if (IS_ERR(drm_dev))
147 return PTR_ERR(drm_dev);
Mark Yao2048e322014-08-22 18:36:26 +0800148
Tomeu Vizosof7069742016-06-10 13:14:13 +0200149 dev_set_drvdata(dev, drm_dev);
150
151 private = devm_kzalloc(drm_dev->dev, sizeof(*private), GFP_KERNEL);
152 if (!private) {
153 ret = -ENOMEM;
Tomasz Figa9127f992016-06-21 13:27:34 +0900154 goto err_free;
Tomeu Vizosof7069742016-06-10 13:14:13 +0200155 }
156
Mark Yao2048e322014-08-22 18:36:26 +0800157 drm_dev->dev_private = private;
158
Yakir Yang5182c1a2016-07-24 14:57:44 +0800159 INIT_LIST_HEAD(&private->psr_list);
Sean Paul18d8d4d2016-08-16 16:11:28 -0700160 spin_lock_init(&private->psr_list_lock);
Yakir Yang5182c1a2016-07-24 14:57:44 +0800161
Mark Yao2048e322014-08-22 18:36:26 +0800162 drm_mode_config_init(drm_dev);
163
164 rockchip_drm_mode_config_init(drm_dev);
165
166 dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
167 GFP_KERNEL);
168 if (!dev->dma_parms) {
169 ret = -ENOMEM;
170 goto err_config_cleanup;
171 }
172
Mark Yao2d90d4772016-04-19 10:13:27 +0800173 if (is_support_iommu) {
174 /* TODO(djkurtz): fetch the mapping start/size from somewhere */
175 mapping = arm_iommu_create_mapping(&platform_bus_type,
176 0x00000000,
177 SZ_2G);
178 if (IS_ERR(mapping)) {
179 ret = PTR_ERR(mapping);
180 goto err_config_cleanup;
181 }
182
183 ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
184 if (ret)
185 goto err_release_mapping;
186
187 dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
188
189 ret = arm_iommu_attach_device(dev, mapping);
190 if (ret)
191 goto err_release_mapping;
Mark Yao2048e322014-08-22 18:36:26 +0800192 }
193
Mark Yao2048e322014-08-22 18:36:26 +0800194 /* Try to bind all sub drivers. */
195 ret = component_bind_all(dev, drm_dev);
196 if (ret)
197 goto err_detach_device;
198
199 /* init kms poll for handling hpd */
200 drm_kms_helper_poll_init(drm_dev);
201
202 /*
203 * enable drm irq mode.
204 * - with irq_enabled = true, we can use the vblank feature.
205 */
206 drm_dev->irq_enabled = true;
207
208 ret = drm_vblank_init(drm_dev, ROCKCHIP_MAX_CRTC);
209 if (ret)
210 goto err_kms_helper_poll_fini;
211
Mark Yao63ebb9f2015-11-30 18:22:42 +0800212 drm_mode_config_reset(drm_dev);
213
Mark Yao2048e322014-08-22 18:36:26 +0800214 ret = rockchip_drm_fbdev_init(drm_dev);
215 if (ret)
216 goto err_vblank_cleanup;
217
Tomasz Figa9127f992016-06-21 13:27:34 +0900218 ret = drm_dev_register(drm_dev, 0);
219 if (ret)
220 goto err_fbdev_fini;
221
Mark Yao2d90d4772016-04-19 10:13:27 +0800222 if (is_support_iommu)
223 arm_iommu_release_mapping(mapping);
Mark Yao2048e322014-08-22 18:36:26 +0800224 return 0;
Tomasz Figa9127f992016-06-21 13:27:34 +0900225err_fbdev_fini:
226 rockchip_drm_fbdev_fini(drm_dev);
Mark Yao2048e322014-08-22 18:36:26 +0800227err_vblank_cleanup:
228 drm_vblank_cleanup(drm_dev);
229err_kms_helper_poll_fini:
230 drm_kms_helper_poll_fini(drm_dev);
231 component_unbind_all(dev, drm_dev);
232err_detach_device:
Mark Yao2d90d4772016-04-19 10:13:27 +0800233 if (is_support_iommu)
234 arm_iommu_detach_device(dev);
Mark Yao2048e322014-08-22 18:36:26 +0800235err_release_mapping:
Mark Yao2d90d4772016-04-19 10:13:27 +0800236 if (is_support_iommu)
237 arm_iommu_release_mapping(mapping);
Mark Yao2048e322014-08-22 18:36:26 +0800238err_config_cleanup:
239 drm_mode_config_cleanup(drm_dev);
240 drm_dev->dev_private = NULL;
Tomeu Vizosof7069742016-06-10 13:14:13 +0200241err_free:
242 drm_dev_unref(drm_dev);
Mark Yao2048e322014-08-22 18:36:26 +0800243 return ret;
244}
245
Tomeu Vizosof7069742016-06-10 13:14:13 +0200246static void rockchip_drm_unbind(struct device *dev)
Mark Yao2048e322014-08-22 18:36:26 +0800247{
Tomeu Vizosof7069742016-06-10 13:14:13 +0200248 struct drm_device *drm_dev = dev_get_drvdata(dev);
Mark Yao2048e322014-08-22 18:36:26 +0800249
250 rockchip_drm_fbdev_fini(drm_dev);
251 drm_vblank_cleanup(drm_dev);
252 drm_kms_helper_poll_fini(drm_dev);
253 component_unbind_all(dev, drm_dev);
Mark Yao2d90d4772016-04-19 10:13:27 +0800254 if (is_support_iommu)
255 arm_iommu_detach_device(dev);
Mark Yao2048e322014-08-22 18:36:26 +0800256 drm_mode_config_cleanup(drm_dev);
257 drm_dev->dev_private = NULL;
Tomeu Vizosof7069742016-06-10 13:14:13 +0200258 drm_dev_unregister(drm_dev);
259 drm_dev_unref(drm_dev);
260 dev_set_drvdata(dev, NULL);
Mark Yao2048e322014-08-22 18:36:26 +0800261}
262
John Keeping8ff490a2016-05-10 17:03:56 +0100263static void rockchip_drm_lastclose(struct drm_device *dev)
Mark Yao2048e322014-08-22 18:36:26 +0800264{
265 struct rockchip_drm_private *priv = dev->dev_private;
266
267 drm_fb_helper_restore_fbdev_mode_unlocked(&priv->fbdev_helper);
268}
269
270static const struct file_operations rockchip_drm_driver_fops = {
271 .owner = THIS_MODULE,
272 .open = drm_open,
273 .mmap = rockchip_gem_mmap,
274 .poll = drm_poll,
275 .read = drm_read,
276 .unlocked_ioctl = drm_ioctl,
277#ifdef CONFIG_COMPAT
278 .compat_ioctl = drm_compat_ioctl,
279#endif
280 .release = drm_release,
281};
282
Mark Yao2048e322014-08-22 18:36:26 +0800283static struct drm_driver rockchip_drm_driver = {
Mark Yao63ebb9f2015-11-30 18:22:42 +0800284 .driver_features = DRIVER_MODESET | DRIVER_GEM |
285 DRIVER_PRIME | DRIVER_ATOMIC,
Mark Yao2048e322014-08-22 18:36:26 +0800286 .lastclose = rockchip_drm_lastclose,
Ville Syrjäläb44f8402015-09-30 16:46:48 +0300287 .get_vblank_counter = drm_vblank_no_hw_counter,
Mark Yao2048e322014-08-22 18:36:26 +0800288 .enable_vblank = rockchip_drm_crtc_enable_vblank,
289 .disable_vblank = rockchip_drm_crtc_disable_vblank,
Daniel Vetter80f67cd2016-05-30 19:53:12 +0200290 .gem_vm_ops = &drm_gem_cma_vm_ops,
Daniel Vetterc2466ac2016-05-30 19:53:03 +0200291 .gem_free_object_unlocked = rockchip_gem_free_object,
Mark Yao2048e322014-08-22 18:36:26 +0800292 .dumb_create = rockchip_gem_dumb_create,
293 .dumb_map_offset = rockchip_gem_dumb_map_offset,
294 .dumb_destroy = drm_gem_dumb_destroy,
295 .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
296 .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
297 .gem_prime_import = drm_gem_prime_import,
298 .gem_prime_export = drm_gem_prime_export,
299 .gem_prime_get_sg_table = rockchip_gem_prime_get_sg_table,
300 .gem_prime_vmap = rockchip_gem_prime_vmap,
301 .gem_prime_vunmap = rockchip_gem_prime_vunmap,
302 .gem_prime_mmap = rockchip_gem_mmap_buf,
303 .fops = &rockchip_drm_driver_fops,
304 .name = DRIVER_NAME,
305 .desc = DRIVER_DESC,
306 .date = DRIVER_DATE,
307 .major = DRIVER_MAJOR,
308 .minor = DRIVER_MINOR,
309};
310
311#ifdef CONFIG_PM_SLEEP
Baoyou Xie623981772016-09-25 15:43:08 +0800312static void rockchip_drm_fb_suspend(struct drm_device *drm)
Tomeu Vizoso5a587382016-06-06 16:53:32 +0200313{
314 struct rockchip_drm_private *priv = drm->dev_private;
315
316 console_lock();
317 drm_fb_helper_set_suspend(&priv->fbdev_helper, 1);
318 console_unlock();
319}
320
Baoyou Xie623981772016-09-25 15:43:08 +0800321static void rockchip_drm_fb_resume(struct drm_device *drm)
Tomeu Vizoso5a587382016-06-06 16:53:32 +0200322{
323 struct rockchip_drm_private *priv = drm->dev_private;
324
325 console_lock();
326 drm_fb_helper_set_suspend(&priv->fbdev_helper, 0);
327 console_unlock();
328}
329
Mark Yao2048e322014-08-22 18:36:26 +0800330static int rockchip_drm_sys_suspend(struct device *dev)
331{
332 struct drm_device *drm = dev_get_drvdata(dev);
Tomeu Vizoso5a587382016-06-06 16:53:32 +0200333 struct rockchip_drm_private *priv = drm->dev_private;
Mark Yao2048e322014-08-22 18:36:26 +0800334
Tomeu Vizoso5a587382016-06-06 16:53:32 +0200335 drm_kms_helper_poll_disable(drm);
336 rockchip_drm_fb_suspend(drm);
Mark Yao2048e322014-08-22 18:36:26 +0800337
Tomeu Vizoso5a587382016-06-06 16:53:32 +0200338 priv->state = drm_atomic_helper_suspend(drm);
339 if (IS_ERR(priv->state)) {
340 rockchip_drm_fb_resume(drm);
341 drm_kms_helper_poll_enable(drm);
342 return PTR_ERR(priv->state);
Mark Yao2048e322014-08-22 18:36:26 +0800343 }
Mark Yao2048e322014-08-22 18:36:26 +0800344
345 return 0;
346}
347
348static int rockchip_drm_sys_resume(struct device *dev)
349{
350 struct drm_device *drm = dev_get_drvdata(dev);
Tomeu Vizoso5a587382016-06-06 16:53:32 +0200351 struct rockchip_drm_private *priv = drm->dev_private;
Mark Yao2048e322014-08-22 18:36:26 +0800352
Tomeu Vizoso5a587382016-06-06 16:53:32 +0200353 drm_atomic_helper_resume(drm, priv->state);
354 rockchip_drm_fb_resume(drm);
355 drm_kms_helper_poll_enable(drm);
Mark Yao2048e322014-08-22 18:36:26 +0800356
357 return 0;
358}
359#endif
360
361static const struct dev_pm_ops rockchip_drm_pm_ops = {
362 SET_SYSTEM_SLEEP_PM_OPS(rockchip_drm_sys_suspend,
363 rockchip_drm_sys_resume)
364};
365
Mark Yao2048e322014-08-22 18:36:26 +0800366static int compare_of(struct device *dev, void *data)
367{
368 struct device_node *np = data;
369
370 return dev->of_node == np;
371}
372
Mark Yao5bad7d22015-11-10 16:47:19 +0800373static void rockchip_add_endpoints(struct device *dev,
374 struct component_match **match,
375 struct device_node *port)
376{
377 struct device_node *ep, *remote;
378
379 for_each_child_of_node(port, ep) {
380 remote = of_graph_get_remote_port_parent(ep);
381 if (!remote || !of_device_is_available(remote)) {
382 of_node_put(remote);
383 continue;
384 } else if (!of_device_is_available(remote->parent)) {
385 dev_warn(dev, "parent device of %s is not available\n",
386 remote->full_name);
387 of_node_put(remote);
388 continue;
389 }
390
391 component_match_add(dev, match, compare_of, remote);
392 of_node_put(remote);
393 }
394}
395
Mark Yao2048e322014-08-22 18:36:26 +0800396static const struct component_master_ops rockchip_drm_ops = {
397 .bind = rockchip_drm_bind,
398 .unbind = rockchip_drm_unbind,
399};
400
401static int rockchip_drm_platform_probe(struct platform_device *pdev)
402{
Mark Yao5bad7d22015-11-10 16:47:19 +0800403 struct device *dev = &pdev->dev;
404 struct component_match *match = NULL;
405 struct device_node *np = dev->of_node;
406 struct device_node *port;
407 int i;
Mark Yao2048e322014-08-22 18:36:26 +0800408
Mark Yao5bad7d22015-11-10 16:47:19 +0800409 if (!np)
Mark Yao2048e322014-08-22 18:36:26 +0800410 return -ENODEV;
Mark Yao5bad7d22015-11-10 16:47:19 +0800411 /*
412 * Bind the crtc ports first, so that
413 * drm_of_find_possible_crtcs called from encoder .bind callbacks
414 * works as expected.
415 */
416 for (i = 0;; i++) {
Mark Yao2d90d4772016-04-19 10:13:27 +0800417 struct device_node *iommu;
418
Mark Yao5bad7d22015-11-10 16:47:19 +0800419 port = of_parse_phandle(np, "ports", i);
420 if (!port)
421 break;
Mark Yao2048e322014-08-22 18:36:26 +0800422
Mark Yao5bad7d22015-11-10 16:47:19 +0800423 if (!of_device_is_available(port->parent)) {
424 of_node_put(port);
425 continue;
426 }
427
Mark Yao2d90d4772016-04-19 10:13:27 +0800428 iommu = of_parse_phandle(port->parent, "iommus", 0);
429 if (!iommu || !of_device_is_available(iommu->parent)) {
430 dev_dbg(dev, "no iommu attached for %s, using non-iommu buffers\n",
431 port->parent->full_name);
432 /*
433 * if there is a crtc not support iommu, force set all
434 * crtc use non-iommu buffer.
435 */
436 is_support_iommu = false;
437 }
438
Peter Chen6d5fa282016-07-05 10:04:48 +0800439 of_node_put(iommu);
Mark Yao5bad7d22015-11-10 16:47:19 +0800440 component_match_add(dev, &match, compare_of, port->parent);
441 of_node_put(port);
442 }
443
444 if (i == 0) {
445 dev_err(dev, "missing 'ports' property\n");
446 return -ENODEV;
447 }
448
449 if (!match) {
450 dev_err(dev, "No available vop found for display-subsystem.\n");
451 return -ENODEV;
452 }
453 /*
454 * For each bound crtc, bind the encoders attached to its
455 * remote endpoint.
456 */
457 for (i = 0;; i++) {
458 port = of_parse_phandle(np, "ports", i);
459 if (!port)
460 break;
461
462 if (!of_device_is_available(port->parent)) {
463 of_node_put(port);
464 continue;
465 }
466
467 rockchip_add_endpoints(dev, &match, port);
468 of_node_put(port);
469 }
470
471 return component_master_add_with_match(dev, &rockchip_drm_ops, match);
Mark Yao2048e322014-08-22 18:36:26 +0800472}
473
474static int rockchip_drm_platform_remove(struct platform_device *pdev)
475{
476 component_master_del(&pdev->dev, &rockchip_drm_ops);
477
478 return 0;
479}
480
481static const struct of_device_id rockchip_drm_dt_ids[] = {
482 { .compatible = "rockchip,display-subsystem", },
483 { /* sentinel */ },
484};
485MODULE_DEVICE_TABLE(of, rockchip_drm_dt_ids);
486
487static struct platform_driver rockchip_drm_platform_driver = {
488 .probe = rockchip_drm_platform_probe,
489 .remove = rockchip_drm_platform_remove,
490 .driver = {
Mark Yao2048e322014-08-22 18:36:26 +0800491 .name = "rockchip-drm",
492 .of_match_table = rockchip_drm_dt_ids,
493 .pm = &rockchip_drm_pm_ops,
494 },
495};
496
497module_platform_driver(rockchip_drm_platform_driver);
498
499MODULE_AUTHOR("Mark Yao <mark.yao@rock-chips.com>");
500MODULE_DESCRIPTION("ROCKCHIP DRM Driver");
501MODULE_LICENSE("GPL v2");