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: 10616 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0245D23E56 for ; Thu, 9 Aug 2012 09:36:57 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id AFD66A189C3 for ; Thu, 9 Aug 2012 09:36:56 +0000 (UTC) Received: by ghbg10 with SMTP id g10so206999ghb.11 for ; Thu, 09 Aug 2012 02:36:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-tm-as-mml:cc:subject:x-beenthere :x-mailman-version:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=4kwERgkrb3XzYP98eFs19/ILJCzJAb1gSQ8xyPVsSVM=; b=Ps2iYxuRo+c9cFy7L4Um0jXDy6p+eIahK5pMLHEPVbAMFd0J+Lp7aW/GirlHksu4Ti S/UEdHv7mdgv960IssYagBXevaiF2+CdLhlcvvoMhfsIxNY6X27NTkedo5avJpxXnFTp fDnua/YFrvFUc2qUExn0eX9AA/xM/e8Qe4xD4ove17pQr/A+KMNkyLOgKqiHdZWZIanX jvpsJIhmSTmdbEAT7syDE9MkzE58f6MfEz775Uzb9nB99H9vTZtGihimVd9VwTDryTD4 MmaoISPJ90pAYR4KJn+PgdxUb0aXZYA5c9s/BcSaoZnPMbTs7wKcdThrwEvCcukqB+F1 Y0Vg== Received: by 10.50.95.230 with SMTP id dn6mr406671igb.16.1344505015961; Thu, 09 Aug 2012 02:36:55 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.200 with SMTP id ew8csp418igc; Thu, 9 Aug 2012 02:36:55 -0700 (PDT) Received: by 10.180.89.235 with SMTP id br11mr1387529wib.3.1344505014700; Thu, 09 Aug 2012 02:36:54 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id p10si915908wic.16.2012.08.09.02.36.53; Thu, 09 Aug 2012 02:36:54 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SzPAi-00086S-Hp; Thu, 09 Aug 2012 09:36:52 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SzPAg-00086N-Lz for linaro-mm-sig@lists.linaro.org; Thu, 09 Aug 2012 09:36:51 +0000 Received: from epcpsbgm1.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 <0M8H006TQEP6SRW0@mailout4.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 09 Aug 2012 18:36:48 +0900 (KST) X-AuditID: cbfee61a-b7f616d000004b7e-35-502384b09e9d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id E1.4A.19326.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> for linaro-mm-sig@lists.linaro.org; Thu, 09 Aug 2012 18:36:48 +0900 (KST) From: Tomasz Stanislawski To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org 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+NgFnrIJMWRmVeSWpSXmKPExsVy+t9jAd0NLcoBBh0bzSy+XHnI5MDocfvf Y+YAxigum5TUnMyy1CJ9uwSujI7t81gKXkhWrFx4iqWBcYFYFyMHh4SAicSmDaVdjJxAppjE hXvr2UBsIYFFjBLP3xV0MXIB2WuZJCYt7GACSbAB1R9b8pkRxBYRcJA4fXcWM4jNLDCHWeLl lkAQW1jAQ2Lz5IssIDaLgKpEx+GlYL28QPEVZ76zQSyTl3h6vw/M5hTwlFi8+jUzxGIPiVt9 V5gmMPIuYGRYxSiaWpBcUJyUnmuoV5yYW1yal66XnJ+7iRHs8WdSOxhXNlgcYhTgYFTi4dXY oBQgxJpYVlyZe4hRgoNZSYT3VrlygBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXFeY++v/kIC6Ykl qdmpqQWpRTBZJg5OqQbGxfkOyaF7tgXlrFr2UyipXbXB59ks2+DsziUl6hsqe5RXfcnLm1y+ 7LbpfIZPW6aZtN+TOLbXcUF0bCnDZGWOQ5lLHntZ7ThW9GzC5TR74W1c+80MDmw+Y7L+88+d FRlML2auELrFf8nApcenW+1a6ML756eLmz9N1jq/RXZSq2br32If07t7lFiKMxINtZiLihMB jDfc4fQBAAA= X-TM-AS-MML: No Cc: linaro-mm-sig@lists.linaro.org, jy0922.shim@samsung.com, pawel@osciak.com, gregkh@linuxfoundation.org, sw0312.kim@samsung.com, linux-kernel@vger.kernel.org, inki.dae@samsung.com, kyungmin.park@samsung.com, laurent.pinchart@ideasonboard.com, airlied@redhat.com, dan.j.williams@intel.com Subject: [Linaro-mm-sig] [PATCH v2 2/2] drm: set owner field to for all DMABUF exporters X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQlOXSFMK4N7gopulWcXjZxoTVusjwxuyRN3sUgeAF3nwC1jq9Jwb4NffRJjKHwNB9+O/i/7 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,