From patchwork Mon Dec 8 16:11:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 5457421 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 BBE869F1C5 for ; Mon, 8 Dec 2014 16:12:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA4AF2015A for ; Mon, 8 Dec 2014 16:12:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0ECEE20155 for ; Mon, 8 Dec 2014 16:12:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5024B6E7BD; Mon, 8 Dec 2014 08:12:14 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from pegasos-out.vodafone.de (pegasos-out.vodafone.de [80.84.1.38]) by gabe.freedesktop.org (Postfix) with ESMTP id A38996E7C1 for ; Mon, 8 Dec 2014 08:12:13 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by pegasos-out.vodafone.de (Rohrpostix2 Daemon) with ESMTP id 112E36848C4 for ; Mon, 8 Dec 2014 17:12:13 +0100 (CET) X-Virus-Scanned: amavisd-new at vodafone.de X-Spam-Score: 0.157 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Authentication-Results: rohrpostix2.prod.vfnet.de (amavisd-new); dkim=softfail (invalid, public key: DNS query timeout for mail._domainkey.vodafone.de) header.i=@vodafone.de Received: from pegasos-out.vodafone.de ([127.0.0.1]) by localhost (rohrpostix2.prod.vfnet.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BoTju7qkqIvB for ; Mon, 8 Dec 2014 17:11:51 +0100 (CET) Received: from smtp-04.vodafone.de (smtp-04.vodafone.de [10.215.254.39]) by pegasos-out.vodafone.de (Rohrpostix2 Daemon) with ESMTP id B72766848CB for ; Mon, 8 Dec 2014 17:11:51 +0100 (CET) X-DKIM: OpenDKIM Filter v2.6.8 pegasos-out.vodafone.de B72766848CB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafone.de; s=mail; t=1418055111; bh=QGOgGc/AWtKzTh/caCBkrIBbcBLvk3v8veHe4LV7uTE=; h=From:To:Subject:Date:In-Reply-To:References; b=2ne3o5LXvQLK80cKtwPgTumhuVtzOLeOjuDhIhIWJ0A+1m/rA0um+CGqtzaxPony/ JRLvNfgoBh8PE/2ED9Mvx0FrH9akaPNk12XDwOllK11MrzuNLsBXi+6CNcz+dxzqID RjUH8SdhAvG2tsZVorXd3c5EmtPGWP2Wg/Ks/sdc= X-DKIM: OpenDKIM Filter v2.0.2 smtp-04.vodafone.de 8D479E4A9C X-Virus-Scanned: amavisd-new at vodafone.de Received: from smtp-04.vodafone.de ([127.0.0.1]) by localhost (xsmail-dmz8.prod.vfnet.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z19-IqG72tlh for ; Mon, 8 Dec 2014 17:11:38 +0100 (CET) From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/6] drm/radeon: optionally return an ID for the last PT update Date: Mon, 8 Dec 2014 17:11:12 +0100 Message-Id: <1418055073-2211-5-git-send-email-deathsimple@vodafone.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418055073-2211-1-git-send-email-deathsimple@vodafone.de> References: <1418055073-2211-1-git-send-email-deathsimple@vodafone.de> MIME-Version: 1.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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Christian König PT updates can be seen as command submissions as well, and we don't necessary need to wait on all of them. Signed-off-by: Christian König --- drivers/gpu/drm/radeon/radeon_gem.c | 12 +++++++++++- include/uapi/drm/radeon_drm.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index fe48f22..dd45611 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -691,8 +691,18 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void *data, default: break; } - if (!r) + args->id = 0; + if (!r) { + struct radeon_fence *fence; + radeon_gem_va_update_vm(rdev, bo_va); + fence = bo_va->last_pt_update; + if (fence) { + mutex_lock(&fpriv->seq_lock); + args->id = radeon_seq_push(&fpriv->seq, fence); + mutex_unlock(&fpriv->seq_lock); + } + } args->operation = RADEON_VA_RESULT_OK; if (r) { args->operation = RADEON_VA_RESULT_ERROR; diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h index a34e3db..2c50838 100644 --- a/include/uapi/drm/radeon_drm.h +++ b/include/uapi/drm/radeon_drm.h @@ -940,6 +940,7 @@ struct drm_radeon_gem_va { uint32_t vm_id; uint32_t flags; uint64_t offset; + uint64_t id; }; #define RADEON_CHUNK_ID_RELOCS 0x01