[Beignet] [PATCH 1/3] ocl20/runtime: take the first 64KB page table entries.

Ruiling Song ruiling.song at intel.com
Thu Nov 26 18:09:08 PST 2015


After we take first 64KB page table entries. we would make sure
the global memory will not be allocated in the range [0, 64KB].
this is needed, so that we can easily differentiate local/global
address space.

Signed-off-by: Ruiling Song <ruiling.song at intel.com>
---
 src/intel/intel_gpgpu.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/intel/intel_gpgpu.c b/src/intel/intel_gpgpu.c
index 110c36f..935595e 100644
--- a/src/intel/intel_gpgpu.c
+++ b/src/intel/intel_gpgpu.c
@@ -953,8 +953,13 @@ intel_gpgpu_state_init(intel_gpgpu_t *gpgpu,
 
   /* make sure aux buffer is page aligned */
   size_aux = ALIGN(size_aux, 4096);
+  // we need to take the first 64KB page table entry, so that global memory and
+  // local memory address space are separated. we may need a better way to do this.
+  if (size_aux < 64*1024) size_aux = 64*1024;
 
   bo = dri_bo_alloc(gpgpu->drv->bufmgr, "AUX_BUFFER", size_aux, 4096);
+  drm_intel_bo_set_softpin_offset(bo, 0);
+
   if (!bo || dri_bo_map(bo, 1) != 0) {
     fprintf(stderr, "%s:%d: %s.\n", __FILE__, __LINE__, strerror(errno));
     if (bo)
-- 
2.4.1



More information about the Beignet mailing list