From patchwork Thu Jun 2 13:33:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9149965 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 55C8160751 for ; Thu, 2 Jun 2016 13:33:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47E8B254F7 for ; Thu, 2 Jun 2016 13:33:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CB5528047; Thu, 2 Jun 2016 13:33:48 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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 AD145254F7 for ; Thu, 2 Jun 2016 13:33:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0365A6EB8D; Thu, 2 Jun 2016 13:33:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-x244.google.com (mail-qg0-x244.google.com [IPv6:2607:f8b0:400d:c04::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F4D76EB89 for ; Thu, 2 Jun 2016 13:33:44 +0000 (UTC) Received: by mail-qg0-x244.google.com with SMTP id t106so15925759qgt.2 for ; Thu, 02 Jun 2016 06:33:44 -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; bh=dVxP/XYSlipQYtma0UYUH69gzJxSLsWsQufkFPK1rmA=; b=N7a63MInxAR28ffKGXL2bpc+q9gHlxPtQ42kAgoPjAIHH8URa/SO1JcRqpjDH+7GAc mISb9/wJSXBtzoya6j8COC94L98a9i/xs6HVr9wD0xAdD/HKVtWsAMGSXl9pxpXCzluV NWE3mOb/BXp3tmuduWzmY2UO0tDZY7A33Gi9gytSB8/Sm+bOYqdaK+L7ihQ7UD3NZCzq yLZiEnkdsgqxFxUKFDfo1cWEzSHsF5lOP0ZPnoWC+riIdv+3PJANR5IVd8sKR3Rki7UB i30Fmc79HBc0woc4BHPu7lbxqDMOy5btgvo8iZoSiP11TKMjCBZ/n2ZNmn+Fdv3Vo+g3 iRWg== 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; bh=dVxP/XYSlipQYtma0UYUH69gzJxSLsWsQufkFPK1rmA=; b=LNxPArQvqjjYrRI0Fl9trJ57tje83wz8nhmjPT8vZF0VrQtkFewBMdttRSA3hDovfR Ta9WzIAHED7dMzCn8L6K9VSUkr/+PBsTKi5XgCM1cjVCE5nyLyHcaEpYGU8mwrHhBm/e yBftm4T4ngIXgfryfB0vZyK9Ho6w68ISfRdIu10oWujtAv07izIuyHxfDqtJYq4WZHfE Le23g1Awe73q8NPDbg8gR8+GIQUSHWtBDgc0NntcvfVziPl4PJUEdx7Nrg1bKwMFRH1k 4IyjODIWWi4uqBlpPisM31ZTFurhoezoE2drB7VNX/F0ySlyOcat4Doemb7v6iomFysA K/hg== X-Gm-Message-State: ALyK8tIJEZRhZqRymNTfpOZIpvwKEkawZeDdp7/iGm8b58R3HFHUbYEh1ouRQw5WyflOVQ== X-Received: by 10.141.42.133 with SMTP id t127mr43693874qhe.12.1464874422896; Thu, 02 Jun 2016 06:33:42 -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 u131sm7962690qka.44.2016.06.02.06.33.42 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Jun 2016 06:33:42 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/6] drm/amdgpu/atpx: track whether if this is a hybrid graphics platform Date: Thu, 2 Jun 2016 09:33:32 -0400 Message-Id: <1464874417-27272-1-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 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 hybrid graphics in this case refers to systems which use the new platform d3 cold ACPI methods as opposed to ATPX for dGPU power control. Signed-off-by: Alex Deucher Acked-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 19d15dc..c6b5ce3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -2394,10 +2394,12 @@ bool amdgpu_device_is_px(struct drm_device *dev); void amdgpu_register_atpx_handler(void); void amdgpu_unregister_atpx_handler(void); bool amdgpu_has_atpx_dgpu_power_cntl(void); +bool amdgpu_is_atpx_hybrid(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; } +static inline bool amdgpu_is_atpx_hybrid(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 90dfedc..3e973c7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c @@ -28,6 +28,7 @@ struct amdgpu_atpx_functions { struct amdgpu_atpx { acpi_handle handle; struct amdgpu_atpx_functions functions; + bool is_hybrid; }; static struct amdgpu_atpx_priv { @@ -68,6 +69,10 @@ bool amdgpu_has_atpx_dgpu_power_cntl(void) { return amdgpu_atpx_priv.atpx.functions.power_cntl; } +bool amdgpu_is_atpx_hybrid(void) { + return amdgpu_atpx_priv.atpx.is_hybrid; +} + /** * amdgpu_atpx_call - call an ATPX method * @@ -192,9 +197,11 @@ static int amdgpu_atpx_validate(struct amdgpu_atpx *atpx) ATPX_DYNAMIC_DGPU_POWER_OFF_SUPPORTED)) atpx->functions.power_cntl = true; + atpx->is_hybrid = false; if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { - printk("Hybrid Graphics, ATPX dGPU power cntl disabled\n"); + printk("ATPX Hybrid Graphics\n"); atpx->functions.power_cntl = false; + atpx->is_hybrid = true; } return 0;