Skip to content

Commit f587087

Browse files
committed
drm/sun4i: backend: Move line stride setup to buffer setup function
Setup the line stride in the buffer setup function, since it's tied to the buffer itself, and is not needed when we do not set the buffer in the backend. This is for example the case when using the frontend and then routing its output to the backend. Reviewed-by: Chen-Yu Tsai <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/cbec84125bc0d5a6cf1d856b8291fbf77b138881.1516613040.git-series.maxime.ripard@free-electrons.com
1 parent 54156da commit f587087

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/gpu/drm/sun4i/sun4i_backend.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ int sun4i_backend_update_layer_coord(struct sun4i_backend *backend,
141141
int layer, struct drm_plane *plane)
142142
{
143143
struct drm_plane_state *state = plane->state;
144-
struct drm_framebuffer *fb = state->fb;
145144

146145
DRM_DEBUG_DRIVER("Updating layer %d\n", layer);
147146

@@ -153,12 +152,6 @@ int sun4i_backend_update_layer_coord(struct sun4i_backend *backend,
153152
state->crtc_h));
154153
}
155154

156-
/* Set the line width */
157-
DRM_DEBUG_DRIVER("Layer line width: %d bits\n", fb->pitches[0] * 8);
158-
regmap_write(backend->engine.regs,
159-
SUN4I_BACKEND_LAYLINEWIDTH_REG(layer),
160-
fb->pitches[0] * 8);
161-
162155
/* Set height and width */
163156
DRM_DEBUG_DRIVER("Layer size W: %u H: %u\n",
164157
state->crtc_w, state->crtc_h);
@@ -218,6 +211,12 @@ int sun4i_backend_update_layer_buffer(struct sun4i_backend *backend,
218211
u32 lo_paddr, hi_paddr;
219212
dma_addr_t paddr;
220213

214+
/* Set the line width */
215+
DRM_DEBUG_DRIVER("Layer line width: %d bits\n", fb->pitches[0] * 8);
216+
regmap_write(backend->engine.regs,
217+
SUN4I_BACKEND_LAYLINEWIDTH_REG(layer),
218+
fb->pitches[0] * 8);
219+
221220
/* Get the start of the displayed memory */
222221
paddr = drm_fb_cma_get_gem_addr(fb, state, 0);
223222
DRM_DEBUG_DRIVER("Setting buffer address to %pad\n", &paddr);

0 commit comments

Comments
 (0)