Path: blob/21.2-virgl/src/freedreno/decode/script.h
4565 views
/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */12/*3* Copyright (C) 2014 Rob Clark <[email protected]>4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the "Software"),7* to deal in the Software without restriction, including without limitation8* the rights to use, copy, modify, merge, publish, distribute, sublicense,9* and/or sell copies of the Software, and to permit persons to whom the10* Software is furnished to do so, subject to the following conditions:11*12* The above copyright notice and this permission notice (including the next13* paragraph) shall be included in all copies or substantial portions of the14* Software.15*16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR17* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,18* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL19* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER20* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,21* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE22* SOFTWARE.23*24* Authors:25* Rob Clark <[email protected]>26*/2728#ifndef SCRIPT_H_29#define SCRIPT_H_3031#include <stdint.h>3233// XXX make script support optional34#define ENABLE_SCRIPTING 13536#ifdef ENABLE_SCRIPTING3738/* called at start to load the script: */39int script_load(const char *file);4041/* called at start of each cmdstream file: */42void script_start_cmdstream(const char *name);4344/* called at each DRAW_INDX, calls script drawidx fxn to process45* the current state46*/47__attribute__((weak))48void script_draw(const char *primtype, uint32_t nindx);4950struct rnn;51struct rnndomain;52__attribute__((weak))53void script_packet(uint32_t *dwords, uint32_t sizedwords,54struct rnn *rnn,55struct rnndomain *dom);5657/* maybe at some point it is interesting to add additional script58* hooks for CP_EVENT_WRITE, etc?59*/6061/* called at end of each cmdstream file: */62void script_end_cmdstream(void);6364void script_start_submit(void);65void script_end_submit(void);6667/* called after last cmdstream file: */68void script_finish(void);6970#else71// TODO no-op stubs..72#endif7374#endif /* SCRIPT_H_ */757677