From patchwork Wed Jun 1 20:53:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9148115 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 647AB60761 for ; Wed, 1 Jun 2016 20:53:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58846200F4 for ; Wed, 1 Jun 2016 20:53:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D499268AE; Wed, 1 Jun 2016 20:53:47 +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 0DEF5200F4 for ; Wed, 1 Jun 2016 20:53:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B2B046E28C; Wed, 1 Jun 2016 20:53:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 562876E28A for ; Wed, 1 Jun 2016 20:53:37 +0000 (UTC) Received: by mail-io0-x243.google.com with SMTP id p194so4095670iod.0 for ; Wed, 01 Jun 2016 13:53:37 -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=OpY1kyIZIo+kc755KTW3t4bhmpVm6T+Kanqz4R+HXhY=; b=FoVyEucW5jhTcm5OCHAE0lfq/PQLxpO3mAFMjE4WIVZ840HwLcf17Iux4nccszq1Ow eLG96hfNv5sls6ckpGzh4qfJXAtERBTeXNucU/eVcUpBExpEAFF4lKUEdg+vC27JgHPI 6UNZp9vj2pnEK0lyEes2EUhOOj2POFmYvaWYou4TYCgQPlw/HJo5rk6O94yp/dMAZMU7 uIamPZ3ys0Nhnekx3KPXoZ4YGmD/WS6FP1nLqzmSZs5pXn+B4FiyfC1gq1lQbVxV3jSE nodyoNRje2L5hhQseDvnNlKpvRyTSj8VIOgP0vh1PO7hi3zOADCd4/j4xdCI/LMGi6jd JADg== 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=OpY1kyIZIo+kc755KTW3t4bhmpVm6T+Kanqz4R+HXhY=; b=FUfjx3F36rhce3wgJOXWwAe8Si2fHX7bcH5GJQhauzx2sx1a1grNqVMVCc2tIaziKA rMSQ5f5nhgZB8qKOetSPMElwUWdg/0FJUcSk1ovEVnMtPv97Bco7ytu00WUKQxSldXNT TZ3mqtgPS3M+5zBxXeyXIB+KMEjA3Eb68WpVXFpH4jy9Ch3QjhbEOY5tJVjz2fAiitmq KAAXCks0mMFGGnoQJ6aEk1tu9YtWNiBQRRHQBnScEmbqwHmQLFprjsMaKqbj9KRtwHAj 1Z/XJfzI1ZmoZdpicGlvM8XzwhLGN5bdb7+u4VPxeLPbRHYwL0fpY5oNl6acBxMwFKju 833w== X-Gm-Message-State: ALyK8tJFX9M1++dPlys8lQ1ucVMNRY2aeZmCLvm2bfoLFbmrlkWqhITmykpcUrTD1CmdKw== X-Received: by 10.107.158.9 with SMTP id h9mr6625621ioe.153.1464814416279; Wed, 01 Jun 2016 13:53:36 -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.35 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Jun 2016 13:53:35 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 04/12] drm/amdgpu/atpx: add a query for ATPX dGPU power control Date: Wed, 1 Jun 2016 16:53:17 -0400 Message-Id: <1464814405-19729-5-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/amd/amdgpu/amdgpu.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index ab122cc4..19d15dc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -2393,9 +2393,11 @@ bool amdgpu_device_is_px(struct drm_device *dev); #if defined(CONFIG_VGA_SWITCHEROO) void amdgpu_register_atpx_handler(void); void amdgpu_unregister_atpx_handler(void); +bool amdgpu_has_atpx_dgpu_power_cntl(void); #else static inline void amdgpu_register_atpx_handler(void) {} static inline void amdgpu_unregister_atpx_handler(void) {} +static inline bool amdgpu_has_atpx_dgpu_power_cntl(void) { return false; } #endif /* diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c index c5d280c..7b11af1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c @@ -64,6 +64,10 @@ bool amdgpu_has_atpx(void) { return amdgpu_atpx_priv.atpx_detected; } +bool amdgpu_has_atpx_dgpu_power_cntl(void) { + return amdgpu_atpx_priv.atpx.functions.power_cntl; +} + /** * amdgpu_atpx_call - call an ATPX method *