cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

intel_gt_buffer_pool.h (1045B)


      1/* SPDX-License-Identifier: MIT */
      2/*
      3 * Copyright © 2014-2018 Intel Corporation
      4 */
      5
      6#ifndef INTEL_GT_BUFFER_POOL_H
      7#define INTEL_GT_BUFFER_POOL_H
      8
      9#include <linux/types.h>
     10
     11#include "i915_active.h"
     12#include "intel_gt_buffer_pool_types.h"
     13
     14struct intel_gt;
     15struct i915_request;
     16
     17struct intel_gt_buffer_pool_node *
     18intel_gt_get_buffer_pool(struct intel_gt *gt, size_t size,
     19			 enum i915_map_type type);
     20
     21void intel_gt_buffer_pool_mark_used(struct intel_gt_buffer_pool_node *node);
     22
     23static inline int
     24intel_gt_buffer_pool_mark_active(struct intel_gt_buffer_pool_node *node,
     25				 struct i915_request *rq)
     26{
     27	/* did we call mark_used? */
     28	GEM_WARN_ON(!node->pinned);
     29
     30	return i915_active_add_request(&node->active, rq);
     31}
     32
     33static inline void
     34intel_gt_buffer_pool_put(struct intel_gt_buffer_pool_node *node)
     35{
     36	i915_active_release(&node->active);
     37}
     38
     39void intel_gt_init_buffer_pool(struct intel_gt *gt);
     40void intel_gt_flush_buffer_pool(struct intel_gt *gt);
     41void intel_gt_fini_buffer_pool(struct intel_gt *gt);
     42
     43#endif /* INTEL_GT_BUFFER_POOL_H */