diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2018-11-10 09:56:47 -0500 |
---|---|---|
committer | Noralf Trønnes <noralf@tronnes.org> | 2018-11-20 08:58:19 -0500 |
commit | 3db8d37dd84e93f352b8a8d34a713415cd1a6d0f (patch) | |
tree | 30d24df108e711b85628e252399df6b2bda5a95e | |
parent | b9068cde51eea189c2c3560a9a8ae83f7b213c9c (diff) |
drm/tinydrm: Use DRM_GEM_CMA_VMAP_DRIVER_OPS
The CMA helper now has the functionality to ensure a virtual address on
imported buffer so use that.
While touching all tinydrm drivers, remove the unnecessary inclusion of
drm_fb_helper.h in some drivers.
Cc: David Lechner <david@lechnology.com>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20181110145647.17580-6-noralf@tronnes.org
-rw-r--r-- | drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 71 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/hx8357d.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/ili9225.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/ili9341.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/mi0283qt.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/mipi-dbi.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/repaper.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/st7586.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/st7735r.c | 4 | ||||
-rw-r--r-- | include/drm/tinydrm/tinydrm.h | 35 |
11 files changed, 38 insertions, 116 deletions
diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c index 9af51d982a33..01a6f2d42440 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c | |||
@@ -36,77 +36,6 @@ | |||
36 | * and registers the DRM device using devm_tinydrm_register(). | 36 | * and registers the DRM device using devm_tinydrm_register(). |
37 | */ | 37 | */ |
38 | 38 | ||
39 | /** | ||
40 | * tinydrm_gem_cma_prime_import_sg_table - Produce a CMA GEM object from | ||
41 | * another driver's scatter/gather table of pinned pages | ||
42 | * @drm: DRM device to import into | ||
43 | * @attach: DMA-BUF attachment | ||
44 | * @sgt: Scatter/gather table of pinned pages | ||
45 | * | ||
46 | * This function imports a scatter/gather table exported via DMA-BUF by | ||
47 | * another driver using drm_gem_cma_prime_import_sg_table(). It sets the | ||
48 | * kernel virtual address on the CMA object. Drivers should use this as their | ||
49 | * &drm_driver->gem_prime_import_sg_table callback if they need the virtual | ||
50 | * address. tinydrm_gem_cma_free_object() should be used in combination with | ||
51 | * this function. | ||
52 | * | ||
53 | * Returns: | ||
54 | * A pointer to a newly created GEM object or an ERR_PTR-encoded negative | ||
55 | * error code on failure. | ||
56 | */ | ||
57 | struct drm_gem_object * | ||
58 | tinydrm_gem_cma_prime_import_sg_table(struct drm_device *drm, | ||
59 | struct dma_buf_attachment *attach, | ||
60 | struct sg_table *sgt) | ||
61 | { | ||
62 | struct drm_gem_cma_object *cma_obj; | ||
63 | struct drm_gem_object *obj; | ||
64 | void *vaddr; | ||
65 | |||
66 | vaddr = dma_buf_vmap(attach->dmabuf); | ||
67 | if (!vaddr) { | ||
68 | DRM_ERROR("Failed to vmap PRIME buffer\n"); | ||
69 | return ERR_PTR(-ENOMEM); | ||
70 | } | ||
71 | |||
72 | obj = drm_gem_cma_prime_import_sg_table(drm, attach, sgt); | ||
73 | if (IS_ERR(obj)) { | ||
74 | dma_buf_vunmap(attach->dmabuf, vaddr); | ||
75 | return obj; | ||
76 | } | ||
77 | |||
78 | cma_obj = to_drm_gem_cma_obj(obj); | ||
79 | cma_obj->vaddr = vaddr; | ||
80 | |||
81 | return obj; | ||
82 | } | ||
83 | EXPORT_SYMBOL(tinydrm_gem_cma_prime_import_sg_table); | ||
84 | |||
85 | /** | ||
86 | * tinydrm_gem_cma_free_object - Free resources associated with a CMA GEM | ||
87 | * object | ||
88 | * @gem_obj: GEM object to free | ||
89 | * | ||
90 | * This function frees the backing memory of the CMA GEM object, cleans up the | ||
91 | * GEM object state and frees the memory used to store the object itself using | ||
92 | * drm_gem_cma_free_object(). It also handles PRIME buffers which has the kernel | ||
93 | * virtual address set by tinydrm_gem_cma_prime_import_sg_table(). Drivers | ||
94 | * can use this as their &drm_driver->gem_free_object_unlocked callback. | ||
95 | */ | ||
96 | void tinydrm_gem_cma_free_object(struct drm_gem_object *gem_obj) | ||
97 | { | ||
98 | if (gem_obj->import_attach) { | ||
99 | struct drm_gem_cma_object *cma_obj; | ||
100 | |||
101 | cma_obj = to_drm_gem_cma_obj(gem_obj); | ||
102 | dma_buf_vunmap(gem_obj->import_attach->dmabuf, cma_obj->vaddr); | ||
103 | cma_obj->vaddr = NULL; | ||
104 | } | ||
105 | |||
106 | drm_gem_cma_free_object(gem_obj); | ||
107 | } | ||
108 | EXPORT_SYMBOL_GPL(tinydrm_gem_cma_free_object); | ||
109 | |||
110 | static struct drm_framebuffer * | 39 | static struct drm_framebuffer * |
111 | tinydrm_fb_create(struct drm_device *drm, struct drm_file *file_priv, | 40 | tinydrm_fb_create(struct drm_device *drm, struct drm_file *file_priv, |
112 | const struct drm_mode_fb_cmd2 *mode_cmd) | 41 | const struct drm_mode_fb_cmd2 *mode_cmd) |
diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c index dcd390163a4a..bf6bfbc5d412 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c | |||
@@ -9,12 +9,18 @@ | |||
9 | 9 | ||
10 | #include <linux/backlight.h> | 10 | #include <linux/backlight.h> |
11 | #include <linux/dma-buf.h> | 11 | #include <linux/dma-buf.h> |
12 | #include <linux/module.h> | ||
12 | #include <linux/pm.h> | 13 | #include <linux/pm.h> |
13 | #include <linux/spi/spi.h> | 14 | #include <linux/spi/spi.h> |
14 | #include <linux/swab.h> | 15 | #include <linux/swab.h> |
15 | 16 | ||
17 | #include <drm/drm_device.h> | ||
18 | #include <drm/drm_drv.h> | ||
19 | #include <drm/drm_fourcc.h> | ||
20 | #include <drm/drm_print.h> | ||
16 | #include <drm/tinydrm/tinydrm.h> | 21 | #include <drm/tinydrm/tinydrm.h> |
17 | #include <drm/tinydrm/tinydrm-helpers.h> | 22 | #include <drm/tinydrm/tinydrm-helpers.h> |
23 | #include <uapi/drm/drm.h> | ||
18 | 24 | ||
19 | static unsigned int spi_max; | 25 | static unsigned int spi_max; |
20 | module_param(spi_max, uint, 0400); | 26 | module_param(spi_max, uint, 0400); |
diff --git a/drivers/gpu/drm/tinydrm/hx8357d.c b/drivers/gpu/drm/tinydrm/hx8357d.c index c3e51c2baebc..81a2bbeb25d4 100644 --- a/drivers/gpu/drm/tinydrm/hx8357d.c +++ b/drivers/gpu/drm/tinydrm/hx8357d.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/property.h> | 16 | #include <linux/property.h> |
17 | #include <linux/spi/spi.h> | 17 | #include <linux/spi/spi.h> |
18 | 18 | ||
19 | #include <drm/drm_fb_helper.h> | 19 | #include <drm/drm_gem_cma_helper.h> |
20 | #include <drm/drm_gem_framebuffer_helper.h> | 20 | #include <drm/drm_gem_framebuffer_helper.h> |
21 | #include <drm/drm_modeset_helper.h> | 21 | #include <drm/drm_modeset_helper.h> |
22 | #include <drm/tinydrm/mipi-dbi.h> | 22 | #include <drm/tinydrm/mipi-dbi.h> |
@@ -188,7 +188,7 @@ DEFINE_DRM_GEM_CMA_FOPS(hx8357d_fops); | |||
188 | static struct drm_driver hx8357d_driver = { | 188 | static struct drm_driver hx8357d_driver = { |
189 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_ATOMIC, | 189 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_ATOMIC, |
190 | .fops = &hx8357d_fops, | 190 | .fops = &hx8357d_fops, |
191 | TINYDRM_GEM_DRIVER_OPS, | 191 | DRM_GEM_CMA_VMAP_DRIVER_OPS, |
192 | .debugfs_init = mipi_dbi_debugfs_init, | 192 | .debugfs_init = mipi_dbi_debugfs_init, |
193 | .name = "hx8357d", | 193 | .name = "hx8357d", |
194 | .desc = "HX8357D", | 194 | .desc = "HX8357D", |
diff --git a/drivers/gpu/drm/tinydrm/ili9225.c b/drivers/gpu/drm/tinydrm/ili9225.c index 455fefe012f5..78f7c2d1b449 100644 --- a/drivers/gpu/drm/tinydrm/ili9225.c +++ b/drivers/gpu/drm/tinydrm/ili9225.c | |||
@@ -20,7 +20,8 @@ | |||
20 | #include <linux/spi/spi.h> | 20 | #include <linux/spi/spi.h> |
21 | #include <video/mipi_display.h> | 21 | #include <video/mipi_display.h> |
22 | 22 | ||
23 | #include <drm/drm_fb_helper.h> | 23 | #include <drm/drm_fb_cma_helper.h> |
24 | #include <drm/drm_gem_cma_helper.h> | ||
24 | #include <drm/drm_gem_framebuffer_helper.h> | 25 | #include <drm/drm_gem_framebuffer_helper.h> |
25 | #include <drm/tinydrm/mipi-dbi.h> | 26 | #include <drm/tinydrm/mipi-dbi.h> |
26 | #include <drm/tinydrm/tinydrm-helpers.h> | 27 | #include <drm/tinydrm/tinydrm-helpers.h> |
@@ -367,7 +368,7 @@ static struct drm_driver ili9225_driver = { | |||
367 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | | 368 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | |
368 | DRIVER_ATOMIC, | 369 | DRIVER_ATOMIC, |
369 | .fops = &ili9225_fops, | 370 | .fops = &ili9225_fops, |
370 | TINYDRM_GEM_DRIVER_OPS, | 371 | DRM_GEM_CMA_VMAP_DRIVER_OPS, |
371 | .name = "ili9225", | 372 | .name = "ili9225", |
372 | .desc = "Ilitek ILI9225", | 373 | .desc = "Ilitek ILI9225", |
373 | .date = "20171106", | 374 | .date = "20171106", |
diff --git a/drivers/gpu/drm/tinydrm/ili9341.c b/drivers/gpu/drm/tinydrm/ili9341.c index 6701037749a7..51395bdc6ca2 100644 --- a/drivers/gpu/drm/tinydrm/ili9341.c +++ b/drivers/gpu/drm/tinydrm/ili9341.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/property.h> | 15 | #include <linux/property.h> |
16 | #include <linux/spi/spi.h> | 16 | #include <linux/spi/spi.h> |
17 | 17 | ||
18 | #include <drm/drm_fb_helper.h> | 18 | #include <drm/drm_gem_cma_helper.h> |
19 | #include <drm/drm_gem_framebuffer_helper.h> | 19 | #include <drm/drm_gem_framebuffer_helper.h> |
20 | #include <drm/drm_modeset_helper.h> | 20 | #include <drm/drm_modeset_helper.h> |
21 | #include <drm/tinydrm/mipi-dbi.h> | 21 | #include <drm/tinydrm/mipi-dbi.h> |
@@ -144,7 +144,7 @@ DEFINE_DRM_GEM_CMA_FOPS(ili9341_fops); | |||
144 | static struct drm_driver ili9341_driver = { | 144 | static struct drm_driver ili9341_driver = { |
145 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_ATOMIC, | 145 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_ATOMIC, |
146 | .fops = &ili9341_fops, | 146 | .fops = &ili9341_fops, |
147 | TINYDRM_GEM_DRIVER_OPS, | 147 | DRM_GEM_CMA_VMAP_DRIVER_OPS, |
148 | .debugfs_init = mipi_dbi_debugfs_init, | 148 | .debugfs_init = mipi_dbi_debugfs_init, |
149 | .name = "ili9341", | 149 | .name = "ili9341", |
150 | .desc = "Ilitek ILI9341", | 150 | .desc = "Ilitek ILI9341", |
diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c b/drivers/gpu/drm/tinydrm/mi0283qt.c index d7bb4c5e6657..3fa62e77c30b 100644 --- a/drivers/gpu/drm/tinydrm/mi0283qt.c +++ b/drivers/gpu/drm/tinydrm/mi0283qt.c | |||
@@ -17,9 +17,9 @@ | |||
17 | #include <linux/regulator/consumer.h> | 17 | #include <linux/regulator/consumer.h> |
18 | #include <linux/spi/spi.h> | 18 | #include <linux/spi/spi.h> |
19 | 19 | ||
20 | #include <drm/drm_fb_helper.h> | 20 | #include <drm/drm_gem_cma_helper.h> |
21 | #include <drm/drm_modeset_helper.h> | ||
22 | #include <drm/drm_gem_framebuffer_helper.h> | 21 | #include <drm/drm_gem_framebuffer_helper.h> |
22 | #include <drm/drm_modeset_helper.h> | ||
23 | #include <drm/tinydrm/mipi-dbi.h> | 23 | #include <drm/tinydrm/mipi-dbi.h> |
24 | #include <drm/tinydrm/tinydrm-helpers.h> | 24 | #include <drm/tinydrm/tinydrm-helpers.h> |
25 | #include <video/mipi_display.h> | 25 | #include <video/mipi_display.h> |
@@ -153,7 +153,7 @@ static struct drm_driver mi0283qt_driver = { | |||
153 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | | 153 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | |
154 | DRIVER_ATOMIC, | 154 | DRIVER_ATOMIC, |
155 | .fops = &mi0283qt_fops, | 155 | .fops = &mi0283qt_fops, |
156 | TINYDRM_GEM_DRIVER_OPS, | 156 | DRM_GEM_CMA_VMAP_DRIVER_OPS, |
157 | .debugfs_init = mipi_dbi_debugfs_init, | 157 | .debugfs_init = mipi_dbi_debugfs_init, |
158 | .name = "mi0283qt", | 158 | .name = "mi0283qt", |
159 | .desc = "Multi-Inno MI0283QT", | 159 | .desc = "Multi-Inno MI0283QT", |
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 1bb870021f6e..3a05e56f9b0d 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c | |||
@@ -9,15 +9,19 @@ | |||
9 | * (at your option) any later version. | 9 | * (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <drm/drm_gem_framebuffer_helper.h> | ||
13 | #include <drm/tinydrm/mipi-dbi.h> | ||
14 | #include <drm/tinydrm/tinydrm-helpers.h> | ||
15 | #include <linux/debugfs.h> | 12 | #include <linux/debugfs.h> |
16 | #include <linux/dma-buf.h> | 13 | #include <linux/dma-buf.h> |
17 | #include <linux/gpio/consumer.h> | 14 | #include <linux/gpio/consumer.h> |
18 | #include <linux/module.h> | 15 | #include <linux/module.h> |
19 | #include <linux/regulator/consumer.h> | 16 | #include <linux/regulator/consumer.h> |
20 | #include <linux/spi/spi.h> | 17 | #include <linux/spi/spi.h> |
18 | |||
19 | #include <drm/drm_fb_cma_helper.h> | ||
20 | #include <drm/drm_gem_cma_helper.h> | ||
21 | #include <drm/drm_gem_framebuffer_helper.h> | ||
22 | #include <drm/tinydrm/mipi-dbi.h> | ||
23 | #include <drm/tinydrm/tinydrm-helpers.h> | ||
24 | #include <uapi/drm/drm.h> | ||
21 | #include <video/mipi_display.h> | 25 | #include <video/mipi_display.h> |
22 | 26 | ||
23 | #define MIPI_DBI_MAX_SPI_READ_SPEED 2000000 /* 2MHz */ | 27 | #define MIPI_DBI_MAX_SPI_READ_SPEED 2000000 /* 2MHz */ |
diff --git a/drivers/gpu/drm/tinydrm/repaper.c b/drivers/gpu/drm/tinydrm/repaper.c index 50a1d4216ce7..07f45a008a0f 100644 --- a/drivers/gpu/drm/tinydrm/repaper.c +++ b/drivers/gpu/drm/tinydrm/repaper.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <linux/spi/spi.h> | 26 | #include <linux/spi/spi.h> |
27 | #include <linux/thermal.h> | 27 | #include <linux/thermal.h> |
28 | 28 | ||
29 | #include <drm/drm_fb_cma_helper.h> | ||
30 | #include <drm/drm_gem_cma_helper.h> | ||
29 | #include <drm/drm_gem_framebuffer_helper.h> | 31 | #include <drm/drm_gem_framebuffer_helper.h> |
30 | #include <drm/tinydrm/tinydrm.h> | 32 | #include <drm/tinydrm/tinydrm.h> |
31 | #include <drm/tinydrm/tinydrm-helpers.h> | 33 | #include <drm/tinydrm/tinydrm-helpers.h> |
@@ -882,7 +884,7 @@ static struct drm_driver repaper_driver = { | |||
882 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | | 884 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | |
883 | DRIVER_ATOMIC, | 885 | DRIVER_ATOMIC, |
884 | .fops = &repaper_fops, | 886 | .fops = &repaper_fops, |
885 | TINYDRM_GEM_DRIVER_OPS, | 887 | DRM_GEM_CMA_VMAP_DRIVER_OPS, |
886 | .name = "repaper", | 888 | .name = "repaper", |
887 | .desc = "Pervasive Displays RePaper e-ink panels", | 889 | .desc = "Pervasive Displays RePaper e-ink panels", |
888 | .date = "20170405", | 890 | .date = "20170405", |
diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c index 2fcbc3067d71..a6a8a1081b73 100644 --- a/drivers/gpu/drm/tinydrm/st7586.c +++ b/drivers/gpu/drm/tinydrm/st7586.c | |||
@@ -17,7 +17,8 @@ | |||
17 | #include <linux/spi/spi.h> | 17 | #include <linux/spi/spi.h> |
18 | #include <video/mipi_display.h> | 18 | #include <video/mipi_display.h> |
19 | 19 | ||
20 | #include <drm/drm_fb_helper.h> | 20 | #include <drm/drm_fb_cma_helper.h> |
21 | #include <drm/drm_gem_cma_helper.h> | ||
21 | #include <drm/drm_gem_framebuffer_helper.h> | 22 | #include <drm/drm_gem_framebuffer_helper.h> |
22 | #include <drm/tinydrm/mipi-dbi.h> | 23 | #include <drm/tinydrm/mipi-dbi.h> |
23 | #include <drm/tinydrm/tinydrm-helpers.h> | 24 | #include <drm/tinydrm/tinydrm-helpers.h> |
@@ -303,7 +304,7 @@ static struct drm_driver st7586_driver = { | |||
303 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | | 304 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | |
304 | DRIVER_ATOMIC, | 305 | DRIVER_ATOMIC, |
305 | .fops = &st7586_fops, | 306 | .fops = &st7586_fops, |
306 | TINYDRM_GEM_DRIVER_OPS, | 307 | DRM_GEM_CMA_VMAP_DRIVER_OPS, |
307 | .debugfs_init = mipi_dbi_debugfs_init, | 308 | .debugfs_init = mipi_dbi_debugfs_init, |
308 | .name = "st7586", | 309 | .name = "st7586", |
309 | .desc = "Sitronix ST7586", | 310 | .desc = "Sitronix ST7586", |
diff --git a/drivers/gpu/drm/tinydrm/st7735r.c b/drivers/gpu/drm/tinydrm/st7735r.c index 3081bc57c116..b39779e0dcd8 100644 --- a/drivers/gpu/drm/tinydrm/st7735r.c +++ b/drivers/gpu/drm/tinydrm/st7735r.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/spi/spi.h> | 14 | #include <linux/spi/spi.h> |
15 | #include <video/mipi_display.h> | 15 | #include <video/mipi_display.h> |
16 | 16 | ||
17 | #include <drm/drm_fb_helper.h> | 17 | #include <drm/drm_gem_cma_helper.h> |
18 | #include <drm/drm_gem_framebuffer_helper.h> | 18 | #include <drm/drm_gem_framebuffer_helper.h> |
19 | #include <drm/tinydrm/mipi-dbi.h> | 19 | #include <drm/tinydrm/mipi-dbi.h> |
20 | #include <drm/tinydrm/tinydrm-helpers.h> | 20 | #include <drm/tinydrm/tinydrm-helpers.h> |
@@ -119,7 +119,7 @@ static struct drm_driver st7735r_driver = { | |||
119 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | | 119 | .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | |
120 | DRIVER_ATOMIC, | 120 | DRIVER_ATOMIC, |
121 | .fops = &st7735r_fops, | 121 | .fops = &st7735r_fops, |
122 | TINYDRM_GEM_DRIVER_OPS, | 122 | DRM_GEM_CMA_VMAP_DRIVER_OPS, |
123 | .debugfs_init = mipi_dbi_debugfs_init, | 123 | .debugfs_init = mipi_dbi_debugfs_init, |
124 | .name = "st7735r", | 124 | .name = "st7735r", |
125 | .desc = "Sitronix ST7735R", | 125 | .desc = "Sitronix ST7735R", |
diff --git a/include/drm/tinydrm/tinydrm.h b/include/drm/tinydrm/tinydrm.h index fe9827d0ca8a..448aa5ea4722 100644 --- a/include/drm/tinydrm/tinydrm.h +++ b/include/drm/tinydrm/tinydrm.h | |||
@@ -10,10 +10,15 @@ | |||
10 | #ifndef __LINUX_TINYDRM_H | 10 | #ifndef __LINUX_TINYDRM_H |
11 | #define __LINUX_TINYDRM_H | 11 | #define __LINUX_TINYDRM_H |
12 | 12 | ||
13 | #include <drm/drm_gem_cma_helper.h> | 13 | #include <linux/mutex.h> |
14 | #include <drm/drm_fb_cma_helper.h> | ||
15 | #include <drm/drm_simple_kms_helper.h> | 14 | #include <drm/drm_simple_kms_helper.h> |
16 | 15 | ||
16 | struct drm_clip_rect; | ||
17 | struct drm_driver; | ||
18 | struct drm_file; | ||
19 | struct drm_framebuffer; | ||
20 | struct drm_framebuffer_funcs; | ||
21 | |||
17 | /** | 22 | /** |
18 | * struct tinydrm_device - tinydrm device | 23 | * struct tinydrm_device - tinydrm device |
19 | */ | 24 | */ |
@@ -54,27 +59,6 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe) | |||
54 | } | 59 | } |
55 | 60 | ||
56 | /** | 61 | /** |
57 | * TINYDRM_GEM_DRIVER_OPS - default tinydrm gem operations | ||
58 | * | ||
59 | * This macro provides a shortcut for setting the tinydrm GEM operations in | ||
60 | * the &drm_driver structure. | ||
61 | */ | ||
62 | #define TINYDRM_GEM_DRIVER_OPS \ | ||
63 | .gem_free_object_unlocked = tinydrm_gem_cma_free_object, \ | ||
64 | .gem_print_info = drm_gem_cma_print_info, \ | ||
65 | .gem_vm_ops = &drm_gem_cma_vm_ops, \ | ||
66 | .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \ | ||
67 | .prime_fd_to_handle = drm_gem_prime_fd_to_handle, \ | ||
68 | .gem_prime_import = drm_gem_prime_import, \ | ||
69 | .gem_prime_export = drm_gem_prime_export, \ | ||
70 | .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, \ | ||
71 | .gem_prime_import_sg_table = tinydrm_gem_cma_prime_import_sg_table, \ | ||
72 | .gem_prime_vmap = drm_gem_cma_prime_vmap, \ | ||
73 | .gem_prime_vunmap = drm_gem_cma_prime_vunmap, \ | ||
74 | .gem_prime_mmap = drm_gem_cma_prime_mmap, \ | ||
75 | .dumb_create = drm_gem_cma_dumb_create | ||
76 | |||
77 | /** | ||
78 | * TINYDRM_MODE - tinydrm display mode | 62 | * TINYDRM_MODE - tinydrm display mode |
79 | * @hd: Horizontal resolution, width | 63 | * @hd: Horizontal resolution, width |
80 | * @vd: Vertical resolution, height | 64 | * @vd: Vertical resolution, height |
@@ -97,11 +81,6 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe) | |||
97 | .type = DRM_MODE_TYPE_DRIVER, \ | 81 | .type = DRM_MODE_TYPE_DRIVER, \ |
98 | .clock = 1 /* pass validation */ | 82 | .clock = 1 /* pass validation */ |
99 | 83 | ||
100 | void tinydrm_gem_cma_free_object(struct drm_gem_object *gem_obj); | ||
101 | struct drm_gem_object * | ||
102 | tinydrm_gem_cma_prime_import_sg_table(struct drm_device *drm, | ||
103 | struct dma_buf_attachment *attach, | ||
104 | struct sg_table *sgt); | ||
105 | int devm_tinydrm_init(struct device *parent, struct tinydrm_device *tdev, | 84 | int devm_tinydrm_init(struct device *parent, struct tinydrm_device *tdev, |
106 | const struct drm_framebuffer_funcs *fb_funcs, | 85 | const struct drm_framebuffer_funcs *fb_funcs, |
107 | struct drm_driver *driver); | 86 | struct drm_driver *driver); |