/* * SPDX-License-Identifier: MIT * * Copyright © 2014-2016 Intel Corporation */ #include <linux/scatterlist.h> #include <linux/slab.h> #include "i915_drv.h" #include "i915_gem.h" #include "i915_gem_internal.h" #include "i915_gem_object.h" #include "i915_scatterlist.h" #include "i915_utils.h" #define QUIET … #define MAYFAIL … static void internal_free_pages(struct sg_table *st) { … } static int i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj) { … } static void i915_gem_object_put_pages_internal(struct drm_i915_gem_object *obj, struct sg_table *pages) { … } static const struct drm_i915_gem_object_ops i915_gem_object_internal_ops = …; struct drm_i915_gem_object * __i915_gem_object_create_internal(struct drm_i915_private *i915, const struct drm_i915_gem_object_ops *ops, phys_addr_t size) { … } /** * i915_gem_object_create_internal: create an object with volatile pages * @i915: the i915 device * @size: the size in bytes of backing storage to allocate for the object * * Creates a new object that wraps some internal memory for private use. * This object is not backed by swappable storage, and as such its contents * are volatile and only valid whilst pinned. If the object is reaped by the * shrinker, its pages and data will be discarded. Equally, it is not a full * GEM object and so not valid for access from userspace. This makes it useful * for hardware interfaces like ringbuffers (which are pinned from the time * the request is written to the time the hardware stops accessing it), but * not for contexts (which need to be preserved when not active for later * reuse). Note that it is not cleared upon allocation. */ struct drm_i915_gem_object * i915_gem_object_create_internal(struct drm_i915_private *i915, phys_addr_t size) { … }