1 /* 2 * Copyright (C) 2019-2020 Collabora Ltd. 3 * Copyright (C) 2019 Alyssa Rosenzweig 4 * Copyright (C) 2014-2017 Broadcom 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a 7 * copy of this software and associated documentation files (the "Software"), 8 * to deal in the Software without restriction, including without limitation 9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 * and/or sell copies of the Software, and to permit persons to whom the 11 * Software is furnished to do so, subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice (including the next 14 * paragraph) shall be included in all copies or substantial portions of the 15 * Software. 16 * 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 * SOFTWARE. 24 * 25 */ 26 27 #ifndef __PAN_SCOREBOARD_H__ 28 #define __PAN_SCOREBOARD_H__ 29 30 #include "midgard_pack.h" 31 #include "pan_pool.h" 32 33 struct pan_scoreboard { 34 /* The first job in the batch */ 35 mali_ptr first_job; 36 37 /* The number of jobs in the primary batch, essentially */ 38 unsigned job_index; 39 40 /* A CPU-side pointer to the previous job for next_job linking */ 41 struct mali_job_header_packed *prev_job; 42 43 /* A CPU-side pointer to the first tiler job for dep updates when 44 * injecting a reload tiler job. 45 */ 46 struct mali_job_header_packed *first_tiler; 47 uint32_t first_tiler_dep1; 48 49 /* The dependency for tiler jobs (i.e. the index of the last emitted 50 * tiler job, or zero if none have been emitted) */ 51 unsigned tiler_dep; 52 53 /* The job index of the WRITE_VALUE job (before it has been created) */ 54 unsigned write_value_index; 55 }; 56 57 unsigned 58 panfrost_add_job( 59 struct pan_pool *pool, 60 struct pan_scoreboard *scoreboard, 61 enum mali_job_type type, 62 bool barrier, 63 unsigned local_dep, 64 const struct panfrost_ptr *job, 65 bool inject); 66 67 void panfrost_scoreboard_initialize_tiler( 68 struct pan_pool *pool, 69 struct pan_scoreboard *scoreboard, 70 mali_ptr polygon_list); 71 72 #endif 73