From patchwork Tue Nov 19 14:17:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11252849 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F0E831390 for ; Tue, 19 Nov 2019 23:28:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9ECE2245D for ; Tue, 19 Nov 2019 23:28:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9ECE2245D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: mail.kernel.org; spf=none 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 729E26E9EE; Tue, 19 Nov 2019 23:28:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from crapouillou.net (outils.crapouillou.net [89.234.176.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 431156E311 for ; Tue, 19 Nov 2019 14:28:13 +0000 (UTC) From: Paul Cercueil To: David Airlie , Daniel Vetter , Rob Herring , Mark Rutland Subject: [PATCH 3/6] gpu/drm: ingenic: Use the plane's src_[x, y] to configure DMA length Date: Tue, 19 Nov 2019 15:17:33 +0100 Message-Id: <20191119141736.74607-3-paul@crapouillou.net> In-Reply-To: <20191119141736.74607-1-paul@crapouillou.net> References: <20191119141736.74607-1-paul@crapouillou.net> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 19 Nov 2019 23:28:08 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1574173066; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OS0h2Ggg0b56cOSobtp4VRoJMemsoZrzaLZRtyDPpVY=; b=U2Ab5tl5RgP93po3s3jGRYQnUOPa+NEAxx4xgdMlmqap1W9fZu5mv9FMBgfJkvuBUt77Ei h2f6TRrhQ2d6H4DGVqAYY0syO7SCXoh2vzPWAsOIYCgg/GtXBhdblt2K7Z+Q8dthB/eJCp P1WZdmqVNi0KtuNolxBY55l0FrsQA28= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Cercueil , devicetree@vger.kernel.org, od@zcrc.me, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Instead of obtaining the width/height of the framebuffer from the CRTC state, obtain it from the current plane state. Signed-off-by: Paul Cercueil --- drivers/gpu/drm/ingenic/ingenic-drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c index 6dc4b06e7e68..7a172271bd63 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c @@ -374,8 +374,8 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane, struct drm_framebuffer *fb = state->fb; if (fb) { - width = state->crtc->state->adjusted_mode.hdisplay; - height = state->crtc->state->adjusted_mode.vdisplay; + width = state->src_w >> 16; + height = state->src_h >> 16; cpp = fb->format->cpp[plane->index]; priv->dma_hwdesc->addr = drm_fb_cma_get_gem_addr(fb, state, 0);