From patchwork Tue Nov 10 19:30:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 322860 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp500301ils; Tue, 10 Nov 2020 11:31:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhUFkM1S/1KBKedM0vOn9z5MxM9xE7VXWOhef4RzBdtj2beXaSjAulYAsfUHwLdoE00Qbg X-Received: by 2002:a62:f211:0:b029:18c:28cf:89ff with SMTP id m17-20020a62f2110000b029018c28cf89ffmr8187037pfh.71.1605036700152; Tue, 10 Nov 2020 11:31:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605036700; cv=none; d=google.com; s=arc-20160816; b=Pg1QG4+D1pMPkVg/1k+rqiqjv5pOPiHCXBBhrrGnc39bOJdCH9x+VV7lDH4mZ9S/f8 43NTSafHillvQcdfMZ2x0zuWF/Vsex/Ze9oJHoX4aWvtu8vn6QXD3mQh52qx7+PjpeWJ yqPk+Gcm8G8j0SGwuHMGyLnqRM8Ydm2gWMvsn0b5inZJmQ+t7MLIqjnh5SbFBb4JcZKz E3kYzPSWc6t/nODreEilCl+2cv/itvPK+5hVTmz51Dgvkx7+DrvCaSfrRBjH6/IwZITU 8/kDO2Ger6XMby+MNhJGnphmb14QzWwJlLPBr9mkAfyI66awOry/kLhb8swT1xcpNYRg Z3xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to; bh=RzUyGiHJ+4i8ANbXAw3TB+q7FS6SRIkirNY+k+Y+Q6k=; b=u1ucEZCFjfUIH4cCYJcrSHgNnO59dl+joqbwtClz2bu29M2z8Kl4xVW/TKl4fklfc1 AqdXU3HYr0MrxBDp3QD4zIN1hpnRXvjVuJrYIK+Hb5rK08uof94CaHdb+GhaQCF0s98W ZZZhuI/mCLRp/2Hp9hwAPJPgEpiSLxBVqrqHqIKCvY4OIS0P4+15cq+rNzqX2ieuXqLR 3GDdEMfXkSNrIK9NI1WrDRdU/DduGcxIgsVx5iTu5hSKR9V4gnoiQqibNbc+iaNpY6mX Fwh6SDCZreQHeApFU814axvv1N9rW6Z01lgEQA1GZBMrMz9nS4Pv44kBygF1eJCh1pkC VIPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=tmfnWr1P; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id y2si1298906plk.176.2020.11.10.11.31.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 11:31:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=tmfnWr1P; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20C6189BF3; Tue, 10 Nov 2020 19:31:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7479189BF5 for ; Tue, 10 Nov 2020 19:31:26 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id d142so4344772wmd.4 for ; Tue, 10 Nov 2020 11:31:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EMKJYN4cADZ/51nOTydJW9dcnK9yEI29SFRHcdhKjx0=; b=tmfnWr1PFAZjvFUoR70C/EeiHh5YP6TtNv8y7lYw9Nw/feqC/lAHTDFMby7fV5FYcU Xba3hs1WRtRejNsmv02L/hFQLaAYQDGw6Och/0RDZf6Ho1Amyy0v8jPCl2v4pRL715vh 4XrOLlYqOBrdIoiV//72GwFAqDwm38Ob165dWEIj1YbMTku/gm1pH8F4vhZe9F7BoK0C qG3uSnS1N2HGx9nyo23hGifKjDayTPAB7nk1cnK3ZhwdAyZvOd8xei3kfhXCOJUU21Yy pMyLIP58Uo9TymtizzG224a6YIiOduHQ64qsLYpu1vtbBoYwqJdERv9byTxsUSlKAXZE QACg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EMKJYN4cADZ/51nOTydJW9dcnK9yEI29SFRHcdhKjx0=; b=Zh3ql9IB4KwirOrX404/ecf6S/+/3kIOyQyv8WhSeUtPH4GL75qmDIZRFSq7m/hUZV GCkY5pYl8FgM8yVrZ4NIKLd3WJ21JagT/LV+3niH3Cr8wY+XJFvDhutPfjlehONTEMM8 IZU/jvrkOkyOUAa2CBhEFkX4Yt7mPAozeoU0nH9K1Ji0b4mke4GCuRahAHQha1ptatis eVK+Vh2KGuaG1CK9AB9AwW5I3AyJbdKUwnAEJe6HT1vxwHw9NQI/cBxLqp5nGGd7TwLA VNkCvqNmJzzDOPI9dT2VLq9aaHsC9lO3+MEMDvFKGSAeYMl9u104OZ2HdCi9mow9BpTQ HVzQ== X-Gm-Message-State: AOAM531QL4OmAHt5gVPJj9/9ltcSOIq7JRGMhFf4m17fR1/ySvblFOEJ lmwX/SDYMofd59CYxwbMCrpjuA== X-Received: by 2002:a1c:3846:: with SMTP id f67mr750176wma.33.1605036685081; Tue, 10 Nov 2020 11:31:25 -0800 (PST) Received: from dell.default ([91.110.221.139]) by smtp.gmail.com with ESMTPSA id 30sm17635335wrs.84.2020.11.10.11.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 11:31:24 -0800 (PST) From: Lee Jones To: lee.jones@linaro.org Subject: [PATCH 07/30] drm/radeon/kv_dpm: Strip out unused functions and their tables Date: Tue, 10 Nov 2020 19:30:49 +0000 Message-Id: <20201110193112.988999-8-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201110193112.988999-1-lee.jones@linaro.org> References: <20201110193112.988999-1-lee.jones@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Alex Deucher , =?utf-8?q?Christian_K=C3=B6?= =?utf-8?q?nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" These haven't been used since the driver was upstreamed in 2013. Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/radeon/kv_dpm.c:161:40: warning: ‘cpl_cac_config_reg’ defined but not used [-Wunused-const-variable=] drivers/gpu/drm/radeon/kv_dpm.c:156:40: warning: ‘mc3_cac_config_reg’ defined but not used [-Wunused-const-variable=] drivers/gpu/drm/radeon/kv_dpm.c:151:40: warning: ‘mc2_cac_config_reg’ defined but not used [-Wunused-const-variable=] drivers/gpu/drm/radeon/kv_dpm.c:146:40: warning: ‘mc1_cac_config_reg’ defined but not used [-Wunused-const-variable=] drivers/gpu/drm/radeon/kv_dpm.c:141:40: warning: ‘mc0_cac_config_reg’ defined but not used [-Wunused-const-variable=] drivers/gpu/drm/radeon/kv_dpm.c:136:40: warning: ‘sx0_cac_config_reg’ defined but not used [-Wunused-const-variable=] drivers/gpu/drm/radeon/kv_dpm.c:104:43: warning: ‘cpl_local_cac_cfg_kv’ defined but not used [-Wunused-const-variable=] drivers/gpu/drm/radeon/kv_dpm.c:98:43: warning: ‘mc3_local_cac_cfg_kv’ defined but not used [-Wunused-const-variable=] drivers/gpu/drm/radeon/kv_dpm.c:92:43: warning: ‘mc2_local_cac_cfg_kv’ defined but not used [-Wunused-const-variable=] drivers/gpu/drm/radeon/kv_dpm.c:86:43: warning: ‘mc1_local_cac_cfg_kv’ defined but not used [-Wunused-const-variable=] drivers/gpu/drm/radeon/kv_dpm.c:80:43: warning: ‘mc0_local_cac_cfg_kv’ defined but not used [-Wunused-const-variable=] drivers/gpu/drm/radeon/kv_dpm.c:67:43: warning: ‘sx_local_cac_cfg_kv’ defined but not used [-Wunused-const-variable=] Cc: Alex Deucher Cc: "Christian König" Cc: David Airlie Cc: Daniel Vetter Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/radeon/kv_dpm.c | 205 +------------------------------- 1 file changed, 1 insertion(+), 204 deletions(-) diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c index 5e6086eb18073..f7735da07feb9 100644 --- a/drivers/gpu/drm/radeon/kv_dpm.c +++ b/drivers/gpu/drm/radeon/kv_dpm.c @@ -64,105 +64,6 @@ extern void cik_exit_rlc_safe_mode(struct radeon_device *rdev); extern void cik_update_cg(struct radeon_device *rdev, u32 block, bool enable); -static const struct kv_lcac_config_values sx_local_cac_cfg_kv[] = -{ - { 0, 4, 1 }, - { 1, 4, 1 }, - { 2, 5, 1 }, - { 3, 4, 2 }, - { 4, 1, 1 }, - { 5, 5, 2 }, - { 6, 6, 1 }, - { 7, 9, 2 }, - { 0xffffffff } -}; - -static const struct kv_lcac_config_values mc0_local_cac_cfg_kv[] = -{ - { 0, 4, 1 }, - { 0xffffffff } -}; - -static const struct kv_lcac_config_values mc1_local_cac_cfg_kv[] = -{ - { 0, 4, 1 }, - { 0xffffffff } -}; - -static const struct kv_lcac_config_values mc2_local_cac_cfg_kv[] = -{ - { 0, 4, 1 }, - { 0xffffffff } -}; - -static const struct kv_lcac_config_values mc3_local_cac_cfg_kv[] = -{ - { 0, 4, 1 }, - { 0xffffffff } -}; - -static const struct kv_lcac_config_values cpl_local_cac_cfg_kv[] = -{ - { 0, 4, 1 }, - { 1, 4, 1 }, - { 2, 5, 1 }, - { 3, 4, 1 }, - { 4, 1, 1 }, - { 5, 5, 1 }, - { 6, 6, 1 }, - { 7, 9, 1 }, - { 8, 4, 1 }, - { 9, 2, 1 }, - { 10, 3, 1 }, - { 11, 6, 1 }, - { 12, 8, 2 }, - { 13, 1, 1 }, - { 14, 2, 1 }, - { 15, 3, 1 }, - { 16, 1, 1 }, - { 17, 4, 1 }, - { 18, 3, 1 }, - { 19, 1, 1 }, - { 20, 8, 1 }, - { 21, 5, 1 }, - { 22, 1, 1 }, - { 23, 1, 1 }, - { 24, 4, 1 }, - { 27, 6, 1 }, - { 28, 1, 1 }, - { 0xffffffff } -}; - -static const struct kv_lcac_config_reg sx0_cac_config_reg[] = -{ - { 0xc0400d00, 0x003e0000, 17, 0x3fc00000, 22, 0x0001fffe, 1, 0x00000001, 0 } -}; - -static const struct kv_lcac_config_reg mc0_cac_config_reg[] = -{ - { 0xc0400d30, 0x003e0000, 17, 0x3fc00000, 22, 0x0001fffe, 1, 0x00000001, 0 } -}; - -static const struct kv_lcac_config_reg mc1_cac_config_reg[] = -{ - { 0xc0400d3c, 0x003e0000, 17, 0x3fc00000, 22, 0x0001fffe, 1, 0x00000001, 0 } -}; - -static const struct kv_lcac_config_reg mc2_cac_config_reg[] = -{ - { 0xc0400d48, 0x003e0000, 17, 0x3fc00000, 22, 0x0001fffe, 1, 0x00000001, 0 } -}; - -static const struct kv_lcac_config_reg mc3_cac_config_reg[] = -{ - { 0xc0400d54, 0x003e0000, 17, 0x3fc00000, 22, 0x0001fffe, 1, 0x00000001, 0 } -}; - -static const struct kv_lcac_config_reg cpl_cac_config_reg[] = -{ - { 0xc0400d80, 0x003e0000, 17, 0x3fc00000, 22, 0x0001fffe, 1, 0x00000001, 0 } -}; - static const struct kv_pt_config_reg didt_config_kv[] = { { 0x10, 0x000000ff, 0, 0x0, KV_CONFIGREG_DIDT_IND }, @@ -254,32 +155,6 @@ static struct kv_power_info *kv_get_pi(struct radeon_device *rdev) return pi; } -#if 0 -static void kv_program_local_cac_table(struct radeon_device *rdev, - const struct kv_lcac_config_values *local_cac_table, - const struct kv_lcac_config_reg *local_cac_reg) -{ - u32 i, count, data; - const struct kv_lcac_config_values *values = local_cac_table; - - while (values->block_id != 0xffffffff) { - count = values->signal_id; - for (i = 0; i < count; i++) { - data = ((values->block_id << local_cac_reg->block_shift) & - local_cac_reg->block_mask); - data |= ((i << local_cac_reg->signal_shift) & - local_cac_reg->signal_mask); - data |= ((values->t << local_cac_reg->t_shift) & - local_cac_reg->t_mask); - data |= ((1 << local_cac_reg->enable_shift) & - local_cac_reg->enable_mask); - WREG32_SMC(local_cac_reg->cntl, data); - } - values++; - } -} -#endif - static int kv_program_pt_config_registers(struct radeon_device *rdev, const struct kv_pt_config_reg *cac_config_regs) { @@ -398,39 +273,6 @@ static int kv_enable_didt(struct radeon_device *rdev, bool enable) return 0; } -#if 0 -static void kv_initialize_hardware_cac_manager(struct radeon_device *rdev) -{ - struct kv_power_info *pi = kv_get_pi(rdev); - - if (pi->caps_cac) { - WREG32_SMC(LCAC_SX0_OVR_SEL, 0); - WREG32_SMC(LCAC_SX0_OVR_VAL, 0); - kv_program_local_cac_table(rdev, sx_local_cac_cfg_kv, sx0_cac_config_reg); - - WREG32_SMC(LCAC_MC0_OVR_SEL, 0); - WREG32_SMC(LCAC_MC0_OVR_VAL, 0); - kv_program_local_cac_table(rdev, mc0_local_cac_cfg_kv, mc0_cac_config_reg); - - WREG32_SMC(LCAC_MC1_OVR_SEL, 0); - WREG32_SMC(LCAC_MC1_OVR_VAL, 0); - kv_program_local_cac_table(rdev, mc1_local_cac_cfg_kv, mc1_cac_config_reg); - - WREG32_SMC(LCAC_MC2_OVR_SEL, 0); - WREG32_SMC(LCAC_MC2_OVR_VAL, 0); - kv_program_local_cac_table(rdev, mc2_local_cac_cfg_kv, mc2_cac_config_reg); - - WREG32_SMC(LCAC_MC3_OVR_SEL, 0); - WREG32_SMC(LCAC_MC3_OVR_VAL, 0); - kv_program_local_cac_table(rdev, mc3_local_cac_cfg_kv, mc3_cac_config_reg); - - WREG32_SMC(LCAC_CPL_OVR_SEL, 0); - WREG32_SMC(LCAC_CPL_OVR_VAL, 0); - kv_program_local_cac_table(rdev, cpl_local_cac_cfg_kv, cpl_cac_config_reg); - } -} -#endif - static int kv_enable_smc_cac(struct radeon_device *rdev, bool enable) { struct kv_power_info *pi = kv_get_pi(rdev); @@ -1227,9 +1069,7 @@ int kv_dpm_enable(struct radeon_device *rdev) return ret; } kv_program_vc(rdev); -#if 0 - kv_initialize_hardware_cac_manager(rdev); -#endif + kv_start_am(rdev); if (pi->enable_auto_thermal_throttling) { ret = kv_enable_auto_thermal_throttling(rdev); @@ -1330,26 +1170,6 @@ void kv_dpm_disable(struct radeon_device *rdev) kv_update_current_ps(rdev, rdev->pm.dpm.boot_ps); } -#if 0 -static int kv_write_smc_soft_register(struct radeon_device *rdev, - u16 reg_offset, u32 value) -{ - struct kv_power_info *pi = kv_get_pi(rdev); - - return kv_copy_bytes_to_smc(rdev, pi->soft_regs_start + reg_offset, - (u8 *)&value, sizeof(u16), pi->sram_end); -} - -static int kv_read_smc_soft_register(struct radeon_device *rdev, - u16 reg_offset, u32 *value) -{ - struct kv_power_info *pi = kv_get_pi(rdev); - - return kv_read_smc_sram_dword(rdev, pi->soft_regs_start + reg_offset, - value, pi->sram_end); -} -#endif - static void kv_init_sclk_t(struct radeon_device *rdev) { struct kv_power_info *pi = kv_get_pi(rdev); @@ -1939,29 +1759,6 @@ void kv_dpm_setup_asic(struct radeon_device *rdev) kv_init_sclk_t(rdev); } -#if 0 -void kv_dpm_reset_asic(struct radeon_device *rdev) -{ - struct kv_power_info *pi = kv_get_pi(rdev); - - if (rdev->family == CHIP_KABINI || rdev->family == CHIP_MULLINS) { - kv_force_lowest_valid(rdev); - kv_init_graphics_levels(rdev); - kv_program_bootup_state(rdev); - kv_upload_dpm_settings(rdev); - kv_force_lowest_valid(rdev); - kv_unforce_levels(rdev); - } else { - kv_init_graphics_levels(rdev); - kv_program_bootup_state(rdev); - kv_freeze_sclk_dpm(rdev, true); - kv_upload_dpm_settings(rdev); - kv_freeze_sclk_dpm(rdev, false); - kv_set_enabled_level(rdev, pi->graphics_boot_level); - } -} -#endif - //XXX use sumo_dpm_display_configuration_changed static void kv_construct_max_power_limits_table(struct radeon_device *rdev,