mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
cb6d2467ac
Create an io-mapping to describe the CPU aperture for lmem. Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Cc: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20191025153728.23689-2-chris@chris-wilson.co.uk
41 lines
831 B
C
41 lines
831 B
C
// SPDX-License-Identifier: MIT
|
|
/*
|
|
* Copyright © 2019 Intel Corporation
|
|
*/
|
|
|
|
#include "i915_drv.h"
|
|
#include "intel_memory_region.h"
|
|
#include "gem/i915_gem_lmem.h"
|
|
#include "gem/i915_gem_region.h"
|
|
#include "intel_region_lmem.h"
|
|
|
|
static void
|
|
region_lmem_release(struct intel_memory_region *mem)
|
|
{
|
|
io_mapping_fini(&mem->iomap);
|
|
intel_memory_region_release_buddy(mem);
|
|
}
|
|
|
|
static int
|
|
region_lmem_init(struct intel_memory_region *mem)
|
|
{
|
|
int ret;
|
|
|
|
if (!io_mapping_init_wc(&mem->iomap,
|
|
mem->io_start,
|
|
resource_size(&mem->region)))
|
|
return -EIO;
|
|
|
|
ret = intel_memory_region_init_buddy(mem);
|
|
if (ret)
|
|
io_mapping_fini(&mem->iomap);
|
|
|
|
return ret;
|
|
}
|
|
|
|
const struct intel_memory_region_ops intel_region_lmem_ops = {
|
|
.init = region_lmem_init,
|
|
.release = region_lmem_release,
|
|
.create_object = __i915_gem_lmem_object_create,
|
|
};
|