linux/drivers/gpu/drm/i915/intel_memory_region.c

// SPDX-License-Identifier: MIT
/*
 * Copyright © 2019 Intel Corporation
 */

#include <linux/prandom.h>

#include <uapi/drm/i915_drm.h>

#include "intel_memory_region.h"
#include "i915_drv.h"
#include "i915_ttm_buddy_manager.h"

static const struct {} intel_region_map[] =;

static int __iopagetest(struct intel_memory_region *mem,
			u8 __iomem *va, int pagesize,
			u8 value, resource_size_t offset,
			const void *caller)
{}

static int iopagetest(struct intel_memory_region *mem,
		      resource_size_t offset,
		      const void *caller)
{}

static resource_size_t random_page(resource_size_t last)
{}

static int iomemtest(struct intel_memory_region *mem,
		     bool test_all,
		     const void *caller)
{}

struct intel_memory_region *
intel_memory_region_lookup(struct drm_i915_private *i915,
			   u16 class, u16 instance)
{}

struct intel_memory_region *
intel_memory_region_by_type(struct drm_i915_private *i915,
			    enum intel_memory_type mem_type)
{}

/**
 * intel_memory_region_reserve - Reserve a memory range
 * @mem: The region for which we want to reserve a range.
 * @offset: Start of the range to reserve.
 * @size: The size of the range to reserve.
 *
 * Return: 0 on success, negative error code on failure.
 */
int intel_memory_region_reserve(struct intel_memory_region *mem,
				resource_size_t offset,
				resource_size_t size)
{}

void intel_memory_region_debug(struct intel_memory_region *mr,
			       struct drm_printer *printer)
{}

static int intel_memory_region_memtest(struct intel_memory_region *mem,
				       void *caller)
{}

static const char *region_type_str(u16 type)
{}

struct intel_memory_region *
intel_memory_region_create(struct drm_i915_private *i915,
			   resource_size_t start,
			   resource_size_t size,
			   resource_size_t min_page_size,
			   resource_size_t io_start,
			   resource_size_t io_size,
			   u16 type,
			   u16 instance,
			   const struct intel_memory_region_ops *ops)
{}

void intel_memory_region_set_name(struct intel_memory_region *mem,
				  const char *fmt, ...)
{}

void intel_memory_region_avail(struct intel_memory_region *mr,
			       u64 *avail, u64 *visible_avail)
{}

void intel_memory_region_destroy(struct intel_memory_region *mem)
{}

/* Global memory region registration -- only slight layer inversions! */

int intel_memory_regions_hw_probe(struct drm_i915_private *i915)
{}

void intel_memory_regions_driver_release(struct drm_i915_private *i915)
{}

#if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
#include "selftests/intel_memory_region.c"
#include "selftests/mock_region.c"
#endif