From patchwork Mon Jan 22 09:25:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 125349 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1053741ljf; Mon, 22 Jan 2018 01:25:43 -0800 (PST) X-Google-Smtp-Source: AH8x22551u5TsgsZzIWdeiztXxXaM59dZotoRsnKVnwI3zaBsGA3NrL9iRoLtSib331LrL0Mf+wa X-Received: by 10.101.96.132 with SMTP id t4mr6691866pgu.58.1516613142991; Mon, 22 Jan 2018 01:25:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516613142; cv=none; d=google.com; s=arc-20160816; b=XgiYL9rijh4LZeHsUFPFxbzQsKnUx1hcQ0TGGFkYEfZOLGCPQwdwZUs8x05RPE8DJT kXZc5NQb2Kx8E7ZnR7/jRZcaK8NwsOs+oZRCAL4Gx9Bc622mRgnaSu1pLvYw65QIpivw E9QOYqxYTzOPFML4eYZNxmTuQXPQhAukEoyrEopxK73xIIu0J2xUo0OgSl0tXg4y9Ind XfCdWhz/55giqfHnM3RqNn4a4gIe7gLHUh9Ugoo6b++rUlr0Xxk7p3iOgDn10A8xk6jI U0ug8gsCL+ACglVNkhDqaQKbBnOpNJvBl59/BhfyOgvUV/Nr/Jquos+72TdV0dYIQm44 Tk9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=FUExMoKylKffKHUMo8+Cz55PCd7FByETiaxVEsUfNd4=; b=xzu8toCQVwkq/SHITe1lZIug0uzAlUoHgHRm5hbhO3Dio13/lHYOBvbVFi+8hnoGJV WooCdNgBvT+Yg3r5FyXK68zvbA6wQKs8Kjsv8aB2c+MfC4AUOGop8RFmdkovVTOBTeVn HaKiYHzjpx80JuCk2BBtIsQ4CqUaqrFMh49RYHyoxQtrUK0a6jQbMZeBXMEEmEp8WTwc pkgzcoYsQWrbnWOadTf/fxQZ4L+HLYmUJj7kAAsPP3YhJXI5EJJVz7njCRPm5gtYulK2 8iyw2UT1bql7qS+E0qL5d3ZEBIjQCpHaGkqUTCqpSWMKe4OFgcah4YPfldAq6o+qD2+8 0sTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id p184si15142864pfg.371.2018.01.22.01.25.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jan 2018 01:25:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 871156E11C; Mon, 22 Jan 2018 09:25:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 845346E0C6 for ; Mon, 22 Jan 2018 09:25:40 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id DEF262069C; Mon, 22 Jan 2018 10:25:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id AD8E7206A4; Mon, 22 Jan 2018 10:25:29 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v4 01/13] drm/sun4i: backend: Move line stride setup to buffer setup function Date: Mon, 22 Jan 2018 10:25:15 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: linux-arm-kernel@lists.infradead.org, thomas@vitsch.nl, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, narmstrong@baylibre.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Reviewed-by: Neil Armstrong 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);