From patchwork Thu Jun 2 13:33:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9149973 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 63F3C60751 for ; Thu, 2 Jun 2016 13:33:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 565D4254F7 for ; Thu, 2 Jun 2016 13:33:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B7D228047; Thu, 2 Jun 2016 13:33: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=-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 D8F87254F7 for ; Thu, 2 Jun 2016 13:33:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A94F6EB90; Thu, 2 Jun 2016 13:33:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-x241.google.com (mail-qg0-x241.google.com [IPv6:2607:f8b0:400d:c04::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id BAF6D6EB8C for ; Thu, 2 Jun 2016 13:33:45 +0000 (UTC) Received: by mail-qg0-x241.google.com with SMTP id t106so15925791qgt.2 for ; Thu, 02 Jun 2016 06:33:45 -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=SQBUA4VLOowRhnUFmj8u12fCiox/m1Csc5ky8/9vss8=; b=jH5ISPm7xJZaYeWsffwG/7xakk6OFBhUm9I62vEYiRT/jf309rZalSfu+FkwkuWqQp X7/s7PmF4Pha4IHS/3V2LKZSMe8aLPxm0Ep5vL6SXmw1G3NfnXgTQ+ZvWdVkvjMuDI+x g0WWArKbwA9HloCbOjP6yT6rnjdQiDBaIV4mZVrBCFZNLaEWHjLJ8JjUjiI/mzZ0vkBG s5FAAwvxtD+18lYRiKp+f9fcexXOueu5LTt9ngI9IC9l9/MgPy600VqZfC/LDR+dH/u0 NDLdy0PLznqYeHheEVSWC5Gafp72CUp/154gXDX2Lj6tPlRHE8LPoqDe8delGclvANn3 NhUA== 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=SQBUA4VLOowRhnUFmj8u12fCiox/m1Csc5ky8/9vss8=; b=Ee2sgYR/JX7SO1aSTKJOBaH9kjbsaS6e3UAK9dNMbQvGzEJhZmHAPUBZ6+uaBqEZkC J2Gts6Zj1E2V68DCzVfW4xu7rqLatAOWV5NV8YxLyOv42iLKLCl3Jr5oZutecbiAnI8N pOBol8PZE5L6RlTVyonmJYYwQyvDzCTdaxg+ct8DvDq5onWAyqWk5vXQYjw6MLEdbESO 8yxi8ZlEdVezlvACa0SIORLzbq2H7s/gup2TOIqsJGDFa2yyTGp9oVAsF1duSIrMH6bW 3rm57WpYqOzW6aKUws30OhS5S2L6MWgoK0Y1NTJNR0OMZCNshPMurPxYU5h2mdsiiH45 y24w== X-Gm-Message-State: ALyK8tL4P/0q4whtMCnLRifOj1WHYaow7s5Sp0rJ2Svuam7lVBa+8/kNrCeLZSnoiLFO0w== X-Received: by 10.140.23.37 with SMTP id 34mr41100492qgo.14.1464874424520; Thu, 02 Jun 2016 06:33:44 -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.44 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Jun 2016 06:33:44 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/6] drm/radeon/atpx: track whether if this is a hybrid graphics platform Date: Thu, 2 Jun 2016 09:33:35 -0400 Message-Id: <1464874417-27272-4-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464874417-27272-1-git-send-email-alexander.deucher@amd.com> References: <1464874417-27272-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 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 --- drivers/gpu/drm/radeon/radeon_atpx_handler.c | 9 ++++++++- drivers/gpu/drm/radeon/radeon_drv.c | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c index 6996b31..de17b5e 100644 --- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c +++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c @@ -28,6 +28,7 @@ struct radeon_atpx_functions { struct radeon_atpx { acpi_handle handle; struct radeon_atpx_functions functions; + bool is_hybrid; }; static struct radeon_atpx_priv { @@ -67,6 +68,10 @@ bool radeon_has_atpx_dgpu_power_cntl(void) { return radeon_atpx_priv.atpx.functions.power_cntl; } +bool radeon_is_atpx_hybrid(void) { + return radeon_atpx_priv.atpx.is_hybrid; +} + /** * radeon_atpx_call - call an ATPX method * @@ -190,9 +195,11 @@ static int radeon_atpx_validate(struct radeon_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; diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index ec80050..af52f10 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -166,10 +166,12 @@ void radeon_debugfs_cleanup(struct drm_minor *minor); void radeon_register_atpx_handler(void); void radeon_unregister_atpx_handler(void); bool radeon_has_atpx_dgpu_power_cntl(void); +bool radeon_is_atpx_hybrid(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; } +static inline bool radeon_is_atpx_hybrid(void) { return false; } #endif int radeon_no_wb;