Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp395747lqb; Thu, 29 Feb 2024 04:31:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU+AqlIwtpn2mtiLj2zbBhR5ZRzUgcxt1k8GX43M4rW/35AdvgbS8gFIKTnyRna5+GIRdhMYhpiJqtlbGob5LM9foVaJHB6IZKWYwdMeA== X-Google-Smtp-Source: AGHT+IGs+TcwzDnRUS9pVqsXgJZTqGNtpla6sqclYPOGQmBhRh+9szjjv1jxaEkiEWBnSK3AHPFm X-Received: by 2002:a92:c84f:0:b0:365:b485:734c with SMTP id b15-20020a92c84f000000b00365b485734cmr2275594ilq.25.1709209863980; Thu, 29 Feb 2024 04:31:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709209863; cv=pass; d=google.com; s=arc-20160816; b=IwYRQoqWO3S5j12O/xRtNANqAVqtmWrSXmer2o9g7nhnposQ1VHdDo2/j4d9Zsu45k +LMaGYhHGLEsA5uOcPLOVLI4IG1voJ8SbzUu5RxesjhKtx1K6JZh3jmcIzIyVDHXoJz/ 3S3TfJ+bwkzhGIzPXhDb3JdC2+Oi8h38hHoCA5Yp/HqNpOnVPw33L+b/4lnINddE8YXj fLN4rSeVpZ/IH/XAGDT5YPYF3owy2HhSSnlqMS8voOEKTU8JwnByBZJIkegHa1JrmS2N l1LfWVaZHqNrl2gj7ToSwfJmm32AabfXE6ce9v/bKYRrnmcTuPJOZSLD4L6III2VaDit Fz5w== 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=/wgFxga+xfFgN+d9Q5bdLC3iZvHBX3fdFn8JgaTLPAI=; fh=Nzc9m1uqJvY/Kq4HV6Cni+QUVHe2QqhH42dk/Z6v7Fg=; b=JAs6mjEltItAyS2p1/ifizqzXJrUaRsVLuL1BOifwb9/N3+moO2EGHqK8WsxAa3BuM eeWL5/LEmJhc5FlkzI6ltPjMQtVIAhLPT5Ae7cCz0YQcxLVy1E6sNeotSh7G0PHJ1l7K a1b6KmtwzLh94Aik21hZ8XHN+5cG/utCOvMbtRF3482pDV1KlfLkdoH0J1J19xXa+4cT hezA50NEV3jzB/raPJ5BDtDH8BidtHXJfwCNIcpKBvHHuIzMwMB0/jXnYkoKu+zXJmLe GY9WBpBWdWv7Wb90nJZYWKrY4haB2Qv2gEIc+8IIL1IPhm3j0rPvsZhPfRidsm6CAbh7 b2ww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j2uwzqMw; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-86701-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86701-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 14-20020a630a0e000000b005db9566a62fsi1288882pgk.697.2024.02.29.04.31.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 04:31:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86701-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j2uwzqMw; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-86701-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86701-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 0C55A28E2D4 for ; Thu, 29 Feb 2024 12:31:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A98C91E521; Thu, 29 Feb 2024 12:30:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="j2uwzqMw" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 06C3213D2ED for ; Thu, 29 Feb 2024 12:30:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709209851; cv=none; b=NWkaLWglvb6Ol8zPbzpicNeXkMujHn3Tnytd5fW3dbxE6rEd+O93Kztpx141joBY6tWiyU/Imiv9rrH2BzJ5SFdB6NHSpADQE7E2UkzFT9sUDrZx0EcBT2BKkRKolVuEJKcFGphwWWMeuyjrMsrnTOJX260uhHguczk3eDVjoNE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709209851; c=relaxed/simple; bh=I8wHXrw5KXLL0vG+bL726Zb9dp643IbYVediCET50o8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SvKP2098Ikt0qq4a3dDn8Gh6EJGTRWhFxDHIOY+qPcR/qN4x+KGpH0+EUFiZFZlit6QYNiRzjXTbR6aHHIprSjXsO0VuI9edgYoh5Eq0L03aG/OjVJKI61j6VG4q4yikWJaCF2YCwlt7OVC7SLth9UN80oc88EDGhpk28o/bz9w= 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=j2uwzqMw; arc=none smtp.client-ip=192.198.163.16 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=1709209850; x=1740745850; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=I8wHXrw5KXLL0vG+bL726Zb9dp643IbYVediCET50o8=; b=j2uwzqMwbbIMsHc2vNzCj2RxJwQzdoJJST3I4Y4PWwcyfj6WEVyHT67b Os3g/lf1t9n30F/3+GDrny9ZbMRXOiESw47MGOwJYWyiOXxJQK+nx6Mxr XrLScKhpoT7v6Vxo+dMvCWwpjNbaZQVJQZadRx0WNVsuBXkbL26uxdUjF IhhIVtj8sGb+nXDD2QY6TMXH8qTp8Gt+sr/HiMXWCX9CqrCDHB0bPoknE awrNuz6siCJ3yjYHOdmgDoc2Saan7BFgwLkpyOWHyHUCBlanquNm0XGgL xCKeo7SZFPPCcNqLbQIdF4d2Qn/6SbXl6SiUbm9SCu8Jy8o029s4A/tDr w==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="4255542" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="4255542" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 04:30:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="827771475" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="827771475" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by orsmga001.jf.intel.com with SMTP; 29 Feb 2024 04:30:30 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 29 Feb 2024 14:30:29 +0200 Date: Thu, 29 Feb 2024 14:30:29 +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, 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: <79c92cfa-cf5a-4a23-8a93-11c1af7432fc@ancud.ru> X-Patchwork-Hint: comment On Wed, Feb 28, 2024 at 09:32:47PM +0300, Nikita Kiryushin wrote: > > check_overlay_dst for clipped is called 2 times: in drm_rect_intersect > and than directly. Change second call for check of drm_rect_intersect > result to save some time (in locked code section). > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 8d8b2dd3995f ("drm/i915: Make the PIPESRC rect relative to the > entire bigjoiner area") > Signed-off-by: Nikita Kiryushin > --- > drivers/gpu/drm/i915/display/intel_overlay.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c > b/drivers/gpu/drm/i915/display/intel_overlay.c > index 2b1392d5a902..1cda1c163a92 100644 > --- a/drivers/gpu/drm/i915/display/intel_overlay.c > +++ b/drivers/gpu/drm/i915/display/intel_overlay.c > @@ -972,9 +972,8 @@ static int check_overlay_dst(struct intel_overlay > *overlay, > rec->dst_width, rec->dst_height); > clipped = req; > - drm_rect_intersect(&clipped, &crtc_state->pipe_src); > - if (!drm_rect_visible(&clipped) || > + if (!drm_rect_intersect(&clipped, &crtc_state->pipe_src) || I prefer the current way where we have no side effects in the if statement. > !drm_rect_equals(&clipped, &req)) > return -EINVAL; > -- 2.34.1 -- Ville Syrj?l? Intel