From patchwork Fri Dec 20 00:51:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 3385041 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 907C09F384 for ; Fri, 20 Dec 2013 00:52:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CEDBB20173 for ; Fri, 20 Dec 2013 00:52:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id F3BC620155 for ; Fri, 20 Dec 2013 00:52:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 332F911D97C; Thu, 19 Dec 2013 16:51:58 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qe0-f51.google.com (mail-qe0-f51.google.com [209.85.128.51]) by gabe.freedesktop.org (Postfix) with ESMTP id DF38E10F0BB for ; Thu, 19 Dec 2013 16:51:39 -0800 (PST) Received: by mail-qe0-f51.google.com with SMTP id 1so1775544qee.24 for ; Thu, 19 Dec 2013 16:51:39 -0800 (PST) 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=w5Ykk3KFStFF2wF2E3cIcI1Y2Nmf9liODMUmKim6ZqQ=; b=b9eTwl04obD9bQM8s8CAL1IU5fKDbUfODVVYMkN0RHYXT2bhlyTSgs+hnmAOwjWO2d gJB1aHWztFWQunwh0JAm7Odft7EkP+LWYzWHIZblhzzMHhPU2Ce6uaLaSnpF/G6K0N64 mwLTWvJfLYiugOs7a4A01Zk6epCrQ0fyHGsjNbfvU9gYGw+kO94Hbv6HnctEg8DD6V+m nMFoSdFFg7zggH2ALyeaVPqWkfSSbdd5c27M6HzFF12f0yTiUNenZTsvRX6dMLi71rAq OGg/xzAEdj7GqPY/Ws2TtB9X5NtPcYdnz1cWHBPge2rED1zU8X3IayI6JCpVhvui4wPy VOKw== X-Received: by 10.224.65.65 with SMTP id h1mr7069664qai.104.1387500699577; Thu, 19 Dec 2013 16:51:39 -0800 (PST) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by mx.google.com with ESMTPSA id i7sm14173820qeo.7.2013.12.19.16.51.39 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Thu, 19 Dec 2013 16:51:39 -0800 (PST) From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 11/18] drm/radeon/dpm: add late_enable for CI Date: Thu, 19 Dec 2013 19:51:15 -0500 Message-Id: <1387500682-10246-12-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1387500682-10246-1-git-send-email-alexander.deucher@amd.com> References: <1387500682-10246-1-git-send-email-alexander.deucher@amd.com> Cc: Alex Deucher X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make sure interrupts are enabled before we enable thermal interrupts. Also, don't powergate uvd until after the ring tests. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/ci_dpm.c | 29 +++++++++++++++++++++++++++++ drivers/gpu/drm/radeon/radeon_asic.c | 1 + drivers/gpu/drm/radeon/radeon_asic.h | 1 + 3 files changed, 31 insertions(+) diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index f891fc0..13ee5af 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c @@ -4685,6 +4685,35 @@ int ci_dpm_enable(struct radeon_device *rdev) return 0; } +int ci_dpm_late_enable(struct radeon_device *rdev) +{ + int ret; + + if (rdev->irq.installed && + r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) { +#if 0 + PPSMC_Result result; +#endif + ret = ci_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX); + if (ret) { + DRM_ERROR("ci_set_thermal_temperature_range failed\n"); + return ret; + } + rdev->irq.dpm_thermal = true; + radeon_irq_set(rdev); +#if 0 + result = ci_send_msg_to_smc(rdev, PPSMC_MSG_EnableThermalInterrupt); + + if (result != PPSMC_Result_OK) + DRM_DEBUG_KMS("Could not enable thermal interrupts.\n"); +#endif + } + + ci_dpm_powergate_uvd(rdev, true); + + return 0; +} + void ci_dpm_disable(struct radeon_device *rdev) { struct ci_power_info *pi = ci_get_pi(rdev); diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index 23df62f..9c9a407 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c @@ -2067,6 +2067,7 @@ static struct radeon_asic ci_asic = { .init = &ci_dpm_init, .setup_asic = &ci_dpm_setup_asic, .enable = &ci_dpm_enable, + .late_enable = &ci_dpm_late_enable, .disable = &ci_dpm_disable, .pre_set_power_state = &ci_dpm_pre_set_power_state, .set_power_state = &ci_dpm_set_power_state, diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h index 9489ee3..095a4fa 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h @@ -755,6 +755,7 @@ int kv_get_temp(struct radeon_device *rdev); int ci_dpm_init(struct radeon_device *rdev); int ci_dpm_enable(struct radeon_device *rdev); +int ci_dpm_late_enable(struct radeon_device *rdev); void ci_dpm_disable(struct radeon_device *rdev); int ci_dpm_pre_set_power_state(struct radeon_device *rdev); int ci_dpm_set_power_state(struct radeon_device *rdev);