From patchwork Wed Dec 13 15:33:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 121789 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5621207qgn; Wed, 13 Dec 2017 07:34:13 -0800 (PST) X-Google-Smtp-Source: ACJfBoupaqGXtLFC3hLNm3bs8P/PxYwm8BxBaztkxDOEBqDpLK/FtQUwrERxYB+YKt1vJsNX4DvB X-Received: by 10.98.104.194 with SMTP id d185mr6388725pfc.155.1513179253899; Wed, 13 Dec 2017 07:34:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513179253; cv=none; d=google.com; s=arc-20160816; b=iDqdxfIF58bIqj7d2FNr0u7R0yNJe7uXSQaTCRAIukmVKFt9xS0JyIE4rBb5GgrByR 8jT3HyEWGefA+18LUNQiY/qxKxHAd7d2CE/3pVqP3w4Pul1JZTon/mG41uMNd3HYpw7P VtWBgImhXfmQuo+12vnUr8QxM4cDzrOcUBqG0LxXmewnp2WYYZB+go1+t826MfUOECpB A4y8Bl1tQgl3GyPycm9RtpeZQE4/7icbiekZDTmDABd17OiskEHB4yJatJrKaBb8AZHu Brj/YO6BsbiF7WFTZBL+G3bxT4EIZmnK3VGxEvfbiQ2v8mV/jj7af3+Yv1ZrKFoMiz2j 40GA== 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=TEbiUimMtUKj24SBbpqnxSQFb4hltBR/35oA0hrdRnc=; b=Zdv5sQCbHvXIvA10ccxMhkC1TaK22JOW85wuVg/3unZVV0AbKtsEIPqJD18UxwmLTE BfPcr8iulPsAmE/cDMdta53AML7p5M4SGNjQg9kAbYqjyCTjPKoD1Xpr4trsy3vpQyG1 IHIuZTbpnzbjWK8NH7+yExHoZ5q+urB6yTq3cNdPcdsr6wjxm2ulvWbg49zgr4j8k80T hTNaQEl28w2D1IOx5jXgR+YTv+VWgHl//cAZpkY1nuI4DQ3Rkvuao/vmXthio4ntuxZA k1x/BAzmlKO9DUKVxMsOodNPzMP5K9ijArdhkJZpXNv8tPHoXpCzn7cQkonQnII2nBOK gCJQ== 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 e62si1597841pfa.154.2017.12.13.07.34.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Dec 2017 07:34:13 -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 638AB6E514; Wed, 13 Dec 2017 15:33:40 +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 5D6346E510 for ; Wed, 13 Dec 2017 15:33:39 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 2971620850; Wed, 13 Dec 2017 16:33:38 +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 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 F2BC120732; Wed, 13 Dec 2017 16:33:37 +0100 (CET) From: Maxime Ripard To: Daniel Vetter , David Airlie , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH 1/8] drm/sun4i: backend: Move line stride setup to buffer setup function Date: Wed, 13 Dec 2017 16:33:25 +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 Petazzoni , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.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. 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);