diff options
-rw-r--r-- | drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c | 30 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/ili9225.c | 23 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/mi0283qt.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/mipi-dbi.c | 30 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/repaper.c | 28 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/st7586.c | 23 | ||||
-rw-r--r-- | drivers/gpu/drm/tinydrm/st7735r.c | 2 | ||||
-rw-r--r-- | include/drm/tinydrm/mipi-dbi.h | 4 | ||||
-rw-r--r-- | include/drm/tinydrm/tinydrm-helpers.h | 5 | ||||
-rw-r--r-- | include/drm/tinydrm/tinydrm.h | 4 |
11 files changed, 78 insertions, 78 deletions
diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c index d1c3ce9ab294..dcd390163a4a 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c | |||
@@ -78,6 +78,36 @@ bool tinydrm_merge_clips(struct drm_clip_rect *dst, | |||
78 | } | 78 | } |
79 | EXPORT_SYMBOL(tinydrm_merge_clips); | 79 | EXPORT_SYMBOL(tinydrm_merge_clips); |
80 | 80 | ||
81 | int tinydrm_fb_dirty(struct drm_framebuffer *fb, | ||
82 | struct drm_file *file_priv, | ||
83 | unsigned int flags, unsigned int color, | ||
84 | struct drm_clip_rect *clips, | ||
85 | unsigned int num_clips) | ||
86 | { | ||
87 | struct tinydrm_device *tdev = fb->dev->dev_private; | ||
88 | struct drm_plane *plane = &tdev->pipe.plane; | ||
89 | int ret = 0; | ||
90 | |||
91 | drm_modeset_lock(&plane->mutex, NULL); | ||
92 | |||
93 | /* fbdev can flush even when we're not interested */ | ||
94 | if (plane->state->fb == fb) { | ||
95 | mutex_lock(&tdev->dirty_lock); | ||
96 | ret = tdev->fb_dirty(fb, file_priv, flags, | ||
97 | color, clips, num_clips); | ||
98 | mutex_unlock(&tdev->dirty_lock); | ||
99 | } | ||
100 | |||
101 | drm_modeset_unlock(&plane->mutex); | ||
102 | |||
103 | if (ret) | ||
104 | dev_err_once(fb->dev->dev, | ||
105 | "Failed to update display %d\n", ret); | ||
106 | |||
107 | return ret; | ||
108 | } | ||
109 | EXPORT_SYMBOL(tinydrm_fb_dirty); | ||
110 | |||
81 | /** | 111 | /** |
82 | * tinydrm_memcpy - Copy clip buffer | 112 | * tinydrm_memcpy - Copy clip buffer |
83 | * @dst: Destination buffer | 113 | * @dst: Destination buffer |
diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c index 11ae950b0fc9..e68b528ae64d 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | |||
@@ -125,9 +125,8 @@ void tinydrm_display_pipe_update(struct drm_simple_display_pipe *pipe, | |||
125 | struct drm_crtc *crtc = &tdev->pipe.crtc; | 125 | struct drm_crtc *crtc = &tdev->pipe.crtc; |
126 | 126 | ||
127 | if (fb && (fb != old_state->fb)) { | 127 | if (fb && (fb != old_state->fb)) { |
128 | pipe->plane.fb = fb; | 128 | if (tdev->fb_dirty) |
129 | if (fb->funcs->dirty) | 129 | tdev->fb_dirty(fb, NULL, 0, 0, NULL, 0); |
130 | fb->funcs->dirty(fb, NULL, 0, 0, NULL, 0); | ||
131 | } | 130 | } |
132 | 131 | ||
133 | if (crtc->state->event) { | 132 | if (crtc->state->event) { |
diff --git a/drivers/gpu/drm/tinydrm/ili9225.c b/drivers/gpu/drm/tinydrm/ili9225.c index 089d22798c8b..0874e877b111 100644 --- a/drivers/gpu/drm/tinydrm/ili9225.c +++ b/drivers/gpu/drm/tinydrm/ili9225.c | |||
@@ -88,14 +88,8 @@ static int ili9225_fb_dirty(struct drm_framebuffer *fb, | |||
88 | bool full; | 88 | bool full; |
89 | void *tr; | 89 | void *tr; |
90 | 90 | ||
91 | mutex_lock(&tdev->dirty_lock); | ||
92 | |||
93 | if (!mipi->enabled) | 91 | if (!mipi->enabled) |
94 | goto out_unlock; | 92 | return 0; |
95 | |||
96 | /* fbdev can flush even when we're not interested */ | ||
97 | if (tdev->pipe.plane.fb != fb) | ||
98 | goto out_unlock; | ||
99 | 93 | ||
100 | full = tinydrm_merge_clips(&clip, clips, num_clips, flags, | 94 | full = tinydrm_merge_clips(&clip, clips, num_clips, flags, |
101 | fb->width, fb->height); | 95 | fb->width, fb->height); |
@@ -108,7 +102,7 @@ static int ili9225_fb_dirty(struct drm_framebuffer *fb, | |||
108 | tr = mipi->tx_buf; | 102 | tr = mipi->tx_buf; |
109 | ret = mipi_dbi_buf_copy(mipi->tx_buf, fb, &clip, swap); | 103 | ret = mipi_dbi_buf_copy(mipi->tx_buf, fb, &clip, swap); |
110 | if (ret) | 104 | if (ret) |
111 | goto out_unlock; | 105 | return ret; |
112 | } else { | 106 | } else { |
113 | tr = cma_obj->vaddr; | 107 | tr = cma_obj->vaddr; |
114 | } | 108 | } |
@@ -159,20 +153,13 @@ static int ili9225_fb_dirty(struct drm_framebuffer *fb, | |||
159 | ret = mipi_dbi_command_buf(mipi, ILI9225_WRITE_DATA_TO_GRAM, tr, | 153 | ret = mipi_dbi_command_buf(mipi, ILI9225_WRITE_DATA_TO_GRAM, tr, |
160 | (clip.x2 - clip.x1) * (clip.y2 - clip.y1) * 2); | 154 | (clip.x2 - clip.x1) * (clip.y2 - clip.y1) * 2); |
161 | 155 | ||
162 | out_unlock: | ||
163 | mutex_unlock(&tdev->dirty_lock); | ||
164 | |||
165 | if (ret) | ||
166 | dev_err_once(fb->dev->dev, "Failed to update display %d\n", | ||
167 | ret); | ||
168 | |||
169 | return ret; | 156 | return ret; |
170 | } | 157 | } |
171 | 158 | ||
172 | static const struct drm_framebuffer_funcs ili9225_fb_funcs = { | 159 | static const struct drm_framebuffer_funcs ili9225_fb_funcs = { |
173 | .destroy = drm_gem_fb_destroy, | 160 | .destroy = drm_gem_fb_destroy, |
174 | .create_handle = drm_gem_fb_create_handle, | 161 | .create_handle = drm_gem_fb_create_handle, |
175 | .dirty = ili9225_fb_dirty, | 162 | .dirty = tinydrm_fb_dirty, |
176 | }; | 163 | }; |
177 | 164 | ||
178 | static void ili9225_pipe_enable(struct drm_simple_display_pipe *pipe, | 165 | static void ili9225_pipe_enable(struct drm_simple_display_pipe *pipe, |
@@ -269,7 +256,7 @@ static void ili9225_pipe_enable(struct drm_simple_display_pipe *pipe, | |||
269 | 256 | ||
270 | ili9225_command(mipi, ILI9225_DISPLAY_CONTROL_1, 0x1017); | 257 | ili9225_command(mipi, ILI9225_DISPLAY_CONTROL_1, 0x1017); |
271 | 258 | ||
272 | mipi_dbi_enable_flush(mipi); | 259 | mipi_dbi_enable_flush(mipi, crtc_state, plane_state); |
273 | } | 260 | } |
274 | 261 | ||
275 | static void ili9225_pipe_disable(struct drm_simple_display_pipe *pipe) | 262 | static void ili9225_pipe_disable(struct drm_simple_display_pipe *pipe) |
@@ -342,6 +329,8 @@ static int ili9225_init(struct device *dev, struct mipi_dbi *mipi, | |||
342 | if (ret) | 329 | if (ret) |
343 | return ret; | 330 | return ret; |
344 | 331 | ||
332 | tdev->fb_dirty = ili9225_fb_dirty; | ||
333 | |||
345 | ret = tinydrm_display_pipe_init(tdev, pipe_funcs, | 334 | ret = tinydrm_display_pipe_init(tdev, pipe_funcs, |
346 | DRM_MODE_CONNECTOR_VIRTUAL, | 335 | DRM_MODE_CONNECTOR_VIRTUAL, |
347 | ili9225_formats, | 336 | ili9225_formats, |
diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c b/drivers/gpu/drm/tinydrm/mi0283qt.c index 82ad9b61898e..4e6d2ee94e55 100644 --- a/drivers/gpu/drm/tinydrm/mi0283qt.c +++ b/drivers/gpu/drm/tinydrm/mi0283qt.c | |||
@@ -127,7 +127,7 @@ static void mi0283qt_enable(struct drm_simple_display_pipe *pipe, | |||
127 | msleep(100); | 127 | msleep(100); |
128 | 128 | ||
129 | out_enable: | 129 | out_enable: |
130 | mipi_dbi_enable_flush(mipi); | 130 | mipi_dbi_enable_flush(mipi, crtc_state, plane_state); |
131 | } | 131 | } |
132 | 132 | ||
133 | static const struct drm_simple_display_pipe_funcs mi0283qt_pipe_funcs = { | 133 | static const struct drm_simple_display_pipe_funcs mi0283qt_pipe_funcs = { |
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 9e903812b573..4d1fb31a781f 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c | |||
@@ -219,14 +219,8 @@ static int mipi_dbi_fb_dirty(struct drm_framebuffer *fb, | |||
219 | bool full; | 219 | bool full; |
220 | void *tr; | 220 | void *tr; |
221 | 221 | ||
222 | mutex_lock(&tdev->dirty_lock); | ||
223 | |||
224 | if (!mipi->enabled) | 222 | if (!mipi->enabled) |
225 | goto out_unlock; | 223 | return 0; |
226 | |||
227 | /* fbdev can flush even when we're not interested */ | ||
228 | if (tdev->pipe.plane.fb != fb) | ||
229 | goto out_unlock; | ||
230 | 224 | ||
231 | full = tinydrm_merge_clips(&clip, clips, num_clips, flags, | 225 | full = tinydrm_merge_clips(&clip, clips, num_clips, flags, |
232 | fb->width, fb->height); | 226 | fb->width, fb->height); |
@@ -239,7 +233,7 @@ static int mipi_dbi_fb_dirty(struct drm_framebuffer *fb, | |||
239 | tr = mipi->tx_buf; | 233 | tr = mipi->tx_buf; |
240 | ret = mipi_dbi_buf_copy(mipi->tx_buf, fb, &clip, swap); | 234 | ret = mipi_dbi_buf_copy(mipi->tx_buf, fb, &clip, swap); |
241 | if (ret) | 235 | if (ret) |
242 | goto out_unlock; | 236 | return ret; |
243 | } else { | 237 | } else { |
244 | tr = cma_obj->vaddr; | 238 | tr = cma_obj->vaddr; |
245 | } | 239 | } |
@@ -254,20 +248,13 @@ static int mipi_dbi_fb_dirty(struct drm_framebuffer *fb, | |||
254 | ret = mipi_dbi_command_buf(mipi, MIPI_DCS_WRITE_MEMORY_START, tr, | 248 | ret = mipi_dbi_command_buf(mipi, MIPI_DCS_WRITE_MEMORY_START, tr, |
255 | (clip.x2 - clip.x1) * (clip.y2 - clip.y1) * 2); | 249 | (clip.x2 - clip.x1) * (clip.y2 - clip.y1) * 2); |
256 | 250 | ||
257 | out_unlock: | ||
258 | mutex_unlock(&tdev->dirty_lock); | ||
259 | |||
260 | if (ret) | ||
261 | dev_err_once(fb->dev->dev, "Failed to update display %d\n", | ||
262 | ret); | ||
263 | |||
264 | return ret; | 251 | return ret; |
265 | } | 252 | } |
266 | 253 | ||
267 | static const struct drm_framebuffer_funcs mipi_dbi_fb_funcs = { | 254 | static const struct drm_framebuffer_funcs mipi_dbi_fb_funcs = { |
268 | .destroy = drm_gem_fb_destroy, | 255 | .destroy = drm_gem_fb_destroy, |
269 | .create_handle = drm_gem_fb_create_handle, | 256 | .create_handle = drm_gem_fb_create_handle, |
270 | .dirty = mipi_dbi_fb_dirty, | 257 | .dirty = tinydrm_fb_dirty, |
271 | }; | 258 | }; |
272 | 259 | ||
273 | /** | 260 | /** |
@@ -278,13 +265,16 @@ static const struct drm_framebuffer_funcs mipi_dbi_fb_funcs = { | |||
278 | * enables the backlight. Drivers can use this in their | 265 | * enables the backlight. Drivers can use this in their |
279 | * &drm_simple_display_pipe_funcs->enable callback. | 266 | * &drm_simple_display_pipe_funcs->enable callback. |
280 | */ | 267 | */ |
281 | void mipi_dbi_enable_flush(struct mipi_dbi *mipi) | 268 | void mipi_dbi_enable_flush(struct mipi_dbi *mipi, |
269 | struct drm_crtc_state *crtc_state, | ||
270 | struct drm_plane_state *plane_state) | ||
282 | { | 271 | { |
283 | struct drm_framebuffer *fb = mipi->tinydrm.pipe.plane.fb; | 272 | struct tinydrm_device *tdev = &mipi->tinydrm; |
273 | struct drm_framebuffer *fb = plane_state->fb; | ||
284 | 274 | ||
285 | mipi->enabled = true; | 275 | mipi->enabled = true; |
286 | if (fb) | 276 | if (fb) |
287 | fb->funcs->dirty(fb, NULL, 0, 0, NULL, 0); | 277 | tdev->fb_dirty(fb, NULL, 0, 0, NULL, 0); |
288 | 278 | ||
289 | backlight_enable(mipi->backlight); | 279 | backlight_enable(mipi->backlight); |
290 | } | 280 | } |
@@ -381,6 +371,8 @@ int mipi_dbi_init(struct device *dev, struct mipi_dbi *mipi, | |||
381 | if (ret) | 371 | if (ret) |
382 | return ret; | 372 | return ret; |
383 | 373 | ||
374 | tdev->fb_dirty = mipi_dbi_fb_dirty; | ||
375 | |||
384 | /* TODO: Maybe add DRM_MODE_CONNECTOR_SPI */ | 376 | /* TODO: Maybe add DRM_MODE_CONNECTOR_SPI */ |
385 | ret = tinydrm_display_pipe_init(tdev, pipe_funcs, | 377 | ret = tinydrm_display_pipe_init(tdev, pipe_funcs, |
386 | DRM_MODE_CONNECTOR_VIRTUAL, | 378 | DRM_MODE_CONNECTOR_VIRTUAL, |
diff --git a/drivers/gpu/drm/tinydrm/repaper.c b/drivers/gpu/drm/tinydrm/repaper.c index 33b4a71916e4..bb6f80a81899 100644 --- a/drivers/gpu/drm/tinydrm/repaper.c +++ b/drivers/gpu/drm/tinydrm/repaper.c | |||
@@ -540,14 +540,8 @@ static int repaper_fb_dirty(struct drm_framebuffer *fb, | |||
540 | clip.y1 = 0; | 540 | clip.y1 = 0; |
541 | clip.y2 = fb->height; | 541 | clip.y2 = fb->height; |
542 | 542 | ||
543 | mutex_lock(&tdev->dirty_lock); | ||
544 | |||
545 | if (!epd->enabled) | 543 | if (!epd->enabled) |
546 | goto out_unlock; | 544 | return 0; |
547 | |||
548 | /* fbdev can flush even when we're not interested */ | ||
549 | if (tdev->pipe.plane.fb != fb) | ||
550 | goto out_unlock; | ||
551 | 545 | ||
552 | repaper_get_temperature(epd); | 546 | repaper_get_temperature(epd); |
553 | 547 | ||
@@ -555,16 +549,14 @@ static int repaper_fb_dirty(struct drm_framebuffer *fb, | |||
555 | epd->factored_stage_time); | 549 | epd->factored_stage_time); |
556 | 550 | ||
557 | buf = kmalloc(fb->width * fb->height, GFP_KERNEL); | 551 | buf = kmalloc(fb->width * fb->height, GFP_KERNEL); |
558 | if (!buf) { | 552 | if (!buf) |
559 | ret = -ENOMEM; | 553 | return -ENOMEM; |
560 | goto out_unlock; | ||
561 | } | ||
562 | 554 | ||
563 | if (import_attach) { | 555 | if (import_attach) { |
564 | ret = dma_buf_begin_cpu_access(import_attach->dmabuf, | 556 | ret = dma_buf_begin_cpu_access(import_attach->dmabuf, |
565 | DMA_FROM_DEVICE); | 557 | DMA_FROM_DEVICE); |
566 | if (ret) | 558 | if (ret) |
567 | goto out_unlock; | 559 | goto out_free; |
568 | } | 560 | } |
569 | 561 | ||
570 | tinydrm_xrgb8888_to_gray8(buf, cma_obj->vaddr, fb, &clip); | 562 | tinydrm_xrgb8888_to_gray8(buf, cma_obj->vaddr, fb, &clip); |
@@ -573,7 +565,7 @@ static int repaper_fb_dirty(struct drm_framebuffer *fb, | |||
573 | ret = dma_buf_end_cpu_access(import_attach->dmabuf, | 565 | ret = dma_buf_end_cpu_access(import_attach->dmabuf, |
574 | DMA_FROM_DEVICE); | 566 | DMA_FROM_DEVICE); |
575 | if (ret) | 567 | if (ret) |
576 | goto out_unlock; | 568 | goto out_free; |
577 | } | 569 | } |
578 | 570 | ||
579 | repaper_gray8_to_mono_reversed(buf, fb->width, fb->height); | 571 | repaper_gray8_to_mono_reversed(buf, fb->width, fb->height); |
@@ -625,11 +617,7 @@ static int repaper_fb_dirty(struct drm_framebuffer *fb, | |||
625 | } | 617 | } |
626 | } | 618 | } |
627 | 619 | ||
628 | out_unlock: | 620 | out_free: |
629 | mutex_unlock(&tdev->dirty_lock); | ||
630 | |||
631 | if (ret) | ||
632 | DRM_DEV_ERROR(fb->dev->dev, "Failed to update display (%d)\n", ret); | ||
633 | kfree(buf); | 621 | kfree(buf); |
634 | 622 | ||
635 | return ret; | 623 | return ret; |
@@ -638,7 +626,7 @@ out_unlock: | |||
638 | static const struct drm_framebuffer_funcs repaper_fb_funcs = { | 626 | static const struct drm_framebuffer_funcs repaper_fb_funcs = { |
639 | .destroy = drm_gem_fb_destroy, | 627 | .destroy = drm_gem_fb_destroy, |
640 | .create_handle = drm_gem_fb_create_handle, | 628 | .create_handle = drm_gem_fb_create_handle, |
641 | .dirty = repaper_fb_dirty, | 629 | .dirty = tinydrm_fb_dirty, |
642 | }; | 630 | }; |
643 | 631 | ||
644 | static void power_off(struct repaper_epd *epd) | 632 | static void power_off(struct repaper_epd *epd) |
@@ -1070,6 +1058,8 @@ static int repaper_probe(struct spi_device *spi) | |||
1070 | if (ret) | 1058 | if (ret) |
1071 | return ret; | 1059 | return ret; |
1072 | 1060 | ||
1061 | tdev->fb_dirty = repaper_fb_dirty; | ||
1062 | |||
1073 | ret = tinydrm_display_pipe_init(tdev, &repaper_pipe_funcs, | 1063 | ret = tinydrm_display_pipe_init(tdev, &repaper_pipe_funcs, |
1074 | DRM_MODE_CONNECTOR_VIRTUAL, | 1064 | DRM_MODE_CONNECTOR_VIRTUAL, |
1075 | repaper_formats, | 1065 | repaper_formats, |
diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c index bb08b293c8ce..22644b88199a 100644 --- a/drivers/gpu/drm/tinydrm/st7586.c +++ b/drivers/gpu/drm/tinydrm/st7586.c | |||
@@ -120,14 +120,8 @@ static int st7586_fb_dirty(struct drm_framebuffer *fb, | |||
120 | int start, end; | 120 | int start, end; |
121 | int ret = 0; | 121 | int ret = 0; |
122 | 122 | ||
123 | mutex_lock(&tdev->dirty_lock); | ||
124 | |||
125 | if (!mipi->enabled) | 123 | if (!mipi->enabled) |
126 | goto out_unlock; | 124 | return 0; |
127 | |||
128 | /* fbdev can flush even when we're not interested */ | ||
129 | if (tdev->pipe.plane.fb != fb) | ||
130 | goto out_unlock; | ||
131 | 125 | ||
132 | tinydrm_merge_clips(&clip, clips, num_clips, flags, fb->width, | 126 | tinydrm_merge_clips(&clip, clips, num_clips, flags, fb->width, |
133 | fb->height); | 127 | fb->height); |
@@ -141,7 +135,7 @@ static int st7586_fb_dirty(struct drm_framebuffer *fb, | |||
141 | 135 | ||
142 | ret = st7586_buf_copy(mipi->tx_buf, fb, &clip); | 136 | ret = st7586_buf_copy(mipi->tx_buf, fb, &clip); |
143 | if (ret) | 137 | if (ret) |
144 | goto out_unlock; | 138 | return ret; |
145 | 139 | ||
146 | /* Pixels are packed 3 per byte */ | 140 | /* Pixels are packed 3 per byte */ |
147 | start = clip.x1 / 3; | 141 | start = clip.x1 / 3; |
@@ -158,20 +152,13 @@ static int st7586_fb_dirty(struct drm_framebuffer *fb, | |||
158 | (u8 *)mipi->tx_buf, | 152 | (u8 *)mipi->tx_buf, |
159 | (end - start) * (clip.y2 - clip.y1)); | 153 | (end - start) * (clip.y2 - clip.y1)); |
160 | 154 | ||
161 | out_unlock: | ||
162 | mutex_unlock(&tdev->dirty_lock); | ||
163 | |||
164 | if (ret) | ||
165 | dev_err_once(fb->dev->dev, "Failed to update display %d\n", | ||
166 | ret); | ||
167 | |||
168 | return ret; | 155 | return ret; |
169 | } | 156 | } |
170 | 157 | ||
171 | static const struct drm_framebuffer_funcs st7586_fb_funcs = { | 158 | static const struct drm_framebuffer_funcs st7586_fb_funcs = { |
172 | .destroy = drm_gem_fb_destroy, | 159 | .destroy = drm_gem_fb_destroy, |
173 | .create_handle = drm_gem_fb_create_handle, | 160 | .create_handle = drm_gem_fb_create_handle, |
174 | .dirty = st7586_fb_dirty, | 161 | .dirty = tinydrm_fb_dirty, |
175 | }; | 162 | }; |
176 | 163 | ||
177 | static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe, | 164 | static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe, |
@@ -238,7 +225,7 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe, | |||
238 | 225 | ||
239 | mipi_dbi_command(mipi, MIPI_DCS_SET_DISPLAY_ON); | 226 | mipi_dbi_command(mipi, MIPI_DCS_SET_DISPLAY_ON); |
240 | 227 | ||
241 | mipi_dbi_enable_flush(mipi); | 228 | mipi_dbi_enable_flush(mipi, crtc_state, plane_state); |
242 | } | 229 | } |
243 | 230 | ||
244 | static void st7586_pipe_disable(struct drm_simple_display_pipe *pipe) | 231 | static void st7586_pipe_disable(struct drm_simple_display_pipe *pipe) |
@@ -278,6 +265,8 @@ static int st7586_init(struct device *dev, struct mipi_dbi *mipi, | |||
278 | if (ret) | 265 | if (ret) |
279 | return ret; | 266 | return ret; |
280 | 267 | ||
268 | tdev->fb_dirty = st7586_fb_dirty; | ||
269 | |||
281 | ret = tinydrm_display_pipe_init(tdev, pipe_funcs, | 270 | ret = tinydrm_display_pipe_init(tdev, pipe_funcs, |
282 | DRM_MODE_CONNECTOR_VIRTUAL, | 271 | DRM_MODE_CONNECTOR_VIRTUAL, |
283 | st7586_formats, | 272 | st7586_formats, |
diff --git a/drivers/gpu/drm/tinydrm/st7735r.c b/drivers/gpu/drm/tinydrm/st7735r.c index 19b28f8c78db..189a07894d36 100644 --- a/drivers/gpu/drm/tinydrm/st7735r.c +++ b/drivers/gpu/drm/tinydrm/st7735r.c | |||
@@ -99,7 +99,7 @@ static void jd_t18003_t01_pipe_enable(struct drm_simple_display_pipe *pipe, | |||
99 | 99 | ||
100 | msleep(20); | 100 | msleep(20); |
101 | 101 | ||
102 | mipi_dbi_enable_flush(mipi); | 102 | mipi_dbi_enable_flush(mipi, crtc_state, plane_state); |
103 | } | 103 | } |
104 | 104 | ||
105 | static const struct drm_simple_display_pipe_funcs jd_t18003_t01_pipe_funcs = { | 105 | static const struct drm_simple_display_pipe_funcs jd_t18003_t01_pipe_funcs = { |
diff --git a/include/drm/tinydrm/mipi-dbi.h b/include/drm/tinydrm/mipi-dbi.h index 44e824af2ef6..b8ba58861986 100644 --- a/include/drm/tinydrm/mipi-dbi.h +++ b/include/drm/tinydrm/mipi-dbi.h | |||
@@ -67,7 +67,9 @@ int mipi_dbi_init(struct device *dev, struct mipi_dbi *mipi, | |||
67 | const struct drm_simple_display_pipe_funcs *pipe_funcs, | 67 | const struct drm_simple_display_pipe_funcs *pipe_funcs, |
68 | struct drm_driver *driver, | 68 | struct drm_driver *driver, |
69 | const struct drm_display_mode *mode, unsigned int rotation); | 69 | const struct drm_display_mode *mode, unsigned int rotation); |
70 | void mipi_dbi_enable_flush(struct mipi_dbi *mipi); | 70 | void mipi_dbi_enable_flush(struct mipi_dbi *mipi, |
71 | struct drm_crtc_state *crtc_state, | ||
72 | struct drm_plane_state *plan_state); | ||
71 | void mipi_dbi_pipe_disable(struct drm_simple_display_pipe *pipe); | 73 | void mipi_dbi_pipe_disable(struct drm_simple_display_pipe *pipe); |
72 | void mipi_dbi_hw_reset(struct mipi_dbi *mipi); | 74 | void mipi_dbi_hw_reset(struct mipi_dbi *mipi); |
73 | bool mipi_dbi_display_is_on(struct mipi_dbi *mipi); | 75 | bool mipi_dbi_display_is_on(struct mipi_dbi *mipi); |
diff --git a/include/drm/tinydrm/tinydrm-helpers.h b/include/drm/tinydrm/tinydrm-helpers.h index 0a4ddbc04c60..5b96f0b12c8c 100644 --- a/include/drm/tinydrm/tinydrm-helpers.h +++ b/include/drm/tinydrm/tinydrm-helpers.h | |||
@@ -36,6 +36,11 @@ static inline bool tinydrm_machine_little_endian(void) | |||
36 | bool tinydrm_merge_clips(struct drm_clip_rect *dst, | 36 | bool tinydrm_merge_clips(struct drm_clip_rect *dst, |
37 | struct drm_clip_rect *src, unsigned int num_clips, | 37 | struct drm_clip_rect *src, unsigned int num_clips, |
38 | unsigned int flags, u32 max_width, u32 max_height); | 38 | unsigned int flags, u32 max_width, u32 max_height); |
39 | int tinydrm_fb_dirty(struct drm_framebuffer *fb, | ||
40 | struct drm_file *file_priv, | ||
41 | unsigned int flags, unsigned int color, | ||
42 | struct drm_clip_rect *clips, | ||
43 | unsigned int num_clips); | ||
39 | void tinydrm_memcpy(void *dst, void *vaddr, struct drm_framebuffer *fb, | 44 | void tinydrm_memcpy(void *dst, void *vaddr, struct drm_framebuffer *fb, |
40 | struct drm_clip_rect *clip); | 45 | struct drm_clip_rect *clip); |
41 | void tinydrm_swab16(u16 *dst, void *vaddr, struct drm_framebuffer *fb, | 46 | void tinydrm_swab16(u16 *dst, void *vaddr, struct drm_framebuffer *fb, |
diff --git a/include/drm/tinydrm/tinydrm.h b/include/drm/tinydrm/tinydrm.h index 77a93ec577fd..6e2b960e25eb 100644 --- a/include/drm/tinydrm/tinydrm.h +++ b/include/drm/tinydrm/tinydrm.h | |||
@@ -26,6 +26,10 @@ struct tinydrm_device { | |||
26 | struct drm_simple_display_pipe pipe; | 26 | struct drm_simple_display_pipe pipe; |
27 | struct mutex dirty_lock; | 27 | struct mutex dirty_lock; |
28 | const struct drm_framebuffer_funcs *fb_funcs; | 28 | const struct drm_framebuffer_funcs *fb_funcs; |
29 | int (*fb_dirty)(struct drm_framebuffer *framebuffer, | ||
30 | struct drm_file *file_priv, unsigned flags, | ||
31 | unsigned color, struct drm_clip_rect *clips, | ||
32 | unsigned num_clips); | ||
29 | }; | 33 | }; |
30 | 34 | ||
31 | static inline struct tinydrm_device * | 35 | static inline struct tinydrm_device * |