From patchwork Thu Aug 20 20:51:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bas Nieuwenhuizen X-Patchwork-Id: 7047081 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2CCD3C05AC for ; Thu, 20 Aug 2015 20:53:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 605112022A for ; Thu, 20 Aug 2015 20:53:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6287C20274 for ; Thu, 20 Aug 2015 20:52:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9574A6E1EF; Thu, 20 Aug 2015 13:52:57 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0E6656E1EF for ; Thu, 20 Aug 2015 13:52:56 -0700 (PDT) Received: by wijp15 with SMTP id p15so3498980wij.0 for ; Thu, 20 Aug 2015 13:52:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=dIo+QhjxAvIIKqGWZ7WGGlrn+21bDMWzatSld5fkwYw=; b=GfaoAdTx5oLoNWL3X+kaqmLB4O0Ue0v9nJ5CLC++Fl2QD7/9A1BvIdYnNerTuPnUCa QkN5RuJBBhIGLiMqzfro7owp4R049dCdtY/UFYEyhTSEyjJuhk8AQalr1Xd9ZvIVci1s wGKPHLPSJOc83wvB69Dbv+gp0DsorLqrgMMGuupd/w19CE1Gek5NwEk9WZs96QrJPKW6 TmsNN95DJdUhACsrpljzJUcWBVpkfbQT1wUx1Enm9q+QdztVOxocBa59yEWkdvVSzstt rKTrTqYiRU8BdSx/9nebVHA05d5tcu5uVlxcN0LAJPsp1CX2RB5xoR8DIa98WTliEc3Z rFjg== X-Gm-Message-State: ALoCoQmVOWkD1xMpUXF3oPnW0CbJiGZXBCTwaPfpUp3alZ6vuPqFthBq0e9vNGiS6zlPjESu8vgB X-Received: by 10.194.81.67 with SMTP id y3mr9166371wjx.7.1440103974534; Thu, 20 Aug 2015 13:52:54 -0700 (PDT) Received: from bas-desktop.localdomain (4dafc19f.ftth.telfortglasvezel.nl. [77.175.193.159]) by smtp.gmail.com with ESMTPSA id ll1sm34761wic.14.2015.08.20.13.52.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Aug 2015 13:52:53 -0700 (PDT) From: Bas Nieuwenhuizen To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/amdgpu: only deinitialize initialized ib's. Date: Thu, 20 Aug 2015 22:51:51 +0200 Message-Id: <1440103912-1014-1-git-send-email-bas@basnieuwenhuizen.nl> X-Mailer: git-send-email 2.5.0 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.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Signed-off-by: Bas Nieuwenhuizen --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 2fc58e6..454d4e2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1250,6 +1250,7 @@ struct amdgpu_cs_parser { struct amdgpu_ib *ibs; uint32_t num_ibs; + uint32_t num_initialized_ibs; struct ww_acquire_ctx ticket; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index e4424b4..2c49dd4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -509,7 +509,7 @@ static void amdgpu_cs_parser_fini_late(struct amdgpu_cs_parser *parser) drm_free_large(parser->chunks[i].kdata); kfree(parser->chunks); if (parser->ibs) - for (i = 0; i < parser->num_ibs; i++) + for (i = 0; i < parser->num_initialized_ibs; i++) amdgpu_ib_free(parser->adev, &parser->ibs[i]); kfree(parser->ibs); if (parser->uf.bo) @@ -708,6 +708,7 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev, ib->length_dw = chunk_ib->ib_bytes / 4; ib->flags = chunk_ib->flags; ib->ctx = parser->ctx; + parser->num_initialized_ibs++; j++; }