From patchwork Thu Mar 15 01:00:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 10284091 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 10C2560291 for ; Thu, 15 Mar 2018 08:52:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03F562891D for ; Thu, 15 Mar 2018 08:52:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECC6228920; Thu, 15 Mar 2018 08:52:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A88992891D for ; Thu, 15 Mar 2018 08:52:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 022946E7BA; Thu, 15 Mar 2018 08:52:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl0-x241.google.com (mail-pl0-x241.google.com [IPv6:2607:f8b0:400e:c01::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 56A7C6E75A for ; Thu, 15 Mar 2018 01:01:47 +0000 (UTC) Received: by mail-pl0-x241.google.com with SMTP id 9-v6so2736926ple.11 for ; Wed, 14 Mar 2018 18:01:47 -0700 (PDT) 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 :in-reply-to:references; bh=aMqMHiFU++Okohp3N6GEmoZ6HXUZQYFCiYpVxfZejn8=; b=kKRidehhMkR2fx+/rz3a/hpqXdnirazROZm0ztUo9g62bsHb1LpXDc3a60A9F0n2Ky HIAak8QgXjmZo6wPIsDibiGNhbGDgMZpUxqCOD+kEwzsHFBagAT4FTnKlTW2XXUgs5bq y/4SheGkJcta1pha2+45rIt3suj4f2JV6bEUTXJqGnCHGK1tA+K/GTlgdWlPkKr6cZvq oZLJkaCxhGe5TXYh66htzdN8JhS0JqI+Iix0OE72DvZCrucWdH2JZtRbcHb1WyBlRMX0 2JAh8otblv9AXXtsaHtx6j8bi+pabAlQAsGYwBSMrKs4/IonMv2OCb8P/aA47cs11cRv 4oUA== 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:in-reply-to:references; bh=aMqMHiFU++Okohp3N6GEmoZ6HXUZQYFCiYpVxfZejn8=; b=mo/HaBmTncZkeZ6UnFQHAAUFtPDeYgZ6oHFGc2TQeBhhchqitQRlpLntG8tBC6iEYS 6Mtnn6wMRpmGj8t696OT125SGsHfMwjxDhvLz6saSgAw142aekgzyLNoKWqkZw9GqTIj X6j93aq5fbdQbglKuzrNLVrBfOxh+CVfgakkwsrHn2ybGCe5uVJfHQPoBwhYTq3045Tg K6+WpEROC4zq4rj5X/QzF6X+N806ejHjyEsbo2sEmPbBA45aOZpP8dcIWdfZ1cVhg7Fb KfNMfcAuhfDccRMBGf6wGxRHZVjT3lTXtvDlLHGgqadp5rqCFiiy7Ny0Jgsl6pvDFxje Zk0w== X-Gm-Message-State: AElRT7FZNc9rph5lwpMzyaemuvA+lYkgKDRudAAxgdrRLqEDey9ZSyCw 3aJ3e8Zdthtr4SBwVWVK1Mdbwhpu X-Google-Smtp-Source: AG47ELu75Eu49soURrZ4xNpi9fxPFVu5kza1N7N3lzzE2psXFTs6sqtObyID1olugdwYlg51lWBPVw== X-Received: by 2002:a17:902:8f97:: with SMTP id z23-v6mr5967583plo.162.1521075706811; Wed, 14 Mar 2018 18:01:46 -0700 (PDT) Received: from localhost.localdomain (ppp109-252-55-234.pppoe.spdop.ru. [109.252.55.234]) by smtp.gmail.com with ESMTPSA id k195sm6823009pgc.71.2018.03.14.18.01.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 18:01:46 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding Subject: [PATCH v1 2/3] drm/tegra: plane: Correct legacy blending Date: Thu, 15 Mar 2018 04:00:24 +0300 Message-Id: <00cf4565238be471c90e5823e53e0ed504869bfe.1521075485.git.digetx@gmail.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <8d9c7220b1d2cf126bd2030e5d232ec06f761440.1521075485.git.digetx@gmail.com> References: <8d9c7220b1d2cf126bd2030e5d232ec06f761440.1521075485.git.digetx@gmail.com> In-Reply-To: <8d9c7220b1d2cf126bd2030e5d232ec06f761440.1521075485.git.digetx@gmail.com> References: <8d9c7220b1d2cf126bd2030e5d232ec06f761440.1521075485.git.digetx@gmail.com> X-Mailman-Approved-At: Thu, 15 Mar 2018 08:52:12 +0000 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, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Keep old 'dependent' state of unaffected planes, this way new state takes into account current state of unaffected planes. Fixes: ebae8d07435a ("drm/tegra: dc: Implement legacy blending") Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/plane.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c index fc37dcf8c458..3c0cb6a04c66 100644 --- a/drivers/gpu/drm/tegra/plane.c +++ b/drivers/gpu/drm/tegra/plane.c @@ -287,13 +287,11 @@ unsigned int tegra_plane_format_adjust(unsigned int opaque) return opaque; } -unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane, - struct tegra_plane *other) +static unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane, + struct tegra_plane *other) { unsigned int index = 0, i; - WARN_ON(plane == other); - for (i = 0; i < 3; i++) { if (i == plane->index) continue; @@ -310,18 +308,15 @@ unsigned int tegra_plane_get_overlap_index(struct tegra_plane *plane, void tegra_plane_check_dependent(struct tegra_plane *tegra, struct tegra_plane_state *state) { - struct drm_plane_state *old, *new; + struct drm_plane_state *new; struct drm_plane *plane; unsigned int zpos[2]; unsigned int i; - for (i = 0; i < 3; i++) - state->dependent[i] = false; - for (i = 0; i < 2; i++) zpos[i] = 0; - for_each_oldnew_plane_in_state(state->base.state, plane, old, new, i) { + for_each_new_plane_in_state(state->base.state, plane, new, i) { struct tegra_plane *p = to_tegra_plane(plane); unsigned index; @@ -331,6 +326,8 @@ void tegra_plane_check_dependent(struct tegra_plane *tegra, index = tegra_plane_get_overlap_index(tegra, p); + state->dependent[i] = false; + /* * If any of the other planes is on top of this plane and uses * a format with an alpha component, mark this plane as being