From patchwork Fri Sep 14 20:37:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristian Hogsberg X-Patchwork-Id: 1460101 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id B2FC9DF280 for ; Fri, 14 Sep 2012 20:36:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FA3BA1138 for ; Fri, 14 Sep 2012 13:36:50 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f49.google.com (mail-qa0-f49.google.com [209.85.216.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 1FCD09E803 for ; Fri, 14 Sep 2012 13:36:40 -0700 (PDT) Received: by qafk1 with SMTP id k1so188587qaf.15 for ; Fri, 14 Sep 2012 13:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=77arGtjwTVi2o+5qrlX+SOJp2NsoZXFu7lt/GyJMegw=; b=SERksag37AvVLrZZQ2wdnl0AszcI5vGnma7DHmNJbrh704eIIwFiH+Ma/N2ZfePLJR wpVbuW9OYViYYMbK7e36KscSgo1Ts/H1HuDr2ys7+0jIlubINH2G0uY4HyRCDZnjKeJM 7BlJAfLTRBuufVIA86/8Rr5igkqxl1itecy9pWtV/M6/kEKDsemQVM5o96eu76DgafJv WWQV2S2EP8iOrOE/61AGvmdR0ikWK0PSu8XsnjHgvzV7iUtmNmA1JydkgX8PLIUXz3Ew ZDCGytvqHhFk6JqUUv9/0DkSADC0YvYbLL/ZAsn50OGzJYFl19L7rknDXhEstPGWrqo0 8/dA== Received: by 10.224.176.18 with SMTP id bc18mr10029442qab.63.1347654999555; Fri, 14 Sep 2012 13:36:39 -0700 (PDT) Received: from localhost.localdomain (c-67-186-132-98.hsd1.ma.comcast.net. [67.186.132.98]) by mx.google.com with ESMTPS id l3sm3686504qan.19.2012.09.14.13.36.38 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Sep 2012 13:36:38 -0700 (PDT) From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= To: dri-devel@lists.freedesktop.org Subject: [PATCH] intel: Mark bo's exported to prime as not reusable Date: Fri, 14 Sep 2012 16:37:53 -0400 Message-Id: <1347655073-15167-1-git-send-email-krh@bitplanet.net> X-Mailer: git-send-email 1.7.10.2 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org It's the same situation as flink and we need take the same pre-cautions. --- intel/intel_bufmgr_gem.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 3bcc849..92c0444 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -2472,8 +2472,14 @@ drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; + int ret; - return drmPrimeHandleToFD(bufmgr_gem->fd, bo_gem->gem_handle, DRM_CLOEXEC, prime_fd); + ret = drmPrimeHandleToFD(bufmgr_gem->fd, bo_gem->gem_handle, + DRM_CLOEXEC, prime_fd); + if (ret == 0) + bo_gem->reusable = false; + + return ret; } static int