From patchwork Wed Jun 1 20:53:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9148127 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E4FC860761 for ; Wed, 1 Jun 2016 20:53:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D96F9200F4 for ; Wed, 1 Jun 2016 20:53:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE983268AE; Wed, 1 Jun 2016 20:53:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97642200F4 for ; Wed, 1 Jun 2016 20:53:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5ABBA6EA4D; Wed, 1 Jun 2016 20:53:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id EB81A6EA45 for ; Wed, 1 Jun 2016 20:53:42 +0000 (UTC) Received: by mail-it0-x244.google.com with SMTP id k76so1050086ita.1 for ; Wed, 01 Jun 2016 13:53:42 -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; bh=+OREPtP+RdkNg4iuohiuP9odWAEnsaDJQwenHvCDufU=; b=QGDxcOClk9tKBR55o8chzQMmQn+QRbvA1ohC302pw4dbWVWebHOpGYUc4J/8xT12xk FLAi3T7KSeTLfRXsDHncDCnMiM9Y3DfMtkLVFEW/JtNOy1ZbMhgdbJACJFm3cPi42SKa DZfoM8SQBnlb9cwBqYYrbv2RFLZ3SABzjmKuo1mihp/vw7bCXz42VGzFVzZ/WuPkd+6w r1DMEJfjTV4tC4/l9FTFpd7HpMyIGP8i8rcSLw2i9G390wFlplw0jW2qqMSIwgmM3HS6 9bnbRUZDBIPA3a1tPTNvdFv1xL8uN/JV82mw8Mqnrjzpc43+ZqsjFR93gnTTIoHBzjPo CQSg== 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; bh=+OREPtP+RdkNg4iuohiuP9odWAEnsaDJQwenHvCDufU=; b=DeCi6Q/Jomt1+Cv8Ix6GoOr9gqM62ciRdYluopzpb9RgE7SSFvVn12zsrjQttDv8XD m3Q8K6i+L5l60eH9rcUn8LpEPC5f3aFtpd4UMk23nbUUkl/0TDEJSTCa8/FBhH629VIf MjbEUnGMT0GWRzuDlUt/P7xIrWUAs+cVlklFzwEgXaonXDMbWa/52ftFzEy+UynBy4+e nyH/f1iZjYm375JWVkqBoJsXTGjsULEmIjuKXK2ocbitONwaxjSu7mVELofSP6fZeMMm Q71PphDU3mwSfanNm39VB6iTugzoned9IjnNIBKmkWo2C5wn1UosYXU2wu4eSzTOIWnr 4v1Q== X-Gm-Message-State: ALyK8tIKx8NrYxg4GaESSitn7/KhpjekyJFcP/IBpYAO+/95Nr1zsPQJ0KXRzjFKgoIm0w== X-Received: by 10.36.67.210 with SMTP id s201mr8596676itb.86.1464814421849; Wed, 01 Jun 2016 13:53:41 -0700 (PDT) Received: from cm.amd.com ([165.204.55.251]) by smtp.gmail.com with ESMTPSA id x83sm12983532itf.2.2016.06.01.13.53.41 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Jun 2016 13:53:41 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 10/12] drm/radeon/atpx: add a query for ATPX dGPU power control Date: Wed, 1 Jun 2016 16:53:23 -0400 Message-Id: <1464814405-19729-11-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464814405-19729-1-git-send-email-alexander.deucher@amd.com> References: <1464814405-19729-1-git-send-email-alexander.deucher@amd.com> Cc: Alex Deucher 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The runtime pm sequence is different depending on whether or not the platform supports ATPX dGPU power control. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_atpx_handler.c | 4 ++++ drivers/gpu/drm/radeon/radeon_drv.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c index 3d95194..51da319 100644 --- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c +++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c @@ -63,6 +63,10 @@ bool radeon_has_atpx(void) { return radeon_atpx_priv.atpx_detected; } +bool radeon_has_atpx_dgpu_power_cntl(void) { + return radeon_atpx_priv.atpx.functions.power_cntl; +} + /** * radeon_atpx_call - call an ATPX method * diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 36242a9..2dc43f5 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -165,9 +165,11 @@ void radeon_debugfs_cleanup(struct drm_minor *minor); #if defined(CONFIG_VGA_SWITCHEROO) void radeon_register_atpx_handler(void); void radeon_unregister_atpx_handler(void); +bool radeon_has_atpx_dgpu_power_cntl(void); #else static inline void radeon_register_atpx_handler(void) {} static inline void radeon_unregister_atpx_handler(void) {} +static inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; } #endif int radeon_no_wb;