From patchwork Mon Dec 14 07:24:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Song, Ruiling" X-Patchwork-Id: 7841881 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 345CCBEEE1 for ; Mon, 14 Dec 2015 07:24:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39B60202B8 for ; Mon, 14 Dec 2015 07:24:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 071F020272 for ; Mon, 14 Dec 2015 07:24:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 289246E175; Sun, 13 Dec 2015 23:24:34 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id EB6DE6E175; Sun, 13 Dec 2015 23:24:32 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 13 Dec 2015 23:24:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,426,1444719600"; d="scan'208";a="860140556" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 13 Dec 2015 23:24:32 -0800 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 13 Dec 2015 23:24:32 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 13 Dec 2015 23:24:31 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.158]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.190]) with mapi id 14.03.0248.002; Mon, 14 Dec 2015 15:24:29 +0800 From: "Song, Ruiling" To: "krh@bitplanet.net" , "Winiarski, Michal" Thread-Topic: [Intel-gfx] [RFC libdrm] intel: Add support for softpin Thread-Index: AQHQ6wkYA4rYjBxNGkSxAy3chW7KQp7F2V/wgAQsYgCAAJNuUA== Date: Mon, 14 Dec 2015 07:24:29 +0000 Message-ID: <148B1B7A67D1C24B9EF0BE42EA4977064E408E32@shsmsx102.ccr.corp.intel.com> References: <1441807630-20072-1-git-send-email-michal.winiarski@intel.com> <1441807630-20072-4-git-send-email-michal.winiarski@intel.com> <148B1B7A67D1C24B9EF0BE42EA4977064E408D75@shsmsx102.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsIiwiaWQiOiJhMTllOWRkOC00NTAyLTQ2N2ItYWViZi05NzY5YzNiY2E5M2MiLCJwcm9wcyI6W3sibiI6IkludGVsRGF0YUNsYXNzaWZpY2F0aW9uIiwidmFscyI6W3sidmFsdWUiOiJDVFBfSUMifV19XX0sIlN1YmplY3RMYWJlbHMiOltdLCJUTUNWZXJzaW9uIjoiMTUuNC4xMC4xOSIsIlRydXN0ZWRMYWJlbEhhc2giOiJDdkhJRmQ0MUZ5WlRlY2ttQzJSeUtiWHZnaDFTVDJLN1V4TkhDdlZSQk1VPSJ9 x-inteldataclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Cc: "mesa-dev@lists.freedesktop.org" , "intel-gfx@lists.freedesktop.org" , Ben Widawsky , "dri-devel@lists.freedesktop.org" Subject: Re: [Intel-gfx] [RFC libdrm] intel: Add support for softpin X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 > -----Original Message----- > From: hoegsberg@gmail.com [mailto:hoegsberg@gmail.com] On Behalf Of > Kristian H?gsberg > Sent: Monday, December 14, 2015 1:34 PM > To: Song, Ruiling > Cc: Winiarski, Michal ; intel- > gfx@lists.freedesktop.org; mesa-dev@lists.freedesktop.org; Ben Widawsky > ; dri-devel@lists.freedesktop.org > Subject: Re: [Intel-gfx] [RFC libdrm] intel: Add support for softpin > > On Sun, Dec 13, 2015 at 7:17 PM, Song, Ruiling > wrote: > >> -----Original Message----- > >> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On > Behalf > >> Of Micha? Winiarski > >> Sent: Wednesday, September 9, 2015 10:07 PM > >> To: intel-gfx@lists.freedesktop.org > >> Cc: Ben Widawsky ; dri- > devel@lists.freedesktop.org; > >> mesa-dev@lists.freedesktop.org > >> Subject: [Intel-gfx] [RFC libdrm] intel: Add support for softpin > >> > >> Softpin allows userspace to take greater control of GPU virtual address > >> space and eliminates the need of relocations. It can also be used to > >> mirror addresses between GPU and CPU (shared virtual memory). > >> Calls to drm_intel_bo_emit_reloc are still required to build the list of > >> drm_i915_gem_exec_objects at exec time, but no entries in relocs are > >> created. Self-relocs don't make any sense for softpinned objects and can > >> indicate a programming errors, thus are forbidden. Softpinned objects > >> are marked by asterisk in debug dumps. > >> > >> Cc: Thomas Daniel > >> Cc: Kristian Høgsberg > >> Cc: Zou Nanhai > >> Cc: Michel Thierry > >> Cc: Ben Widawsky > >> Cc: Chris Wilson > >> Signed-off-by: Micha? Winiarski > >> --- > >> include/drm/i915_drm.h | 4 +- > >> intel/intel_bufmgr.c | 9 +++ > >> intel/intel_bufmgr.h | 1 + > >> intel/intel_bufmgr_gem.c | 176 > >> ++++++++++++++++++++++++++++++++++++++++------ > >> intel/intel_bufmgr_priv.h | 7 ++ > >> 5 files changed, 173 insertions(+), 24 deletions(-) > > > > Will anybody help to push the patch to libdrm? Beignet highly depend on > this to implement ocl2.0 svm. > > Is the kernel patch upstream? Yes, the kernel patch already merged, see: http://cgit.freedesktop.org/drm-intel/commit/?id=506a8e87d8d2746b9e9d2433503fe237c54e4750 I find below line of code in libdrm does not match the kernel version. The kernel patch defined as: "#define EXEC_OBJECT_PINNED (1<<4)", but this patch defined it as (1<<3). Hello Michal, Could you help to rebase the patch against: [Intel-gfx] [PATCH libdrm v4 0/2] 48-bit virtual address support in i915 I think we need both 48bit & softpin in libdrm. Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index ded43b1..2b99fc6 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -350,6 +350,7 @@ typedef struct drm_i915_irq_wait { #define I915_PARAM_REVISION 32 #define I915_PARAM_SUBSLICE_TOTAL 33 #define I915_PARAM_EU_TOTAL 34 +#define I915_PARAM_HAS_EXEC_SOFTPIN 37 typedef struct drm_i915_getparam { int param; @@ -680,7 +681,8 @@ struct drm_i915_gem_exec_object2 { #define EXEC_OBJECT_NEEDS_FENCE (1<<0) #define EXEC_OBJECT_NEEDS_GTT (1<<1) #define EXEC_OBJECT_WRITE (1<<2) -#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_WRITE<<1) +#define EXEC_OBJECT_PINNED (1<<3) +#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_PINNED<<1) __u64 flags; _______________________________________________