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: 886096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kKRidehh"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 401r0H4H7Pz9sDK for ; Thu, 15 Mar 2018 12:02:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751700AbeCOBBw (ORCPT ); Wed, 14 Mar 2018 21:01:52 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:42969 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751547AbeCOBBr (ORCPT ); Wed, 14 Mar 2018 21:01:47 -0400 Received: by mail-pl0-f66.google.com with SMTP id w15-v6so2739688plq.9; 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=D5Z51CHjdSK5t8/HEPVBXp9CSSytocjkRp/mC5ydY59uUIia43PJrht3LB0Ld2JvgO PRk13rBw0/cQW2pP6XjaQCqv3euuL9rumhrhTAuUOG26YysIxeSF+z0FdMXb6DAS8VW6 33opNwxk0rF8dmkbwYe/tt6Ckq4Rz69FopnIUdLhu2zU96EMFtcCz7uLJjgW4u3+ZMMS DBE/RRzK4G2ZuiH+eq5+hv+emmWj91UG/SQhWkcoxzE8TWO73llZqGtx9wtNwj3/EVN0 n5o7WWszCb8S0EQ6akHMKzSzrD62CcAogHsNKGnDGF+rJfLPVeUG9ECnGrVYEa8E98L4 dsKw== X-Gm-Message-State: AElRT7GFVP1AARZKfAMtu9mlsZBSHhwatnamhq24iAZoPaMdMGNlDGaw JUy5co2CrfAGniKkkQaAO1A= 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 Cc: dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org 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> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org 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