From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A6DAC021AA for ; Tue, 18 Feb 2025 20:40:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D3BC410E0FD; Tue, 18 Feb 2025 20:40:53 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="No/GJcyy"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2BB7910E0FD for ; Tue, 18 Feb 2025 20:40:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1739911253; x=1771447253; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=jdHnLyMEcqnBCOQfhOJXViEECrW3709cVCSOhZ0H8ZI=; b=No/GJcyyyhtTExr3nylGQ2t0rtP/5Cj7jHzCahD9mUqsyxxvWV+zSrDu y77noaDEGI18kINz3H0RhPs1rdZgYKxnwqxuR6ZbuOusVp3Rk6i+RfCaS kD8qvZLJaAbQ4glEHiwzPQIm15rVqEXc+52SQvBzf5BJOZdzxlYVuVITZ Bmdao62Bdyo3EhWzk3T4cx+8H1Ii0jZ0AeWSP4O8HZOMxM+EztZIJ1OV0 uUyehQDh2MhjQvctfhg30s/kLEF/1eP8fVgHhDeJEzV1BjNtvWfkYOWKR 9ViOAlGuU1lskbkwH01iyvSSez5LU3gj2px1/oW0zrZJbLCJ0Uxc5iUZe A==; X-CSE-ConnectionGUID: fA+QtEo+QXKspeKyVfSDWA== X-CSE-MsgGUID: BoZfIMyOSpi8AQx0ho6AuA== X-IronPort-AV: E=McAfee;i="6700,10204,11348"; a="43458969" X-IronPort-AV: E=Sophos;i="6.13,296,1732608000"; d="scan'208";a="43458969" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2025 12:40:53 -0800 X-CSE-ConnectionGUID: bR+ex8aXTza/XWbj8wWPsQ== X-CSE-MsgGUID: dURcfwq/SvyEPEGComPqdw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,296,1732608000"; d="scan'208";a="115027782" Received: from orsosgc001.jf.intel.com (HELO orsosgc001.intel.com) ([10.165.21.142]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2025 12:40:53 -0800 Date: Tue, 18 Feb 2025 12:40:52 -0800 Message-ID: <85zfijnfzf.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Matt Roper Cc: intel-xe@lists.freedesktop.org Subject: Re: [PATCH] drm/xe: Drop unnecessary GT lookup in xe_exec_queue_create_ioctl() In-Reply-To: <20250218200511.4050060-2-matthew.d.roper@intel.com> References: <20250218200511.4050060-2-matthew.d.roper@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-redhat-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Tue, 18 Feb 2025 12:05:12 -0800, Matt Roper wrote: > > xe_exec_queue_create_ioctl() performs a lookup of the xe_gt for the GT > ID passed from userspace, but the result is never actually used. Since > there's already a separate (and earlier) check that the ID passed from > userspace is valid, the unnecessary lookup can be removed. lgtm, Reviewed-by: Ashutosh Dixit > > Signed-off-by: Matt Roper > --- > drivers/gpu/drm/xe/xe_exec_queue.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c > index 6051db78d706..23a9f519ce1c 100644 > --- a/drivers/gpu/drm/xe/xe_exec_queue.c > +++ b/drivers/gpu/drm/xe/xe_exec_queue.c > @@ -539,7 +539,7 @@ static int exec_queue_user_extensions(struct xe_device *xe, struct xe_exec_queue > return 0; > } > > -static u32 calc_validate_logical_mask(struct xe_device *xe, struct xe_gt *gt, > +static u32 calc_validate_logical_mask(struct xe_device *xe, > struct drm_xe_engine_class_instance *eci, > u16 width, u16 num_placements) > { > @@ -601,7 +601,6 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data, > u64_to_user_ptr(args->instances); > struct xe_hw_engine *hwe; > struct xe_vm *vm; > - struct xe_gt *gt; > struct xe_tile *tile; > struct xe_exec_queue *q = NULL; > u32 logical_mask; > @@ -654,8 +653,7 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data, > &q->multi_gt_link); > } > } else { > - gt = xe_device_get_gt(xe, eci[0].gt_id); > - logical_mask = calc_validate_logical_mask(xe, gt, eci, > + logical_mask = calc_validate_logical_mask(xe, eci, > args->width, > args->num_placements); > if (XE_IOCTL_DBG(xe, !logical_mask)) > -- > 2.48.1 >