Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1112443imm; Wed, 1 Aug 2018 10:22:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdrM6Fu41DzqFB3TzMrqxSteKSVbsUaxSAew3ug8z7OCVY36CWcHDJa+fG4dehOXdonK2VF X-Received: by 2002:a62:f0d:: with SMTP id x13-v6mr27406729pfi.123.1533144175648; Wed, 01 Aug 2018 10:22:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533144175; cv=none; d=google.com; s=arc-20160816; b=BrMZ2pKnLdJmLsfmaDOR6VcynHPv/7amqQi3+8gq7vdETN9ZfS+FVpw4IiHoX+YUWh 9qzNziblVYu/QkhRhgKTsGaQ48vDLtzCLG1ZDidVR9TrIDTHiMOmJjbY3Q8B0Y5aIRCV onOebfGD3Ii7OyBqw6iqEpS21PLmav1FC5zH+0wbk+42DGSll9OA3S8oBNfgB0G7V/8t fxbVN122onL+BmW0VX7KjE5pzStnpbSN0J1fBCj38lhyo7+gswUMQR8KOcORTwcUbKU+ QfE5uBICuPiGmhecwD9hZrf5zpZvwILRv98CNP06lAqyxQUtfEcMyLxkQjOsTvpRQKQN 6S2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=rBKW9ONxGNvu5Rv+blhM+jHMlV/zuDGz8rI3hv+lQ0g=; b=xXCJJIf3chTC3vFAfhnoU5Qq7NohOWYz71bpcRflBKnjehzcmuJxdMdAiq3u/MxobV +PPHV8/CZETTwQfNFSIfCpL10vnoWJEQtyajcBkN4xB/rXBUSlv+1xKo9/u5B9TAoSuL cN9RL2Ezety82r1w7m8jN+pvNZ41PZYfNkCvMW7K8VArHJA2deDMyMOjrT+Y1usHgRRN n25G2/nr/D6JziWKEcRf9OqEvhaQWnY+57o8loGCCAm+ndz4wJ1XqjURy2VPBEY+QiJa z/QAYwhUdqhh2jEUqtFudTobqjcD/joI4BKinbYaua1RVZgV4tzvElE/ROnrbDrvRUvQ hvnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p65-v6si16290139pga.401.2018.08.01.10.22.40; Wed, 01 Aug 2018 10:22:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405374AbeHATHC (ORCPT + 99 others); Wed, 1 Aug 2018 15:07:02 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49100 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403967AbeHATHB (ORCPT ); Wed, 1 Aug 2018 15:07:01 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8308BD1F; Wed, 1 Aug 2018 17:20:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Satendra Singh Thakur , Madhur Verma , Hemanshu Srivastava , Daniel Vetter , Sasha Levin Subject: [PATCH 4.14 171/246] drm/atomic: Handling the case when setting old crtc for plane Date: Wed, 1 Aug 2018 18:51:21 +0200 Message-Id: <20180801165019.913757375@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Satendra Singh Thakur [ Upstream commit fc2a69f3903dfd97cd47f593e642b47918c949df ] In the func drm_atomic_set_crtc_for_plane, with the current code, if crtc of the plane_state and crtc passed as argument to the func are same, entire func will executed in vein. It will get state of crtc and clear and set the bits in plane_mask. All these steps are not required for same old crtc. Ideally, we should do nothing in this case, this patch handles the same, and causes the program to return without doing anything in such scenario. Signed-off-by: Satendra Singh Thakur Cc: Madhur Verma Cc: Hemanshu Srivastava Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/1525326572-25854-1-git-send-email-satendra.t@samsung.com Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_atomic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1355,7 +1355,9 @@ drm_atomic_set_crtc_for_plane(struct drm { struct drm_plane *plane = plane_state->plane; struct drm_crtc_state *crtc_state; - + /* Nothing to do for same crtc*/ + if (plane_state->crtc == crtc) + return 0; if (plane_state->crtc) { crtc_state = drm_atomic_get_crtc_state(plane_state->state, plane_state->crtc);