From patchwork Mon Dec 18 14:57:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 122218 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2936105qgn; Mon, 18 Dec 2017 06:58:08 -0800 (PST) X-Google-Smtp-Source: ACJfBovXFA+FLG8u2Cndma5n9itDN1cZPBuSZa8l8//S+IPVDv+PsSPuoYDi85oL+nQ0IKYpmGmX X-Received: by 10.159.252.11 with SMTP id n11mr12940pls.196.1513609088253; Mon, 18 Dec 2017 06:58:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513609088; cv=none; d=google.com; s=arc-20160816; b=WosYMfkFibe3iZU/sPNOowGHJM/TUjwjATlUYoWWcvLHrZV+IN4zDHWRJX+M9DMKVa E/rsiDlHI5/bbNQuI/TCWRIkJoVLG3air+a4L9yOBt9xlo5e0TmKHmYrv6k2eToZKKj5 DeXTYW5kn/jjfrv9eT8Dqz5wm5i5WBpFOkjf9JepA4ibzH4mN3J11AAGx4+qGZgYOdtW uMVTTJnZYomVM5PyV0XENFM9Cjh8j2fq3j5pcqd+j4agnX3ZkelzK04lhWcuy+SbDDu8 nzDzigHxbHTkDgekZTT5IwH/Q0Kh2nEPudC3ztRDk/4EnwgNm1kY9/HURqAcfwoPFwni ITew== 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=QKMVv3X2iorxkASdM5K3r5/fowbIbJAEeMRh2/qYWqs=; b=E7/eRSFaZT+pmP7LyR89JTftIzBKYCdbir9RjqQ+MpGODQfMR/9k9yP7NxoO+RRxW/ mprf12dyxOZ65ltvqynDsFxeEvWX0AmAzH1b/tKE72KG5OBgtkDk1i7YtlyH97FTo0Yf kDfKsUgKGePUcCmWb3Q7ETUGA06Lg6nIdkgg0cW/dPUK4oKGiLGzBib2bt5qWwNnkvls 7+7xbiUPin5mlv60oVyWGa0tSvFNimdVuWiCgBc+n2WJwm6Gr9UqM+3phgGTMtB3QTg+ uocMsjBcOb+eVkXw6uaOctXHf9y9hvcUjJBgvR+GWgs5YcXcBrqce7iDk3iYdan66Xm9 WHGA== 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 p16si8572423pgq.161.2017.12.18.06.58.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 06:58:08 -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 02A8289B9F; Mon, 18 Dec 2017 14:58:06 +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 C8CD389BC2 for ; Mon, 18 Dec 2017 14:58:04 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 85211203B4; Mon, 18 Dec 2017 15:58:03 +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 5B26B20378; Mon, 18 Dec 2017 15:58:03 +0100 (CET) From: Maxime Ripard To: Daniel Vetter , David Airlie , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v2 01/12] drm/sun4i: backend: Move line stride setup to buffer setup function Date: Mon, 18 Dec 2017 15:57:48 +0100 Message-Id: <1ecb4fa914f6a399dc7bb4bd9f8c6ef68a65007d.1513609024.git-series.maxime.ripard@free-electrons.com> 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: Neil Armstrong Signed-off-by: Maxime Ripard Reviewed-by: Chen-Yu Tsai --- 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);