From patchwork Thu Nov 28 15:37:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 11266295 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 70B481393 for ; Thu, 28 Nov 2019 15:38:17 +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 581BC2084D for ; Thu, 28 Nov 2019 15:38:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 581BC2084D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 16AB26E847; Thu, 28 Nov 2019 15:38:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8574589C05 for ; Thu, 28 Nov 2019 15:37:52 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id b11so11354248wmj.4 for ; Thu, 28 Nov 2019 07:37:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HrdYqIJ8Cxshs6Aa/bHGdGgDvlNcq34vR+c5j3HYNtA=; b=IKCURifBU+t2mgad2WvT21H/fnz33IjdFS0Yigms2hSSJpeP/3wK7Vyatyokzr/ASl TpwnAkYe5N20XuHgBoYvEmRUy8MiK57xiSDzAQIllvENO0ozQV1cQMMQE8ExQJcWYXOF ZdNSHUxFV7aFojdqM7Lgo096dS1/vBSdqv2qNO3hyG9j5DR+NKW8WKnoktc7l/37niXD 9UnhvBl+ytvDr0Jf4o4Dfyv4SatbirUUrpRN+cKV5nonpx1XZ1acbg7SoeolE4ElutYG 3eyHdGejMHIFYRdO8dDG5gmXwq+GHzXGe3Q/Yo+qpvr2TZN6V5DtHunJZt2TJfRbqWuK 5CWg== X-Gm-Message-State: APjAAAV+Cjo+fqdVtbQ++0MDXkp6FOCv/Vx11JiYWOhaVk/9JBm2sa1K J+/xyA6vt2YX7QdPg0LUV9mMtHVIDp4= X-Google-Smtp-Source: APXvYqz8SKwAvHY3TytakMY5iSY6gVr7NcSbL5ZBcKy9HT6jLMl11Qps6inph4HJyMHNHUhNhtWFzg== X-Received: by 2002:a7b:c004:: with SMTP id c4mr9913681wmb.45.1574955471094; Thu, 28 Nov 2019 07:37:51 -0800 (PST) Received: from localhost (pD9E518ED.dip0.t-ipconnect.de. [217.229.24.237]) by smtp.gmail.com with ESMTPSA id s10sm2701711wrw.12.2019.11.28.07.37.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 07:37:50 -0800 (PST) From: Thierry Reding To: Thierry Reding Subject: [PATCH 4/9] drm/tegra: Use proper IOVA address for cursor image Date: Thu, 28 Nov 2019 16:37:36 +0100 Message-Id: <20191128153741.2380419-5-thierry.reding@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191128153741.2380419-1-thierry.reding@gmail.com> References: <20191128153741.2380419-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HrdYqIJ8Cxshs6Aa/bHGdGgDvlNcq34vR+c5j3HYNtA=; b=VfoW0WCZF+O9ztW6wTwsZMcCQ8NaJVc1t8TgojB5qpDu8Wi8cwhXomlYqyp7AlR06e eaWEng2jbKbaYA+K81DXFAfcC6m972l2XqOLYlgzrqXbf6DPCveZ7TNQMgT8tVk5sJlO BjMsUVLOE6h4OUQUsdzfYEE2iTL9FzXqylcoAvgpkW/fLJxCwO4r6DNXVZfkvYieAbcA 4ojPNM7FuokCqYnzQ8RoFdFTuqAYZdCtv6gh4IP2ScJ2BbTtXOzbCqo+w5IlJROIGc1h YvunSypP2EUJEOlRbuAbcs8yHk6o7IQnQhKdlLVcGp9s2BLqMgsd+WKYjRwFCTgCL1Aq TcCQ== 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: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding The IOVA address for the cursor is the result of mapping the buffer object for the given display controller. Make sure to use the proper IOVA address as stored in the cursor's plane state. Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/dc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index d03b33c3b114..0a5f86b61fda 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -847,16 +847,15 @@ static int tegra_cursor_atomic_check(struct drm_plane *plane, static void tegra_cursor_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct tegra_bo *bo = tegra_fb_get_plane(plane->state->fb, 0); + struct tegra_plane_state *state = to_tegra_plane_state(plane->state); struct tegra_dc *dc = to_tegra_dc(plane->state->crtc); - struct drm_plane_state *state = plane->state; u32 value = CURSOR_CLIP_DISPLAY; /* rien ne va plus */ if (!plane->state->crtc || !plane->state->fb) return; - switch (state->crtc_w) { + switch (plane->state->crtc_w) { case 32: value |= CURSOR_SIZE_32x32; break; @@ -874,16 +873,16 @@ static void tegra_cursor_atomic_update(struct drm_plane *plane, break; default: - WARN(1, "cursor size %ux%u not supported\n", state->crtc_w, - state->crtc_h); + WARN(1, "cursor size %ux%u not supported\n", + plane->state->crtc_w, plane->state->crtc_h); return; } - value |= (bo->iova >> 10) & 0x3fffff; + value |= (state->iova[0] >> 10) & 0x3fffff; tegra_dc_writel(dc, value, DC_DISP_CURSOR_START_ADDR); #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT - value = (bo->iova >> 32) & 0x3; + value = (state->iova[0] >> 32) & 0x3; tegra_dc_writel(dc, value, DC_DISP_CURSOR_START_ADDR_HI); #endif @@ -902,7 +901,8 @@ static void tegra_cursor_atomic_update(struct drm_plane *plane, tegra_dc_writel(dc, value, DC_DISP_BLEND_CURSOR_CONTROL); /* position the cursor */ - value = (state->crtc_y & 0x3fff) << 16 | (state->crtc_x & 0x3fff); + value = (plane->state->crtc_y & 0x3fff) << 16 | + (plane->state->crtc_x & 0x3fff); tegra_dc_writel(dc, value, DC_DISP_CURSOR_POSITION); }