From patchwork Tue Aug 12 12:32: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: 4712601 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 EAD8A9F319 for ; Tue, 12 Aug 2014 12:33:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6A452014A for ; Tue, 12 Aug 2014 12:32:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 78F9520115 for ; Tue, 12 Aug 2014 12:32:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4521A6E00F; Tue, 12 Aug 2014 05:32:50 -0700 (PDT) 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 AFA916E05D for ; Tue, 12 Aug 2014 05:32:48 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by pegasos-out.vodafone.de (Rohrpostix2 Daemon) with ESMTP id 2DCB158E1E8 for ; Tue, 12 Aug 2014 14:32:47 +0200 (CEST) X-Virus-Scanned: amavisd-new at vodafone.de X-Spam-Score: 0.41 X-Spam-Level: X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 X9pLRI3AXjhR for ; Tue, 12 Aug 2014 14:32:25 +0200 (CEST) Received: from smtp-05.vodafone.de (xsmail-dmz2.prod.vfnet.de [10.215.254.33]) by pegasos-out.vodafone.de (Rohrpostix2 Daemon) with ESMTP id 9421558E204 for ; Tue, 12 Aug 2014 14:32:25 +0200 (CEST) X-DKIM: OpenDKIM Filter v2.6.8 pegasos-out.vodafone.de 9421558E204 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafone.de; s=mail; t=1407846745; bh=eLUjtc2v7+F3SqS3fzofyGmo+N9ddBC7EQK/xVCPpxw=; h=From:To:Subject:Date:In-Reply-To:References; b=lsfZX/V+0Xi0iICmKCnywWPYJGk8AwDuBzit881hIVusC8kpGANvVNl/uNv+PTWsE QefubbroEc3k9SXcKnIL8QeNKbRxeNAe95YfSE3Z0OCP+E37SAcA3FvwJp00A4jflh KHjoMzI8AvoLx4C5EX2lcCn7PJ53D8o5JOiYwI5o= X-DKIM: OpenDKIM Filter v2.0.2 smtp-05.vodafone.de 7B2D4E4C7C X-Virus-Scanned: amavisd-new at vodafone.de Received: from smtp-05.vodafone.de ([127.0.0.1]) by localhost (xsmail-dmz2.prod.vfnet.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id suV6s7Mxntcs for ; Tue, 12 Aug 2014 14:32:13 +0200 (CEST) From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/radeon: use zero sized BOs for fences v2 Date: Tue, 12 Aug 2014 14:32:12 +0200 Message-Id: <1407846732-2377-2-git-send-email-deathsimple@vodafone.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1407846732-2377-1-git-send-email-deathsimple@vodafone.de> References: <1407846732-2377-1-git-send-email-deathsimple@vodafone.de> MIME-Version: 1.0 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: , 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 This patch allows userspace to created zero sized buffers for use as pure synchronization object. Signed-off-by: Christian König --- drivers/gpu/drm/radeon/radeon_drv.c | 3 ++- drivers/gpu/drm/radeon/radeon_object.c | 2 +- drivers/gpu/drm/radeon/radeon_vm.c | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 86d6b56..5ec6273 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -84,9 +84,10 @@ * 2.39.0 - Add INFO query for number of active CUs * 2.40.0 - Add RADEON_GEM_GTT_WC/UC, flush HDP cache before submitting * CS to GPU + * 2.41.0 - Allow zero sized BOs */ #define KMS_DRIVER_MAJOR 2 -#define KMS_DRIVER_MINOR 40 +#define KMS_DRIVER_MINOR 41 #define KMS_DRIVER_PATCHLEVEL 0 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); int radeon_driver_unload_kms(struct drm_device *dev); diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 480c87d..9dd670e 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -154,7 +154,7 @@ int radeon_bo_create(struct radeon_device *rdev, size = ALIGN(size, PAGE_SIZE); - if (kernel) { + if (kernel || size == 0) { type = ttm_bo_type_kernel; } else if (sg) { type = ttm_bo_type_sg; diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c index 058f200..b2c336a 100644 --- a/drivers/gpu/drm/radeon/radeon_vm.c +++ b/drivers/gpu/drm/radeon/radeon_vm.c @@ -883,6 +883,9 @@ int radeon_vm_bo_update(struct radeon_device *rdev, uint32_t flags; int r; + if (bo_va->bo && radeon_bo_size(bo_va->bo) == 0) + return 0; + if (!bo_va->it.start) { dev_err(rdev->dev, "bo %p don't has a mapping in vm %p\n", bo_va->bo, vm);