From patchwork Fri Jun 12 19:31:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 6600571 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 235439F326 for ; Fri, 12 Jun 2015 19:31:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 41B0C2060E for ; Fri, 12 Jun 2015 19:31:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4051D20551 for ; Fri, 12 Jun 2015 19:31:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 714E76E58C; Fri, 12 Jun 2015 12:31:42 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id E17756E50D for ; Fri, 12 Jun 2015 12:31:39 -0700 (PDT) Received: by wigg3 with SMTP id g3so25124615wig.1 for ; Fri, 12 Jun 2015 12:31:39 -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=6F5d6LeVjLoVB7UA2g+DQwpIJ3/u5Om6QVYDrtMO+V0=; b=lBH7XGPYnhfTli55egLvOhgS+/C9mB87nB1UGhmRMYLe3l2IXv0n6hz6BVC8lPBEPv TZQbmaXfSB4/3r+ulWlOSQOZ5C+8jnMey4B3LLVc9kqym9vY+J+FJMuF8yAlZUhDaX2E FcfZ+LItCeE/iizwacJAUNPV26mFkKmGt5s6KfP4X60kipvestdF/mjkbiqEJ/VD03k7 kalDjwSsxNWpiXDC3N/eJnRMscm6+sAE4+LHrf10ALimH69gKRSSs4Uw2bwy5kJeeFT+ Ehnt+BW1egkkUEwmNwp7uhwb939fnFkQBhWxfTInGNv+LtWK7oHik9SIMN8iEB65KBuO 8zbA== X-Received: by 10.194.235.4 with SMTP id ui4mr29692142wjc.0.1434137499310; Fri, 12 Jun 2015 12:31:39 -0700 (PDT) Received: from odedg-home.redhat.com ([77.126.137.55]) by mx.google.com with ESMTPSA id v3sm4089284wiz.14.2015.06.12.12.31.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jun 2015 12:31:38 -0700 (PDT) From: Oded Gabbay To: dri-devel@lists.freedesktop.org, alexdeucher@gmail.com Subject: [PATCH 10/13] drm/amdkfd: fix runlist length calculation Date: Fri, 12 Jun 2015 22:31:18 +0300 Message-Id: <1434137481-13315-11-git-send-email-oded.gabbay@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1434137481-13315-1-git-send-email-oded.gabbay@gmail.com> References: <1434137481-13315-1-git-send-email-oded.gabbay@gmail.com> 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-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 The MAP_QUEUES packet length for Carrizo is different than for Kaveri. Therefore, we now need to calculate the runlist length with regard to the underlying H/W. Signed-off-by: Ben Goz Signed-off-by: Oded Gabbay --- drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c index 99b6d28..e3230cc 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c @@ -27,6 +27,7 @@ #include "kfd_kernel_queue.h" #include "kfd_priv.h" #include "kfd_pm4_headers.h" +#include "kfd_pm4_headers_vi.h" #include "kfd_pm4_opcodes.h" static inline void inc_wptr(unsigned int *wptr, unsigned int increment_bytes, @@ -55,6 +56,7 @@ static void pm_calc_rlib_size(struct packet_manager *pm, bool *over_subscription) { unsigned int process_count, queue_count; + unsigned int map_queue_size; BUG_ON(!pm || !rlib_size || !over_subscription); @@ -69,9 +71,13 @@ static void pm_calc_rlib_size(struct packet_manager *pm, pr_debug("kfd: over subscribed runlist\n"); } + map_queue_size = + (pm->dqm->dev->device_info->asic_family == CHIP_CARRIZO) ? + sizeof(struct pm4_mes_map_queues) : + sizeof(struct pm4_map_queues); /* calculate run list ib allocation size */ *rlib_size = process_count * sizeof(struct pm4_map_process) + - queue_count * sizeof(struct pm4_map_queues); + queue_count * map_queue_size; /* * Increase the allocation size in case we need a chained run list