Received: by 10.192.165.148 with SMTP id m20csp1689898imm; Thu, 3 May 2018 03:56:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo2GaMkqrWk8aN85eq0WchASeLtOQ9hHKtyQ//Jf6oM/Xo7vhJMvNdqa+ZoUUZqEaPrE9U+ X-Received: by 2002:a63:7344:: with SMTP id d4-v6mr18505325pgn.273.1525345006585; Thu, 03 May 2018 03:56:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525345006; cv=none; d=google.com; s=arc-20160816; b=GEuaLIw9claPvBA39k3l1Nm0ss8M9/qZypVogEhCDcHUAXKe96xQLigi4iXaAS71L/ 4sPRJ1x6k60yVnVkH1zUtcppUfCQ5QgQzJzEVMwKnm3MX72rwAnpBuMeJNFWg2SMn8u2 5CW2M1a2sgLL2o5UfvpqM0Nd7k1P23WGaxKiZeti/MqC/9CDOSj/CYBN/fHcEYH0Aau+ z+ddxFKfzFkki/SjE+GGqPV/sPuXd3cKzl8cNYQvthPXdjsR6kcK0Z1PcezBWQ0UdEs/ 5QgPFuE1ZhJ5HpmcV6Ve9Q5k3OOxV0QvLFCh+IFGtLR+qhAnron8ZgJaCgeaTmtpqaHU 8Q1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date :arc-authentication-results; bh=W9MY6yAtE+cw6sqWotG3gqJ5aGm0F+Air0Jl6o2s+L0=; b=ERzskM+hskaa/K4Tj4uznFG1z+yvm4bZGu9Hq+E1TKa4dHD8AYwnQl6hvLENHFMwbX krE+PR6aAsi3AQysw3M92BUR0AvpUDOcum9VfJ11Ym4CYK++wKbOCIGW4Nggj3099n+o +XAIOlmZOLk0nIBOfXq7lrUksLbvefnoo3B1XUXTDPI/n1g9HKEL6E7b2RZvSYAZWL+Q 2gSoCAGkBV9KpDOonVOUhbZDjAFXsNNTaUrVAUxVkxm9FnNbge2BlvofqeeTaaLxxNY2 RAgSbb02VzUo5jFcU55800xj7iceiOkRyIoVONEPsQ2ATpCvzbZLHw/emiUg2tOz5itc MOMw== 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 z5-v6si2797216pln.562.2018.05.03.03.56.31; Thu, 03 May 2018 03:56:46 -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 S1751809AbeECKzL (ORCPT + 99 others); Thu, 3 May 2018 06:55:11 -0400 Received: from mga11.intel.com ([192.55.52.93]:57087 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751602AbeECKzI (ORCPT ); Thu, 3 May 2018 06:55:08 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2018 03:55:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,358,1520924400"; d="scan'208";a="36551473" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga007.fm.intel.com with SMTP; 03 May 2018 03:55:04 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 03 May 2018 13:55:03 +0300 Date: Thu, 3 May 2018 13:55:03 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Satendra Singh Thakur , Gustavo Padovan , Maarten Lankhorst , Sean Paul , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Hemanshu Srivastava , Madhur Verma Subject: Re: [PATCH] drm/atomic: Handling the case when setting old crtc for plane Message-ID: <20180503105503.GQ23723@intel.com> References: <1525326572-25854-1-git-send-email-satendra.t@samsung.com> <20180503092458.GH12521@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180503092458.GH12521@phenom.ffwll.local> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 03, 2018 at 11:24:59AM +0200, Daniel Vetter wrote: > On Thu, May 03, 2018 at 11:19:32AM +0530, Satendra Singh Thakur wrote: > > 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 > > --- > > drivers/gpu/drm/drm_atomic.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c > > index 7d25c42..5bd3365 100644 > > --- a/drivers/gpu/drm/drm_atomic.c > > +++ b/drivers/gpu/drm/drm_atomic.c > > @@ -1421,7 +1421,9 @@ drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state, > > { > > 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; > > I didn't do this (both here and in the set_crtc_for_connector functions) > because the overhead is probably way down in the noise compared to the > overall atomic commit machinery. Do you really see this as a hotpath? drm_atomic_set_crtc_for_connector() actually has this since commit e2d800a3ce1b ("drm: Avoid connector reference imbalance on error path") -- Ville Syrj?l? Intel