From patchwork Wed Mar 23 17:42:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 8652681 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A164B9FB32 for ; Wed, 23 Mar 2016 17:44:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6E7E203EB for ; Wed, 23 Mar 2016 17:44:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8963D203E6 for ; Wed, 23 Mar 2016 17:44:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 937B66E8ED; Wed, 23 Mar 2016 17:44:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::235]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F6476E8E8 for ; Wed, 23 Mar 2016 17:43:49 +0000 (UTC) Received: by mail-qk0-x235.google.com with SMTP id s68so9935252qkh.3 for ; Wed, 23 Mar 2016 10:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CyMt81QqmHvnrjMEELjpm17JoD4SgbOI0NSCib0lGsI=; b=LHoWJbrQg79FrLaBgwg4Dat+XGFSe1zSXGivvt6WOHm0S4udbtMtC5nvz5l4nSWWta 2X3w/Oci43dqAS2tBUwMF2ddUHzBU7SrsFBPdUpu17tL0yXEiHXqJdE/dTxafQtsK3Gm nMNUQcNVtILPBayQSyNVpmptJgR6LQNMtUn+7Dd2dpUUJ6ZbpZNQ3nlWKTwpuhtFV+LI cwQYpj4eirmm9GoFHmwDHmiwCqAU/3jLbXIIzCwb0vlzunv7/DbhPAuuN3ooGrmsB+ML xrmXInXhiI/n/W+eNrANLpPRIYBU5TwmJOdCQxC9JH+l11wLgrzdGY5kQY+HHH2LPJwU TFXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CyMt81QqmHvnrjMEELjpm17JoD4SgbOI0NSCib0lGsI=; b=dEpdF6hMk6SN32+K9ZJeB3rtNeGSbeeu2f3rJjNn5FQXdDYeueJbfzxbCvJCZ0hNBy o3JR5UuyTI51uW0CI9chtWmMavAOqjzxdTPKSOEuunkBVnJ+zeUJVjX7CJ8H11C9+pFI 12RejE6q3FAP6+kLWCbfdopf0iGuvazPKb6TVc/VmS7QlsuoGmpiRTptlAEsjnhiNqJb e67WKPPYmTlaTGZpocUjtkNfEj356uD1Gmvz6wiR9N6rti0kkTBxlsEKlWx/RtgzGaVS Y/2juv83+KyjNvsbDgnKN8x5QSW2e9yieNktTp9/PK3JqhYVrbVBIpAdN/s66svKvYlx ft5Q== X-Gm-Message-State: AD7BkJIDOrCqHm1yj7qJ4AjWVC0qTf5Gxtpa1MxSIKtWmDvnuL2b9jB2OpPjsv04VKUV9A== X-Received: by 10.55.79.79 with SMTP id d76mr5297710qkb.76.1458755027856; Wed, 23 Mar 2016 10:43:47 -0700 (PDT) Received: from cm.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by smtp.gmail.com with ESMTPSA id v190sm1486878qka.46.2016.03.23.10.43.47 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Mar 2016 10:43:47 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 32/52] drm/amd/amdgpu: add query GFX cu info in CGS query system info Date: Wed, 23 Mar 2016 13:42:48 -0400 Message-Id: <1458754988-16222-33-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458754988-16222-1-git-send-email-alexander.deucher@amd.com> References: <1458754988-16222-1-git-send-email-alexander.deucher@amd.com> MIME-Version: 1.0 Cc: Alex Deucher , Eric Huang X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Needed for per CU powergating. Reviewed-by: Alex Deucher Acked-by: Christian König Signed-off-by: Eric Huang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 5 +++++ drivers/gpu/drm/amd/include/cgs_common.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c index bd4571c..08c1e6d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c @@ -791,6 +791,7 @@ static int amdgpu_cgs_query_system_info(void *cgs_device, struct cgs_system_info *sys_info) { CGS_FUNC_ADEV; + struct amdgpu_cu_info cu_info; if (NULL == sys_info) return -ENODEV; @@ -814,6 +815,10 @@ static int amdgpu_cgs_query_system_info(void *cgs_device, case CGS_SYSTEM_INFO_PG_FLAGS: sys_info->value = adev->pg_flags; break; + case CGS_SYSTEM_INFO_GFX_CU_INFO: + amdgpu_asic_get_cu_info(adev, &cu_info); + sys_info->value = cu_info.number; + break; default: return -ENODEV; } diff --git a/drivers/gpu/drm/amd/include/cgs_common.h b/drivers/gpu/drm/amd/include/cgs_common.h index 2cd427a..58c0cef 100644 --- a/drivers/gpu/drm/amd/include/cgs_common.h +++ b/drivers/gpu/drm/amd/include/cgs_common.h @@ -112,6 +112,7 @@ enum cgs_system_info_id { CGS_SYSTEM_INFO_PCIE_MLW, CGS_SYSTEM_INFO_CG_FLAGS, CGS_SYSTEM_INFO_PG_FLAGS, + CGS_SYSTEM_INFO_GFX_CU_INFO, CGS_SYSTEM_INFO_ID_MAXIMUM, };