Mesa (master): i965/drm: Make alignment parameter a uint64_t.

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Apr 12 04:11:54 UTC 2017


Module: Mesa
Branch: master
Commit: c85d6832fda15f59df786c5843e544ba0bb47b10
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c85d6832fda15f59df786c5843e544ba0bb47b10

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Apr 10 23:55:21 2017 -0700

i965/drm: Make alignment parameter a uint64_t.

Theoretically, with a 48-bit address space, we could have buffers
with an alignment of >= 4GB.  It's a bit silly, but the exec_object
structs (drm_i915_gem_exec_object2) use a __u64 for this, so we may
as well use the same type as the kernel API.

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

---

 src/mesa/drivers/dri/i965/brw_bufmgr.c | 4 ++--
 src/mesa/drivers/dri/i965/brw_bufmgr.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c b/src/mesa/drivers/dri/i965/brw_bufmgr.c
index 3dcd10b21f..40429d8e41 100644
--- a/src/mesa/drivers/dri/i965/brw_bufmgr.c
+++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c
@@ -247,7 +247,7 @@ bo_alloc_internal(struct brw_bufmgr *bufmgr,
                   unsigned long size,
                   unsigned long flags,
                   uint32_t tiling_mode,
-                  uint32_t stride, unsigned int alignment)
+                  uint32_t stride, uint64_t alignment)
 {
    struct brw_bo *bo;
    unsigned int page_size = getpagesize();
@@ -369,7 +369,7 @@ err:
 
 struct brw_bo *
 brw_bo_alloc(struct brw_bufmgr *bufmgr,
-             const char *name, unsigned long size, unsigned int alignment)
+             const char *name, unsigned long size, uint64_t alignment)
 {
    return bo_alloc_internal(bufmgr, name, size, 0, I915_TILING_NONE, 0, 0);
 }
diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.h b/src/mesa/drivers/dri/i965/brw_bufmgr.h
index 93a929d20e..764ffeedd0 100644
--- a/src/mesa/drivers/dri/i965/brw_bufmgr.h
+++ b/src/mesa/drivers/dri/i965/brw_bufmgr.h
@@ -60,7 +60,7 @@ struct brw_bo {
     *
     * Used for GTT mapping & pinning the object.
     */
-   unsigned long align;
+   uint64_t align;
 
    /**
     * Virtual address for accessing the buffer data.  Only valid while
@@ -140,7 +140,7 @@ struct brw_bo {
  * using bo_map() or brw_bo_map_gtt() to be used by the CPU.
  */
 struct brw_bo *brw_bo_alloc(struct brw_bufmgr *bufmgr, const char *name,
-                            unsigned long size, unsigned int alignment);
+                            unsigned long size, uint64_t alignment);
 
 /**
  * Allocate a tiled buffer object.




More information about the mesa-commit mailing list