From patchwork Wed Nov 12 11:38:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 5287841 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 0496B9F440 for ; Wed, 12 Nov 2014 11:38:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 209DE2015D for ; Wed, 12 Nov 2014 11:38:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 508402013D for ; Wed, 12 Nov 2014 11:38:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8AB4D6E27C; Wed, 12 Nov 2014 03:38:47 -0800 (PST) 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 ESMTP id 34A476E25F for ; Wed, 12 Nov 2014 03:38:45 -0800 (PST) Received: by mail-wi0-f171.google.com with SMTP id r20so4563918wiv.10 for ; Wed, 12 Nov 2014 03:38:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Eso6tV4910SCfkBTL1qhPWOUufH1cRsIvhS2IezG1BM=; b=G8rYw35JYPiHbQnintHrSuqjxha+GQeQlbLI6GRGmJn1SPK0VHoxLoaaGW3ECExLGU r/jPf4YI3/F0OA9U7twTlOwl08pBTuq/FCE9Y1rf/dK+mGPMYO3XXua4vLjztMUUXM1q GwFbBIiKfkUccr2iuvFeFEdI2C8DlmL22HCldQyp8hBGBMYF7lbSngFemHDiTe7NTVdb s6rFrrhJ6kjmJAilgGTjuEBIoSar7tpD3aa6eP8B7TnxIcpG7vhplInzgU5HT+8aNZ7C F9nOMJ/5nBW/xTKdP6xSxxaYGH2/SYXCwBWedVNtfMgDlxARXx2keUGR8ZfmPlTxbr8l cQmg== X-Gm-Message-State: ALoCoQkRz6zaIxcWCvqT7YlxiPf28nCDQYsq+R6UGBb79isziXAUYb/STb83M6cYT/RxF23AXn1F X-Received: by 10.194.185.167 with SMTP id fd7mr64128321wjc.108.1415792324505; Wed, 12 Nov 2014 03:38:44 -0800 (PST) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id ji10sm21304728wid.7.2014.11.12.03.38.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Nov 2014 03:38:43 -0800 (PST) From: Daniel Thompson To: David Airlie Subject: [PATCH v2 v3.18-rc4 4/4] drm: sti: Honour O_RDWR during prime-handle-to-fd Date: Wed, 12 Nov 2014 11:38:15 +0000 Message-Id: <1415792295-2466-5-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1415792295-2466-1-git-send-email-daniel.thompson@linaro.org> References: <1415639805-17477-1-git-send-email-daniel.thompson@linaro.org> <1415792295-2466-1-git-send-email-daniel.thompson@linaro.org> Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Benjamin Gaignard 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=-2.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,SUSPICIOUS_RECIPS,UNPARSEABLE_RELAY autolearn=ham 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 Currently the sti drm driver forcible applies O_RDWR when it exports a prime handle. This is because it was not previously possible for user requests to create the fd with O_RDWR passed into drivers. This is a cleanup to remove this code. This change has obvious impact upon the userspace which must change the flags passed to DRM_IOCTL_PRIME_HANDLE_TO_FD. However at present only a tiny handful of developers run this userspace and, if they don't complain, nobody else will. Signed-off-by: Daniel Thompson --- drivers/gpu/drm/sti/sti_drm_drv.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_drm_drv.c b/drivers/gpu/drm/sti/sti_drm_drv.c index 223d93c3a05d..320167e1520a 100644 --- a/drivers/gpu/drm/sti/sti_drm_drv.c +++ b/drivers/gpu/drm/sti/sti_drm_drv.c @@ -93,15 +93,6 @@ static const struct file_operations sti_drm_driver_fops = { .release = drm_release, }; -static struct dma_buf *sti_drm_gem_prime_export(struct drm_device *dev, - struct drm_gem_object *obj, - int flags) -{ - /* we want to be able to write in mmapped buffer */ - flags |= O_RDWR; - return drm_gem_prime_export(dev, obj, flags); -} - static struct drm_driver sti_drm_driver = { .driver_features = DRIVER_HAVE_IRQ | DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME, @@ -119,7 +110,7 @@ static struct drm_driver sti_drm_driver = { .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, - .gem_prime_export = sti_drm_gem_prime_export, + .gem_prime_export = drm_gem_prime_export, .gem_prime_import = drm_gem_prime_import, .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,