From patchwork Sun Sep 25 20:34:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 9349917 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 BE438607F0 for ; Sun, 25 Sep 2016 20:35:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0A682885B for ; Sun, 25 Sep 2016 20:35:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A542528C7B; Sun, 25 Sep 2016 20:35:10 +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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 457002885B for ; Sun, 25 Sep 2016 20:35:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B3486E26F; Sun, 25 Sep 2016 20:35:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 357896E268; Sun, 25 Sep 2016 20:35:01 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id b184so11210376wma.3; Sun, 25 Sep 2016 13:35:01 -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; bh=x/vEe3q2hOEHh4QC0NDmb4mM7tln7CMxYoIdtVlc1fI=; b=eDppXYOQV/oFVdPW/xjZHiyV0FXsTBiAnfvV693GkjrizfakExi4oim+kk1MCw0Y2j lTVtJriezTf668rDn/b705IjgmcgeYIwWbjbCNWir9EdAtRcOrAmL/n5un6+uxbxaXjJ bT1ItOMaa9EWi5fJWLzab1rG3FPDQsvWfweqOraEJP1VW1H428T9hsy2H9QkJ4NrqxI3 1KGVmHnFNw9xRLob/bCRRdqP7lyIjKf4A+Wr+VHJR7nCq55k5V9Za7hdT0ccG+hSaMcp hN2gmcZ4jY+v+2KhqO9SV9qa2cq2+AaOL83zl7N5bP84+dFfsNQdUS0t88OmOSq9v28g KsNw== 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; bh=x/vEe3q2hOEHh4QC0NDmb4mM7tln7CMxYoIdtVlc1fI=; b=kFjVRkWFJBvfaMCzf54ZEJGIijsXFXNM4GdX4KR0pxILFZzOEzJsR0H89WeMZ237Gp qtuTf7P1CSuvN/9EyQyEm0Z1DIvdH37TzKCPjUNp+yMoqd7gRD+cxTCqOtYCYx8xfCke 4zNsfgY9dS650rDSD0NfHbBkAW/tjXRwGCOwq7C9Tc5mYeJEXhmsSvbpeqRWqxQ0iNOQ wXITofFVMwvBcME+iRK/pP7jfpMI2bYATtyTkxahqZMlMNLu9c2tFN8Tiu4nF9+IpqSo SqdDVtwXx3D67nyWtTZUamBmkawgTB0ZJvjVcti4R3D/1A20dogrscCOcYIE67ydFI0k aN2Q== X-Gm-Message-State: AA6/9Rm1mzLlz/aftogbUaRKWf8jct1+TUZQNqrLKT0c3mo+pGxKZA1jO3c9UTofkq0hxg== X-Received: by 10.194.157.193 with SMTP id wo1mr18513654wjb.22.1474835699841; Sun, 25 Sep 2016 13:34:59 -0700 (PDT) Received: from localhost.localdomain ([5.20.238.37]) by smtp.gmail.com with ESMTPSA id a1sm18673649wju.41.2016.09.25.13.34.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 Sep 2016 13:34:59 -0700 (PDT) From: Grazvydas Ignotas To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH] drm/amdgpu/vce3: don't forget to tear down some rings Date: Sun, 25 Sep 2016 23:34:49 +0300 Message-Id: <1474835690-2621-4-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 2.7.4 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 We can use .num_rings for that. Fixes: 6f0359ff7307 ("vce3: add support for third vce ring") Cc: Alex Deucher Signed-off-by: Grazvydas Ignotas --- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c index 06b94c1..121bd6e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c @@ -210,6 +210,8 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) */ int amdgpu_vce_sw_fini(struct amdgpu_device *adev) { + unsigned i; + if (adev->vce.vcpu_bo == NULL) return 0; @@ -217,8 +219,8 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev) amdgpu_bo_unref(&adev->vce.vcpu_bo); - amdgpu_ring_fini(&adev->vce.ring[0]); - amdgpu_ring_fini(&adev->vce.ring[1]); + for (i = 0; i < adev->vce.num_rings; i++) + amdgpu_ring_fini(&adev->vce.ring[i]); release_firmware(adev->vce.fw); mutex_destroy(&adev->vce.idle_mutex);