Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165102AbdD1Jkn (ORCPT ); Fri, 28 Apr 2017 05:40:43 -0400 Received: from mga03.intel.com ([134.134.136.65]:21992 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163662AbdD1JkA (ORCPT ); Fri, 28 Apr 2017 05:40:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,387,1488873600"; d="scan'208";a="1124389926" From: Xiaoguang Chen To: kraxel@redhat.com, alex.williamson@redhat.com, intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, zhi.a.wang@intel.com, zhenyuw@linux.intel.com, linux-kernel@vger.kernel.org, zhiyuan.lv@intel.com, kevin.tian@intel.com Cc: Xiaoguang Chen Subject: [RFC PATCH 4/6] drm/i915: export i915 dmabuf_ops Date: Fri, 28 Apr 2017 17:35:28 +0800 Message-Id: <1493372130-27727-5-git-send-email-xiaoguang.chen@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1493372130-27727-1-git-send-email-xiaoguang.chen@intel.com> References: <1493372130-27727-1-git-send-email-xiaoguang.chen@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1379 Lines: 37 GVT-g will use i915's dmabuf_ops to implement its own dmabuf so exporting it. Signed-off-by: Xiaoguang Chen --- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/i915_gem_dmabuf.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index bb6fc1e..470d461 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -3476,6 +3476,8 @@ struct drm_gem_object *i915_gem_prime_import(struct drm_device *dev, struct dma_buf *i915_gem_prime_export(struct drm_device *dev, struct drm_gem_object *gem_obj, int flags); +extern const struct dma_buf_ops i915_dmabuf_ops; + static inline struct i915_hw_ppgtt * i915_vm_to_ppgtt(struct i915_address_space *vm) { diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c index 11898cd..4dafc99 100644 --- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c +++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c @@ -196,7 +196,7 @@ static int i915_gem_end_cpu_access(struct dma_buf *dma_buf, enum dma_data_direct return err; } -static const struct dma_buf_ops i915_dmabuf_ops = { +const struct dma_buf_ops i915_dmabuf_ops = { .map_dma_buf = i915_gem_map_dma_buf, .unmap_dma_buf = i915_gem_unmap_dma_buf, .release = drm_gem_dmabuf_release, -- 1.9.1