diff options
Diffstat (limited to 'drivers/gpu/drm/tinydrm/st7586.c')
-rw-r--r-- | drivers/gpu/drm/tinydrm/st7586.c | 23 |
1 files changed, 6 insertions, 17 deletions
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, |