Path: blob/21.2-virgl/src/gallium/drivers/panfrost/pan_screen.h
4570 views
/**************************************************************************1*2* Copyright 2018-2019 Alyssa Rosenzweig3* Copyright 2018-2019 Collabora, Ltd.4* All Rights Reserved.5*6* Permission is hereby granted, free of charge, to any person obtaining a7* copy of this software and associated documentation files (the8* "Software"), to deal in the Software without restriction, including9* without limitation the rights to use, copy, modify, merge, publish,10* distribute, sub license, and/or sell copies of the Software, and to11* permit persons to whom the Software is furnished to do so, subject to12* the following conditions:13*14* The above copyright notice and this permission notice (including the15* next paragraph) shall be included in all copies or substantial portions16* of the Software.17*18* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS19* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF20* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.21* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR22* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,23* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE24* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.25*26**************************************************************************/2728#ifndef PAN_SCREEN_H29#define PAN_SCREEN_H3031#include <xf86drm.h>32#include "pipe/p_screen.h"33#include "pipe/p_defines.h"34#include "renderonly/renderonly.h"35#include "util/u_dynarray.h"36#include "util/bitset.h"37#include "util/set.h"3839#include "pan_device.h"40#include "pan_mempool.h"4142struct panfrost_batch;43struct panfrost_context;44struct panfrost_resource;45struct panfrost_shader_state;46struct pan_fb_info;4748/* Virtual table of per-generation (GenXML) functions */4950struct panfrost_vtable {51/* Prepares the renderer state descriptor for a given compiled shader,52* and if desired uploads it as well */53void (*prepare_rsd)(struct panfrost_device *,54struct panfrost_shader_state *,55struct panfrost_pool *, bool);5657/* Emits a thread local storage descriptor */58void (*emit_tls)(struct panfrost_batch *);5960/* Emits a framebuffer descriptor */61void (*emit_fbd)(struct panfrost_batch *, const struct pan_fb_info *);6263/* Emits a fragment job */64mali_ptr (*emit_fragment_job)(struct panfrost_batch *, const struct pan_fb_info *);6566/* General destructor */67void (*screen_destroy)(struct pipe_screen *);6869/* Preload framebuffer */70void (*preload)(struct panfrost_batch *, struct pan_fb_info *);71};7273struct panfrost_screen {74struct pipe_screen base;75struct panfrost_device dev;76struct {77struct panfrost_pool bin_pool;78struct panfrost_pool desc_pool;79} blitter;80struct {81struct panfrost_pool bin_pool;82} indirect_draw;8384struct panfrost_vtable vtbl;85};8687static inline struct panfrost_screen *88pan_screen(struct pipe_screen *p)89{90return (struct panfrost_screen *)p;91}9293static inline struct panfrost_device *94pan_device(struct pipe_screen *p)95{96return &(pan_screen(p)->dev);97}9899struct pipe_fence_handle *100panfrost_fence_create(struct panfrost_context *ctx);101102void103panfrost_cmdstream_screen_init(struct panfrost_screen *screen);104105#endif /* PAN_SCREEN_H */106107108