Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753481AbdLMQDH (ORCPT ); Wed, 13 Dec 2017 11:03:07 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:39013 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752860AbdLMQDG (ORCPT ); Wed, 13 Dec 2017 11:03:06 -0500 X-Google-Smtp-Source: ACJfBot7tfrVOI5lCZOV7FZCIK86uz5GQ1NVaf0d7i7550tSV1IwfMsJhYrW/dWmtvHNE4aMBDuOLA== Subject: Re: [PATCH 1/8] drm/sun4i: backend: Move line stride setup to buffer setup function To: Maxime Ripard , Daniel Vetter , David Airlie , Chen-Yu Tsai Cc: linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, thomas@vitsch.nl References: From: Neil Armstrong Organization: Baylibre Message-ID: <1b65d7ce-99f9-7df5-56c5-829dc27b4b73@baylibre.com> Date: Wed, 13 Dec 2017 17:03:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2091 Lines: 55 On 13/12/2017 16:33, Maxime Ripard wrote: > 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. > > Signed-off-by: Maxime Ripard > --- > drivers/gpu/drm/sun4i/sun4i_backend.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c > index 847eecbe4d14..c99d1a7e815a 100644 > --- a/drivers/gpu/drm/sun4i/sun4i_backend.c > +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c > @@ -141,7 +141,6 @@ int sun4i_backend_update_layer_coord(struct sun4i_backend *backend, > int layer, struct drm_plane *plane) > { > struct drm_plane_state *state = plane->state; > - struct drm_framebuffer *fb = state->fb; > > DRM_DEBUG_DRIVER("Updating layer %d\n", layer); > > @@ -153,12 +152,6 @@ int sun4i_backend_update_layer_coord(struct sun4i_backend *backend, > state->crtc_h)); > } > > - /* Set the line width */ > - DRM_DEBUG_DRIVER("Layer line width: %d bits\n", fb->pitches[0] * 8); > - regmap_write(backend->engine.regs, > - SUN4I_BACKEND_LAYLINEWIDTH_REG(layer), > - fb->pitches[0] * 8); > - > /* Set height and width */ > DRM_DEBUG_DRIVER("Layer size W: %u H: %u\n", > state->crtc_w, state->crtc_h); > @@ -218,6 +211,13 @@ int sun4i_backend_update_layer_buffer(struct sun4i_backend *backend, > u32 lo_paddr, hi_paddr; > dma_addr_t paddr; > > + /* Set the line width */ > + DRM_DEBUG_DRIVER("Layer line width: %d bits\n", fb->pitches[0] * 8); > + regmap_write(backend->engine.regs, > + SUN4I_BACKEND_LAYLINEWIDTH_REG(layer), > + fb->pitches[0] * 8); > + > + > /* Get the start of the displayed memory */ > paddr = drm_fb_cma_get_gem_addr(fb, state, 0); > DRM_DEBUG_DRIVER("Setting buffer address to %pad\n", &paddr); > Reviewed-by: Neil Armstrong