History

Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm update from Dave Airlie: "Exynos and Radeon mostly, with a dma-buf and ttm fix thrown in. It's a bit big but its mostly exynos license fix ups and I'd rather not hold those up since its legally stuff. Radeon has a couple of fixes from dma engine work, TTM is just a locking fix, and dma-buf fix has been hanging around and I finally got a chance to review it." * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (30 commits) drm/ttm: fix fence locking in ttm_buffer_object_transfer drm/prime: drop reference on imported dma-buf come from gem drm/radeon: add quirk for d3 delay during switcheroo poweron for apple macbooks drm/exynos: move finish page flip to a common place drm/exynos: fimd: modify condition in fimd resume drm/radeon: fix DMA CS parser for r6xx linear copy packet drm/radeon: split r6xx and r7xx copy_dma functions drm/exynos: Use devm_clk_get in exynos_drm_gsc.c drm/exynos: Remove redundant NULL check in exynos_drm_gsc.c drm/exynos: Remove explicit freeing using devm_* APIs in exynos_drm_gsc.c drm/exynos: Use devm_clk_get in exynos_drm_rotator.c drm/exynos: Remove redundant NULL check in exynos_drm_rotator.c drm/exynos: Remove unnecessary devm_* freeing APIs in exynos_drm_rotator.c drm/exynos: Use devm_clk_get in exynos_drm_fimc.c drm/exynos: Remove redundant NULL check drm/exynos: Remove explicit freeing using devm_* APIs in exynos_drm_fimc.c drm/exynos: Use devm_kzalloc in exynos_drm_ipp.c drm/exynos: fix gem buffer allocation type checking drm/exynos: remove needless parenthesis. drm/exynos: fix incorrect interrupt induced by m2m operation. ...

Linus Torvalds committed 13 years ago

Commit ca5c8a42 parents ed2c891 e8e896248 files · +447 −828Browse files

Unified · Split

48 files
  1. drivers/gpu/drm/exynos/exynos_drm_buf.c +53 −26
  2. drivers/gpu/drm/exynos/exynos_drm_buf.h +4 −18
  3. drivers/gpu/drm/exynos/exynos_drm_connector.c +4 −18
  4. drivers/gpu/drm/exynos/exynos_drm_connector.h +4 −18
  5. drivers/gpu/drm/exynos/exynos_drm_core.c +4 −18
  6. drivers/gpu/drm/exynos/exynos_drm_crtc.c +34 −18
  7. drivers/gpu/drm/exynos/exynos_drm_crtc.h +5 −18
  8. drivers/gpu/drm/exynos/exynos_drm_dmabuf.c +10 −19
  9. drivers/gpu/drm/exynos/exynos_drm_dmabuf.h +4 −18
  10. drivers/gpu/drm/exynos/exynos_drm_drv.c +4 −18
  11. drivers/gpu/drm/exynos/exynos_drm_drv.h +4 −18
  12. drivers/gpu/drm/exynos/exynos_drm_encoder.c +4 −18
  13. drivers/gpu/drm/exynos/exynos_drm_encoder.h +4 −18
  14. drivers/gpu/drm/exynos/exynos_drm_fb.c +4 −18
  15. drivers/gpu/drm/exynos/exynos_drm_fb.h +4 −18
  16. drivers/gpu/drm/exynos/exynos_drm_fbdev.c +22 −22
  17. drivers/gpu/drm/exynos/exynos_drm_fbdev.h +4 −18
  18. drivers/gpu/drm/exynos/exynos_drm_fimc.c +39 −85
  19. drivers/gpu/drm/exynos/exynos_drm_fimc.h +4 −18
  20. drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 −30
  21. drivers/gpu/drm/exynos/exynos_drm_gem.c +4 −18
  22. drivers/gpu/drm/exynos/exynos_drm_gem.h +4 −18
  23. drivers/gpu/drm/exynos/exynos_drm_gsc.c +12 −44
  24. drivers/gpu/drm/exynos/exynos_drm_gsc.h +4 −18
  25. drivers/gpu/drm/exynos/exynos_drm_hdmi.h +4 −18
  26. drivers/gpu/drm/exynos/exynos_drm_iommu.c +4 −18
  27. drivers/gpu/drm/exynos/exynos_drm_iommu.h +4 −18
  28. drivers/gpu/drm/exynos/exynos_drm_ipp.c +6 −16
  29. drivers/gpu/drm/exynos/exynos_drm_ipp.h +6 −20
  30. drivers/gpu/drm/exynos/exynos_drm_rotator.c +6 −22
  31. drivers/gpu/drm/exynos/exynos_drm_rotator.h +4 −18
  32. drivers/gpu/drm/exynos/exynos_drm_vidi.c +1 −29
  33. drivers/gpu/drm/exynos/exynos_drm_vidi.h +4 −18
  34. drivers/gpu/drm/exynos/exynos_hdmi.h +4 −18
  35. drivers/gpu/drm/exynos/exynos_mixer.c +3 −30
  36. drivers/gpu/drm/i915/i915_gem_dmabuf.c +5 −0
  37. drivers/gpu/drm/nouveau/nouveau_prime.c +1 −0
  38. drivers/gpu/drm/radeon/r600.c +5 −5
  39. drivers/gpu/drm/radeon/r600_cs.c +22 −9
  40. drivers/gpu/drm/radeon/radeon_asic.c +2 −2
  41. drivers/gpu/drm/radeon/radeon_asic.h +4 −0
  42. drivers/gpu/drm/radeon/radeon_device.c +28 −0
  43. drivers/gpu/drm/radeon/radeon_prime.c +1 −0
  44. drivers/gpu/drm/radeon/rv770.c +74 −0
  45. drivers/gpu/drm/ttm/ttm_bo_util.c +3 −1
  46. drivers/staging/omapdrm/omap_gem_dmabuf.c +5 −0
  47. include/drm/exynos_drm.h +4 −18
  48. include/uapi/drm/exynos_drm.h +6 −18
