/*1* Copyright © 2018 Intel Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*22*/2324#ifndef INTEL_AUB_MEM25#define INTEL_AUB_MEM2627#include <stdint.h>2829#include "util/list.h"30#include "util/rb_tree.h"3132#include "dev/intel_device_info.h"33#include "common/intel_decoder.h"3435#ifdef __cplusplus36extern "C" {37#endif3839struct aub_mem {40uint64_t pml4;4142int mem_fd;43off_t mem_fd_len;4445struct list_head maps;46struct rb_tree ggtt;47struct rb_tree mem;48};4950bool aub_mem_init(struct aub_mem *mem);51void aub_mem_fini(struct aub_mem *mem);5253void aub_mem_clear_bo_maps(struct aub_mem *mem);5455void aub_mem_phys_write(void *mem, uint64_t virt_address,56const void *data, uint32_t size);57void aub_mem_ggtt_write(void *mem, uint64_t virt_address,58const void *data, uint32_t size);59void aub_mem_ggtt_entry_write(void *mem, uint64_t virt_address,60const void *data, uint32_t size);61void aub_mem_local_write(void *mem, uint64_t virt_address,62const void *data, uint32_t size);6364struct intel_batch_decode_bo aub_mem_get_ggtt_bo(void *mem, uint64_t address);65struct intel_batch_decode_bo aub_mem_get_ppgtt_bo(void *mem, uint64_t address);6667struct intel_batch_decode_bo aub_mem_get_phys_addr_data(struct aub_mem *mem, uint64_t phys_addr);68struct intel_batch_decode_bo aub_mem_get_ppgtt_addr_data(struct aub_mem *mem, uint64_t virt_addr);6970struct intel_batch_decode_bo aub_mem_get_ppgtt_addr_aub_data(struct aub_mem *mem, uint64_t virt_addr);717273#ifdef __cplusplus74}75#endif7677#endif /* INTEL_AUB_MEM */787980