i965/drm: Make brw_bo_alloc_tiled flags parameter 32-bit.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 11 Apr 2017 07:02:35 +0000 (00:02 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 12 Apr 2017 04:07:45 +0000 (21:07 -0700)
unsigned long is a terrible type for a bitfield - if you need fewer
than 32 bits, it wastes 4 bytes.  If you need more, things break on
32-bit builds.  Just use unsigned.

Even that's a bit ridiculous as we only have one flag today.
Still, it's at least somewhat better.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
src/mesa/drivers/dri/i965/brw_bufmgr.c
src/mesa/drivers/dri/i965/brw_bufmgr.h
src/mesa/drivers/dri/i965/intel_screen.c

index 391de547f6bf1f519ab31fcda08da6df4e5788b0..7f2aa9d85ec0add2ebac752f928c5d24072d68a0 100644 (file)
@@ -245,7 +245,7 @@ static struct brw_bo *
 bo_alloc_internal(struct brw_bufmgr *bufmgr,
                   const char *name,
                   uint64_t size,
-                  unsigned long flags,
+                  unsigned flags,
                   uint32_t tiling_mode,
                   uint32_t stride, uint64_t alignment)
 {
@@ -377,7 +377,7 @@ brw_bo_alloc(struct brw_bufmgr *bufmgr,
 struct brw_bo *
 brw_bo_alloc_tiled(struct brw_bufmgr *bufmgr, const char *name,
                    int x, int y, int cpp, uint32_t tiling,
-                   uint32_t *pitch, unsigned long flags)
+                   uint32_t *pitch, unsigned flags)
 {
    uint64_t size;
    uint32_t stride;
index 46456edb121cc09af7c44de8356e995b0187a90e..1b1790a8cb4257953d2565a9a28d19183659daf4 100644 (file)
@@ -162,7 +162,7 @@ struct brw_bo *brw_bo_alloc_tiled(struct brw_bufmgr *bufmgr,
                                   int x, int y, int cpp,
                                   uint32_t tiling_mode,
                                   uint32_t *pitch,
-                                  unsigned long flags);
+                                  unsigned flags);
 
 /** Takes a reference on a buffer object */
 void brw_bo_reference(struct brw_bo *bo);
index be5b195eb319b21f3c3f620ded0017fed1907eed..23a4bd6d6c89c0c83ae3813861a0da53e71659d9 100644 (file)
@@ -1290,7 +1290,7 @@ static bool
 intel_detect_swizzling(struct intel_screen *screen)
 {
    struct brw_bo *buffer;
-   unsigned long flags = 0;
+   unsigned flags = 0;
    uint32_t aligned_pitch;
    uint32_t tiling = I915_TILING_X;
    uint32_t swizzle_mode = 0;