From patchwork Thu Aug 9 09:36:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 1299651 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id BECDBDFF7B for ; Thu, 9 Aug 2012 09:37:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757391Ab2HIJgw (ORCPT ); Thu, 9 Aug 2012 05:36:52 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:16984 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756475Ab2HIJgu (ORCPT ); Thu, 9 Aug 2012 05:36:50 -0400 Received: from epcpsbgm2.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M8H00CCCEPCWYV0@mailout4.samsung.com>; Thu, 09 Aug 2012 18:36:49 +0900 (KST) X-AuditID: cbfee61b-b7f566d000005c8a-f2-502384b02b82 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 69.1D.23690.0B483205; Thu, 09 Aug 2012 18:36:48 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M8H00KSJEOOS280@mmp1.samsung.com>; Thu, 09 Aug 2012 18:36:48 +0900 (KST) From: Tomasz Stanislawski To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: airlied@redhat.com, m.szyprowski@samsung.com, t.stanislaws@samsung.com, kyungmin.park@samsung.com, laurent.pinchart@ideasonboard.com, sumit.semwal@linaro.org, inki.dae@samsung.com, daniel.vetter@ffwll.ch, rob@ti.com, pawel@osciak.com, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, jy0922.shim@samsung.com, sw0312.kim@samsung.com, dan.j.williams@intel.com Subject: [PATCH v2 2/2] drm: set owner field to for all DMABUF exporters Date: Thu, 09 Aug 2012 11:36:22 +0200 Message-id: <1344504982-30415-3-git-send-email-t.stanislaws@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1344504982-30415-1-git-send-email-t.stanislaws@samsung.com> References: <1344504982-30415-1-git-send-email-t.stanislaws@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOJMWRmVeSWpSXmKPExsVy+t9jAd0NLcoBBjd3Wltc3jWHzaJnw1ZW ByaPz5vkAhijuGxSUnMyy1KL9O0SuDI6ts9jKXghWbFy4SmWBsYFYl2MnBwSAiYSa3/NZYGw xSQu3FvP1sXIxSEksIhRYlfLZBYIp4tJYv2r98wgVWxAHceWfGYEsUUEHCRO350FFmcWmMMs 8XJLIIgtLOAhsXnyRbCpLAKqEh2HlzKB2LxA8RVnvrNBbJOXeHq/D8zmFPCUWLz6NdgcIaCa W31XmCYw8i5gZFjFKJpakFxQnJSea6RXnJhbXJqXrpecn7uJEez9Z9I7GFc1WBxiFOBgVOLh vbFFKUCINbGsuDL3EKMEB7OSCO+tcuUAId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rwm3l/9hQTS E0tSs1NTC1KLYLJMHJxSDYzZAZ8P/34QbDbvh59vQkb2k7sHin5ZBy5I0Niz1UusV/Mz/yx3 9v9zOTcIJ2RKZsY5Hsix3rxayOFvq6m9j1rzqW3s83zyP0dxVRS9vcdxyysjZu9W9iecV1/W 7sj7e1hl4pU5pZxC9+cks12qkvDU6dDg+sG17NOPPdeagps2/1312n7J4XdKLMUZiYZazEXF iQAb8Za1+gEAAA== X-TM-AS-MML: No Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch sets owner field in DMABUF operations for all DMABUF exporters in DRM subsystem. This prevents an exporting module from being unloaded while exported DMABUF descriptor is in use. Signed-off-by: Tomasz Stanislawski Acked-by: Sumit Semwal Acked-by: Daniel Vetter --- drivers/gpu/drm/exynos/exynos_drm_dmabuf.c | 1 + drivers/gpu/drm/i915/i915_gem_dmabuf.c | 1 + drivers/gpu/drm/nouveau/nouveau_prime.c | 1 + drivers/gpu/drm/radeon/radeon_prime.c | 1 + drivers/staging/omapdrm/omap_gem_dmabuf.c | 1 + 5 files changed, 5 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c index 613bf8a..cf3bc6d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c @@ -164,6 +164,7 @@ static void exynos_gem_dmabuf_kunmap(struct dma_buf *dma_buf, } static struct dma_buf_ops exynos_dmabuf_ops = { + .owner = THIS_MODULE, .map_dma_buf = exynos_gem_map_dma_buf, .unmap_dma_buf = exynos_gem_unmap_dma_buf, .kmap = exynos_gem_dmabuf_kmap, diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c index aa308e1..07ff03b 100644 --- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c +++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c @@ -152,6 +152,7 @@ static int i915_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct * } static const struct dma_buf_ops i915_dmabuf_ops = { + .owner = THIS_MODULE, .map_dma_buf = i915_gem_map_dma_buf, .unmap_dma_buf = i915_gem_unmap_dma_buf, .release = i915_gem_dmabuf_release, diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c index a25cf2c..8605033 100644 --- a/drivers/gpu/drm/nouveau/nouveau_prime.c +++ b/drivers/gpu/drm/nouveau/nouveau_prime.c @@ -127,6 +127,7 @@ static void nouveau_gem_prime_vunmap(struct dma_buf *dma_buf, void *vaddr) } static const struct dma_buf_ops nouveau_dmabuf_ops = { + .owner = THIS_MODULE, .map_dma_buf = nouveau_gem_map_dma_buf, .unmap_dma_buf = nouveau_gem_unmap_dma_buf, .release = nouveau_gem_dmabuf_release, diff --git a/drivers/gpu/drm/radeon/radeon_prime.c b/drivers/gpu/drm/radeon/radeon_prime.c index 6bef46a..4061fd3 100644 --- a/drivers/gpu/drm/radeon/radeon_prime.c +++ b/drivers/gpu/drm/radeon/radeon_prime.c @@ -127,6 +127,7 @@ static void radeon_gem_prime_vunmap(struct dma_buf *dma_buf, void *vaddr) mutex_unlock(&dev->struct_mutex); } const static struct dma_buf_ops radeon_dmabuf_ops = { + .owner = THIS_MODULE, .map_dma_buf = radeon_gem_map_dma_buf, .unmap_dma_buf = radeon_gem_unmap_dma_buf, .release = radeon_gem_dmabuf_release, diff --git a/drivers/staging/omapdrm/omap_gem_dmabuf.c b/drivers/staging/omapdrm/omap_gem_dmabuf.c index 42728e0..6a4dd67 100644 --- a/drivers/staging/omapdrm/omap_gem_dmabuf.c +++ b/drivers/staging/omapdrm/omap_gem_dmabuf.c @@ -179,6 +179,7 @@ out_unlock: } struct dma_buf_ops omap_dmabuf_ops = { + .owner = THIS_MODULE, .map_dma_buf = omap_gem_map_dma_buf, .unmap_dma_buf = omap_gem_unmap_dma_buf, .release = omap_gem_dmabuf_release,