From patchwork Mon Nov 16 17:36:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 324449 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp3503280ils; Mon, 16 Nov 2020 09:37:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdogJR8dK6tRfDXY+yhFuH1WcUsQRXat1g+IPGnt8T5DwHML0XaRWjXNTZHi1Lko9eJasL X-Received: by 2002:a63:2ec7:: with SMTP id u190mr270655pgu.21.1605548261097; Mon, 16 Nov 2020 09:37:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605548261; cv=none; d=google.com; s=arc-20160816; b=nUDo4+uhGe19ru/1odMn77rZw6KLCESkqmaplmNcTJ2xmznwJiVLwBluSdteYrVotS q99hgGK0AZ+VKCKVbFlKAz6EubsD06ucMwJ7cslxZWdI06k1fykiPAHjysz65elx+/QU 2E79lJHbeHCX1IHgmDv9iT2yE9Jg2owXeUcaMyttcdUMOluaN0yRFbTBGEdtBvfmrFmm /ChHOnhfJj9kt5zGayWCQT6jDdpQAHdr0vQfPGhW/1i9cEFhsELf1Yqrgvnv2TxAzTov krvDiJVvh0YtsPnj1hv6KFbEGRel14JorBWtpG1zQopQ/lxb6eEB/ZzwLFo/VbOjv5ny iDyw== 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=4TcJh/YX6BXhLMOaykAZupdve52+gsSkXKdwem8q5QU=; b=akBun+BCoCUezndCJhEW8/nh6Gs7Iq2D/sD93wAGeViYEqJY+d9G1/qxpD++h+7jva H1kSrmhQEcIatPlAGHu4L2eyUFWYOdtKYSEvQ9927yOJhXQZteZw5wzFvmCGfQtE4KAZ 6/6MYlMJd/2a/jB7d6VEtK1IwczcwP4Bem5EePg1Eju7wgHTuIKTMmViU7elqnaczJ9d V7mReLoH+Rrce1i5ANuZ7vYKZY1stEikJZCRFz65xGGg3h3/O0h8e7OcrdnowuYybEx5 n7rAFrssNnzizBqumIOsfI4MwcktxKQrfk5Ve719fuv/RWLo6vTBumUVV0tH7kzb1/1l 0QjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=xwaRqeZ7; 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 n193si16472083pfd.160.2020.11.16.09.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 09:37:41 -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=xwaRqeZ7; 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 286FB6E055; Mon, 16 Nov 2020 17:37:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E3A26E03B for ; Mon, 16 Nov 2020 17:37:22 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id a65so31042wme.1 for ; Mon, 16 Nov 2020 09:37:22 -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=I1uDD7eJYKIFmY2+cEE1XxDSSI80DfvhehKV0mcsFfw=; b=xwaRqeZ7quP0cWyeWhd8C6+hJKr/nYyRBXd5dcd/0xopFhUsnodBso0oGf7oip4HT5 CWT6wdh+uJgJBqvi0EEYxPVdELNx/M2yGoG2KAEoeMLoE9LJFe1WUqpcQY8KLAkNaGN8 SvB25e7lNzQ7Q0xQjnrx8YVp1hUbanOFrVvrIBSZi8RCgwbIhHf8fgiLGGTjo7XiQu39 6JxMmkENBQ/YeBPOMpvs+pK9pkDuHh+7tIk9gQ/zKXB1bz8LH3BQ1eILp4X29krtQeee axdAUn7R6YssKyyop9XTX1yvlvTSl8KCMnSgrwEMFrsG/3LPLQdvF/27Wp58nwphtKPG ZeNA== 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=I1uDD7eJYKIFmY2+cEE1XxDSSI80DfvhehKV0mcsFfw=; b=qQepw2M/8WISiYBysq5wzntVgwZxqH7cBPUvWJIUmAq5Z+/BNxfrmnm2/RAlgpl4Cm GwfbEw4RF2ieAR93p8BnPotBtOgzbsXGSo80muqF0HEn6O66RB2QRNsWC5csc+zDprC+ YUkvpiBGj2oYGrhScRi6SLxnYfWLbwCbHau/hMTOOPCg8VUTrUx0OT52Q4HYAy70/CdO 6EoBrNxeO561lEH9jCPLKvd4lET0E4AxqMavk4MeUbTu2iy6B7ou7ohs9idFeLleQHDc 2NZOcEVOMoLpENZ5FAT2FHjZrsJ4mPviHwMg744Y5Dvxctx+C8vhAUYWR/zUXaJFcLBC qUQQ== X-Gm-Message-State: AOAM531WpiCNg/nwYNnjL/bEvxK7UefEUq4wCpVmplwHGyElLqUoJybR xg1hLMsx/J4+356A8FkidHVvXA== X-Received: by 2002:a1c:b0c4:: with SMTP id z187mr16320374wme.113.1605548240726; Mon, 16 Nov 2020 09:37:20 -0800 (PST) Received: from dell.default ([91.110.221.159]) by smtp.gmail.com with ESMTPSA id 30sm16942828wrd.88.2020.11.16.09.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 09:37:20 -0800 (PST) From: Lee Jones To: lee.jones@linaro.org Subject: [PATCH 12/43] drm/radeon/evergreen: Move 'evergreen_*' and 'sumo_*' prototypes out to shared location Date: Mon, 16 Nov 2020 17:36:29 +0000 Message-Id: <20201116173700.1830487-13-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201116173700.1830487-1-lee.jones@linaro.org> References: <20201116173700.1830487-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" Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/radeon/evergreen.c:1281:6: warning: no previous prototype for ‘evergreen_fix_pci_max_read_req_size’ [-Wmissing-prototypes] 1281 | void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/evergreen.c:2664:6: warning: no previous prototype for ‘evergreen_mc_stop’ [-Wmissing-prototypes] 2664 | void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *save) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/evergreen.c:2762:6: warning: no previous prototype for ‘evergreen_mc_resume’ [-Wmissing-prototypes] 2762 | void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save) | ^~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/evergreen.c:2850:6: warning: no previous prototype for ‘evergreen_mc_program’ [-Wmissing-prototypes] 2850 | void evergreen_mc_program(struct radeon_device *rdev) | ^~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/evergreen.c:3710:5: warning: no previous prototype for ‘evergreen_mc_init’ [-Wmissing-prototypes] 3710 | int evergreen_mc_init(struct radeon_device *rdev) | ^~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/evergreen.c:3769:6: warning: no previous prototype for ‘evergreen_print_gpu_status_regs’ [-Wmissing-prototypes] 3769 | void evergreen_print_gpu_status_regs(struct radeon_device *rdev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/evergreen.c:3797:6: warning: no previous prototype for ‘evergreen_is_display_hung’ [-Wmissing-prototypes] 3797 | bool evergreen_is_display_hung(struct radeon_device *rdev) | ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/evergreen.c:4009:6: warning: no previous prototype for ‘evergreen_gpu_pci_config_reset’ [-Wmissing-prototypes] 4009 | void evergreen_gpu_pci_config_reset(struct radeon_device *rdev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/evergreen.c:4110:6: warning: no previous prototype for ‘sumo_rlc_fini’ [-Wmissing-prototypes] 4110 | void sumo_rlc_fini(struct radeon_device *rdev) | ^~~~~~~~~~~~~ drivers/gpu/drm/radeon/evergreen.c:4153:5: warning: no previous prototype for ‘sumo_rlc_init’ [-Wmissing-prototypes] 4153 | int sumo_rlc_init(struct radeon_device *rdev) | ^~~~~~~~~~~~~ drivers/gpu/drm/radeon/evergreen.c:4381:5: warning: no previous prototype for ‘evergreen_rlc_resume’ [-Wmissing-prototypes] 4381 | int evergreen_rlc_resume(struct radeon_device *rdev) | ^~~~~~~~~~~~~ drivers/gpu/drm/radeon/evergreen.c:4670:6: warning: no previous prototype for ‘evergreen_irq_suspend’ [-Wmissing-prototypes] 4670 | void evergreen_irq_suspend(struct radeon_device *rdev) | ^~~~~~~~~~~~~~~~~~~~~ NB: Lots more of these - snipped for brevity 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/cik.c | 6 +--- drivers/gpu/drm/radeon/evergreen.c | 1 + drivers/gpu/drm/radeon/evergreen.h | 51 ++++++++++++++++++++++++++++++ drivers/gpu/drm/radeon/ni.c | 16 +--------- drivers/gpu/drm/radeon/si.c | 7 +--- 5 files changed, 55 insertions(+), 26 deletions(-) create mode 100644 drivers/gpu/drm/radeon/evergreen.h diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index abf370e16bd9f..315c4f3df3656 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c @@ -30,6 +30,7 @@ #include #include "atom.h" +#include "evergreen.h" #include "cik_blit_shaders.h" #include "cikd.h" #include "clearstate_ci.h" @@ -126,11 +127,6 @@ MODULE_FIRMWARE("radeon/mullins_sdma.bin"); extern int r600_ih_ring_alloc(struct radeon_device *rdev); extern void r600_ih_ring_fini(struct radeon_device *rdev); -extern void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *save); -extern void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save); -extern bool evergreen_is_display_hung(struct radeon_device *rdev); -extern void sumo_rlc_fini(struct radeon_device *rdev); -extern int sumo_rlc_init(struct radeon_device *rdev); extern void si_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc); extern void si_rlc_reset(struct radeon_device *rdev); extern void si_init_uvd_internal_cg(struct radeon_device *rdev); diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 9a1e240b07234..f860f5ef2df88 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -32,6 +32,7 @@ #include "atom.h" #include "avivod.h" #include "rv770.h" +#include "evergreen.h" #include "evergreen_blit_shaders.h" #include "evergreen_reg.h" #include "evergreend.h" diff --git a/drivers/gpu/drm/radeon/evergreen.h b/drivers/gpu/drm/radeon/evergreen.h new file mode 100644 index 0000000000000..30c9ca99ced90 --- /dev/null +++ b/drivers/gpu/drm/radeon/evergreen.h @@ -0,0 +1,51 @@ +/* radeon_evergreen.h -- Private header for radeon driver -*- linux-c -*- + * + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2000 VA Linux Systems, Inc., Fremont, California. + * All rights reserved. + * + * 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 (including the next + * paragraph) 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 + * PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + * + */ + +#ifndef __RADEON_EVERGREEN_H__ +#define __RADEON_EVERGREEN_H__ + +struct evergreen_mc_save; +struct radeon_device; + +bool evergreen_is_display_hung(struct radeon_device *rdev); +void evergreen_print_gpu_status_regs(struct radeon_device *rdev); +void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *save); +void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save); +int evergreen_mc_wait_for_idle(struct radeon_device *rdev); +void evergreen_mc_program(struct radeon_device *rdev); +void evergreen_irq_suspend(struct radeon_device *rdev); +int evergreen_mc_init(struct radeon_device *rdev); +void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev); +void evergreen_pcie_gen2_enable(struct radeon_device *rdev); +void evergreen_program_aspm(struct radeon_device *rdev); +void sumo_rlc_fini(struct radeon_device *rdev); +int sumo_rlc_init(struct radeon_device *rdev); +void evergreen_gpu_pci_config_reset(struct radeon_device *rdev); +u32 evergreen_get_number_of_dram_channels(struct radeon_device *rdev); +void evergreen_print_gpu_status_regs(struct radeon_device *rdev); + +#endif /* __RADEON_EVERGREEN_H__ */ diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index 564a775b4b90c..1c9030a4631b8 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c @@ -32,6 +32,7 @@ #include "atom.h" #include "cayman_blit_shaders.h" #include "clearstate_cayman.h" +#include "evergreen.h" #include "ni_reg.h" #include "nid.h" #include "radeon.h" @@ -190,21 +191,6 @@ static const u32 tn_rlc_save_restore_register_list[] = 0x802c, }; -extern bool evergreen_is_display_hung(struct radeon_device *rdev); -extern void evergreen_print_gpu_status_regs(struct radeon_device *rdev); -extern void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *save); -extern void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save); -extern int evergreen_mc_wait_for_idle(struct radeon_device *rdev); -extern void evergreen_mc_program(struct radeon_device *rdev); -extern void evergreen_irq_suspend(struct radeon_device *rdev); -extern int evergreen_mc_init(struct radeon_device *rdev); -extern void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev); -extern void evergreen_pcie_gen2_enable(struct radeon_device *rdev); -extern void evergreen_program_aspm(struct radeon_device *rdev); -extern void sumo_rlc_fini(struct radeon_device *rdev); -extern int sumo_rlc_init(struct radeon_device *rdev); -extern void evergreen_gpu_pci_config_reset(struct radeon_device *rdev); - /* Firmware Names */ MODULE_FIRMWARE("radeon/BARTS_pfp.bin"); MODULE_FIRMWARE("radeon/BARTS_me.bin"); diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index de0792842af89..45076c27d7ded 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c @@ -32,6 +32,7 @@ #include "atom.h" #include "clearstate_si.h" +#include "evergreen.h" #include "radeon.h" #include "radeon_asic.h" #include "radeon_audio.h" @@ -129,12 +130,6 @@ extern void sumo_rlc_fini(struct radeon_device *rdev); extern int sumo_rlc_init(struct radeon_device *rdev); extern int r600_ih_ring_alloc(struct radeon_device *rdev); extern void r600_ih_ring_fini(struct radeon_device *rdev); -extern void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev); -extern void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *save); -extern void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save); -extern u32 evergreen_get_number_of_dram_channels(struct radeon_device *rdev); -extern void evergreen_print_gpu_status_regs(struct radeon_device *rdev); -extern bool evergreen_is_display_hung(struct radeon_device *rdev); static void si_enable_gui_idle_interrupt(struct radeon_device *rdev, bool enable); static void si_init_pg(struct radeon_device *rdev);