Message ID | ec22d742-632b-426a-ac86-62641a38c907@moroto.mountain |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-19237-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:37c1:b0:101:2151:f287 with SMTP id y1csp904469dyq; Mon, 8 Jan 2024 01:06:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/4hOnR2CHlFzsuzdgPiq2Rau4jNlaXBXYClEoyAusTBASyRxhm//ZNnO4ieNBVE+2oPeK X-Received: by 2002:a05:6a00:1e0d:b0:6d9:364c:54be with SMTP id gx13-20020a056a001e0d00b006d9364c54bemr3345654pfb.62.1704704782619; Mon, 08 Jan 2024 01:06:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704704782; cv=none; d=google.com; s=arc-20160816; b=zFHl1hfl59ecKZqGncUiNYUq2uC9RIkq7P/H3eBng7+aCE4FHbCDX4tYQx0clVxC3O UjPdFrVCBObN70TlEcPDPMd81XV193u9shZAkO2ex64DfuKFBRJgVXP5KJtT89I6g6o3 rIjP9Zv4aWF2/H15KF2+nppFIDZ+CP9qz2ODWELi1rQYWPiyhmHVpvIlhfHPDbjd7yMP aoipLPJM4g0tFQ4xyh1tIqP89mTD00NQ1HOwkJDeu+ZyDLcQijGE6mbZQ6yw0Oop8CeH FWKcO/clJ1bj/dthyY4Tl0dFoA4bGf+QeHy8wabbTDewY5Gu/TintFS3vEPvsTWHoukF MXsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=w2EyoLbnPqZmV+8zXuTXWwVH9AFKfyr2X73Q99Ksn7g=; fh=cO0dtcINFwvz1PzWCQy+Kef5rfYlLDkgAOnB4J9/3eI=; b=NPEqXlJpMDnQOucDGs7cZJaEtKxjjXis7oWx0qORm4Z2b4YAXbIZpPc2KcDWLn9VJf lu82CFa1yhawYzOHgcrH1Xrp2LRErWeie89/aqd5M/g1s+ebV7pUgvXzILmI5tB7V/Xa MVwm1LGeHkMjTZL2WcQKKbZOjOo3IWChMs+O1Kp5cqixgWvkHUgDm2E8WYzbLSnTu6SC tZZGNTkwM72lRj+10XDmyObfwkcC4UVOcwVQi9RIRQXB+TTE80kv9tdWO7LlQD/0nrqO A9POIyelhtWaP3RybPF3g3oRjxOa3SXxAdEcjTHNN34VvYTSZHe9uYJxJVP6pk85MWsW dbIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SDz+xyLS; spf=pass (google.com: domain of linux-kernel+bounces-19237-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19237-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r193-20020a632bca000000b005ce0f4a19f9si5671898pgr.340.2024.01.08.01.06.22 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 01:06:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19237-ouuuleilei=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=@linaro.org header.s=google header.b=SDz+xyLS; spf=pass (google.com: domain of linux-kernel+bounces-19237-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19237-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 33AA3282810 for <ouuuleilei@gmail.com>; Mon, 8 Jan 2024 09:06:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17C5F111BD; Mon, 8 Jan 2024 09:06:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SDz+xyLS" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0115DDCD for <linux-kernel@vger.kernel.org>; Mon, 8 Jan 2024 09:06:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40e490c2115so1503905e9.0 for <linux-kernel@vger.kernel.org>; Mon, 08 Jan 2024 01:06:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704704761; x=1705309561; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=w2EyoLbnPqZmV+8zXuTXWwVH9AFKfyr2X73Q99Ksn7g=; b=SDz+xyLSrHs8XA25VS5OX3bTq+MlRk+2QXHAsRJMDzhJjFHRjXNp6vBJVfWaKFGLAd Njx6ExOG9TI/poYZndRBGndcbCh4VlG18MauJvcl+C5ldCmDtR0B8lv2zRIl58Np6a9R E9qEYdfWixyrdyboHLdQPXXtoWJeYb13/hjRQAbEJdtAfgmdQSQsGCXLYgbzEgT290v+ Mm/lIuEo9QeI23rv2sWui2WnuuJVWnYAqbGmfPSaxjoZKDA5RZiImEEbY64oBPYT/Sq/ mQ7VPLa3wnmSfw3dkeADjR5Ap1fa7vIkj6AbXMo4vLUpRgYPLysv8WfEkQzxGnMvZzXF IVyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704704761; x=1705309561; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w2EyoLbnPqZmV+8zXuTXWwVH9AFKfyr2X73Q99Ksn7g=; b=gdycdQvbDlwmjHnFZUWtrwlHyvFe0xuYwSBqYxTlPnqZqReUhsp3Q900id6bhXu2Po j7v38s/VzvCQRQYe1Zq+4fXciTQII98N8Zpk3c7C7wA9s2eSQdn99/dxFXOTV+s1rmhF 3gyhftWlgWvEbvqj1d4sCRjsE+O58wbgxpH3fRBUIJzOUo1b5Fk1dBlwrhdFYjPU0EBx cisj8+JQykP/L/ZzHUj3G3/hoev2LtHBFcG9xqfJABZjFz5kW7Xy4LuQN/LNrT7tAfFZ QTuPBntQXQHzT0cWtZJMs1zPLkhAdZo3GZddUoXZJYxHTTL9oe6JMaDMUH0zbqhVw50r Vx5A== X-Gm-Message-State: AOJu0YyF+HW2kvV3/4i99D/Y3CVUGeyItkXLI/UpdljWatNv0Jt7HajB vaVdiC0IIT7JfvCzix5Ylfa61HJw0AQtzg== X-Received: by 2002:a1c:7204:0:b0:40e:4aae:7e62 with SMTP id n4-20020a1c7204000000b0040e4aae7e62mr12731wmc.58.1704704760955; Mon, 08 Jan 2024 01:06:00 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id w5-20020a05600c474500b0040e34835a58sm10219495wmo.22.2024.01.08.01.06.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 01:06:00 -0800 (PST) Date: Mon, 8 Jan 2024 12:05:57 +0300 From: Dan Carpenter <dan.carpenter@linaro.org> To: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Oded Gabbay <ogabbay@kernel.org>, Thomas =?iso-8859-1?q?Hellstr=F6m?= <thomas.hellstrom@linux.intel.com>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, John Harrison <John.C.Harrison@intel.com>, Michal Wajdeczko <michal.wajdeczko@intel.com>, Matthew Brost <matthew.brost@intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] drm/xe: clean up type of GUC_HXG_MSG_0_ORIGIN Message-ID: <ec22d742-632b-426a-ac86-62641a38c907@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787512522091416932 X-GMAIL-MSGID: 1787512522091416932 |
Series |
drm/xe: clean up type of GUC_HXG_MSG_0_ORIGIN
|
|
Commit Message
Dan Carpenter
Jan. 8, 2024, 9:05 a.m. UTC
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 <dan.carpenter@linaro.org>
---
drivers/gpu/drm/xe/abi/guc_messages_abi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
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 <dan.carpenter@linaro.org> 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? 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 >
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 <dan.carpenter@linaro.org> > > 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/ ? - 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_ ? then we can also think of creating library with common helpers for GuC (for encoding/decoding HXG messages, preparing ADS, reading logs, etc) btw, we can also consider sharing register definitions: - drm/intel/include/regs xe_engine_regs.h xe_gt_regs.h xe_regs_defs.h 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 >>
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 <dan.carpenter@linaro.org> >> >> 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/? > > - 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. > >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. 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 >>>
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 <dan.carpenter@linaro.org> >>> >>> 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 >>>>
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)