aub_read.h revision 01e04c3f
1/* 2 * Copyright © 2018 Intel Corporation 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice (including the next 12 * paragraph) shall be included in all copies or substantial portions of the 13 * Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 * IN THE SOFTWARE. 22 * 23 */ 24 25#ifndef INTEL_AUB_READ 26#define INTEL_AUB_READ 27 28#include <stdint.h> 29 30#include "dev/gen_device_info.h" 31 32#ifdef __cplusplus 33extern "C" { 34#endif 35 36enum gen_engine { 37 GEN_ENGINE_RENDER = 1, 38 GEN_ENGINE_VIDEO = 2, 39 GEN_ENGINE_BLITTER = 3, 40}; 41 42struct aub_read { 43 /* Caller's data */ 44 void *user_data; 45 46 void (*error)(void *user_data, const void *aub_data, const char *msg); 47 48 void (*info)(void *user_data, int pci_id, const char *app_name); 49 50 void (*local_write)(void *user_data, uint64_t phys_addr, const void *data, uint32_t data_len); 51 void (*phys_write)(void *user_data, uint64_t phys_addr, const void *data, uint32_t data_len); 52 void (*ggtt_write)(void *user_data, uint64_t phys_addr, const void *data, uint32_t data_len); 53 void (*ggtt_entry_write)(void *user_data, uint64_t phys_addr, 54 const void *data, uint32_t data_len); 55 56 void (*reg_write)(void *user_data, uint32_t reg_offset, uint32_t reg_value); 57 58 void (*ring_write)(void *user_data, enum gen_engine engine, 59 const void *data, uint32_t data_len); 60 void (*execlist_write)(void *user_data, enum gen_engine engine, 61 uint64_t context_descriptor); 62 63 /* Reader's data */ 64 uint32_t render_elsp[4]; 65 int render_elsp_index; 66 uint32_t video_elsp[4]; 67 int video_elsp_index; 68 uint32_t blitter_elsp[4]; 69 int blitter_elsp_index; 70 71 struct gen_device_info devinfo; 72}; 73 74int aub_read_command(struct aub_read *read, const void *data, uint32_t data_len); 75 76#ifdef __cplusplus 77} 78#endif 79 80#endif /* INTEL_AUB_READ */ 81