From patchwork Tue Jul 2 07:18:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2810981 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D74DABF4A1 for ; Tue, 2 Jul 2013 07:19:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EBB4E2014C for ; Tue, 2 Jul 2013 07:18:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 95C012014B for ; Tue, 2 Jul 2013 07:18:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C3F4E617A for ; Tue, 2 Jul 2013 00:18:58 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) by gabe.freedesktop.org (Postfix) with ESMTP id AA028E6167 for ; Tue, 2 Jul 2013 00:18:44 -0700 (PDT) Received: by mail-ee0-f53.google.com with SMTP id c41so2508287eek.26 for ; Tue, 02 Jul 2013 00:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer; bh=eEw3di0fsORGtrA5q3A1lBls+VuJvu6HAEeUCFWSgBA=; b=GMQVM79CsM3A69McGdYOz4Zj8IuOAzNdEVXp+k1rERMyjbTL13F/Tdoo+eI85sP+ej xgPCyNlWGojb7ZxyIJ6NqDxF1Jz/wg9bCSYTYj2563DRxkQPBNC9RyomoJ8nOFF5+HYM BHS+CpLKNy8r0YSlVoPKFDtmMpvfFMbnm4WK8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=eEw3di0fsORGtrA5q3A1lBls+VuJvu6HAEeUCFWSgBA=; b=elZ99gz8ELkzrcm0uadrEpqqBcQHVmPWcsbph4nkVWRIcz3RyQDWu1arhxSw7AcqBa u+EuRDsWjZtZf5dyeEaSAj7A45aW9GifBiOqxb7FDu/bUhl8lAA0HPGeCMq8QiIo4sEE 9bwFZNjBvwM1E5xNfRv5P6P/5i6dI4T1260GX0JgKybLZjYnxfx74KWZbIw4EOlDWIRZ jxN3dAz1D3IYc6aWdGDOXDR405T1mP1VogKO+GUGEx3TP2Fbj9oD3RLy9PW2eSWWKTXU QUzR38VfwU2SFQRd1WJfy0KTJ8cj2EJ5VztFfy42+L3lxQebMNxC2Kb8ylJPIFlYoHWE PGKg== X-Received: by 10.14.182.132 with SMTP id o4mr24423373eem.94.1372749523475; Tue, 02 Jul 2013 00:18:43 -0700 (PDT) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id n42sm34641386eeh.15.2013.07.02.00.18.41 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Jul 2013 00:18:42 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH] drm/prime: fix up handle_to_fd ioctl return value Date: Tue, 2 Jul 2013 09:18:39 +0200 Message-Id: <1372749519-3266-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQm3FsMUMjmKERXNKPDl7K6aXzqwVbz6qbl5ANMhZbkga/MZrs9DkeuHTokwLhDODFK8iItU Cc: Daniel Vetter , Kyungmin Park , Seung-Woo Kim , YoungJun Cho 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 X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 In commit da34242e5e0638312130f5bd5d2d277afbc6f806 Author: YoungJun Cho Date: Wed Jun 26 10:21:42 2013 +0900 drm/prime: add return check for dma_buf_fd the failure case handling was fixed up. But in the case when we already had the buffer exported it changed the return value: Previously we've return 0 on success, now we return the fd. This ABI change has been caught by i-g-t/prime_self_import/with_one_bo. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66436 Cc: YoungJun Cho Cc: Seung-Woo Kim Cc: Kyungmin Park Tested-by: lu hua Signed-off-by: Daniel Vetter Reviewed-by: YoungJun Cho --- drivers/gpu/drm/drm_prime.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 52709f2..1e0de41 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -347,10 +347,13 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev, out_have_obj: get_dma_buf(dmabuf); ret = dma_buf_fd(dmabuf, flags); - if (ret < 0) + if (ret < 0) { dma_buf_put(dmabuf); - else + } else { *prime_fd = ret; + ret = 0; + } + goto out; fail_rm_handle: