From patchwork Tue Jan 9 10:09:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 123847 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp266066edr; Tue, 9 Jan 2018 02:09:42 -0800 (PST) X-Google-Smtp-Source: ACJfBos6YYMInHsVtUhgJ6WXCYGyG6IfliS6upr7QEIuM0dl2glLmZ+N71sMtbaNU/5Q8jd0z95B X-Received: by 10.84.130.6 with SMTP id 6mr15417331plc.134.1515492582759; Tue, 09 Jan 2018 02:09:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515492582; cv=none; d=google.com; s=arc-20160816; b=rK1z8TJ/uR1D3ne7zhFBB9Qly3tABqd4aqm9YTN7Lp9cBa8VqaC5QDOsJFBnSOehXt gbUhzIAZ0/Wh05C5CzBfIElLyxKaMgzsSLEaDNqTYu0ZlbocK2pxFW98mzc1bMEAtSQT TzS/oZV96oC7Ykyl2vqk9+/O51pWZ97uHkI6SsB/o2XfT83Wm24Bcs+JFc2+6uDh+DO5 Ned5I/d5iqu7gu5F0ttud1NGVN8Mv7Cmvvtw/5Yalqss/9yRgxIqQCnrO5LhagBUkKbX tj4udvaPuVgg6WGlVq7iYiy0SoOww7eVhHSDxXrf0omxW8CGDX4lGVabAdbqrqnerVcm /ObQ== 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=cWEPfMkT5n53BO3ozvPJvPMZ3ccFYEggKCFllj3F8oK7RbHR85d+Yvv8mzzLgf2Jb0 0K1C98SmmcIXxRemS0jqn10XvyA5dahKjaMHytNvjzGa3edZ7ejfddXS11QA0gXuUWW7 Hxj09dY3IA+R78FnkZLjulbMQqdddkKfSrhIuIOJT8VxkF2AlYV22n8KnlSG1rXHEuTS mVYfhf1XGSxSkBlvbw4k8q+NYDL3woXF7qeg4tOo0+UtzN12pCUCHF3RaB9RpIUEmifv PtrRzHKDrdxcevnvAqKm7C/3YIFQ8kund8TfC+Kj1ddqjFJQMOmFQ9nlrspKNk/u+lGO n4sg== 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 k195si8786702pgc.187.2018.01.09.02.09.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 02:09: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 BFB6D6E066; Tue, 9 Jan 2018 10:09: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 C142389F71 for ; Tue, 9 Jan 2018 10:09:40 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 44A652081A; Tue, 9 Jan 2018 11:09: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 11079203B7; Tue, 9 Jan 2018 11:09:29 +0100 (CET) From: Maxime Ripard To: Daniel Vetter , David Airlie , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v3 01/13] drm/sun4i: backend: Move line stride setup to buffer setup function Date: Tue, 9 Jan 2018 11:09:14 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Thomas Petazzoni , narmstrong@baylibre.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, thomas@vitsch.nl 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);