aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_vm.c
diff options
context:
space:
mode:
authorMatthew Brost <matthew.brost@intel.com>2023-07-19 21:00:51 -0700
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 11:37:53 -0500
commit63412a5a6718771214900aec51fc9253b36efcc5 (patch)
tree32b6c2ae3f8b89687524ad23bf5436e312bbdadb /drivers/gpu/drm/xe/xe_vm.c
parent3daf694ccf8afb936e3508c98738d52b13941397 (diff)
drm/xe: Change tile masks from u64 to u8
This will save us a few bytes in the xe_vma structure. v2: Use hweight8 rather than hweight_long (Rodrigo) Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_vm.c')
-rw-r--r--drivers/gpu/drm/xe/xe_vm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 1ea4f20ac723..a01504ecd2af 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -871,7 +871,7 @@ static struct xe_vma *xe_vma_create(struct xe_vm *vm,
u64 start, u64 end,
bool read_only,
bool is_null,
- u64 tile_mask)
+ u8 tile_mask)
{
struct xe_vma *vma;
struct xe_tile *tile;
@@ -1579,7 +1579,7 @@ xe_vm_unbind_vma(struct xe_vma *vma, struct xe_engine *e,
struct dma_fence_array *cf = NULL;
struct xe_vm *vm = xe_vma_vm(vma);
int cur_fence = 0, i;
- int number_tiles = hweight_long(vma->tile_present);
+ int number_tiles = hweight8(vma->tile_present);
int err;
u8 id;
@@ -1654,7 +1654,7 @@ xe_vm_bind_vma(struct xe_vma *vma, struct xe_engine *e,
struct dma_fence_array *cf = NULL;
struct xe_vm *vm = xe_vma_vm(vma);
int cur_fence = 0, i;
- int number_tiles = hweight_long(vma->tile_mask);
+ int number_tiles = hweight8(vma->tile_mask);
int err;
u8 id;
@@ -2250,7 +2250,7 @@ static void print_op(struct xe_device *xe, struct drm_gpuva_op *op)
static struct drm_gpuva_ops *
vm_bind_ioctl_ops_create(struct xe_vm *vm, struct xe_bo *bo,
u64 bo_offset_or_userptr, u64 addr, u64 range,
- u32 operation, u64 tile_mask, u32 region)
+ u32 operation, u8 tile_mask, u32 region)
{
struct drm_gem_object *obj = bo ? &bo->ttm.base : NULL;
struct ww_acquire_ctx ww;
@@ -2354,7 +2354,7 @@ vm_bind_ioctl_ops_create(struct xe_vm *vm, struct xe_bo *bo,
}
static struct xe_vma *new_vma(struct xe_vm *vm, struct drm_gpuva_op_map *op,
- u64 tile_mask, bool read_only, bool is_null)
+ u8 tile_mask, bool read_only, bool is_null)
{
struct xe_bo *bo = op->gem.obj ? gem_to_xe_bo(op->gem.obj) : NULL;
struct xe_vma *vma;
@@ -3339,7 +3339,7 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
u64 addr = bind_ops[i].addr;
u32 op = bind_ops[i].op;
u64 obj_offset = bind_ops[i].obj_offset;
- u64 tile_mask = bind_ops[i].tile_mask;
+ u8 tile_mask = bind_ops[i].tile_mask;
u32 region = bind_ops[i].region;
ops[i] = vm_bind_ioctl_ops_create(vm, bos[i], obj_offset,