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: 40648 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 02AC2206A5 for ; Wed, 12 Nov 2014 11:38:49 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf7607553lab.7 for ; Wed, 12 Nov 2014 03:38:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Eso6tV4910SCfkBTL1qhPWOUufH1cRsIvhS2IezG1BM=; b=eBC8sgxzXsG+9ub6LijHOhc1BliLi32yhM2DJZWoBGUk4f+PFcn5eZAVLjYAdMIvjW NdBYalRVBJpPQApa4nPPa9nyVoAFOwMXLwzrlrijXM+1PsQkwyy7TaYr2EBVccLzuGVZ ZCdrOjJdTl0Oxlf9o1Pd25MGrqKglSHV0J4HZYMP9dyYRB+svIMhnIaK2QcMkn+X4LL8 9WxrM9q+0sr79rP4PZe6aqoA4+/u229VUQkrBISGtU+H4vZ/Wtd8+gzKvO7lE2S78nx1 o3YTDHTNNjhjk8TAp+XMTxSXutJyeaW6S6kJ/yTXul5DU/QTDLoXLiVQX7lCInLZ+YU0 H42A== X-Gm-Message-State: ALoCoQlp9XDPAJDX8FUCEcV2s2U+vj7lgeuk5tEC0k6obT40FOFYC/nGPNbc99PKJSivNf8fQNV7 X-Received: by 10.112.32.163 with SMTP id k3mr311895lbi.17.1415792327963; Wed, 12 Nov 2014 03:38:47 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.200 with SMTP id y8ls465742lad.14.gmail; Wed, 12 Nov 2014 03:38:47 -0800 (PST) X-Received: by 10.112.62.166 with SMTP id z6mr14677013lbr.74.1415792327665; Wed, 12 Nov 2014 03:38:47 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id ay11si34446858lab.132.2014.11.12.03.38.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Nov 2014 03:38:47 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id 10so8992422lbg.7 for ; Wed, 12 Nov 2014 03:38:47 -0800 (PST) X-Received: by 10.152.116.102 with SMTP id jv6mr21829413lab.40.1415792327196; Wed, 12 Nov 2014 03:38:47 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp407763lbc; Wed, 12 Nov 2014 03:38:46 -0800 (PST) X-Received: by 10.194.246.167 with SMTP id xx7mr62006322wjc.118.1415792324731; Wed, 12 Nov 2014 03:38:44 -0800 (PST) Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com. [74.125.82.43]) by mx.google.com with ESMTPS id lk2si39711950wjc.58.2014.11.12.03.38.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Nov 2014 03:38:44 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.43 as permitted sender) client-ip=74.125.82.43; Received: by mail-wg0-f43.google.com with SMTP id y10so14061255wgg.16 for ; Wed, 12 Nov 2014 03:38:44 -0800 (PST) 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 Cc: Daniel Thompson , dri-devel@lists.freedesktop.org, Rob Clark , Benjamin Gaignard , linux-kernel@vger.kernel.org, patches@linaro.org, linaro-kernel@lists.linaro.org, John Stultz , Sumit Semwal 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> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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,