Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4531210imm; Mon, 25 Jun 2018 18:10:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJtRiVF4YSRY6NI3mbQQ9jxw47WhVNDuaxozGdgUr6imtclrjLfAAxFJk4e9+K/pYC5KKye X-Received: by 2002:a62:d653:: with SMTP id r80-v6mr15152052pfg.54.1529975453264; Mon, 25 Jun 2018 18:10:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529975453; cv=none; d=google.com; s=arc-20160816; b=N7IWXMJUZX/GfXAU1OIPJUgYts+sjl8saZGNckrls26I99A1+lx6GcYoVBfIzJyCbE eaQbZOMANTMAq+N/sSSSdgoCSAM5ethsJ3wwo4hiriuyMswuEPaIT8aCfVuQU9Ir4xnb Y2WHwhxYUeqz9uuegdOZa5LKtivt79+z83yjhUi63DSkqAcYUJArHdCpjEeJktYuTB/R f9yLp0EiUTCDPFRVy2SOW6nz4288u0R1OLSs4uli1Lw9SvTGctdOoJaqVUHSD8TSfiAk jEoRiEfYhlbzH9zIhmKQtQMp40Zr8U4dn/M2GfBR5oZIoZEUJtOXhDfXh6LcS5TOiG91 C9Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=AaybOczC6NZwuD/HPgOmiTnpxhrGN6c2v0f1JXFLhbo=; b=sOC7rhJhWKKWJjG65SbM4VRWLqwNOxDN2b7OkxAgAYbBS7rF4TXZcxWSkXt7kWKfNE TVfSR/TU7mzFyGk6xvw5gUd0U/xqyXfiBEEoYWgat+XGwBf2CYYxe3iLQjX20vmaw2ZG Zc1mgKYUJnjO1u4gV7ymTeXU8kSkqaoRwftdopvYQNo7T+U9Yrckl3IcYJmDklL6fHvI 8xRzpYY93lrcW0+JhDT/iWbEf4kFJ+5kiNIJBh36ADGFoznzzxZNpIvIc8GRvG8OZbSt 1zx1FT/m0zG4EWL4r44tkPHhHK72nzL68YxZoVOk7mEInxtK+g7jkfEyCgi79L3tosAh vhoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t66-v6si253271pgt.538.2018.06.25.18.10.38; Mon, 25 Jun 2018 18:10:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935148AbeFZBJi (ORCPT + 99 others); Mon, 25 Jun 2018 21:09:38 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36912 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935093AbeFZBJb (ORCPT ); Mon, 25 Jun 2018 21:09:31 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5EB8A401EF1D; Tue, 26 Jun 2018 01:09:31 +0000 (UTC) Received: from whitewolf.lyude.net.com (ovpn-122-29.rdu2.redhat.com [10.10.122.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id B02B8111DCEB; Tue, 26 Jun 2018 01:09:30 +0000 (UTC) From: Lyude Paul To: amd-gfx@lists.freedesktop.org Cc: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "David (ChunMing) Zhou" , David Airlie , Monk Liu , Felix Kuehling , Shaoyun Liu , Kai-Heng Feng , Huang Rui , Junwei Zhang , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] drm/amdgpu: Add amdgpu_atpx_get_dhandle() Date: Mon, 25 Jun 2018 21:09:06 -0400 Message-Id: <20180626010916.20300-4-lyude@redhat.com> In-Reply-To: <20180626010916.20300-1-lyude@redhat.com> References: <20180626010916.20300-1-lyude@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 26 Jun 2018 01:09:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 26 Jun 2018 01:09:31 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lyude@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since it seems that some vendors are storing the ATIF ACPI methods under the same handle that ATPX lives under instead of the device's own handle, we're going to need to be able to retrieve this handle later so we can probe for ATIF there. Signed-off-by: Lyude Paul --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 ++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index e7e70518748a..06401f0cde6d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1819,6 +1819,12 @@ static inline bool amdgpu_atpx_dgpu_req_power_for_displays(void) { return false; static inline bool amdgpu_has_atpx(void) { return false; } #endif +#if defined(CONFIG_VGA_SWITCHEROO) && defined(CONFIG_ACPI) +void *amdgpu_atpx_get_dhandle(void); +#else +static inline void *amdgpu_atpx_get_dhandle(void) { return NULL; } +#endif + /* * KMS */ diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c index 717cc5a90313..8a46073f0778 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c @@ -90,6 +90,12 @@ bool amdgpu_atpx_dgpu_req_power_for_displays(void) { return amdgpu_atpx_priv.atpx.dgpu_req_power_for_displays; } +#if defined(CONFIG_ACPI) +void *amdgpu_atpx_get_dhandle(void) { + return amdgpu_atpx_priv.dhandle; +} +#endif + /** * amdgpu_atpx_call - call an ATPX method * -- 2.17.1