anv: Convert drm_i915_gem_memory_class_instance to intel_memory_class_instance
Also using pointers to intel_device_info struct instead of replicate the same information. Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
This commit is contained in:

committed by
Marge Bot

parent
9fc224631c
commit
099b9e5058
@@ -1457,7 +1457,7 @@ anv_device_alloc_bo(struct anv_device *device,
|
||||
* one of them.
|
||||
*/
|
||||
if (anv_physical_device_has_vram(device->physical)) {
|
||||
struct drm_i915_gem_memory_class_instance regions[2];
|
||||
const struct intel_memory_class_instance *regions[2];
|
||||
uint32_t nregions = 0;
|
||||
|
||||
/* This always try to put the object in local memory. Here
|
||||
|
@@ -406,22 +406,16 @@ anv_init_meminfo(struct anv_physical_device *device, int fd)
|
||||
{
|
||||
const struct intel_device_info *devinfo = &device->info;
|
||||
|
||||
device->sys.region.memory_class = devinfo->mem.sram.mem.klass;
|
||||
device->sys.region.memory_instance = devinfo->mem.sram.mem.instance;
|
||||
device->sys.region = &devinfo->mem.sram.mem;
|
||||
device->sys.size =
|
||||
anv_compute_sys_heap_size(device, devinfo->mem.sram.mappable.size);
|
||||
device->sys.available = devinfo->mem.sram.mappable.free;
|
||||
|
||||
device->vram_mappable.region.memory_class = devinfo->mem.vram.mem.klass;
|
||||
device->vram_mappable.region.memory_instance =
|
||||
devinfo->mem.vram.mem.instance;
|
||||
device->vram_mappable.region = &devinfo->mem.vram.mem;
|
||||
device->vram_mappable.size = devinfo->mem.vram.mappable.size;
|
||||
device->vram_mappable.available = devinfo->mem.vram.mappable.free;
|
||||
|
||||
device->vram_non_mappable.region.memory_class =
|
||||
devinfo->mem.vram.mem.klass;
|
||||
device->vram_non_mappable.region.memory_instance =
|
||||
devinfo->mem.vram.mem.instance;
|
||||
device->vram_non_mappable.region = &devinfo->mem.vram.mem;
|
||||
device->vram_non_mappable.size = devinfo->mem.vram.unmappable.size;
|
||||
device->vram_non_mappable.available = devinfo->mem.vram.unmappable.free;
|
||||
|
||||
|
@@ -66,15 +66,23 @@ anv_gem_close(struct anv_device *device, uint32_t gem_handle)
|
||||
uint32_t
|
||||
anv_gem_create_regions(struct anv_device *device, uint64_t anv_bo_size,
|
||||
uint32_t flags, uint32_t num_regions,
|
||||
struct drm_i915_gem_memory_class_instance *regions)
|
||||
const struct intel_memory_class_instance **regions)
|
||||
{
|
||||
struct drm_i915_gem_memory_class_instance i915_regions[2];
|
||||
|
||||
/* Check for invalid flags */
|
||||
assert((flags & ~I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS) == 0);
|
||||
assert(num_regions <= ARRAY_SIZE(i915_regions));
|
||||
|
||||
for (uint32_t i = 0; i < num_regions; i++) {
|
||||
i915_regions[i].memory_class = regions[i]->klass;
|
||||
i915_regions[i].memory_instance = regions[i]->instance;
|
||||
}
|
||||
|
||||
struct drm_i915_gem_create_ext_memory_regions ext_regions = {
|
||||
.base = { .name = I915_GEM_CREATE_EXT_MEMORY_REGIONS },
|
||||
.num_regions = num_regions,
|
||||
.regions = (uintptr_t)regions,
|
||||
.regions = (uintptr_t)i915_regions,
|
||||
};
|
||||
|
||||
struct drm_i915_gem_create_ext gem_create = {
|
||||
|
@@ -48,7 +48,7 @@ anv_gem_close(struct anv_device *device, uint32_t gem_handle)
|
||||
uint32_t
|
||||
anv_gem_create_regions(struct anv_device *device, uint64_t anv_bo_size,
|
||||
uint32_t flags, uint32_t num_regions,
|
||||
struct drm_i915_gem_memory_class_instance *regions)
|
||||
const struct intel_memory_class_instance **regions)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@@ -896,7 +896,7 @@ struct anv_memory_heap {
|
||||
};
|
||||
|
||||
struct anv_memregion {
|
||||
struct drm_i915_gem_memory_class_instance region;
|
||||
const struct intel_memory_class_instance *region;
|
||||
uint64_t size;
|
||||
uint64_t available;
|
||||
};
|
||||
@@ -1349,7 +1349,7 @@ uint32_t anv_gem_create(struct anv_device *device, uint64_t size);
|
||||
void anv_gem_close(struct anv_device *device, uint32_t gem_handle);
|
||||
uint32_t anv_gem_create_regions(struct anv_device *device, uint64_t anv_bo_size,
|
||||
uint32_t flags, uint32_t num_regions,
|
||||
struct drm_i915_gem_memory_class_instance *regions);
|
||||
const struct intel_memory_class_instance **regions);
|
||||
uint32_t anv_gem_userptr(struct anv_device *device, void *mem, size_t size);
|
||||
int anv_gem_wait(struct anv_device *device, uint32_t gem_handle, int64_t *timeout_ns);
|
||||
int anv_gem_set_tiling(struct anv_device *device, uint32_t gem_handle,
|
||||
|
Reference in New Issue
Block a user