Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1122792rdb; Wed, 6 Dec 2023 09:09:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWe2gB9kN9PJStnwhQePRaRmDrQ45MT+dgbQcl3gX58oWxHoHWfVWDlrCa2hzar1u6NBtT X-Received: by 2002:a05:6a20:a296:b0:189:2e8f:d34d with SMTP id a22-20020a056a20a29600b001892e8fd34dmr793090pzl.42.1701882546239; Wed, 06 Dec 2023 09:09:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701882546; cv=none; d=google.com; s=arc-20160816; b=PqaAzIvqklyrt1LF68n4pY/Kkk3qpE04aqZdEAv7UNB9JG1Vm2D+c/tf//hysYuxwv muATv8T7REhmcX9julsj5o/Ew1DKeN/m1BsdcGQuF+v8M7iGX4ae10/vSn1QzwinmPVT uLcxc0tonQL8ljOQMqSfSrCYfjJcCkMsGCMpp6FV+1nBl3UgkgU/TT6BIge6DWlw0HL4 duzQh0zUKmVCu8Ll+lTnvGqTa4PsXnueIex6JtfHo2b+749zjqiAyY+GVvE05PnnmEBJ /1hBUZPCZn0LaESe1YbKE5lKMBWPWAyqVY6O+uuZR3JlGoJ0Varn3XzSQIpIljWg87we tuRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=F90E6ezWa81IqrXxI2Eyak+OrAR7RPFLzPfvvTuxnUc=; fh=JWBJNOW76BF5QzrUhgUKpLPn3l6pZxF1ePTIAYJF7zM=; b=JtuxBDeJzCiHn/D3nRLD+p2S9Bdvwklj9Gm/INaOaJkarq1K3GWdG0wAuFvltnHq4s HbOpCvMPUN2eJIuahR97mUI6bZU+bdQLUftK5cXe6pT2vec9UVzcHDaxdRdF9tUk5GEo DkvJ9S2gBp0JDXLTriHK5a0wCEo3XUrPgod9Sha+bA/XA747HI1gc5rGkgAcy1rlzbCJ uTtTs+3GQjbWtKK4photYikCjM+FCR7xVXC4NlwFEQngW9I8dY0agovfI40YhnjoGWsJ Q33vNhpESXb9s7Ncbhkty5reaU2jtwzEJACjMtmc7wc8OkoBnquq6LJMxTwEyS71jmhK FJdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZVgRo1Ae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id j4-20020a654304000000b005c66e00ffccsi175290pgq.260.2023.12.06.09.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 09:09:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZVgRo1Ae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DD118801C89F; Wed, 6 Dec 2023 09:09:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442692AbjLFRIt (ORCPT + 99 others); Wed, 6 Dec 2023 12:08:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442694AbjLFRIs (ORCPT ); Wed, 6 Dec 2023 12:08:48 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BA19C9; Wed, 6 Dec 2023 09:08:54 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-54d048550dfso34698a12.0; Wed, 06 Dec 2023 09:08:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701882532; x=1702487332; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=F90E6ezWa81IqrXxI2Eyak+OrAR7RPFLzPfvvTuxnUc=; b=ZVgRo1AeVOBqr51kADNYNp1YCfVbgdjYvmbaSSmg+Q/1KJ8rbMwMVFudYh3YfFhsd4 3DSAlS87g12fUpWHaYwIrYEPmbr2z1hA+TFXleYZPut3JR6piHeNDpAs22LY4aTMqiDb acNSaYoxBjLy1gjFqOOc3zyhxB3L/W1Mf7w8cfSYGyBi+qld8vT1G2zLSKg2CD0zZkEb bRcDMc6gZ/hkSITaFhOoDV2X8rh31uAAvPrd2nZENZZoNSpen5+8KiAHvO5vT6e/osdT KsN2Fx0b8Es1udLqPTFI3ZSkTZW43OaqucdmYZrYI+xRYIrKQvYTLovj1bRjqa8xvW+c JieA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701882532; x=1702487332; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F90E6ezWa81IqrXxI2Eyak+OrAR7RPFLzPfvvTuxnUc=; b=o7oA4B/y7neRt+my8CnGzxjVUdaJJVk9ogOm5wr4x3EXzIJHhylwG61ueyOyoEqsG6 XyRnyCTBQbe+Zf638oJwYeuZcpw5pAluYzaqP2odBccNrqfJclGGYVflFyrC3XUmeGhQ kBBB+E0tTqmGBw/EDjdzolSxdJp8vt8xtjmxZgTPwwcoJsNMcI01hPj2kOg4Q3bfyFa0 RxQWdVFkn2KIZEinfxzBUP5igB7aSk3eQTB4Vulk/xcdGYtEysL1jyJoX5coWYSTmJ/x +HeYw4RwEH80RGJV2C0R1aGfRB2UmzP+fiieFcusuqC+hf319NxFVXSdP+wylxNIVeC5 khTg== X-Gm-Message-State: AOJu0Yxlmmxiw3mYdCsy7925omijQGUWf16UMetEmlhGZ1F4sFCXM3JF qdcvvtYQ9hbHpEmZwRgDYJki1XSYxjfhMoCAljlMxprs X-Received: by 2002:a50:871d:0:b0:54c:22bd:2385 with SMTP id i29-20020a50871d000000b0054c22bd2385mr597119edb.4.1701882532026; Wed, 06 Dec 2023 09:08:52 -0800 (PST) MIME-Version: 1.0 References: <20231205220526.417719-1-robdclark@gmail.com> <20231205220526.417719-2-robdclark@gmail.com> <19ca53ae-b180-4ec6-9294-dd45825af653@linaro.org> In-Reply-To: <19ca53ae-b180-4ec6-9294-dd45825af653@linaro.org> From: Rob Clark Date: Wed, 6 Dec 2023 09:08:40 -0800 Message-ID: Subject: Re: [PATCH 1/5] drm/msm/adreno: Split up giant device table To: Konrad Dybcio Cc: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Johan Hovold , Bjorn Andersson , open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 06 Dec 2023 09:09:03 -0800 (PST) On Wed, Dec 6, 2023 at 4:29=E2=80=AFAM Konrad Dybcio wrote: > > > > On 12/5/23 23:03, Rob Clark wrote: > > From: Rob Clark > > > > Split into a separate table per generation, in preparation to move each > > gen's device table to it's own file. > > > > Signed-off-by: Rob Clark > > --- > > drivers/gpu/drm/msm/adreno/adreno_device.c | 59 +++++++++++++++++++--= - > > 1 file changed, 51 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/d= rm/msm/adreno/adreno_device.c > > index 41b13dec9bef..36392801f929 100644 > > --- a/drivers/gpu/drm/msm/adreno/adreno_device.c > > +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c > > @@ -20,7 +20,7 @@ bool allow_vram_carveout =3D false; > > MODULE_PARM_DESC(allow_vram_carveout, "Allow using VRAM Carveout, in = place of IOMMU"); > > module_param_named(allow_vram_carveout, allow_vram_carveout, bool, 06= 00); > > > > -static const struct adreno_info gpulist[] =3D { > > +static const struct adreno_info a2xx_gpus[] =3D { > > { > > .chip_ids =3D ADRENO_CHIP_IDS(0x02000000), > > .family =3D ADRENO_2XX_GEN1, > > @@ -55,6 +55,12 @@ static const struct adreno_info gpulist[] =3D { > > .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, > > .init =3D a2xx_gpu_init, > > }, { > > + /* sentinal */ > sentinel? > > > + } > > +}; > > + > > +static const struct adreno_info a3xx_gpus[] =3D { > > + { > > .chip_ids =3D ADRENO_CHIP_IDS( > > 0x03000512, > > 0x03000520 > > @@ -110,6 +116,12 @@ static const struct adreno_info gpulist[] =3D { > > .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, > > .init =3D a3xx_gpu_init, > > }, { > > + /* sentinal */ > > + } > > +}; > > + > > +static const struct adreno_info a4xx_gpus[] =3D { > > + { > > .chip_ids =3D ADRENO_CHIP_IDS(0x04000500), > > .family =3D ADRENO_4XX, > > .revn =3D 405, > > @@ -143,6 +155,12 @@ static const struct adreno_info gpulist[] =3D { > > .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, > > .init =3D a4xx_gpu_init, > > }, { > > + /* sentinal */ > > + } > > +}; > > + > > +static const struct adreno_info a5xx_gpus[] =3D { > > + { > > .chip_ids =3D ADRENO_CHIP_IDS(0x05000600), > > .family =3D ADRENO_5XX, > > .revn =3D 506, > > @@ -268,6 +286,12 @@ static const struct adreno_info gpulist[] =3D { > > .init =3D a5xx_gpu_init, > > .zapfw =3D "a540_zap.mdt", > > }, { > > + /* sentinal */ > > + } > > +}; > > + > > +static const struct adreno_info a6xx_gpus[] =3D { > > + { > > .chip_ids =3D ADRENO_CHIP_IDS(0x06010000), > > .family =3D ADRENO_6XX_GEN1, > > .revn =3D 610, > > @@ -493,6 +517,12 @@ static const struct adreno_info gpulist[] =3D { > > .hwcg =3D a690_hwcg, > > .address_space_size =3D SZ_16G, > > }, { > > + /* sentinal */ > > + } > > +}; > > + > > +static const struct adreno_info a7xx_gpus[] =3D { > > + { > > .chip_ids =3D ADRENO_CHIP_IDS(0x07030001), > > .family =3D ADRENO_7XX_GEN1, > > .fw =3D { > > @@ -522,7 +552,18 @@ static const struct adreno_info gpulist[] =3D { > > .zapfw =3D "a740_zap.mdt", > > .hwcg =3D a740_hwcg, > > .address_space_size =3D SZ_16G, > > - }, > > + }, { > > + /* sentinal */ > > + } > > +}; > > + > > +static const struct adreno_info *gpulist[] =3D { > > + a2xx_gpus, > > + a3xx_gpus, > > + a4xx_gpus, > > + a5xx_gpus, > > + a6xx_gpus, > > + a7xx_gpus, > > }; > > > > MODULE_FIRMWARE("qcom/a300_pm4.fw"); > > @@ -557,12 +598,14 @@ static const struct adreno_info *adreno_info(uint= 32_t chip_id) > > { > > /* identify gpu: */ > > for (int i =3D 0; i < ARRAY_SIZE(gpulist); i++) { > > - const struct adreno_info *info =3D &gpulist[i]; > > - if (info->machine && !of_machine_is_compatible(info->mach= ine)) > > - continue; > > - for (int j =3D 0; info->chip_ids[j]; j++) > I'm not sure using sentinels here is a good idea, it adds a > whole lot of stack size. Perhaps gpulist could be a struct > of array pointers and an array of sizes? I guess you meant text size.. But with 30 devices currently, that array would be (30 + 7) * 8 =3D 296 bytes.. each sentinel is ~112 bytes (and arguably we could move a bit more out of adreno_info). So it isn't that big of a difference. Being able to have aNxx_info subclass adreno_effort might be a more compelling reason to go for an array of pointers. I'd have to see how awkward that looks. BR, -R