Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp445456rdd; Tue, 9 Jan 2024 08:49:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IElo6Tt5M+OYgHluH1Nus3i/85mjwZpdI4tQTR5P/l42N9APiW3Cz6XVu7UKpdwGFi3jOv5 X-Received: by 2002:a05:600c:3f9b:b0:40e:44ac:ae17 with SMTP id fs27-20020a05600c3f9b00b0040e44acae17mr2122882wmb.148.1704818946525; Tue, 09 Jan 2024 08:49:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704818946; cv=none; d=google.com; s=arc-20160816; b=DvMQ9U8bc2XAvGwnfw5JDYwEM1UkYWLEzNTsTOS/wAE7chbqBPg/qUkNHGacpB7xyn xkdDeZQVMxatrs4FcsKdDNdx+mQue48KBp9aqdwrG46chcVm1tbb3NUtc4uMEz7ftz6R pUEDkZzo356nvMiBn/3n5i8LxPFJUQoX9F3IrZI51lcUjFsXFQE2jJMYWn0SJDGJzstB s+iTq4dXc4ndlNUiXHIKsZCdx3Mh8hyQUv0fXOavsIyW+7wPDzm/R74GUs3hTYn4aIYf MGMwDqEnD0Z4yQUbSjMj9Fbkejov+xgNgNpH6WT7CW3l+UtKh1GrrLf8Cp/k/KgeuRTF H57Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=4ZLaFsIBCDKiE75LltL7lmTxjKTRaYXl3jv3c0QuavM=; fh=M/VTdYXEH+iSeQAztNn2FaKTGY7U7C4WKYrPBkZmZJ4=; b=wOlDYdAG40H/PI6du7roxpO3m+SatGH4Wrgco22OaJ5gpjMKmVKfQhaaMNxZcm1/Ot sK2K9yspC5aqEUFYrKnt3+t3g5EfOgebIQgW+/IofuTUHWAhsMLV270QJQwGZqPGFNAY 86RhT/IR9G/Ocqbc+/zObYavDJmqqlH40a10tOXD16j+nu6qaB8P4YpDf3JtIdXlG9a7 LI9WfIhIiEl4JBznhlf5Jm6wwTU/eYUoxbTI52UzLqv5rPytTTNqf2+shNvbcU50/WYZ jdva+jbUdMyspriIACwKcqRhT+A1T02r9NUbjJ48FDGvXua5k+DpkzCkUu1ApKvd0FhD ip4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fgLBbaMx; spf=pass (google.com: domain of linux-kernel+bounces-21130-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21130-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m14-20020a17090607ce00b00a2b1e7e06e7si914143ejc.641.2024.01.09.08.49.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 08:49:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21130-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fgLBbaMx; spf=pass (google.com: domain of linux-kernel+bounces-21130-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21130-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 20D6D1F265E1 for ; Tue, 9 Jan 2024 16:49:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90D813A8F6; Tue, 9 Jan 2024 16:47:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fgLBbaMx" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 0F309364B7; Tue, 9 Jan 2024 16:47:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704818874; x=1736354874; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=gaEKgeWzK9tycqPLAAm+RoBb74b0rOVzaME1Qb2Pfjw=; b=fgLBbaMxEqecKZlvyoeE5A/iBhnYyS1HqD+nzBO/fe5snmQ8clhbn4Zd rqo9XMjWoh0C/YNgYd1y2uCJ54JgFJ5Y7+gfWrzJdSDn6NERhLcUWsqbP K24oWSV8ERKAYq7dLlJKTp2cDt8yPHPWRSBg1l4TyVQ407LKCUUq8A/0G AiG9BXxo9LAYcoikHbrsAYQKWAuYCENES/o8IjbiokRRDHiTK3EpvhAI5 EklDY1+aRb7R4NtDM8ANEHukhpPdf3s+nPumfd4YYD1VxHP2S5kiqOAie yPdZGa2uWaTOahs5oY0mJQ2oPcKxZjJz6xOFu1rSfGVCMLjJvwuxzUtQg w==; X-IronPort-AV: E=McAfee;i="6600,9927,10947"; a="388696403" X-IronPort-AV: E=Sophos;i="6.04,183,1695711600"; d="scan'208";a="388696403" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2024 08:47:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10947"; a="852253484" X-IronPort-AV: E=Sophos;i="6.04,183,1695711600"; d="scan'208";a="852253484" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by fmsmga004.fm.intel.com with ESMTP; 09 Jan 2024 08:47:41 -0800 Received: from [10.249.150.124] (mwajdecz-MOBL.ger.corp.intel.com [10.249.150.124]) by irvmail002.ir.intel.com (Postfix) with ESMTP id C8648C8375; Tue, 9 Jan 2024 16:47:36 +0000 (GMT) Message-ID: Date: Tue, 9 Jan 2024 17:47:36 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/xe: clean up type of GUC_HXG_MSG_0_ORIGIN Content-Language: en-US To: Lucas De Marchi Cc: Dan Carpenter , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Maxime Ripard , Thomas Zimmermann , Rodrigo Vivi , intel-xe@lists.freedesktop.org References: <84a5c289-e2f6-4e30-a093-5a1c5b335057@intel.com> <7vb3ql7z5dac3kwo7nhibh5al7wemt45ibzuyk4bpyzpltzjml@go7rtyq4m6hq> From: Michal Wajdeczko In-Reply-To: <7vb3ql7z5dac3kwo7nhibh5al7wemt45ibzuyk4bpyzpltzjml@go7rtyq4m6hq> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 08.01.2024 22:24, Lucas De Marchi wrote: > On Mon, Jan 08, 2024 at 09:46:47PM +0100, Michal Wajdeczko wrote: >> >> >> On 08.01.2024 15:07, Lucas De Marchi wrote: >>> On Mon, Jan 08, 2024 at 12:05:57PM +0300, Dan Carpenter wrote: >>>> The GUC_HXG_MSG_0_ORIGIN definition should be unsigned.  Currently >>>> it is >>>> defined as INT_MIN.  This doesn't cause a problem currently but it's >>>> still worth cleaning up. >>>> >>>> Signed-off-by: Dan Carpenter >>> >>> it seems there are a few more places to change to follow what was done >>> in commit 962bd34bb457 ("drm/i915/uc: Fix undefined behavior due to >>> shift overflowing the constant"). >>> >>> +Michal >>> >>> Could we eventually share these abi includes with i915 so we don't >>> keep fixing the same thing in 2 places? >> >> it should be possible and I guess we should plan for that while >> discussing all this new xe driver... >> >> anyway, what about creating new intel/ folder under drm/ ? > > include/drm/intel/? maybe, but then we will be limited to pure definitions/inlines, while I hope we could separate more GuC firmware specific, but still driver agnostic, code and place it under drivers/gpu/drm/intel/ drivers/gpu/drm/intel/ include/ abi/ guc_actions_abi.h guc_errors_abi.h guc_klvs_abi.h guc/ guc_hxg_helpers.c guc_log_helpers.c note that AMD has its definitions in drm/amd/include/ not under include/ > >> >> - drm/intel/include/abi >>        guc_actions_abi.h >>        guc_klvs_abi.h >>        ... >> >> the only question would be what prefix should be used for macros: >> just GUC_ or INTEL_GUC_ or XE_GUC_ ? > > if using a intel/ dir, probably better with INTEL_ prefix > >> >> then we can also think of creating library with common helpers for GuC >> (for encoding/decoding HXG messages, preparing ADS, reading logs, etc) > > with the other differences we have, I don't see much benefit, > particularly as it won't change for i915 wrt supported platforms. we are still using unified firmware versions across different platforms, so any newer firmware version drops could still be beneficial for the i915 and those legacy platforms > >> >> btw, we can also consider sharing register definitions: >> >> - drm/intel/include/regs >>        xe_engine_regs.h >>        xe_gt_regs.h >>        xe_regs_defs.h > > same as above, I don't think it's worth it as xe will keep adding to it > and it doesn't care for all the previous platforms. For those files we > may eventually autogen them like done by mesa. autogen sounds promising, so lets wait and once this will happen we can abandon xe/regs > > Lucas De Marchi > >> >> Michal >> >>> >>> Lucas De Marchi >>> >>>> --- >>>> drivers/gpu/drm/xe/abi/guc_messages_abi.h | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/gpu/drm/xe/abi/guc_messages_abi.h >>>> b/drivers/gpu/drm/xe/abi/guc_messages_abi.h >>>> index 3d199016cf88..c04606872e48 100644 >>>> --- a/drivers/gpu/drm/xe/abi/guc_messages_abi.h >>>> +++ b/drivers/gpu/drm/xe/abi/guc_messages_abi.h >>>> @@ -40,7 +40,7 @@ >>>>  */ >>>> >>>> #define GUC_HXG_MSG_MIN_LEN            1u >>>> -#define GUC_HXG_MSG_0_ORIGIN            (0x1 << 31) >>>> +#define GUC_HXG_MSG_0_ORIGIN            (0x1U << 31) >>>> #define   GUC_HXG_ORIGIN_HOST            0u >>>> #define   GUC_HXG_ORIGIN_GUC            1u >>>> #define GUC_HXG_MSG_0_TYPE            (0x7 << 28) >>>> --  >>>> 2.42.0 >>>>