Received: by 10.223.176.46 with SMTP id f43csp1003914wra; Fri, 26 Jan 2018 10:12:16 -0800 (PST) X-Google-Smtp-Source: AH8x2271SDOFQCtGBI98ydKvh42YGaFqD8WTD7KQGGrCnx7Bjc2lsjyiyPJ92jmOsizpmacbiWfL X-Received: by 2002:a17:902:d68e:: with SMTP id v14-v6mr14600785ply.241.1516990336010; Fri, 26 Jan 2018 10:12:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516990335; cv=none; d=google.com; s=arc-20160816; b=MrU9X0gPkjY90kS10UUzVj9x7I3qWuahZcyouc3DujmZcMjhIt7CfcOhSN4A6o11rt pMjS7oD2jecQ/4/3xt6td1XCqIvfSB3fyOXTo6SZwlZFVmB/fUl9nAYHmEBtxtf4+OUO gYlUvMx3mKuyPB/NUlTKgiiSayrYCQFCIGeUuzJMva44U2uhZlzG6Fxu0ne9Mce87gww GqIV0ssYttZnr8VGtn+v9H0V9Dg9qBLKa2stMV54fos6SJ9Yjxqz3jyXnLnOJiEB2HDt nSdVW9Gx3sI+hIljYrMC0ktNF8uhdMl+ATRuoK6TXomJRTjfcR4wiW6jIVMyC5BgNY/I 9fbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:reply-to:from :subject:message-id:arc-authentication-results; bh=7AZ52khf1OTzsCjDKFO00mZvIxFME/FhyW9lw3LbkHk=; b=XwiUWawB9IBldUkZLqgGaHbxihK0DJ2njlu5EDcJ1+jsny9XwmDoRfQCcIY187dhui 9T4wvdL44QlSFVvf8AM1TWY69JTXaUvGMDIQ/gi9o7M4xKbdtX3DJBFUx2/fhyEri+TE aHWeI5LS5TjjIRYO6kDPjJurD23Y2leCGhQyf3rjJWcFooGundIAy9vVRA3mCWzGTosO 08/4hxHeLriM9Kmr+D9DH80ZcjCTNjGW38lDfYu6t41lSF6O0lFiTrGIqojRJ7NMo9Hy 1htOy1JPh2QKIR0iGt/R16HMoyPlyrpA0Jd6i8Y/Dp1Cqv7wmIWCzLso/MkoDIjxAoeM L9Eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14si3297232pgd.49.2018.01.26.10.12.01; Fri, 26 Jan 2018 10:12:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752130AbeAZSLF (ORCPT + 99 others); Fri, 26 Jan 2018 13:11:05 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:45988 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751586AbeAZSLC (ORCPT ); Fri, 26 Jan 2018 13:11:02 -0500 Received: by mail-qt0-f193.google.com with SMTP id x27so3409370qtm.12 for ; Fri, 26 Jan 2018 10:11:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:reply-to:to:cc:date :in-reply-to:references:organization:mime-version :content-transfer-encoding; bh=7AZ52khf1OTzsCjDKFO00mZvIxFME/FhyW9lw3LbkHk=; b=WtFoORnOj8+Zmw/2j4nJjNSRTa8Lj1SFVlC5aUY81LgOEbbSGVmY+Q3ErWAzouZRQQ Osdoev2AYIgzdYRv7b8dDu71FSv9VNj0kMx9cMftkjeFvufgePYbTkzV5bC51KyWl8V0 /AqHWGWsWofmGvv8M0vP/JDg2tvlrbkPXgZUh8dnuGi1Bp2tkarY1/NyvriE/H4VH/rl Ti8X0Arw8CNOpIH+D3AEFSD1X/3bzY8/n2ujg9FIlb1Gqj24GpO+bIqyCfaU/4wX1Eff qfJPYEECFH6QI8NYT2UTUsCfh4/f8L/50xDdhHXkLuaXhoTMIm5iUMrjGEonUrerFKGr CQkQ== X-Gm-Message-State: AKwxytfXMjwFBfq9WR0JpjNRt/KF6uKZXSGVJYwYywaj+LJ2zmQ1ctLo c8MvYvrkWLnlvQ8IbJ6tcVdpaQ== X-Received: by 10.237.33.4 with SMTP id 4mr4609724qtc.132.1516990261434; Fri, 26 Jan 2018 10:11:01 -0800 (PST) Received: from whitewolf.lyude.net (pool-108-26-161-12.bstnma.fios.verizon.net. [108.26.161.12]) by smtp.gmail.com with ESMTPSA id j12sm3865935qke.23.2018.01.26.10.11.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jan 2018 10:11:01 -0800 (PST) Message-ID: <1516990260.5161.8.camel@redhat.com> Subject: Re: [RFC v2 3/4] drm/nouveau: Add support for BLCG on Kepler2 From: Lyude Paul Reply-To: lyude@redhat.com To: Ilia Mirkin Cc: nouveau , Ben Skeggs , David Airlie , Greg Kroah-Hartman , Thomas Gleixner , Kate Stewart , Alexandre Courbot , Karol Herbst , LKML , dri-devel Date: Fri, 26 Jan 2018 13:11:00 -0500 In-Reply-To: References: <20180126033607.7682-1-lyude@redhat.com> <20180126033607.7682-4-lyude@redhat.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.4 (3.26.4-1.fc27) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-01-26 at 02:53 -0500, Ilia Mirkin wrote: > On Thu, Jan 25, 2018 at 10:35 PM, Lyude Paul wrote: > > Same as the previous patch, but for Kepler2 now > > > > Signed-off-by: Lyude Paul > > --- > > drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h | 1 + > > drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 8 +-- > > drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110.c | 62 ++++++++++++++++++++ > > drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild | 1 + > > drivers/gpu/drm/nouveau/nvkm/subdev/fb/gk110.c | 71 > > +++++++++++++++++++++++ > > 5 files changed, 139 insertions(+), 4 deletions(-) > > create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/fb/gk110.c > > > > diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h > > b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h > > index adb78f7d083a..92be0e5269c6 100644 > > --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h > > +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h > > @@ -75,6 +75,7 @@ int mcp89_fb_new(struct nvkm_device *, int, struct nvkm_fb > > **); > > int gf100_fb_new(struct nvkm_device *, int, struct nvkm_fb **); > > int gf108_fb_new(struct nvkm_device *, int, struct nvkm_fb **); > > int gk104_fb_new(struct nvkm_device *, int, struct nvkm_fb **); > > +int gk110_fb_new(struct nvkm_device *, int, struct nvkm_fb **); > > int gk20a_fb_new(struct nvkm_device *, int, struct nvkm_fb **); > > int gm107_fb_new(struct nvkm_device *, int, struct nvkm_fb **); > > int gm200_fb_new(struct nvkm_device *, int, struct nvkm_fb **); > > diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c > > b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c > > index 74bd09b1c893..7590a30b7ff0 100644 > > --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c > > +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c > > @@ -1812,7 +1812,7 @@ nvf0_chipset = { > > .bus = gf100_bus_new, > > .clk = gk104_clk_new, > > .devinit = gf100_devinit_new, > > - .fb = gk104_fb_new, > > + .fb = gk110_fb_new, > > .fuse = gf100_fuse_new, > > .gpio = gk104_gpio_new, > > .i2c = gk104_i2c_new, > > @@ -1850,7 +1850,7 @@ nvf1_chipset = { > > .bus = gf100_bus_new, > > .clk = gk104_clk_new, > > .devinit = gf100_devinit_new, > > - .fb = gk104_fb_new, > > + .fb = gk110_fb_new, > > .fuse = gf100_fuse_new, > > .gpio = gk104_gpio_new, > > .i2c = gk104_i2c_new, > > @@ -1888,7 +1888,7 @@ nv106_chipset = { > > .bus = gf100_bus_new, > > .clk = gk104_clk_new, > > .devinit = gf100_devinit_new, > > - .fb = gk104_fb_new, > > + .fb = gk110_fb_new, > > .fuse = gf100_fuse_new, > > .gpio = gk104_gpio_new, > > .i2c = gk104_i2c_new, > > @@ -1926,7 +1926,7 @@ nv108_chipset = { > > .bus = gf100_bus_new, > > .clk = gk104_clk_new, > > .devinit = gf100_devinit_new, > > - .fb = gk104_fb_new, > > + .fb = gk110_fb_new, > > .fuse = gf100_fuse_new, > > .gpio = gk104_gpio_new, > > .i2c = gk104_i2c_new, > > diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110.c > > b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110.c > > index a38e19b61c1d..38d3328e45f1 100644 > > --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110.c > > +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110.c > > @@ -22,6 +22,7 @@ > > * Authors: Ben Skeggs > > */ > > #include "gf100.h" > > +#include "gk104.h" > > #include "ctxgf100.h" > > > > #include > > @@ -156,6 +157,66 @@ gk110_gr_pack_mmio[] = { > > {} > > }; > > > > +const struct nvkm_therm_clkgate_init > > These should all be static, no? True, will send out a V3 in a moment > > > +gk110_clkgate_blcg_init_sked_0[] = { > > + { 0x407000, 1, 0x00004041 }, > > + {} > > +}; > > + > > +const struct nvkm_therm_clkgate_init > > +gk110_clkgate_blcg_init_gpc_gcc_0[] = { > > + { 0x419020, 1, 0x00000042 }, > > + { 0x419038, 1, 0x00000042 }, > > + {} > > +}; > > + > > +const struct nvkm_therm_clkgate_init > > +gk110_clkgate_blcg_init_gpc_l1c_0[] = { > > + { 0x419cd4, 2, 0x00004042 }, > > + {} > > +}; > > + > > +const struct nvkm_therm_clkgate_init > > +gk110_clkgate_blcg_init_gpc_mp_0[] = { > > + { 0x419fd0, 1, 0x00004043 }, > > + { 0x419fd8, 1, 0x00004049 }, > > + { 0x419fe0, 2, 0x00004042 }, > > + { 0x419ff0, 1, 0x00000046 }, > > + { 0x419ff8, 1, 0x00004042 }, > > + { 0x419f90, 1, 0x00004042 }, > > + {} > > +}; > > + > > +const struct nvkm_therm_clkgate_pack > > +gk110_clkgate_pack[] = { > > + { gk104_clkgate_blcg_init_main_0 }, > > + { gk104_clkgate_blcg_init_rstr2d_0 }, > > + { gk104_clkgate_blcg_init_unk_0 }, > > + { gk104_clkgate_blcg_init_gcc_0 }, > > + { gk110_clkgate_blcg_init_sked_0 }, > > + { gk104_clkgate_blcg_init_unk_1 }, > > + { gk104_clkgate_blcg_init_gpc_ctxctl_0 }, > > + { gk104_clkgate_blcg_init_gpc_unk_0 }, > > + { gk104_clkgate_blcg_init_gpc_esetup_0 }, > > + { gk104_clkgate_blcg_init_gpc_tpbus_0 }, > > + { gk104_clkgate_blcg_init_gpc_zcull_0 }, > > + { gk104_clkgate_blcg_init_gpc_tpconf_0 }, > > + { gk104_clkgate_blcg_init_gpc_unk_1 }, > > + { gk110_clkgate_blcg_init_gpc_gcc_0 }, > > + { gk104_clkgate_blcg_init_gpc_ffb_0 }, > > + { gk104_clkgate_blcg_init_gpc_tex_0 }, > > + { gk104_clkgate_blcg_init_gpc_poly_0 }, > > + { gk110_clkgate_blcg_init_gpc_l1c_0 }, > > + { gk104_clkgate_blcg_init_gpc_unk_2 }, > > + { gk110_clkgate_blcg_init_gpc_mp_0 }, > > + { gk104_clkgate_blcg_init_gpc_ppc_0 }, > > + { gk104_clkgate_blcg_init_rop_zrop_0 }, > > + { gk104_clkgate_blcg_init_rop_0 }, > > + { gk104_clkgate_blcg_init_rop_crop_0 }, > > + { gk104_clkgate_blcg_init_pxbar_0 }, > > + {} > > +}; > > + > > /************************************************************************** > > ***** > > * PGRAPH engine/subdev functions > > > > **************************************************************************** > > **/ > > @@ -192,6 +253,7 @@ gk110_gr = { > > .rops = gf100_gr_rops, > > .ppc_nr = 2, > > .grctx = &gk110_grctx, > > + .clkgate_pack = gk110_clkgate_pack, > > .sclass = { > > { -1, -1, FERMI_TWOD_A }, > > { -1, -1, KEPLER_INLINE_TO_MEMORY_B }, > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild > > b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild > > index 2571530e82f1..b4f22cce5d43 100644 > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild > > @@ -22,6 +22,7 @@ nvkm-y += nvkm/subdev/fb/mcp89.o > > nvkm-y += nvkm/subdev/fb/gf100.o > > nvkm-y += nvkm/subdev/fb/gf108.o > > nvkm-y += nvkm/subdev/fb/gk104.o > > +nvkm-y += nvkm/subdev/fb/gk110.o > > nvkm-y += nvkm/subdev/fb/gk20a.o > > nvkm-y += nvkm/subdev/fb/gm107.o > > nvkm-y += nvkm/subdev/fb/gm200.o > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gk110.c > > b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gk110.c > > new file mode 100644 > > index 000000000000..5c8feef151a4 > > --- /dev/null > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gk110.c > > @@ -0,0 +1,71 @@ > > +/* > > + * Copyright 2017 Red Hat Inc. > > + * > > + * Permission is hereby granted, free of charge, to any person obtaining a > > + * copy of this software and associated documentation files (the > > "Software"), > > + * to deal in the Software without restriction, including without > > limitation > > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > > + * and/or sell copies of the Software, and to permit persons to whom the > > + * Software is furnished to do so, subject to the following conditions: > > + * > > + * The above copyright notice and this permission notice shall be included > > in > > + * all copies or substantial portions of the Software. > > + * > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS > > OR > > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > > + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR > > + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, > > + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR > > + * OTHER DEALINGS IN THE SOFTWARE. > > + * > > + * Authors: Lyude Paul > > + */ > > +#include "gf100.h" > > +#include "gk104.h" > > +#include "ram.h" > > +#include > > +#include > > + > > +/* > > + > > **************************************************************************** > > *** > > + * PGRAPH registers for clockgating > > + > > **************************************************************************** > > *** > > + */ > > + > > +const struct nvkm_therm_clkgate_init > > +gk110_fb_clkgate_blcg_init_unk_0[] = { > > + { 0x100d10, 1, 0x0000c242 }, > > + { 0x100d30, 1, 0x0000c242 }, > > + { 0x100d3c, 1, 0x00000242 }, > > + { 0x100d48, 1, 0x0000c242 }, > > + { 0x100d1c, 1, 0x00000042 }, > > + {} > > +}; > > + > > +static const struct nvkm_therm_clkgate_pack > > +gk110_fb_clkgate_pack[] = { > > + { gk110_fb_clkgate_blcg_init_unk_0 }, > > + { gk104_fb_clkgate_blcg_init_vm_0 }, > > + { gk104_fb_clkgate_blcg_init_main_0 }, > > + { gk104_fb_clkgate_blcg_init_bcast_0 }, > > + {} > > +}; > > + > > +static const struct nvkm_fb_func > > +gk110_fb = { > > + .dtor = gf100_fb_dtor, > > + .oneinit = gf100_fb_oneinit, > > + .init = gf100_fb_init, > > + .init_page = gf100_fb_init_page, > > + .intr = gf100_fb_intr, > > + .ram_new = gk104_ram_new, > > + .default_bigpage = 17, > > + .clkgate_pack = gk110_fb_clkgate_pack, > > +}; > > + > > +int > > +gk110_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) > > +{ > > + return gf100_fb_new_(&gk110_fb, device, index, pfb); > > +} > > -- > > 2.14.3 > >