Path: blob/21.2-virgl/src/gallium/drivers/lima/lima_job.h
4565 views
/*1* Copyright (C) 2018-2019 Lima Project2*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 shall be included in11* all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR17* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19* OTHER DEALINGS IN THE SOFTWARE.20*21*/2223#ifndef H_LIMA_JOB24#define H_LIMA_JOB2526#include <stdbool.h>27#include <stdint.h>2829#include <util/u_dynarray.h>3031#include <pipe/p_state.h>3233#define MAX_DRAWS_PER_JOB 25003435struct lima_context;36struct lima_bo;37struct lima_dump;38struct pipe_surface;3940struct lima_job_key {41struct pipe_surface *cbuf;42struct pipe_surface *zsbuf;43};4445struct lima_job_clear {46unsigned buffers;47uint32_t color_8pc;48uint32_t depth;49uint32_t stencil;50uint64_t color_16pc;51};5253struct lima_job_fb_info {54int width, height;55int tiled_w, tiled_h;56int shift_w, shift_h;57int block_w, block_h;58int shift_min;59};6061struct lima_job {62int fd;63struct lima_context *ctx;6465struct util_dynarray gem_bos[2];66struct util_dynarray bos[2];6768struct lima_job_key key;6970struct util_dynarray vs_cmd_array;71struct util_dynarray plbu_cmd_array;72struct util_dynarray plbu_cmd_head;7374unsigned resolve;7576int pp_max_stack_size;7778struct pipe_scissor_state damage_rect;7980struct lima_job_clear clear;8182struct lima_job_fb_info fb;8384int draws;8586/* for dump command stream */87struct lima_dump *dump;88};8990static inline bool91lima_job_has_draw_pending(struct lima_job *job)92{93return !!job->plbu_cmd_array.size;94}9596struct lima_job *lima_job_get(struct lima_context *ctx);9798bool lima_job_add_bo(struct lima_job *job, int pipe,99struct lima_bo *bo, uint32_t flags);100void *lima_job_create_stream_bo(struct lima_job *job, int pipe,101unsigned size, uint32_t *va);102103void lima_do_job(struct lima_job *job);104105bool lima_job_init(struct lima_context *ctx);106void lima_job_fini(struct lima_context *ctx);107108#endif109110111