Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3032370rdb; Tue, 6 Feb 2024 05:27:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6o9KKVF3PDa3HEyBolu7NAfvlDjyxqtjhgRssrMlcXPifqC/tT2G9uYoU15VbN1q6Fv+I X-Received: by 2002:a05:622a:3d0:b0:42b:f0c0:9356 with SMTP id k16-20020a05622a03d000b0042bf0c09356mr2892065qtx.45.1707226049106; Tue, 06 Feb 2024 05:27:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707226049; cv=pass; d=google.com; s=arc-20160816; b=y7GQ34cuzgxklfs5Tta5eBbh6XnmXbrG+0SX8YCwcKGgrUwodTr+un+drSoR5PCTZT JTiemZt+IQstEW+/rAPJIJ85ExZloMqRIIo03OmWbcCI522NthlZUd6cEyD0q4Usboj4 PYNpzBHWnpOKzvWMMzxjSVpEtvWCTENjKZVBRbPyge9To4eGxv5UZ79AYfWzQ9lNnQDi HPkRw7aPnYW5KfG2j53bLYx2okq7wm1vaIG/mmHTHX/01VtGnyPFJfSczzoDgjsCAU1A 46NR5MMsV2TT/K4A+I+iIdoEiHvzMYzmnonIW0zvLFH498oTYafF4V8md4Sj4ihtqvxF nDJQ== ARC-Message-Signature: i=2; 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=lAh/Xln+YAVG5lL4JB2QuzaRVGDziorbg6WeqhL3icA=; fh=HI3ttQFgt9oVQzvdmRBNQ+dol+r0XgCZOiMfFa6WKNk=; b=ct5vV7yhrf0aFw5VpOLqjhy3MEpOWmAdORWUG1+et3p/rL77x8cmXdeo22HPvpj2Dp DhKwKsm44OSPbAB7w/8n4vxBNAj2+bdrPjI9iwDiVFYyQ4mLssmcl669+r3SjL7nVUom R/dc2504Dvn+lknYhM/wxlRVKby5Bm/SJw2W9/Hunp2q898Xj0sxzm4VKgRYPjghcdmT oOxpSGiQi3BWnjn2HgSsh1kI/qULHSiHxqriPD8DUdTPtUMNiEiAXSMhoRUk/B1WzDzd RaGE3MDzD5VE3HGwTvUT7HDwKoC8iRXwUHGIFNn1/b5vlNq2tHaPRAo0PKXVcjygeTGs PgAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=iYWDzEEn; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-55016-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com X-Forwarded-Encrypted: i=1; AJvYcCUG1UEhJ3X3NeE0yYdbXo8WBNWAXQwV2zSndYDjDIqZYOH7hkJMzzLWrcY0kML0SzFes1sAorrPBORbsdl8J2OVhNNfoROA2Tz9VFJU1w== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a10-20020a05622a064a00b0042bedde445fsi2341301qtb.156.2024.02.06.05.27.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 05:27:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55016-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=iYWDzEEn; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-55016-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 967831C229E9 for ; Tue, 6 Feb 2024 13:27:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94630128826; Tue, 6 Feb 2024 13:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="iYWDzEEn" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 3654612FF97 for ; Tue, 6 Feb 2024 13:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707226036; cv=none; b=Z+XUfnpH+rPD5ReZ4GGAe2iAa8P3uZdikB2aSWmHousNJkjZ/DuN3smZGb1DZZK3WifTtWUY3A+sswv2V2Imz+vYPCsETYXQ6v+l64Trtp4wIBekmoSGGUHnlUEyAfIuYreOnfDaHD+lNTj+lXEmyVxrcW6D1xWgGYlEZih4G0E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707226036; c=relaxed/simple; bh=hQ+QP63TDympmBm6f1787+x8JkcNvVe7bh5SVgAcn5c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oBo8/3iZPyjpWz1O0Ox0wtLt/2fawRVb4JowkpAxHI+YYEK+gLkeOxXfIv3kg8OMEQTb+4zf8cST8QIM9m78zNEPdEvLSlCEarXKS/cfbF5wYBY/aw4gSjocsnnCYOartMhz2BrWmSnn2HR9bO7ZHe/zWHrNILz9zqkCLiWdod0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=iYWDzEEn; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707226033; bh=hQ+QP63TDympmBm6f1787+x8JkcNvVe7bh5SVgAcn5c=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=iYWDzEEnv1nWRcUIeci/q5vSYZZ9aUERduKYgiTOqA/Kd60fzZRLg84hRqzdEewZh ZFSXZPdOHreGQCVnMMudxUFLJuT/6V+AA7WialF6TuGeV0lUtV5I4f1m0k12ipSrSJ pzlUIjNbWWX2NDZSwoXRuOZqLwWhQ8Kc90oohMV+Qw8dXBoD/1ZDLkiv1WuR6vBw6y L63+4nUOmSSH4qTZlG76DWRn81skPu0ZaCKYI2MclYNREMPdHmOjc06yGoWq8UZi93 I+KNZaAEroMP2M5BNfaCtvpHpZuNUQQGoidab5TVMPXbcp1k+dgsoRF2fXCWfbjzdU i4HRrDMGCssEg== Received: from [100.113.186.2] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 69A233782072; Tue, 6 Feb 2024 13:27:12 +0000 (UTC) Message-ID: <4fe9947f-b190-4dcc-8d1e-f532e6dcb827@collabora.com> Date: Tue, 6 Feb 2024 14:27:11 +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 v3 1/7] drm/mediatek: dsi: Use GENMASK() for register mask definitions Content-Language: en-US To: =?UTF-8?B?Q0sgSHUgKOiDoeS/iuWFiSk=?= , "chunkuang.hu@kernel.org" Cc: "linux-kernel@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , "kernel@collabora.com" , "daniel@ffwll.ch" , "p.zabel@pengutronix.de" , "dri-devel@lists.freedesktop.org" , "airlied@gmail.com" , "linux-arm-kernel@lists.infradead.org" , "matthias.bgg@gmail.com" References: <20240131113434.241929-1-angelogioacchino.delregno@collabora.com> <20240131113434.241929-2-angelogioacchino.delregno@collabora.com> <082bc4d9efd0746d7ec25eab0b3bf96018e997e5.camel@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <082bc4d9efd0746d7ec25eab0b3bf96018e997e5.camel@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Il 06/02/24 09:57, CK Hu (胡俊光) ha scritto: > Hi, Angelo: > > On Wed, 2024-01-31 at 12:34 +0100, AngeloGioacchino Del Regno wrote: >> Change magic numerical masks with usage of the GENMASK() macro >> to improve readability. >> >> While at it, also fix the DSI_PS_SEL mask to include all bits instead >> of just a subset of them. >> >> This commit brings no functional changes. >> >> Signed-off-by: AngeloGioacchino Del Regno < >> angelogioacchino.delregno@collabora.com> >> --- >> drivers/gpu/drm/mediatek/mtk_dsi.c | 45 +++++++++++++++------------- >> -- >> 1 file changed, 23 insertions(+), 22 deletions(-) >> >> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c >> b/drivers/gpu/drm/mediatek/mtk_dsi.c >> index a2fdfc8ddb15..3b7392c03b4d 100644 >> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c >> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c >> @@ -58,18 +58,18 @@ >> >> #define DSI_TXRX_CTRL 0x18 >> #define VC_NUM BIT(1) >> -#define LANE_NUM (0xf << 2) >> +#define LANE_NUM GENMASK(5, 2) >> #define DIS_EOT BIT(6) >> #define NULL_EN BIT(7) >> #define TE_FREERUN BIT(8) >> #define EXT_TE_EN BIT(9) >> #define EXT_TE_EDGE BIT(10) >> -#define MAX_RTN_SIZE (0xf << 12) >> +#define MAX_RTN_SIZE GENMASK(15, 12) >> #define HSTX_CKLP_EN BIT(16) >> >> #define DSI_PSCTRL 0x1c >> -#define DSI_PS_WC 0x3fff >> -#define DSI_PS_SEL (3 << 16) >> +#define DSI_PS_WC GENMASK(14, 0) >> +#define DSI_PS_SEL GENMASK(19, 16) > > The original definition of DSI_PS_WC/DSI_PS_SEL is correct in MT8173. > So both need two definition and let each SoC select its own definition. > The additional bits are unused on older SoCs and, if set, will be simply ignored; if we want to prevent setting bits that don't exist on the old ones, that should be done as a later commit introducing SoC capabilities for those and when the new capabilities for the new SoCs are introduced anyway. As of now, this doesn't break anything. Regards, Angelo