From patchwork Thu Jul 10 21:54:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 4528611 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 094909F3B4 for ; Thu, 10 Jul 2014 23:34:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 385F0201F4 for ; Thu, 10 Jul 2014 23:34:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 73578201D5 for ; Thu, 10 Jul 2014 23:34:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 367596E7A8; Thu, 10 Jul 2014 16:33:25 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 58D9D6E163 for ; Thu, 10 Jul 2014 14:56:59 -0700 (PDT) Received: by mail-wg0-f52.google.com with SMTP id b13so202793wgh.11 for ; Thu, 10 Jul 2014 14:56:58 -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=f4t6GUbv3ea6YK/YxVXaAlfGLG04pRYoKwKT1L8Ekjo=; b=xauuZZ21HNQroO2t/PPimKlZW3RtFo3SDN94IC03DdeJNWlWlJCr9EC4yRMdr9fk4M v55FxfkJmYxpE/V4t/tInXOdxgl7OjHcOhg4nTWy2gSOe3GDBgnZpHl/LmT0Is/9sXgL 0h8m8hsOhC1W30MgMDMzIDDSAP6wQriIPGPaQJRdioPqQdBWunRCJ9Q/+LxT/05+lPYy niZMvqP/jGJrXWwxsvnqEL2oz59ug5T8ddUoVBWggtBJd1RV5rcHj4mGMzYnpfCbVUhJ PK+pLJ4mMKjtkQASHIutlkTb7iiPxjHtH1C1rlNduNOBBV7dt8yMKvSJayv794akJeKJ mmUw== X-Received: by 10.180.91.81 with SMTP id cc17mr22162470wib.17.1405029417678; Thu, 10 Jul 2014 14:56:57 -0700 (PDT) Received: from localhost.localdomain ([77.127.59.49]) by mx.google.com with ESMTPSA id pq9sm831097wjc.35.2014.07.10.14.56.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 14:56:57 -0700 (PDT) From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Subject: [PATCH 65/83] hsa/radeon: fixing a bug to support 32b processes Date: Fri, 11 Jul 2014 00:54:21 +0300 Message-Id: <1405029279-6894-37-git-send-email-oded.gabbay@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com> References: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com> X-Mailman-Approved-At: Thu, 10 Jul 2014 16:33:12 -0700 Cc: Andrew Lewycky , Ben Goz , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, 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 From: Ben Goz This commit is a bug fix for 32b hsa processes support Signed-off-by: Ben Goz Signed-off-by: Oded Gabbay --- drivers/gpu/hsa/radeon/cik_regs.h | 1 + drivers/gpu/hsa/radeon/kfd_device_queue_manager.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/hsa/radeon/cik_regs.h b/drivers/gpu/hsa/radeon/cik_regs.h index fa5ec01..a6404e3 100644 --- a/drivers/gpu/hsa/radeon/cik_regs.h +++ b/drivers/gpu/hsa/radeon/cik_regs.h @@ -45,6 +45,7 @@ /* if PTR32, this is the upper limit of GPUVM */ #define SH_MEM_CONFIG 0x8C34 #define PTR32 (1 << 0) +#define PRIVATE_ATC (1 << 1) #define ALIGNMENT_MODE(x) ((x) << 2) #define SH_MEM_ALIGNMENT_MODE_DWORD 0 #define SH_MEM_ALIGNMENT_MODE_DWORD_STRICT 1 diff --git a/drivers/gpu/hsa/radeon/kfd_device_queue_manager.c b/drivers/gpu/hsa/radeon/kfd_device_queue_manager.c index 01573b1..3e1def1 100644 --- a/drivers/gpu/hsa/radeon/kfd_device_queue_manager.c +++ b/drivers/gpu/hsa/radeon/kfd_device_queue_manager.c @@ -90,15 +90,17 @@ static void init_process_memory(struct device_queue_manager *dqm, struct qcm_pro if (qpd->pqm->process->is_32bit_user_mode) { temp = get_sh_mem_bases_32(qpd->pqm->process, dqm->dev); qpd->sh_mem_bases = SHARED_BASE(temp); + qpd->sh_mem_config = PTR32; } else { temp = get_sh_mem_bases_nybble_64(qpd->pqm->process, dqm->dev); qpd->sh_mem_bases = compute_sh_mem_bases_64bit(temp); + qpd->sh_mem_config = 0; } - qpd->sh_mem_config = ALIGNMENT_MODE(SH_MEM_ALIGNMENT_MODE_UNALIGNED); + qpd->sh_mem_config |= ALIGNMENT_MODE(SH_MEM_ALIGNMENT_MODE_UNALIGNED); qpd->sh_mem_config |= DEFAULT_MTYPE(MTYPE_NONCACHED); qpd->sh_mem_ape1_limit = 0; - qpd->sh_mem_ape1_base = 1; + qpd->sh_mem_ape1_base = 0; pr_debug("kfd: is32bit process: %d sh_mem_bases nybble: 0x%X and register 0x%X\n", qpd->pqm->process->is_32bit_user_mode, temp, qpd->sh_mem_bases); @@ -854,7 +856,7 @@ static int execute_queues_cpsch(struct device_queue_manager *dqm) } if (dqm->queue_count <= 0 || dqm->processes_count <= 0) - return 0; + return 0; mutex_lock(&dqm->lock); if (dqm->active_runlist) {