Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1765403lqg; Mon, 4 Mar 2024 03:11:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUe8FDyaISfoTy2Nu2cKkGddhkDXr8OVqhS1M/ELWpsFXTGsSPc3sBGYtbfdXlK/QW+ShJJk427KZ0KRU/losnPLYP5rA7Z9Kd/4y4lAg== X-Google-Smtp-Source: AGHT+IHfuOMaLKQ640RSQoU6EeauFsnuKFgvRTia//lwW8oTvJSuFHPaRIWSL1X+bv5yjg/dexyP X-Received: by 2002:a17:902:ce91:b0:1dc:a834:5e1a with SMTP id f17-20020a170902ce9100b001dca8345e1amr9380569plg.11.1709550713723; Mon, 04 Mar 2024 03:11:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709550713; cv=pass; d=google.com; s=arc-20160816; b=TYTDCaCZF/n8u5yvpF3OUNrp/vHlNpPBwxGbUUGnPBwrvcKi7HJezh02P7Zpgg5mtM vBsgBFbB3x879lz2X2cqa/lquw8ge67Ws60yKiVULCSXpDbkp5D19bfhN01pWRg0EkZl CKpeAHnKjur8sGnoeFW9rbXDa19RTcM+buV/kGPqVVNFl2SQAK359pOpkhf2RseiKJau pH9r90Lx8WPJNnaDcYsUPFFyGoMgdmWvVFaoHquF7iDojlfQTTW/IJ/1jWMAzYbGE1ue qxUZLDhT/NjuYN6nPsFNnnD0fWyVlPZyF6CxkbTptSfVgU8r3TkJbL4VL2v7xYNrrxxz bzcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=VJ1daIdHtcv8RmtQF9il5FIbIYuUpBeFieXJ6o2z1UA=; fh=7ZiXlf072G/lN8xdmqYn6Mje4+3/VHs3sDtd4iIrwW0=; b=ETEOg8pfJnv35POIg0Op1dZZz2WIHfd4w1brfj/wLWq+rV/jaaTgcahoS3MQUg0fpc oo1x4Y5pkNKGIt4BJzOIpKZcTfu5Gs5TCN6DH0S8np8CKwJOyvNeAMnrtEf45CkidCKn 14qCAIPjrFVHd2MEpkKO6k/kb4cUnTu4VxNVGQiGcYt77p/M2It+vgRY1eqVXPUukgXl kqcg6UQFfd2xnHi2u1yM8WqdPWvVB/SEv491QwciK3TkqiHz1FOlySDr7PipEgjP+2Nc N/4SBHJRNYj8XH779ManK+ngXYYAixg8VsX9scphvZPyZ7MCU7sGJPp/osv4ObJRFhpH VPgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f9CripOA; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-90486-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90486-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u1-20020a170902e80100b001d9c37d7188si8126343plg.201.2024.03.04.03.11.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 03:11:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90486-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f9CripOA; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-90486-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90486-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6893D286D8F for ; Mon, 4 Mar 2024 11:11:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8272038FBC; Mon, 4 Mar 2024 11:11:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="f9CripOA" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2680F46AD for ; Mon, 4 Mar 2024 11:11:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709550685; cv=none; b=AeECL+voHbTeq7SNG1QfI8qn5PlJ5de6BKOKdNXqIfwDLZX4bcJD4DB9TVGsbC5EmjkRTM9droxoIj44YD95NDYFQuc6QF9/C0G9OAZwfA5OhUaxMs7kyMwH23/7fKl53updO98m9Txc6MJgsQce7/lyCnVbt3Xae5So66yTTPQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709550685; c=relaxed/simple; bh=0T0lhm8LzcAdzbLDuBp+ZTGZjesoCjhi5zU7O8aSCKI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=crIfbw9jak9Ki4YieEwmKU86MtDlD0DmrttFpY+wjFNbvRIYsxnik9/FM5+dIviwX0SnSbFe6eLRhTGyeAVWopopY2vHybu86W9tAEJIvF2kgUxAWsGzbep60oxCbvrK3rsGl3ky0TTC+zjHATxZWZGcAxxtH6lXksJSgJtudqI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=f9CripOA; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709550684; x=1741086684; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=0T0lhm8LzcAdzbLDuBp+ZTGZjesoCjhi5zU7O8aSCKI=; b=f9CripOA53/9SXNGSz+zq2JlTMz1QpfLG06Rp8dFiiv6jRJJC3zGadXv URNX0JDSLzzLF4LrHSbcuVRwVHrSPJ7/SP/6wkmRw4odyWRzODjmthBZB er9wzOk5XBC8mIZFTyCFM83crmdnA9Ndfw5hijyTEFQlaeX5iPRvu0O2G UMhW6hh5f3kHo6RFGmZRTpLi2eQe3iWu3yGMkUj0fngd/K7sQXQimppR/ A1v6DCvMTrOw8Yzhvu6kGXRnE7Y12n5bwgIO+xZ6Q11njjRPnLjVrfbuW Q896JnC3KpaUZDtusRcL3O6D5nJughBec5rh9OuJVqO+PFv8gQViBGWkI w==; X-IronPort-AV: E=McAfee;i="6600,9927,11002"; a="4160900" X-IronPort-AV: E=Sophos;i="6.06,203,1705392000"; d="scan'208";a="4160900" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2024 03:11:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11002"; a="827773138" X-IronPort-AV: E=Sophos;i="6.06,203,1705392000"; d="scan'208";a="827773138" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by orsmga001.jf.intel.com with SMTP; 04 Mar 2024 03:11:18 -0800 Received: by stinkbox (sSMTP sendmail emulation); Mon, 04 Mar 2024 13:11:17 +0200 Date: Mon, 4 Mar 2024 13:11:17 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Nikita Kiryushin Cc: Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , David Airlie , Daniel Vetter , Manasi Navare , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH] drm/i915: Remove unneeded double drm_rect_visible call in check_overlay_dst Message-ID: References: <> <79c92cfa-cf5a-4a23-8a93-11c1af7432fc@ancud.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Patchwork-Hint: comment On Fri, Mar 01, 2024 at 09:56:41PM +0300, Nikita Kiryushin wrote: > On 2/29/24 15:30, Ville Syrj?l? wrote: > > I prefer the current way where we have no side effects in > > the if statement. > > > > This seem like a valid concern from readability and maintainability > standpoint. My patch was aimed mostly at performance and maintainability > using tools: some more pedantic analyzers are sensitive to non-checked > return values (as of now, drm_rect_intersect is ignored). > > Would it be a better idea to make an update to the patch with second > drm_rect_visible call changed to an appropriately named state flag set > with drm_rect_intersect result? I was thinking of maybe removing that drm_rect_visible() from drm_rect_intersect() entirely, but looks like it's used fairly extensively, so would require a bunch of work. But now that I though about this I recalled that there was an earlier patch trying to do exactly what you suggested in this patch. And looks like there was a second version posted which I completely missed: https://patchwork.freedesktop.org/series/115605/ While that does still have drm_rect_intersect() with its side effects inside the if() I don't find it quite as objectionable since it's the only thing in there. So it's a bit more obvious what is happening. I've gone and merged that one. Thanks for the patch regardless. At least I reminded me to look at the earlier attempt ;) > > BTW, the original patch somehow got mangled while it made its way to the > patchwork: source list line in patch got broken, which permits the patch > from being applied (the original version did not have that line break). > Any ideas how to prevent this happening with the second version of patch > (in case the idea is viable)? -- Ville Syrj?l? Intel