From edf17dbdaa525fe3a9abbbfafa768c556cfd7af2 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 13 Jan 2014 14:14:36 -0800 Subject: intel: Create a new drm_intel_bo offset64 field. The existing 'offset' field is unfortunately typed as 'unsigned long', which is unfortunately only 4 bytes with a 32-bit userspace. Traditionally, the hardware has only supported 32-bit virtual addresses, so even though the kernel uses a __u64, the value would always fit. However, Broadwell supports 48-bit addressing. So with a 64-bit kernel, the card virtual address may be too large to fit in the 'offset' field. Ideally, we would change the type of 'offset' to be a uint64_t---but this would break the libdrm ABI. Instead, we create a new 'offset64' field to hold the full 64-bit value from the kernel, and store the 32-bit truncation in the existing 'offset' field, for compatibility. Signed-off-by: Kenneth Graunke Reviewed-by: Eric Anholt Reviewed-by: Ben Widawsky Reviewed-by: Ian Romanick --- intel/intel_bufmgr.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'intel/intel_bufmgr.h') diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h index 2eb9742b..9383c722 100644 --- a/intel/intel_bufmgr.h +++ b/intel/intel_bufmgr.h @@ -61,9 +61,8 @@ struct _drm_intel_bo { unsigned long align; /** - * Last seen card virtual address (offset from the beginning of the - * aperture) for the object. This should be used to fill relocation - * entries when calling drm_intel_bo_emit_reloc() + * Deprecated field containing (possibly the low 32-bits of) the last + * seen virtual card address. Use offset64 instead. */ unsigned long offset; @@ -84,6 +83,13 @@ struct _drm_intel_bo { * MM-specific handle for accessing object */ int handle; + + /** + * Last seen card virtual address (offset from the beginning of the + * aperture) for the object. This should be used to fill relocation + * entries when calling drm_intel_bo_emit_reloc() + */ + uint64_t offset64; }; enum aub_dump_bmp_format { -- cgit v1.2.3