drivers/gpu/drm/exynos/exynos_drm_buf.c+53−26
@@ -3,24 +3,10 @@ · 2 unmodified lines
33 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
44 * Author: Inki Dae <inki.dae@samsung.com>
55 *
6− * Permission is hereby granted, free of charge, to any person obtaining a
7− * copy of this software and associated documentation files (the "Software"),
8− * to deal in the Software without restriction, including without limitation
9− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10− * and/or sell copies of the Software, and to permit persons to whom the
11− * Software is furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice (including the next
14− * paragraph) shall be included in all copies or substantial portions of the
15− * Software.
16− *
17− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23− * OTHER DEALINGS IN THE SOFTWARE.
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms of the GNU General Public License as published by the
8+ * Free Software Foundation; either version 2 of the License, or (at your
9+ * option) any later version.
2410 */
2511
2612 #include <drm/drmP.h>
@@ -29,6 +15,7 @@ · 2 unmodified lines
2915 #include "exynos_drm_drv.h"
3016 #include "exynos_drm_gem.h"
3117 #include "exynos_drm_buf.h"
18+#include "exynos_drm_iommu.h"
3219
3320 static int lowlevel_buffer_allocate(struct drm_device *dev,
3421 unsigned int flags, struct exynos_drm_gem_buf *buf)
@@ -51,7 +38,7 @@ static int lowlevel_buffer_allocate(struct drm_device *dev, · 16 unmodified lines
5138 * region will be allocated else physically contiguous
5239 * as possible.
5340 */
54− if (flags & EXYNOS_BO_CONTIG)
41+ if (!(flags & EXYNOS_BO_NONCONTIG))
5542 dma_set_attr(DMA_ATTR_FORCE_CONTIGUOUS, &buf->dma_attrs);
5643
5744 /*
@@ -66,14 +53,45 @@ static int lowlevel_buffer_allocate(struct drm_device *dev, · 8 unmodified lines
6653 dma_set_attr(attr, &buf->dma_attrs);
6754 dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &buf->dma_attrs);
6855
69− buf->pages = dma_alloc_attrs(dev->dev, buf->size,
70− &buf->dma_addr, GFP_KERNEL, &buf->dma_attrs);
71− if (!buf->pages) {
72− DRM_ERROR("failed to allocate buffer.\n");
73− return -ENOMEM;
56+ nr_pages = buf->size >> PAGE_SHIFT;
57+
58+ if (!is_drm_iommu_supported(dev)) {
59+ dma_addr_t start_addr;
60+ unsigned int i = 0;
61+
62+ buf->pages = kzalloc(sizeof(struct page) * nr_pages,
63+ GFP_KERNEL);
64+ if (!buf->pages) {
65+ DRM_ERROR("failed to allocate pages.\n");
66+ return -ENOMEM;
67+ }
68+
69+ buf->kvaddr = dma_alloc_attrs(dev->dev, buf->size,
70+ &buf->dma_addr, GFP_KERNEL,
71+ &buf->dma_attrs);
72+ if (!buf->kvaddr) {
73+ DRM_ERROR("failed to allocate buffer.\n");
74+ kfree(buf->pages);
75+ return -ENOMEM;
76+ }
77+
78+ start_addr = buf->dma_addr;
79+ while (i < nr_pages) {
80+ buf->pages[i] = phys_to_page(start_addr);
81+ start_addr += PAGE_SIZE;
82+ i++;
83+ }
84+ } else {
85+
86+ buf->pages = dma_alloc_attrs(dev->dev, buf->size,
87+ &buf->dma_addr, GFP_KERNEL,
88+ &buf->dma_attrs);
89+ if (!buf->pages) {
90+ DRM_ERROR("failed to allocate buffer.\n");
91+ return -ENOMEM;
92+ }
7493 }
7594
76− nr_pages = buf->size >> PAGE_SHIFT;
7795 buf->sgt = drm_prime_pages_to_sg(buf->pages, nr_pages);
7896 if (!buf->sgt) {
7997 DRM_ERROR("failed to get sg table.\n");
@@ -92,6 +110,9 @@ err_free_attrs: · 12 unmodified lines
92110 (dma_addr_t)buf->dma_addr, &buf->dma_attrs);
93111 buf->dma_addr = (dma_addr_t)NULL;
94112
113+ if (!is_drm_iommu_supported(dev))
114+ kfree(buf->pages);
115+
95116 return ret;
96117 }
97118
@@ -114,8 +135,14 @@ static void lowlevel_buffer_deallocate(struct drm_device *dev, · 16 unmodified lines
114135 kfree(buf->sgt);
115136 buf->sgt = NULL;
116137
117− dma_free_attrs(dev->dev, buf->size, buf->pages,
138+ if (!is_drm_iommu_supported(dev)) {
139+ dma_free_attrs(dev->dev, buf->size, buf->kvaddr,
118140 (dma_addr_t)buf->dma_addr, &buf->dma_attrs);
141+ kfree(buf->pages);
142+ } else
143+ dma_free_attrs(dev->dev, buf->size, buf->pages,
144+ (dma_addr_t)buf->dma_addr, &buf->dma_attrs);
145+
119146 buf->dma_addr = (dma_addr_t)NULL;
120147 }
121148
drivers/gpu/drm/exynos/exynos_drm_buf.h+4−18
@@ -3,24 +3,10 @@ · 2 unmodified lines
33 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
44 * Author: Inki Dae <inki.dae@samsung.com>
55 *
6− * Permission is hereby granted, free of charge, to any person obtaining a
7− * copy of this software and associated documentation files (the "Software"),
8− * to deal in the Software without restriction, including without limitation
9− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10− * and/or sell copies of the Software, and to permit persons to whom the
11− * Software is furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice (including the next
14− * paragraph) shall be included in all copies or substantial portions of the
15− * Software.
16− *
17− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23− * OTHER DEALINGS IN THE SOFTWARE.
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms of the GNU General Public License as published by the
8+ * Free Software Foundation; either version 2 of the License, or (at your
9+ * option) any later version.
2410 */
2511
2612 #ifndef _EXYNOS_DRM_BUF_H_
drivers/gpu/drm/exynos/exynos_drm_connector.c+4−18
@@ -5,24 +5,10 @@ · 4 unmodified lines
55 * Joonyoung Shim <jy0922.shim@samsung.com>
66 * Seung-Woo Kim <sw0312.kim@samsung.com>
77 *
8− * Permission is hereby granted, free of charge, to any person obtaining a
9− * copy of this software and associated documentation files (the "Software"),
10− * to deal in the Software without restriction, including without limitation
11− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12− * and/or sell copies of the Software, and to permit persons to whom the
13− * Software is furnished to do so, subject to the following conditions:
14− *
15− * The above copyright notice and this permission notice (including the next
16− * paragraph) shall be included in all copies or substantial portions of the
17− * Software.
18− *
19− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25− * OTHER DEALINGS IN THE SOFTWARE.
8+ * This program is free software; you can redistribute it and/or modify it
9+ * under the terms of the GNU General Public License as published by the
10+ * Free Software Foundation; either version 2 of the License, or (at your
11+ * option) any later version.
2612 */
2713
2814 #include <drm/drmP.h>
drivers/gpu/drm/exynos/exynos_drm_connector.h+4−18
@@ -5,24 +5,10 @@ · 4 unmodified lines
55 * Joonyoung Shim <jy0922.shim@samsung.com>
66 * Seung-Woo Kim <sw0312.kim@samsung.com>
77 *
8− * Permission is hereby granted, free of charge, to any person obtaining a
9− * copy of this software and associated documentation files (the "Software"),
10− * to deal in the Software without restriction, including without limitation
11− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12− * and/or sell copies of the Software, and to permit persons to whom the
13− * Software is furnished to do so, subject to the following conditions:
14− *
15− * The above copyright notice and this permission notice (including the next
16− * paragraph) shall be included in all copies or substantial portions of the
17− * Software.
18− *
19− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25− * OTHER DEALINGS IN THE SOFTWARE.
8+ * This program is free software; you can redistribute it and/or modify it
9+ * under the terms of the GNU General Public License as published by the
10+ * Free Software Foundation; either version 2 of the License, or (at your
11+ * option) any later version.
2612 */
2713
2814 #ifndef _EXYNOS_DRM_CONNECTOR_H_
drivers/gpu/drm/exynos/exynos_drm_core.c+4−18
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Joonyoung Shim <jy0922.shim@samsung.com>
77 * Seung-Woo Kim <sw0312.kim@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814
2915 #include <drm/drmP.h>
drivers/gpu/drm/exynos/exynos_drm_crtc.c+34−18
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Joonyoung Shim <jy0922.shim@samsung.com>
77 * Seung-Woo Kim <sw0312.kim@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814
2915 #include <drm/drmP.h>
@@ -407,3 +393,33 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc) · 377 unmodified lines
407393 exynos_drm_fn_encoder(private->crtc[crtc], &crtc,
408394 exynos_drm_disable_vblank);
409395 }
396+
397+void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc)
398+{
399+ struct exynos_drm_private *dev_priv = dev->dev_private;
400+ struct drm_pending_vblank_event *e, *t;
401+ struct timeval now;
402+ unsigned long flags;
403+
404+ DRM_DEBUG_KMS("%s\n", __FILE__);
405+
406+ spin_lock_irqsave(&dev->event_lock, flags);
407+
408+ list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
409+ base.link) {
410+ /* if event's pipe isn't same as crtc then ignore it. */
411+ if (crtc != e->pipe)
412+ continue;
413+
414+ do_gettimeofday(&now);
415+ e->event.sequence = 0;
416+ e->event.tv_sec = now.tv_sec;
417+ e->event.tv_usec = now.tv_usec;
418+
419+ list_move_tail(&e->base.link, &e->base.file_priv->event_list);
420+ wake_up_interruptible(&e->base.file_priv->event_wait);
421+ drm_vblank_put(dev, crtc);
422+ }
423+
424+ spin_unlock_irqrestore(&dev->event_lock, flags);
425+}
drivers/gpu/drm/exynos/exynos_drm_crtc.h+5−18
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Joonyoung Shim <jy0922.shim@samsung.com>
77 * Seung-Woo Kim <sw0312.kim@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814
2915 #ifndef _EXYNOS_DRM_CRTC_H_
@@ -32,5 +18,6 @@ · 2 unmodified lines
3218 int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr);
3319 int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int crtc);
3420 void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc);
21+void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc);
3522
3623 #endif
drivers/gpu/drm/exynos/exynos_drm_dmabuf.c+10−19
@@ -3,24 +3,10 @@ · 2 unmodified lines
33 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
44 * Author: Inki Dae <inki.dae@samsung.com>
55 *
6− * Permission is hereby granted, free of charge, to any person obtaining a
7− * copy of this software and associated documentation files (the "Software"),
8− * to deal in the Software without restriction, including without limitation
9− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10− * and/or sell copies of the Software, and to permit persons to whom the
11− * Software is furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice (including the next
14− * paragraph) shall be included in all copies or substantial portions of the
15− * Software.
16− *
17− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23− * OTHER DEALINGS IN THE SOFTWARE.
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms of the GNU General Public License as published by the
8+ * Free Software Foundation; either version 2 of the License, or (at your
9+ * option) any later version.
2410 */
2511
2612 #include <drm/drmP.h>
@@ -222,7 +208,7 @@ struct dma_buf *exynos_dmabuf_prime_export(struct drm_device *drm_dev, · 195 unmodified lines
222208 struct exynos_drm_gem_obj *exynos_gem_obj = to_exynos_gem_obj(obj);
223209
224210 return dma_buf_export(exynos_gem_obj, &exynos_dmabuf_ops,
225− exynos_gem_obj->base.size, 0600);
211+ exynos_gem_obj->base.size, flags);
226212 }
227213
228214 struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev,
@@ -246,7 +232,12 @@ struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev, · 17 unmodified lines
246232
247233 /* is it from our device? */
248234 if (obj->dev == drm_dev) {
235+ /*
236+ * Importing dmabuf exported from out own gem increases
237+ * refcount on gem itself instead of f_count of dmabuf.
238+ */
249239 drm_gem_object_reference(obj);
240+ dma_buf_put(dma_buf);
250241 return obj;
251242 }
252243 }
drivers/gpu/drm/exynos/exynos_drm_dmabuf.h+4−18
@@ -3,24 +3,10 @@ · 2 unmodified lines
33 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
44 * Author: Inki Dae <inki.dae@samsung.com>
55 *
6− * Permission is hereby granted, free of charge, to any person obtaining a
7− * copy of this software and associated documentation files (the "Software"),
8− * to deal in the Software without restriction, including without limitation
9− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10− * and/or sell copies of the Software, and to permit persons to whom the
11− * Software is furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice (including the next
14− * paragraph) shall be included in all copies or substantial portions of the
15− * Software.
16− *
17− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23− * OTHER DEALINGS IN THE SOFTWARE.
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms of the GNU General Public License as published by the
8+ * Free Software Foundation; either version 2 of the License, or (at your
9+ * option) any later version.
2410 */
2511
2612 #ifndef _EXYNOS_DRM_DMABUF_H_
drivers/gpu/drm/exynos/exynos_drm_drv.c+4−18
@@ -5,24 +5,10 @@ · 4 unmodified lines
55 * Joonyoung Shim <jy0922.shim@samsung.com>
66 * Seung-Woo Kim <sw0312.kim@samsung.com>
77 *
8− * Permission is hereby granted, free of charge, to any person obtaining a
9− * copy of this software and associated documentation files (the "Software"),
10− * to deal in the Software without restriction, including without limitation
11− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12− * and/or sell copies of the Software, and to permit persons to whom the
13− * Software is furnished to do so, subject to the following conditions:
14− *
15− * The above copyright notice and this permission notice (including the next
16− * paragraph) shall be included in all copies or substantial portions of the
17− * Software.
18− *
19− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25− * OTHER DEALINGS IN THE SOFTWARE.
8+ * This program is free software; you can redistribute it and/or modify it
9+ * under the terms of the GNU General Public License as published by the
10+ * Free Software Foundation; either version 2 of the License, or (at your
11+ * option) any later version.
2612 */
2713
2814 #include <drm/drmP.h>
drivers/gpu/drm/exynos/exynos_drm_drv.h+4−18
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Joonyoung Shim <jy0922.shim@samsung.com>
77 * Seung-Woo Kim <sw0312.kim@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814
2915 #ifndef _EXYNOS_DRM_DRV_H_
drivers/gpu/drm/exynos/exynos_drm_encoder.c+4−18
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Joonyoung Shim <jy0922.shim@samsung.com>
77 * Seung-Woo Kim <sw0312.kim@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814
2915 #include <drm/drmP.h>
drivers/gpu/drm/exynos/exynos_drm_encoder.h+4−18
@@ -5,24 +5,10 @@ · 4 unmodified lines
55 * Joonyoung Shim <jy0922.shim@samsung.com>
66 * Seung-Woo Kim <sw0312.kim@samsung.com>
77 *
8− * Permission is hereby granted, free of charge, to any person obtaining a
9− * copy of this software and associated documentation files (the "Software"),
10− * to deal in the Software without restriction, including without limitation
11− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12− * and/or sell copies of the Software, and to permit persons to whom the
13− * Software is furnished to do so, subject to the following conditions:
14− *
15− * The above copyright notice and this permission notice (including the next
16− * paragraph) shall be included in all copies or substantial portions of the
17− * Software.
18− *
19− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25− * OTHER DEALINGS IN THE SOFTWARE.
8+ * This program is free software; you can redistribute it and/or modify it
9+ * under the terms of the GNU General Public License as published by the
10+ * Free Software Foundation; either version 2 of the License, or (at your
11+ * option) any later version.
2612 */
2713
2814 #ifndef _EXYNOS_DRM_ENCODER_H_
drivers/gpu/drm/exynos/exynos_drm_fb.c+4−18
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Joonyoung Shim <jy0922.shim@samsung.com>
77 * Seung-Woo Kim <sw0312.kim@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814
2915 #include <drm/drmP.h>
drivers/gpu/drm/exynos/exynos_drm_fb.h+4−18
@@ -5,24 +5,10 @@ · 4 unmodified lines
55 * Joonyoung Shim <jy0922.shim@samsung.com>
66 * Seung-Woo Kim <sw0312.kim@samsung.com>
77 *
8− * Permission is hereby granted, free of charge, to any person obtaining a
9− * copy of this software and associated documentation files (the "Software"),
10− * to deal in the Software without restriction, including without limitation
11− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12− * and/or sell copies of the Software, and to permit persons to whom the
13− * Software is furnished to do so, subject to the following conditions:
14− *
15− * The above copyright notice and this permission notice (including the next
16− * paragraph) shall be included in all copies or substantial portions of the
17− * Software.
18− *
19− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25− * OTHER DEALINGS IN THE SOFTWARE.
8+ * This program is free software; you can redistribute it and/or modify it
9+ * under the terms of the GNU General Public License as published by the
10+ * Free Software Foundation; either version 2 of the License, or (at your
11+ * option) any later version.
2612 */
2713
2814 #ifndef _EXYNOS_DRM_FB_H_
drivers/gpu/drm/exynos/exynos_drm_fbdev.c+22−22
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Joonyoung Shim <jy0922.shim@samsung.com>
77 * Seung-Woo Kim <sw0312.kim@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814
2915 #include <drm/drmP.h>
@@ -34,6 +20,7 @@ · 4 unmodified lines
3420 #include "exynos_drm_drv.h"
3521 #include "exynos_drm_fb.h"
3622 #include "exynos_drm_gem.h"
23+#include "exynos_drm_iommu.h"
3724
3825 #define MAX_CONNECTOR 4
3926 #define PREFERRED_BPP 32
@@ -111,9 +98,18 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper, · 71 unmodified lines
11198
11299 /* map pages with kernel virtual space. */
113100 if (!buffer->kvaddr) {
114− unsigned int nr_pages = buffer->size >> PAGE_SHIFT;
115− buffer->kvaddr = vmap(buffer->pages, nr_pages, VM_MAP,
101+ if (is_drm_iommu_supported(dev)) {
102+ unsigned int nr_pages = buffer->size >> PAGE_SHIFT;
103+
104+ buffer->kvaddr = vmap(buffer->pages, nr_pages, VM_MAP,
116105 pgprot_writecombine(PAGE_KERNEL));
106+ } else {
107+ phys_addr_t dma_addr = buffer->dma_addr;
108+ if (dma_addr)
109+ buffer->kvaddr = phys_to_virt(dma_addr);
110+ else
111+ buffer->kvaddr = (void __iomem *)NULL;
112+ }
117113 if (!buffer->kvaddr) {
118114 DRM_ERROR("failed to map pages to kernel space.\n");
119115 return -EIO;
@@ -128,8 +124,12 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper, · 8 unmodified lines
128124
129125 dev->mode_config.fb_base = (resource_size_t)buffer->dma_addr;
130126 fbi->screen_base = buffer->kvaddr + offset;
131− fbi->fix.smem_start = (unsigned long)
127+ if (is_drm_iommu_supported(dev))
128+ fbi->fix.smem_start = (unsigned long)
132129 (page_to_phys(sg_page(buffer->sgt->sgl)) + offset);
130+ else
131+ fbi->fix.smem_start = (unsigned long)buffer->dma_addr;
132+
133133 fbi->screen_size = size;
134134 fbi->fix.smem_len = size;
135135
@@ -320,7 +320,7 @@ static void exynos_drm_fbdev_destroy(struct drm_device *dev, · 184 unmodified lines
320320 struct exynos_drm_gem_obj *exynos_gem_obj = exynos_fbd->exynos_gem_obj;
321321 struct drm_framebuffer *fb;
322322
323− if (exynos_gem_obj->buffer->kvaddr)
323+ if (is_drm_iommu_supported(dev) && exynos_gem_obj->buffer->kvaddr)
324324 vunmap(exynos_gem_obj->buffer->kvaddr);
325325
326326 /* release drm framebuffer and real buffer */
drivers/gpu/drm/exynos/exynos_drm_fbdev.h+4−18
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Joonyoung Shim <jy0922.shim@samsung.com>
77 * Seung-Woo Kim <sw0312.kim@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814
2915 #ifndef _EXYNOS_DRM_FBDEV_H_
drivers/gpu/drm/exynos/exynos_drm_fimc.c+39−85
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 #include "exynos_drm_fimc.h"
2626
2727 /*
28− * FIMC is stand for Fully Interactive Mobile Camera and
28+ * FIMC stands for Fully Interactive Mobile Camera and
2929 * supports image scaler/rotator and input/output DMA operations.
3030 * input DMA reads image data from the memory.
3131 * output DMA writes image data to memory.
@@ -163,19 +163,29 @@ struct fimc_context { · 131 unmodified lines
163163 bool suspended;
164164 };
165165
166−static void fimc_sw_reset(struct fimc_context *ctx, bool pattern)
166+static void fimc_sw_reset(struct fimc_context *ctx)
167167 {
168168 u32 cfg;
169169
170− DRM_DEBUG_KMS("%s:pattern[%d]\n", __func__, pattern);
170+ DRM_DEBUG_KMS("%s\n", __func__);
171+
172+ /* stop dma operation */
173+ cfg = fimc_read(EXYNOS_CISTATUS);
174+ if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg)) {
175+ cfg = fimc_read(EXYNOS_MSCTRL);
176+ cfg &= ~EXYNOS_MSCTRL_ENVID;
177+ fimc_write(cfg, EXYNOS_MSCTRL);
178+ }
171179
172180 cfg = fimc_read(EXYNOS_CISRCFMT);
173181 cfg |= EXYNOS_CISRCFMT_ITU601_8BIT;
174− if (pattern)
175− cfg |= EXYNOS_CIGCTRL_TESTPATTERN_COLOR_BAR;
176−
177182 fimc_write(cfg, EXYNOS_CISRCFMT);
178183
184+ /* disable image capture */
185+ cfg = fimc_read(EXYNOS_CIIMGCPT);
186+ cfg &= ~(EXYNOS_CIIMGCPT_IMGCPTEN_SC | EXYNOS_CIIMGCPT_IMGCPTEN);
187+ fimc_write(cfg, EXYNOS_CIIMGCPT);
188+
179189 /* s/w reset */
180190 cfg = fimc_read(EXYNOS_CIGCTRL);
181191 cfg |= (EXYNOS_CIGCTRL_SWRST);
@@ -695,7 +705,7 @@ static int fimc_src_set_addr(struct device *dev, · 513 unmodified lines
695705 {
696706 struct fimc_context *ctx = get_fimc_context(dev);
697707 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
698− struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
708+ struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
699709 struct drm_exynos_ipp_property *property;
700710 struct drm_exynos_ipp_config *config;
701711
@@ -705,10 +715,6 @@ static int fimc_src_set_addr(struct device *dev, · 3 unmodified lines
705715 }
706716
707717 property = &c_node->property;
708− if (!property) {
709− DRM_ERROR("failed to get property.\n");
710− return -EINVAL;
711− }
712718
713719 DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
714720 property->prop_id, buf_id, buf_type);
@@ -1206,7 +1212,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id, · 491 unmodified lines
12061212 }
12071213
12081214 /* sequence id */
1209− cfg &= (~mask);
1215+ cfg &= ~mask;
12101216 cfg |= (enable << buf_id);
12111217 fimc_write(cfg, EXYNOS_CIFCNTSEQ);
12121218
@@ -1231,7 +1237,7 @@ static int fimc_dst_set_addr(struct device *dev, · 18 unmodified lines
12311237 {
12321238 struct fimc_context *ctx = get_fimc_context(dev);
12331239 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
1234− struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
1240+ struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
12351241 struct drm_exynos_ipp_property *property;
12361242 struct drm_exynos_ipp_config *config;
12371243
@@ -1241,10 +1247,6 @@ static int fimc_dst_set_addr(struct device *dev, · 3 unmodified lines
12411247 }
12421248
12431249 property = &c_node->property;
1244− if (!property) {
1245− DRM_ERROR("failed to get property.\n");
1246− return -EINVAL;
1247− }
12481250
12491251 DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
12501252 property->prop_id, buf_id, buf_type);
@@ -1317,7 +1319,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id) · 66 unmodified lines
13171319 {
13181320 struct fimc_context *ctx = dev_id;
13191321 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
1320− struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
1322+ struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
13211323 struct drm_exynos_ipp_event_work *event_work =
13221324 c_node->event_work;
13231325 int buf_id;
@@ -1395,6 +1397,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip) · 71 unmodified lines
13951397 case EXYNOS_DRM_FLIP_NONE:
13961398 case EXYNOS_DRM_FLIP_VERTICAL:
13971399 case EXYNOS_DRM_FLIP_HORIZONTAL:
1400+ case EXYNOS_DRM_FLIP_BOTH:
13981401 return true;
13991402 default:
14001403 DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
@@ -1543,7 +1546,7 @@ static int fimc_ippdrv_reset(struct device *dev) · 142 unmodified lines
15431546 DRM_DEBUG_KMS("%s\n", __func__);
15441547
15451548 /* reset h/w block */
1546− fimc_sw_reset(ctx, false);
1549+ fimc_sw_reset(ctx);
15471550
15481551 /* reset scaler capability */
15491552 memset(&ctx->sc, 0x0, sizeof(ctx->sc));
@@ -1557,7 +1560,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) · 7 unmodified lines
15571560 {
15581561 struct fimc_context *ctx = get_fimc_context(dev);
15591562 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
1560− struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
1563+ struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
15611564 struct drm_exynos_ipp_property *property;
15621565 struct drm_exynos_ipp_config *config;
15631566 struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX];
@@ -1573,10 +1576,6 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) · 9 unmodified lines
15731576 }
15741577
15751578 property = &c_node->property;
1576− if (!property) {
1577− DRM_ERROR("failed to get property.\n");
1578− return -EINVAL;
1579− }
15801579
15811580 fimc_handle_irq(ctx, true, false, true);
15821581
@@ -1739,93 +1738,64 @@ static int fimc_probe(struct platform_device *pdev) · 156 unmodified lines
17391738 platform_get_device_id(pdev)->driver_data;
17401739
17411740 /* clock control */
1742− ctx->sclk_fimc_clk = clk_get(dev, "sclk_fimc");
1741+ ctx->sclk_fimc_clk = devm_clk_get(dev, "sclk_fimc");
17431742 if (IS_ERR(ctx->sclk_fimc_clk)) {
17441743 dev_err(dev, "failed to get src fimc clock.\n");
1745− ret = PTR_ERR(ctx->sclk_fimc_clk);
1746− goto err_ctx;
1744+ return PTR_ERR(ctx->sclk_fimc_clk);
17471745 }
17481746 clk_enable(ctx->sclk_fimc_clk);
17491747
1750− ctx->fimc_clk = clk_get(dev, "fimc");
1748+ ctx->fimc_clk = devm_clk_get(dev, "fimc");
17511749 if (IS_ERR(ctx->fimc_clk)) {
17521750 dev_err(dev, "failed to get fimc clock.\n");
1753− ret = PTR_ERR(ctx->fimc_clk);
17541751 clk_disable(ctx->sclk_fimc_clk);
1755− clk_put(ctx->sclk_fimc_clk);
1756− goto err_ctx;
1752+ return PTR_ERR(ctx->fimc_clk);
17571753 }
17581754
1759− ctx->wb_clk = clk_get(dev, "pxl_async0");
1755+ ctx->wb_clk = devm_clk_get(dev, "pxl_async0");
17601756 if (IS_ERR(ctx->wb_clk)) {
17611757 dev_err(dev, "failed to get writeback a clock.\n");
1762− ret = PTR_ERR(ctx->wb_clk);
17631758 clk_disable(ctx->sclk_fimc_clk);
1764− clk_put(ctx->sclk_fimc_clk);
1765− clk_put(ctx->fimc_clk);
1766− goto err_ctx;
1759+ return PTR_ERR(ctx->wb_clk);
17671760 }
17681761
1769− ctx->wb_b_clk = clk_get(dev, "pxl_async1");
1762+ ctx->wb_b_clk = devm_clk_get(dev, "pxl_async1");
17701763 if (IS_ERR(ctx->wb_b_clk)) {
17711764 dev_err(dev, "failed to get writeback b clock.\n");
1772− ret = PTR_ERR(ctx->wb_b_clk);
17731765 clk_disable(ctx->sclk_fimc_clk);
1774− clk_put(ctx->sclk_fimc_clk);
1775− clk_put(ctx->fimc_clk);
1776− clk_put(ctx->wb_clk);
1777− goto err_ctx;
1766+ return PTR_ERR(ctx->wb_b_clk);
17781767 }
17791768
1780− parent_clk = clk_get(dev, ddata->parent_clk);
1769+ parent_clk = devm_clk_get(dev, ddata->parent_clk);
17811770
17821771 if (IS_ERR(parent_clk)) {
17831772 dev_err(dev, "failed to get parent clock.\n");
1784− ret = PTR_ERR(parent_clk);
17851773 clk_disable(ctx->sclk_fimc_clk);
1786− clk_put(ctx->sclk_fimc_clk);
1787− clk_put(ctx->fimc_clk);
1788− clk_put(ctx->wb_clk);
1789− clk_put(ctx->wb_b_clk);
1790− goto err_ctx;
1774+ return PTR_ERR(parent_clk);
17911775 }
17921776
17931777 if (clk_set_parent(ctx->sclk_fimc_clk, parent_clk)) {
17941778 dev_err(dev, "failed to set parent.\n");
1795− ret = -EINVAL;
1796− clk_put(parent_clk);
17971779 clk_disable(ctx->sclk_fimc_clk);
1798− clk_put(ctx->sclk_fimc_clk);
1799− clk_put(ctx->fimc_clk);
1800− clk_put(ctx->wb_clk);
1801− clk_put(ctx->wb_b_clk);
1802− goto err_ctx;
1780+ return -EINVAL;
18031781 }
18041782
1805− clk_put(parent_clk);
1783+ devm_clk_put(dev, parent_clk);
18061784 clk_set_rate(ctx->sclk_fimc_clk, pdata->clk_rate);
18071785
18081786 /* resource memory */
18091787 ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1810− if (!ctx->regs_res) {
1811− dev_err(dev, "failed to find registers.\n");
1812− ret = -ENOENT;
1813− goto err_clk;
1814− }
1815−
18161788 ctx->regs = devm_request_and_ioremap(dev, ctx->regs_res);
18171789 if (!ctx->regs) {
18181790 dev_err(dev, "failed to map registers.\n");
1819− ret = -ENXIO;
1820− goto err_clk;
1791+ return -ENXIO;
18211792 }
18221793
18231794 /* resource irq */
18241795 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
18251796 if (!res) {
18261797 dev_err(dev, "failed to request irq resource.\n");
1827− ret = -ENOENT;
1828− goto err_get_regs;
1798+ return -ENOENT;
18291799 }
18301800
18311801 ctx->irq = res->start;
@@ -1833,7 +1803,7 @@ static int fimc_probe(struct platform_device *pdev) · 1 unmodified line
18331803 IRQF_ONESHOT, "drm_fimc", ctx);
18341804 if (ret < 0) {
18351805 dev_err(dev, "failed to request irq.\n");
1836− goto err_get_regs;
1806+ return ret;
18371807 }
18381808
18391809 /* context initailization */
@@ -1879,15 +1849,7 @@ err_ippdrv_register: · 39 unmodified lines
18791849 pm_runtime_disable(dev);
18801850 err_get_irq:
18811851 free_irq(ctx->irq, ctx);
1882−err_get_regs:
1883− devm_iounmap(dev, ctx->regs);
1884−err_clk:
1885− clk_put(ctx->sclk_fimc_clk);
1886− clk_put(ctx->fimc_clk);
1887− clk_put(ctx->wb_clk);
1888− clk_put(ctx->wb_b_clk);
1889−err_ctx:
1890− devm_kfree(dev, ctx);
1852+
18911853 return ret;
18921854 }
18931855
@@ -1905,14 +1867,6 @@ static int fimc_remove(struct platform_device *pdev) · 11 unmodified lines
19051867 pm_runtime_disable(dev);
19061868
19071869 free_irq(ctx->irq, ctx);
1908− devm_iounmap(dev, ctx->regs);
1909−
1910− clk_put(ctx->sclk_fimc_clk);
1911− clk_put(ctx->fimc_clk);
1912− clk_put(ctx->wb_clk);
1913− clk_put(ctx->wb_b_clk);
1914−
1915− devm_kfree(dev, ctx);
19161870
19171871 return 0;
19181872 }
drivers/gpu/drm/exynos/exynos_drm_fimc.h+4−18
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Jinyoung Jeon <jy0.jeon@samsung.com>
77 * Sangmin Lee <lsmin.lee@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814
2915 #ifndef _EXYNOS_DRM_FIMC_H_
drivers/gpu/drm/exynos/exynos_drm_fimd.c+2−30
@@ -663,34 +663,6 @@ static struct exynos_drm_manager fimd_manager = { · 662 unmodified lines
663663 .display_ops = &fimd_display_ops,
664664 };
665665
666−static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc)
667−{
668− struct exynos_drm_private *dev_priv = drm_dev->dev_private;
669− struct drm_pending_vblank_event *e, *t;
670− struct timeval now;
671− unsigned long flags;
672−
673− spin_lock_irqsave(&drm_dev->event_lock, flags);
674−
675− list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
676− base.link) {
677− /* if event's pipe isn't same as crtc then ignore it. */
678− if (crtc != e->pipe)
679− continue;
680−
681− do_gettimeofday(&now);
682− e->event.sequence = 0;
683− e->event.tv_sec = now.tv_sec;
684− e->event.tv_usec = now.tv_usec;
685−
686− list_move_tail(&e->base.link, &e->base.file_priv->event_list);
687− wake_up_interruptible(&e->base.file_priv->event_wait);
688− drm_vblank_put(drm_dev, crtc);
689− }
690−
691− spin_unlock_irqrestore(&drm_dev->event_lock, flags);
692−}
693−
694666 static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
695667 {
696668 struct fimd_context *ctx = (struct fimd_context *)dev_id;
@@ -710,7 +682,7 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id) · 13 unmodified lines
710682 goto out;
711683
712684 drm_handle_vblank(drm_dev, manager->pipe);
713− fimd_finish_pageflip(drm_dev, manager->pipe);
685+ exynos_drm_crtc_finish_pageflip(drm_dev, manager->pipe);
714686
715687 /* set wait vsync event to zero and wake up queue. */
716688 if (atomic_read(&ctx->wait_vsync_event)) {
@@ -1046,7 +1018,7 @@ static int fimd_resume(struct device *dev) · 329 unmodified lines
10461018 * of pm runtime would still be 1 so in this case, fimd driver
10471019 * should be on directly not drawing on pm runtime interface.
10481020 */
1049− if (pm_runtime_suspended(dev)) {
1021+ if (!pm_runtime_suspended(dev)) {
10501022 int ret;
10511023
10521024 ret = fimd_activate(ctx, true);
drivers/gpu/drm/exynos/exynos_drm_gem.c+4−18
@@ -3,24 +3,10 @@ · 2 unmodified lines
33 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
44 * Author: Inki Dae <inki.dae@samsung.com>
55 *
6− * Permission is hereby granted, free of charge, to any person obtaining a
7− * copy of this software and associated documentation files (the "Software"),
8− * to deal in the Software without restriction, including without limitation
9− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10− * and/or sell copies of the Software, and to permit persons to whom the
11− * Software is furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice (including the next
14− * paragraph) shall be included in all copies or substantial portions of the
15− * Software.
16− *
17− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23− * OTHER DEALINGS IN THE SOFTWARE.
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms of the GNU General Public License as published by the
8+ * Free Software Foundation; either version 2 of the License, or (at your
9+ * option) any later version.
2410 */
2511
2612 #include <drm/drmP.h>
drivers/gpu/drm/exynos/exynos_drm_gem.h+4−18
@@ -3,24 +3,10 @@ · 2 unmodified lines
33 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
44 * Authoer: Inki Dae <inki.dae@samsung.com>
55 *
6− * Permission is hereby granted, free of charge, to any person obtaining a
7− * copy of this software and associated documentation files (the "Software"),
8− * to deal in the Software without restriction, including without limitation
9− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10− * and/or sell copies of the Software, and to permit persons to whom the
11− * Software is furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice (including the next
14− * paragraph) shall be included in all copies or substantial portions of the
15− * Software.
16− *
17− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23− * OTHER DEALINGS IN THE SOFTWARE.
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms of the GNU General Public License as published by the
8+ * Free Software Foundation; either version 2 of the License, or (at your
9+ * option) any later version.
2410 */
2511
2612 #ifndef _EXYNOS_DRM_GEM_H_
drivers/gpu/drm/exynos/exynos_drm_gsc.c+12−44
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 #include "exynos_drm_gsc.h"
2626
2727 /*
28− * GSC is stand for General SCaler and
28+ * GSC stands for General SCaler and
2929 * supports image scaler/rotator and input/output DMA operations.
3030 * input DMA reads image data from the memory.
3131 * output DMA writes image data to memory.
@@ -711,7 +711,7 @@ static int gsc_src_set_addr(struct device *dev, · 679 unmodified lines
711711 {
712712 struct gsc_context *ctx = get_gsc_context(dev);
713713 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
714− struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
714+ struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
715715 struct drm_exynos_ipp_property *property;
716716
717717 if (!c_node) {
@@ -720,10 +720,6 @@ static int gsc_src_set_addr(struct device *dev, · 2 unmodified lines
720720 }
721721
722722 property = &c_node->property;
723− if (!property) {
724− DRM_ERROR("failed to get property.\n");
725− return -EFAULT;
726− }
727723
728724 DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
729725 property->prop_id, buf_id, buf_type);
@@ -1171,7 +1167,7 @@ static int gsc_dst_set_addr(struct device *dev, · 441 unmodified lines
11711167 {
11721168 struct gsc_context *ctx = get_gsc_context(dev);
11731169 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
1174− struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
1170+ struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
11751171 struct drm_exynos_ipp_property *property;
11761172
11771173 if (!c_node) {
@@ -1180,10 +1176,6 @@ static int gsc_dst_set_addr(struct device *dev, · 2 unmodified lines
11801176 }
11811177
11821178 property = &c_node->property;
1183− if (!property) {
1184− DRM_ERROR("failed to get property.\n");
1185− return -EFAULT;
1186− }
11871179
11881180 DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
11891181 property->prop_id, buf_id, buf_type);
@@ -1312,7 +1304,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id) · 122 unmodified lines
13121304 {
13131305 struct gsc_context *ctx = dev_id;
13141306 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
1315− struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
1307+ struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
13161308 struct drm_exynos_ipp_event_work *event_work =
13171309 c_node->event_work;
13181310 u32 status;
@@ -1399,7 +1391,7 @@ static inline bool gsc_check_drm_flip(enum drm_exynos_flip flip) · 80 unmodified lines
13991391 case EXYNOS_DRM_FLIP_NONE:
14001392 case EXYNOS_DRM_FLIP_VERTICAL:
14011393 case EXYNOS_DRM_FLIP_HORIZONTAL:
1402− case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL:
1394+ case EXYNOS_DRM_FLIP_BOTH:
14031395 return true;
14041396 default:
14051397 DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
@@ -1549,7 +1541,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) · 143 unmodified lines
15491541 {
15501542 struct gsc_context *ctx = get_gsc_context(dev);
15511543 struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
1552− struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
1544+ struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
15531545 struct drm_exynos_ipp_property *property;
15541546 struct drm_exynos_ipp_config *config;
15551547 struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX];
@@ -1565,10 +1557,6 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) · 9 unmodified lines
15651557 }
15661558
15671559 property = &c_node->property;
1568− if (!property) {
1569− DRM_ERROR("failed to get property.\n");
1570− return -EINVAL;
1571− }
15721560
15731561 gsc_handle_irq(ctx, true, false, true);
15741562
@@ -1604,7 +1592,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) · 29 unmodified lines
16041592 exynos_drm_ippnb_send_event(IPP_SET_WRITEBACK, (void *)&set_wb);
16051593
16061594 /* src local path */
1607− cfg = readl(GSC_IN_CON);
1595+ cfg = gsc_read(GSC_IN_CON);
16081596 cfg &= ~(GSC_IN_PATH_MASK | GSC_IN_LOCAL_SEL_MASK);
16091597 cfg |= (GSC_IN_PATH_LOCAL | GSC_IN_LOCAL_FIMD_WB);
16101598 gsc_write(cfg, GSC_IN_CON);
@@ -1696,34 +1684,25 @@ static int gsc_probe(struct platform_device *pdev) · 85 unmodified lines
16961684 return -ENOMEM;
16971685
16981686 /* clock control */
1699− ctx->gsc_clk = clk_get(dev, "gscl");
1687+ ctx->gsc_clk = devm_clk_get(dev, "gscl");
17001688 if (IS_ERR(ctx->gsc_clk)) {
17011689 dev_err(dev, "failed to get gsc clock.\n");
1702− ret = PTR_ERR(ctx->gsc_clk);
1703− goto err_ctx;
1690+ return PTR_ERR(ctx->gsc_clk);
17041691 }
17051692
17061693 /* resource memory */
17071694 ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1708− if (!ctx->regs_res) {
1709− dev_err(dev, "failed to find registers.\n");
1710− ret = -ENOENT;
1711− goto err_clk;
1712− }
1713−
17141695 ctx->regs = devm_request_and_ioremap(dev, ctx->regs_res);
17151696 if (!ctx->regs) {
17161697 dev_err(dev, "failed to map registers.\n");
1717− ret = -ENXIO;
1718− goto err_clk;
1698+ return -ENXIO;
17191699 }
17201700
17211701 /* resource irq */
17221702 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
17231703 if (!res) {
17241704 dev_err(dev, "failed to request irq resource.\n");
1725− ret = -ENOENT;
1726− goto err_get_regs;
1705+ return -ENOENT;
17271706 }
17281707
17291708 ctx->irq = res->start;
@@ -1731,7 +1710,7 @@ static int gsc_probe(struct platform_device *pdev) · 1 unmodified line
17311710 IRQF_ONESHOT, "drm_gsc", ctx);
17321711 if (ret < 0) {
17331712 dev_err(dev, "failed to request irq.\n");
1734− goto err_get_regs;
1713+ return ret;
17351714 }
17361715
17371716 /* context initailization */
@@ -1775,12 +1754,6 @@ err_ippdrv_register: · 37 unmodified lines
17751754 pm_runtime_disable(dev);
17761755 err_get_irq:
17771756 free_irq(ctx->irq, ctx);
1778−err_get_regs:
1779− devm_iounmap(dev, ctx->regs);
1780−err_clk:
1781− clk_put(ctx->gsc_clk);
1782−err_ctx:
1783− devm_kfree(dev, ctx);
17841757 return ret;
17851758 }
17861759
@@ -1798,11 +1771,6 @@ static int gsc_remove(struct platform_device *pdev) · 11 unmodified lines
17981771 pm_runtime_disable(dev);
17991772
18001773 free_irq(ctx->irq, ctx);
1801− devm_iounmap(dev, ctx->regs);
1802−
1803− clk_put(ctx->gsc_clk);
1804−
1805− devm_kfree(dev, ctx);
18061774
18071775 return 0;
18081776 }
drivers/gpu/drm/exynos/exynos_drm_gsc.h+4−18
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Jinyoung Jeon <jy0.jeon@samsung.com>
77 * Sangmin Lee <lsmin.lee@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814
2915 #ifndef _EXYNOS_DRM_GSC_H_
drivers/gpu/drm/exynos/exynos_drm_hdmi.h+4−18
@@ -3,24 +3,10 @@ · 2 unmodified lines
33 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
44 * Authoer: Inki Dae <inki.dae@samsung.com>
55 *
6− * Permission is hereby granted, free of charge, to any person obtaining a
7− * copy of this software and associated documentation files (the "Software"),
8− * to deal in the Software without restriction, including without limitation
9− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10− * and/or sell copies of the Software, and to permit persons to whom the
11− * Software is furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice (including the next
14− * paragraph) shall be included in all copies or substantial portions of the
15− * Software.
16− *
17− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23− * OTHER DEALINGS IN THE SOFTWARE.
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms of the GNU General Public License as published by the
8+ * Free Software Foundation; either version 2 of the License, or (at your
9+ * option) any later version.
2410 */
2511
2612 #ifndef _EXYNOS_DRM_HDMI_H_
drivers/gpu/drm/exynos/exynos_drm_iommu.c+4−18
@@ -3,24 +3,10 @@ · 2 unmodified lines
33 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
44 * Author: Inki Dae <inki.dae@samsung.com>
55 *
6− * Permission is hereby granted, free of charge, to any person obtaining a
7− * copy of this software and associated documentation files (the "Software"),
8− * to deal in the Software without restriction, including without limitation
9− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10− * and/or sell copies of the Software, and to permit persons to whom the
11− * Software is furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice (including the next
14− * paragraph) shall be included in all copies or substantial portions of the
15− * Software.
16− *
17− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23− * OTHER DEALINGS IN THE SOFTWARE.
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms of the GNU General Public License as published by the
8+ * Free Software Foundation; either version 2 of the License, or (at your
9+ * option) any later version.
2410 */
2511
2612 #include <drmP.h>
drivers/gpu/drm/exynos/exynos_drm_iommu.h+4−18
@@ -3,24 +3,10 @@ · 2 unmodified lines
33 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
44 * Authoer: Inki Dae <inki.dae@samsung.com>
55 *
6− * Permission is hereby granted, free of charge, to any person obtaining a
7− * copy of this software and associated documentation files (the "Software"),
8− * to deal in the Software without restriction, including without limitation
9− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10− * and/or sell copies of the Software, and to permit persons to whom the
11− * Software is furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice (including the next
14− * paragraph) shall be included in all copies or substantial portions of the
15− * Software.
16− *
17− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23− * OTHER DEALINGS IN THE SOFTWARE.
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms of the GNU General Public License as published by the
8+ * Free Software Foundation; either version 2 of the License, or (at your
9+ * option) any later version.
2410 */
2511
2612 #ifndef _EXYNOS_DRM_IOMMU_H_
drivers/gpu/drm/exynos/exynos_drm_ipp.c+6−16
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 #include "exynos_drm_iommu.h"
2828
2929 /*
30− * IPP is stand for Image Post Processing and
30+ * IPP stands for Image Post Processing and
3131 * supports image scaler/rotator and input/output DMA operations.
3232 * using FIMC, GSC, Rotator, so on.
3333 * IPP is integration device driver of same attribute h/w
@@ -1292,7 +1292,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv, · 1258 unmodified lines
12921292 DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, property->prop_id);
12931293
12941294 /* store command info in ippdrv */
1295− ippdrv->cmd = c_node;
1295+ ippdrv->c_node = c_node;
12961296
12971297 if (!ipp_check_mem_list(c_node)) {
12981298 DRM_DEBUG_KMS("%s:empty memory.\n", __func__);
@@ -1303,7 +1303,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv, · 4 unmodified lines
13031303 ret = ipp_set_property(ippdrv, property);
13041304 if (ret) {
13051305 DRM_ERROR("failed to set property.\n");
1306− ippdrv->cmd = NULL;
1306+ ippdrv->c_node = NULL;
13071307 return ret;
13081308 }
13091309
@@ -1487,11 +1487,6 @@ void ipp_sched_cmd(struct work_struct *work) · 177 unmodified lines
14871487 mutex_lock(&c_node->cmd_lock);
14881488
14891489 property = &c_node->property;
1490− if (!property) {
1491− DRM_ERROR("failed to get property:prop_id[%d]\n",
1492− c_node->property.prop_id);
1493− goto err_unlock;
1494− }
14951490
14961491 switch (cmd_work->ctrl) {
14971492 case IPP_CTRL_PLAY:
@@ -1704,7 +1699,7 @@ void ipp_sched_event(struct work_struct *work) · 206 unmodified lines
17041699 return;
17051700 }
17061701
1707− c_node = ippdrv->cmd;
1702+ c_node = ippdrv->c_node;
17081703 if (!c_node) {
17091704 DRM_ERROR("failed to get command node.\n");
17101705 return;
@@ -1895,7 +1890,7 @@ static int ipp_probe(struct platform_device *pdev) · 184 unmodified lines
18951890 struct exynos_drm_subdrv *subdrv;
18961891 int ret;
18971892
1898− ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
1893+ ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
18991894 if (!ctx)
19001895 return -ENOMEM;
19011896
@@ -1916,8 +1911,7 @@ static int ipp_probe(struct platform_device *pdev) · 14 unmodified lines
19161911 ctx->event_workq = create_singlethread_workqueue("ipp_event");
19171912 if (!ctx->event_workq) {
19181913 dev_err(dev, "failed to create event workqueue\n");
1919− ret = -EINVAL;
1920− goto err_clear;
1914+ return -EINVAL;
19211915 }
19221916
19231917 /*
@@ -1958,8 +1952,6 @@ err_cmd_workq: · 34 unmodified lines
19581952 destroy_workqueue(ctx->cmd_workq);
19591953 err_event_workq:
19601954 destroy_workqueue(ctx->event_workq);
1961−err_clear:
1962− kfree(ctx);
19631955 return ret;
19641956 }
19651957
@@ -1985,8 +1977,6 @@ static int ipp_remove(struct platform_device *pdev) · 19 unmodified lines
19851977 destroy_workqueue(ctx->cmd_workq);
19861978 destroy_workqueue(ctx->event_workq);
19871979
1988− kfree(ctx);
1989−
19901980 return 0;
19911981 }
19921982
drivers/gpu/drm/exynos/exynos_drm_ipp.h+6−20
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Jinyoung Jeon <jy0.jeon@samsung.com>
77 * Sangmin Lee <lsmin.lee@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814
2915 #ifndef _EXYNOS_DRM_IPP_H_
@@ -160,7 +146,7 @@ struct exynos_drm_ipp_ops { · 130 unmodified lines
160146 * @dedicated: dedicated ipp device.
161147 * @ops: source, destination operations.
162148 * @event_workq: event work queue.
163− * @cmd: current command information.
149+ * @c_node: current command information.
164150 * @cmd_list: list head for command information.
165151 * @prop_list: property informations of current ipp driver.
166152 * @check_property: check property about format, size, buffer.
@@ -178,7 +164,7 @@ struct exynos_drm_ippdrv { · 11 unmodified lines
178164 bool dedicated;
179165 struct exynos_drm_ipp_ops *ops[EXYNOS_DRM_OPS_MAX];
180166 struct workqueue_struct *event_workq;
181− struct drm_exynos_ipp_cmd_node *cmd;
167+ struct drm_exynos_ipp_cmd_node *c_node;
182168 struct list_head cmd_list;
183169 struct drm_exynos_ipp_prop_list *prop_list;
184170
drivers/gpu/drm/exynos/exynos_drm_rotator.c+6−22
@@ -139,7 +139,7 @@ static irqreturn_t rotator_irq_handler(int irq, void *arg) · 138 unmodified lines
139139 {
140140 struct rot_context *rot = arg;
141141 struct exynos_drm_ippdrv *ippdrv = &rot->ippdrv;
142− struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
142+ struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
143143 struct drm_exynos_ipp_event_work *event_work = c_node->event_work;
144144 enum rot_irq_status irq_status;
145145 u32 val;
@@ -513,6 +513,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip) · 367 unmodified lines
513513 case EXYNOS_DRM_FLIP_NONE:
514514 case EXYNOS_DRM_FLIP_VERTICAL:
515515 case EXYNOS_DRM_FLIP_HORIZONTAL:
516+ case EXYNOS_DRM_FLIP_BOTH:
516517 return true;
517518 default:
518519 DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
@@ -655,34 +656,26 @@ static int rotator_probe(struct platform_device *pdev) · 136 unmodified lines
655656 platform_get_device_id(pdev)->driver_data;
656657
657658 rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
658− if (!rot->regs_res) {
659− dev_err(dev, "failed to find registers\n");
660− ret = -ENOENT;
661− goto err_get_resource;
662− }
663−
664659 rot->regs = devm_request_and_ioremap(dev, rot->regs_res);
665660 if (!rot->regs) {
666661 dev_err(dev, "failed to map register\n");
667− ret = -ENXIO;
668− goto err_get_resource;
662+ return -ENXIO;
669663 }
670664
671665 rot->irq = platform_get_irq(pdev, 0);
672666 if (rot->irq < 0) {
673667 dev_err(dev, "failed to get irq\n");
674− ret = rot->irq;
675− goto err_get_irq;
668+ return rot->irq;
676669 }
677670
678671 ret = request_threaded_irq(rot->irq, NULL, rotator_irq_handler,
679672 IRQF_ONESHOT, "drm_rotator", rot);
680673 if (ret < 0) {
681674 dev_err(dev, "failed to request irq\n");
682− goto err_get_irq;
675+ return ret;
683676 }
684677
685− rot->clock = clk_get(dev, "rotator");
678+ rot->clock = devm_clk_get(dev, "rotator");
686679 if (IS_ERR_OR_NULL(rot->clock)) {
687680 dev_err(dev, "failed to get clock\n");
688681 ret = PTR_ERR(rot->clock);
@@ -720,13 +713,8 @@ static int rotator_probe(struct platform_device *pdev) · 31 unmodified lines
720713 err_ippdrv_register:
721714 devm_kfree(dev, ippdrv->prop_list);
722715 pm_runtime_disable(dev);
723− clk_put(rot->clock);
724716 err_clk_get:
725717 free_irq(rot->irq, rot);
726−err_get_irq:
727− devm_iounmap(dev, rot->regs);
728−err_get_resource:
729− devm_kfree(dev, rot);
730718 return ret;
731719 }
732720
@@ -740,12 +728,8 @@ static int rotator_remove(struct platform_device *pdev) · 7 unmodified lines
740728 exynos_drm_ippdrv_unregister(ippdrv);
741729
742730 pm_runtime_disable(dev);
743− clk_put(rot->clock);
744731
745732 free_irq(rot->irq, rot);
746− devm_iounmap(dev, rot->regs);
747−
748− devm_kfree(dev, rot);
749733
750734 return 0;
751735 }
drivers/gpu/drm/exynos/exynos_drm_rotator.h+4−18
@@ -5,24 +5,10 @@ · 4 unmodified lines
55 * YoungJun Cho <yj44.cho@samsung.com>
66 * Eunchul Kim <chulspro.kim@samsung.com>
77 *
8− * Permission is hereby granted, free of charge, to any person obtaining a
9− * copy of this software and associated documentation files (the "Software"),
10− * to deal in the Software without restriction, including without limitation
11− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12− * and/or sell copies of the Software, and to permit persons to whom the
13− * Software is furnished to do so, subject to the following conditions:
14− *
15− * The above copyright notice and this permission notice (including the next
16− * paragraph) shall be included in all copies or substantial portions of the
17− * Software.
18− *
19− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25− * OTHER DEALINGS IN THE SOFTWARE.
8+ * This program is free software; you can redistribute it and/or modify it
9+ * under the terms of the GNU General Public License as published by the
10+ * Free Software Foundation; either version 2 of the License, or (at your
11+ * option) any later version.
2612 */
2713
2814 #ifndef _EXYNOS_DRM_ROTATOR_H_
drivers/gpu/drm/exynos/exynos_drm_vidi.c+1−29
@@ -372,34 +372,6 @@ static struct exynos_drm_manager vidi_manager = { · 371 unmodified lines
372372 .display_ops = &vidi_display_ops,
373373 };
374374
375−static void vidi_finish_pageflip(struct drm_device *drm_dev, int crtc)
376−{
377− struct exynos_drm_private *dev_priv = drm_dev->dev_private;
378− struct drm_pending_vblank_event *e, *t;
379− struct timeval now;
380− unsigned long flags;
381−
382− spin_lock_irqsave(&drm_dev->event_lock, flags);
383−
384− list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
385− base.link) {
386− /* if event's pipe isn't same as crtc then ignore it. */
387− if (crtc != e->pipe)
388− continue;
389−
390− do_gettimeofday(&now);
391− e->event.sequence = 0;
392− e->event.tv_sec = now.tv_sec;
393− e->event.tv_usec = now.tv_usec;
394−
395− list_move_tail(&e->base.link, &e->base.file_priv->event_list);
396− wake_up_interruptible(&e->base.file_priv->event_wait);
397− drm_vblank_put(drm_dev, crtc);
398− }
399−
400− spin_unlock_irqrestore(&drm_dev->event_lock, flags);
401−}
402−
403375 static void vidi_fake_vblank_handler(struct work_struct *work)
404376 {
405377 struct vidi_context *ctx = container_of(work, struct vidi_context,
@@ -424,7 +396,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work) · 18 unmodified lines
424396
425397 mutex_unlock(&ctx->lock);
426398
427− vidi_finish_pageflip(subdrv->drm_dev, manager->pipe);
399+ exynos_drm_crtc_finish_pageflip(subdrv->drm_dev, manager->pipe);
428400 }
429401
430402 static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
drivers/gpu/drm/exynos/exynos_drm_vidi.h+4−18
@@ -3,24 +3,10 @@ · 2 unmodified lines
33 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
44 * Author: Inki Dae <inki.dae@samsung.com>
55 *
6− * Permission is hereby granted, free of charge, to any person obtaining a
7− * copy of this software and associated documentation files (the "Software"),
8− * to deal in the Software without restriction, including without limitation
9− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10− * and/or sell copies of the Software, and to permit persons to whom the
11− * Software is furnished to do so, subject to the following conditions:
12− *
13− * The above copyright notice and this permission notice (including the next
14− * paragraph) shall be included in all copies or substantial portions of the
15− * Software.
16− *
17− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23− * OTHER DEALINGS IN THE SOFTWARE.
6+ * This program is free software; you can redistribute it and/or modify it
7+ * under the terms of the GNU General Public License as published by the
8+ * Free Software Foundation; either version 2 of the License, or (at your
9+ * option) any later version.
2410 */
2511
2612 #ifndef _EXYNOS_DRM_VIDI_H_
drivers/gpu/drm/exynos/exynos_hdmi.h+4−18
@@ -5,24 +5,10 @@ · 4 unmodified lines
55 * Inki Dae <inki.dae@samsung.com>
66 * Seung-Woo Kim <sw0312.kim@samsung.com>
77 *
8− * Permission is hereby granted, free of charge, to any person obtaining a
9− * copy of this software and associated documentation files (the "Software"),
10− * to deal in the Software without restriction, including without limitation
11− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12− * and/or sell copies of the Software, and to permit persons to whom the
13− * Software is furnished to do so, subject to the following conditions:
14− *
15− * The above copyright notice and this permission notice (including the next
16− * paragraph) shall be included in all copies or substantial portions of the
17− * Software.
18− *
19− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25− * OTHER DEALINGS IN THE SOFTWARE.
8+ * This program is free software; you can redistribute it and/or modify it
9+ * under the terms of the GNU General Public License as published by the
10+ * Free Software Foundation; either version 2 of the License, or (at your
11+ * option) any later version.
2612 */
2713
2814 #ifndef _EXYNOS_HDMI_H_
drivers/gpu/drm/exynos/exynos_mixer.c+3−30
@@ -35,6 +35,7 @@ · 34 unmodified lines
3535 #include <drm/exynos_drm.h>
3636
3737 #include "exynos_drm_drv.h"
38+#include "exynos_drm_crtc.h"
3839 #include "exynos_drm_hdmi.h"
3940 #include "exynos_drm_iommu.h"
4041
@@ -949,35 +950,6 @@ static struct exynos_mixer_ops mixer_ops = { · 908 unmodified lines
949950 .win_disable = mixer_win_disable,
950951 };
951952
952−/* for pageflip event */
953−static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc)
954−{
955− struct exynos_drm_private *dev_priv = drm_dev->dev_private;
956− struct drm_pending_vblank_event *e, *t;
957− struct timeval now;
958− unsigned long flags;
959−
960− spin_lock_irqsave(&drm_dev->event_lock, flags);
961−
962− list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
963− base.link) {
964− /* if event's pipe isn't same as crtc then ignore it. */
965− if (crtc != e->pipe)
966− continue;
967−
968− do_gettimeofday(&now);
969− e->event.sequence = 0;
970− e->event.tv_sec = now.tv_sec;
971− e->event.tv_usec = now.tv_usec;
972−
973− list_move_tail(&e->base.link, &e->base.file_priv->event_list);
974− wake_up_interruptible(&e->base.file_priv->event_wait);
975− drm_vblank_put(drm_dev, crtc);
976− }
977−
978− spin_unlock_irqrestore(&drm_dev->event_lock, flags);
979−}
980−
981953 static irqreturn_t mixer_irq_handler(int irq, void *arg)
982954 {
983955 struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg;
@@ -1006,7 +978,8 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg) · 22 unmodified lines
1006978 }
1007979
1008980 drm_handle_vblank(drm_hdmi_ctx->drm_dev, ctx->pipe);
1009− mixer_finish_pageflip(drm_hdmi_ctx->drm_dev, ctx->pipe);
981+ exynos_drm_crtc_finish_pageflip(drm_hdmi_ctx->drm_dev,
982+ ctx->pipe);
1010983
1011984 /* set wait vsync event to zero and wake up queue. */
1012985 if (atomic_read(&ctx->wait_vsync_event)) {
drivers/gpu/drm/i915/i915_gem_dmabuf.c+5−0
@@ -266,7 +266,12 @@ struct drm_gem_object *i915_gem_prime_import(struct drm_device *dev, · 265 unmodified lines
266266 obj = dma_buf->priv;
267267 /* is it from our device? */
268268 if (obj->base.dev == dev) {
269+ /*
270+ * Importing dmabuf exported from out own gem increases
271+ * refcount on gem itself instead of f_count of dmabuf.
272+ */
269273 drm_gem_object_reference(&obj->base);
274+ dma_buf_put(dma_buf);
270275 return &obj->base;
271276 }
272277 }
drivers/gpu/drm/nouveau/nouveau_prime.c+1−0
@@ -193,6 +193,7 @@ struct drm_gem_object *nouveau_gem_prime_import(struct drm_device *dev, · 192 unmodified lines
193193 if (nvbo->gem) {
194194 if (nvbo->gem->dev == dev) {
195195 drm_gem_object_reference(nvbo->gem);
196+ dma_buf_put(dma_buf);
196197 return nvbo->gem;
197198 }
198199 }
drivers/gpu/drm/radeon/r600.c+5−5
@@ -2646,7 +2646,7 @@ int r600_copy_blit(struct radeon_device *rdev, · 2645 unmodified lines
26462646 * @num_gpu_pages: number of GPU pages to xfer
26472647 * @fence: radeon fence object
26482648 *
2649− * Copy GPU paging using the DMA engine (r6xx-r7xx).
2649+ * Copy GPU paging using the DMA engine (r6xx).
26502650 * Used by the radeon ttm implementation to move pages if
26512651 * registered as the asic copy callback.
26522652 */
@@ -2669,8 +2669,8 @@ int r600_copy_dma(struct radeon_device *rdev, · 16 unmodified lines
26692669 }
26702670
26712671 size_in_dw = (num_gpu_pages << RADEON_GPU_PAGE_SHIFT) / 4;
2672− num_loops = DIV_ROUND_UP(size_in_dw, 0xffff);
2673− r = radeon_ring_lock(rdev, ring, num_loops * 5 + 8);
2672+ num_loops = DIV_ROUND_UP(size_in_dw, 0xFFFE);
2673+ r = radeon_ring_lock(rdev, ring, num_loops * 4 + 8);
26742674 if (r) {
26752675 DRM_ERROR("radeon: moving bo (%d).\n", r);
26762676 radeon_semaphore_free(rdev, &sem, NULL);
@@ -2693,8 +2693,8 @@ int r600_copy_dma(struct radeon_device *rdev, · 16 unmodified lines
26932693 radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_COPY, 0, 0, cur_size_in_dw));
26942694 radeon_ring_write(ring, dst_offset & 0xfffffffc);
26952695 radeon_ring_write(ring, src_offset & 0xfffffffc);
2696− radeon_ring_write(ring, upper_32_bits(dst_offset) & 0xff);
2697− radeon_ring_write(ring, upper_32_bits(src_offset) & 0xff);
2696+ radeon_ring_write(ring, (((upper_32_bits(dst_offset) & 0xff) << 16) |
2697+ (upper_32_bits(src_offset) & 0xff)));
26982698 src_offset += cur_size_in_dw * 4;
26992699 dst_offset += cur_size_in_dw * 4;
27002700 }
drivers/gpu/drm/radeon/r600_cs.c+22−9
@@ -2677,16 +2677,29 @@ int r600_dma_cs_parse(struct radeon_cs_parser *p) · 2676 unmodified lines
26772677 }
26782678 p->idx += 7;
26792679 } else {
2680− src_offset = ib[idx+2];
2681− src_offset |= ((u64)(ib[idx+4] & 0xff)) << 32;
2682− dst_offset = ib[idx+1];
2683− dst_offset |= ((u64)(ib[idx+3] & 0xff)) << 32;
2680+ if (p->family >= CHIP_RV770) {
2681+ src_offset = ib[idx+2];
2682+ src_offset |= ((u64)(ib[idx+4] & 0xff)) << 32;
2683+ dst_offset = ib[idx+1];
2684+ dst_offset |= ((u64)(ib[idx+3] & 0xff)) << 32;
26842685
2685− ib[idx+1] += (u32)(dst_reloc->lobj.gpu_offset & 0xfffffffc);
2686− ib[idx+2] += (u32)(src_reloc->lobj.gpu_offset & 0xfffffffc);
2687− ib[idx+3] += upper_32_bits(dst_reloc->lobj.gpu_offset) & 0xff;
2688− ib[idx+4] += upper_32_bits(src_reloc->lobj.gpu_offset) & 0xff;
2689− p->idx += 5;
2686+ ib[idx+1] += (u32)(dst_reloc->lobj.gpu_offset & 0xfffffffc);
2687+ ib[idx+2] += (u32)(src_reloc->lobj.gpu_offset & 0xfffffffc);
2688+ ib[idx+3] += upper_32_bits(dst_reloc->lobj.gpu_offset) & 0xff;
2689+ ib[idx+4] += upper_32_bits(src_reloc->lobj.gpu_offset) & 0xff;
2690+ p->idx += 5;
2691+ } else {
2692+ src_offset = ib[idx+2];
2693+ src_offset |= ((u64)(ib[idx+3] & 0xff)) << 32;
2694+ dst_offset = ib[idx+1];
2695+ dst_offset |= ((u64)(ib[idx+3] & 0xff0000)) << 16;
2696+
2697+ ib[idx+1] += (u32)(dst_reloc->lobj.gpu_offset & 0xfffffffc);
2698+ ib[idx+2] += (u32)(src_reloc->lobj.gpu_offset & 0xfffffffc);
2699+ ib[idx+3] += upper_32_bits(src_reloc->lobj.gpu_offset) & 0xff;
2700+ ib[idx+3] += (upper_32_bits(dst_reloc->lobj.gpu_offset) & 0xff) << 16;
2701+ p->idx += 4;
2702+ }
26902703 }
26912704 if ((src_offset + (count * 4)) > radeon_bo_size(src_reloc->robj)) {
26922705 dev_warn(p->dev, "DMA copy src buffer too small (%llu %lu)\n",
drivers/gpu/drm/radeon/radeon_asic.c+2−2
@@ -1140,9 +1140,9 @@ static struct radeon_asic rv770_asic = { · 1139 unmodified lines
11401140 .copy = {
11411141 .blit = &r600_copy_blit,
11421142 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1143− .dma = &r600_copy_dma,
1143+ .dma = &rv770_copy_dma,
11441144 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
1145− .copy = &r600_copy_dma,
1145+ .copy = &rv770_copy_dma,
11461146 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
11471147 },
11481148 .surface = {
drivers/gpu/drm/radeon/radeon_asic.h+4−0
@@ -403,6 +403,10 @@ u32 rv770_page_flip(struct radeon_device *rdev, int crtc, u64 crtc_base); · 402 unmodified lines
403403 void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc);
404404 void r700_cp_stop(struct radeon_device *rdev);
405405 void r700_cp_fini(struct radeon_device *rdev);
406+int rv770_copy_dma(struct radeon_device *rdev,
407+ uint64_t src_offset, uint64_t dst_offset,
408+ unsigned num_gpu_pages,
409+ struct radeon_fence **fence);
406410
407411 /*
408412 * evergreen
drivers/gpu/drm/radeon/radeon_device.c+28−0
@@ -896,6 +896,25 @@ static void radeon_check_arguments(struct radeon_device *rdev) · 895 unmodified lines
896896 }
897897 }
898898
899+/**
900+ * radeon_switcheroo_quirk_long_wakeup - return true if longer d3 delay is
901+ * needed for waking up.
902+ *
903+ * @pdev: pci dev pointer
904+ */
905+static bool radeon_switcheroo_quirk_long_wakeup(struct pci_dev *pdev)
906+{
907+
908+ /* 6600m in a macbook pro */
909+ if (pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE &&
910+ pdev->subsystem_device == 0x00e2) {
911+ printk(KERN_INFO "radeon: quirking longer d3 wakeup delay\n");
912+ return true;
913+ }
914+
915+ return false;
916+}
917+
899918 /**
900919 * radeon_switcheroo_set_state - set switcheroo state
901920 *
@@ -910,10 +929,19 @@ static void radeon_switcheroo_set_state(struct pci_dev *pdev, enum vga_switchero · 8 unmodified lines
910929 struct drm_device *dev = pci_get_drvdata(pdev);
911930 pm_message_t pmm = { .event = PM_EVENT_SUSPEND };
912931 if (state == VGA_SWITCHEROO_ON) {
932+ unsigned d3_delay = dev->pdev->d3_delay;
933+
913934 printk(KERN_INFO "radeon: switched on\n");
914935 /* don't suspend or resume card normally */
915936 dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
937+
938+ if (d3_delay < 20 && radeon_switcheroo_quirk_long_wakeup(pdev))
939+ dev->pdev->d3_delay = 20;
940+
916941 radeon_resume_kms(dev);
942+
943+ dev->pdev->d3_delay = d3_delay;
944+
917945 dev->switch_power_state = DRM_SWITCH_POWER_ON;
918946 drm_kms_helper_poll_enable(dev);
919947 } else {
drivers/gpu/drm/radeon/radeon_prime.c+1−0
@@ -194,6 +194,7 @@ struct drm_gem_object *radeon_gem_prime_import(struct drm_device *dev, · 193 unmodified lines
194194 bo = dma_buf->priv;
195195 if (bo->gem_base.dev == dev) {
196196 drm_gem_object_reference(&bo->gem_base);
197+ dma_buf_put(dma_buf);
197198 return &bo->gem_base;
198199 }
199200 }
drivers/gpu/drm/radeon/rv770.c+74−0
@@ -887,6 +887,80 @@ static int rv770_mc_init(struct radeon_device *rdev) · 886 unmodified lines
887887 return 0;
888888 }
889889
890+/**
891+ * rv770_copy_dma - copy pages using the DMA engine
892+ *
893+ * @rdev: radeon_device pointer
894+ * @src_offset: src GPU address
895+ * @dst_offset: dst GPU address
896+ * @num_gpu_pages: number of GPU pages to xfer
897+ * @fence: radeon fence object
898+ *
899+ * Copy GPU paging using the DMA engine (r7xx).
900+ * Used by the radeon ttm implementation to move pages if
901+ * registered as the asic copy callback.
902+ */
903+int rv770_copy_dma(struct radeon_device *rdev,
904+ uint64_t src_offset, uint64_t dst_offset,
905+ unsigned num_gpu_pages,
906+ struct radeon_fence **fence)
907+{
908+ struct radeon_semaphore *sem = NULL;
909+ int ring_index = rdev->asic->copy.dma_ring_index;
910+ struct radeon_ring *ring = &rdev->ring[ring_index];
911+ u32 size_in_dw, cur_size_in_dw;
912+ int i, num_loops;
913+ int r = 0;
914+
915+ r = radeon_semaphore_create(rdev, &sem);
916+ if (r) {
917+ DRM_ERROR("radeon: moving bo (%d).\n", r);
918+ return r;
919+ }
920+
921+ size_in_dw = (num_gpu_pages << RADEON_GPU_PAGE_SHIFT) / 4;
922+ num_loops = DIV_ROUND_UP(size_in_dw, 0xFFFF);
923+ r = radeon_ring_lock(rdev, ring, num_loops * 5 + 8);
924+ if (r) {
925+ DRM_ERROR("radeon: moving bo (%d).\n", r);
926+ radeon_semaphore_free(rdev, &sem, NULL);
927+ return r;
928+ }
929+
930+ if (radeon_fence_need_sync(*fence, ring->idx)) {
931+ radeon_semaphore_sync_rings(rdev, sem, (*fence)->ring,
932+ ring->idx);
933+ radeon_fence_note_sync(*fence, ring->idx);
934+ } else {
935+ radeon_semaphore_free(rdev, &sem, NULL);
936+ }
937+
938+ for (i = 0; i < num_loops; i++) {
939+ cur_size_in_dw = size_in_dw;
940+ if (cur_size_in_dw > 0xFFFF)
941+ cur_size_in_dw = 0xFFFF;
942+ size_in_dw -= cur_size_in_dw;
943+ radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_COPY, 0, 0, cur_size_in_dw));
944+ radeon_ring_write(ring, dst_offset & 0xfffffffc);
945+ radeon_ring_write(ring, src_offset & 0xfffffffc);
946+ radeon_ring_write(ring, upper_32_bits(dst_offset) & 0xff);
947+ radeon_ring_write(ring, upper_32_bits(src_offset) & 0xff);
948+ src_offset += cur_size_in_dw * 4;
949+ dst_offset += cur_size_in_dw * 4;
950+ }
951+
952+ r = radeon_fence_emit(rdev, fence, ring->idx);
953+ if (r) {
954+ radeon_ring_unlock_undo(rdev, ring);
955+ return r;
956+ }
957+
958+ radeon_ring_unlock_commit(rdev, ring);
959+ radeon_semaphore_free(rdev, &sem, *fence);
960+
961+ return r;
962+}
963+
890964 static int rv770_startup(struct radeon_device *rdev)
891965 {
892966 struct radeon_ring *ring;
drivers/gpu/drm/ttm/ttm_bo_util.c+3−1
@@ -654,11 +654,13 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, · 653 unmodified lines
654654 */
655655
656656 set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
657+
658+ /* ttm_buffer_object_transfer accesses bo->sync_obj */
659+ ret = ttm_buffer_object_transfer(bo, &ghost_obj);
657660 spin_unlock(&bdev->fence_lock);
658661 if (tmp_obj)
659662 driver->sync_obj_unref(&tmp_obj);
660663
661− ret = ttm_buffer_object_transfer(bo, &ghost_obj);
662664 if (ret)
663665 return ret;
664666
drivers/staging/omapdrm/omap_gem_dmabuf.c+5−0
@@ -207,7 +207,12 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev, · 206 unmodified lines
207207 obj = buffer->priv;
208208 /* is it from our device? */
209209 if (obj->dev == dev) {
210+ /*
211+ * Importing dmabuf exported from out own gem increases
212+ * refcount on gem itself instead of f_count of dmabuf.
213+ */
210214 drm_gem_object_reference(obj);
215+ dma_buf_put(buffer);
211216 return obj;
212217 }
213218 }
include/drm/exynos_drm.h+4−18
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Joonyoung Shim <jy0922.shim@samsung.com>
77 * Seung-Woo Kim <sw0312.kim@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814 #ifndef _EXYNOS_DRM_H_
2915 #define _EXYNOS_DRM_H_
include/uapi/drm/exynos_drm.h+6−18
@@ -6,24 +6,10 @@ · 5 unmodified lines
66 * Joonyoung Shim <jy0922.shim@samsung.com>
77 * Seung-Woo Kim <sw0312.kim@samsung.com>
88 *
9− * Permission is hereby granted, free of charge, to any person obtaining a
10− * copy of this software and associated documentation files (the "Software"),
11− * to deal in the Software without restriction, including without limitation
12− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13− * and/or sell copies of the Software, and to permit persons to whom the
14− * Software is furnished to do so, subject to the following conditions:
15− *
16− * The above copyright notice and this permission notice (including the next
17− * paragraph) shall be included in all copies or substantial portions of the
18− * Software.
19− *
20− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23− * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24− * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25− * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26− * OTHER DEALINGS IN THE SOFTWARE.
9+ * This program is free software; you can redistribute it and/or modify it
10+ * under the terms of the GNU General Public License as published by the
11+ * Free Software Foundation; either version 2 of the License, or (at your
12+ * option) any later version.
2713 */
2814
2915 #ifndef _UAPI_EXYNOS_DRM_H_
@@ -185,6 +171,8 @@ enum drm_exynos_flip { · 155 unmodified lines
185171 EXYNOS_DRM_FLIP_NONE = (0 << 0),
186172 EXYNOS_DRM_FLIP_VERTICAL = (1 << 0),
187173 EXYNOS_DRM_FLIP_HORIZONTAL = (1 << 1),
174+ EXYNOS_DRM_FLIP_BOTH = EXYNOS_DRM_FLIP_VERTICAL |
175+ EXYNOS_DRM_FLIP_HORIZONTAL,
188176 };
189177
190178 enum drm_exynos_degree {