lima: adjust pp_stream to use lima_submit_create_stream_bo
[mesa.git] / src / gallium / drivers / lima / lima_context.h
index c16baeef0bac7c4138ada4fe7887a3e6923ef4e5..d73eeea94bff70fa2ad1515175f6a1b2039cc32f 100644 (file)
@@ -55,6 +55,7 @@ struct lima_fs_shader_state {
    void *shader;
    int shader_size;
    int stack_size;
+   bool uses_discard;
    struct lima_bo *bo;
 };
 
@@ -81,7 +82,10 @@ struct lima_vs_shader_state {
 
    struct lima_varying_info varying[LIMA_MAX_VARYING_NUM];
    int varying_stride;
-   int num_varying;
+   int num_outputs;
+   int num_varyings;
+   int gl_pos_idx;
+   int point_size_idx;
 
    struct lima_bo *bo;
 };
@@ -107,7 +111,7 @@ struct lima_context_vertex_buffer {
 
 struct lima_context_viewport_state {
    struct pipe_viewport_state transform;
-   float x, y, width, height;
+   float left, right, bottom, top;
    float near, far;
 };
 
@@ -118,8 +122,6 @@ struct lima_context_constant_buffer {
 };
 
 enum lima_ctx_buff {
-   lima_ctx_buff_sh_varying,
-   lima_ctx_buff_sh_gl_pos,
    lima_ctx_buff_gp_varying_info,
    lima_ctx_buff_gp_attribute_info,
    lima_ctx_buff_gp_uniform,
@@ -129,7 +131,9 @@ enum lima_ctx_buff {
    lima_ctx_buff_pp_uniform_array,
    lima_ctx_buff_pp_uniform,
    lima_ctx_buff_pp_tex_desc,
+   lima_ctx_buff_pp_stack,
    lima_ctx_buff_num,
+   lima_ctx_buff_num_gp = lima_ctx_buff_pp_plb_rsw,
 };
 
 struct lima_ctx_buff_state {
@@ -158,15 +162,9 @@ struct lima_ctx_plb_pp_stream {
    uint32_t offset[4];
 };
 
-struct lima_damage_state {
-   struct pipe_scissor_state *region;
-   unsigned num_region;
-   bool aligned;
-};
-
 struct lima_pp_stream_state {
-   struct lima_bo *bo;
-   uint32_t bo_offset;
+   void *map;
+   uint32_t va;
    uint32_t offset[8];
 };
 
@@ -191,8 +189,9 @@ struct lima_context {
       LIMA_CONTEXT_DIRTY_TEXTURES     = (1 << 14),
    } dirty;
 
+   unsigned resolve;
+
    struct u_upload_mgr *uploader;
-   struct u_suballocator *suballocator;
    struct blitter_context *blitter;
 
    struct slab_child_pool transfer_pool;
@@ -200,6 +199,7 @@ struct lima_context {
    struct lima_context_framebuffer framebuffer;
    struct lima_context_viewport_state viewport;
    struct pipe_scissor_state scissor;
+   struct pipe_scissor_state damage_rect;
    struct lima_context_clear clear;
    struct lima_vs_shader_state *vs;
    struct lima_fs_shader_state *fs;
@@ -212,7 +212,6 @@ struct lima_context {
    struct pipe_stencil_ref stencil_ref;
    struct lima_context_constant_buffer const_buffer[PIPE_SHADER_TYPES];
    struct lima_texture_stateobj tex_stateobj;
-   struct lima_damage_state damage;
    struct lima_pp_stream_state pp_stream;
 
    unsigned min_index;
@@ -227,8 +226,11 @@ struct lima_context {
 
    struct lima_bo *plb[LIMA_CTX_PLB_MAX_NUM];
    struct lima_bo *gp_tile_heap[LIMA_CTX_PLB_MAX_NUM];
-   #define gp_tile_heap_size         0x100000
+   uint32_t gp_tile_heap_size;
    struct lima_bo *plb_gp_stream;
+   struct lima_bo *gp_output;
+   uint32_t gp_output_varyings_offt;
+   uint32_t gp_output_point_size_offt;
 
    struct hash_table *plb_pp_stream;
    uint32_t plb_index;
@@ -237,11 +239,22 @@ struct lima_context {
 
    struct util_dynarray vs_cmd_array;
    struct util_dynarray plbu_cmd_array;
+   struct util_dynarray plbu_cmd_head;
+
+   struct lima_submit *submit;
 
-   struct lima_submit *gp_submit;
-   struct lima_submit *pp_submit;
+   int in_sync_fd;
+   uint32_t in_sync[2];
+   uint32_t out_sync[2];
 
    int id;
+
+   struct pipe_debug_callback debug;
+
+   int pp_max_stack_size;
+
+   unsigned index_offset;
+   struct lima_resource *index_res;
 };
 
 static inline struct lima_context *
@@ -270,14 +283,10 @@ lima_sampler_view(struct pipe_sampler_view *psview)
    return (struct lima_sampler_view *)psview;
 }
 
-#define LIMA_CTX_BUFF_SUBMIT_GP (1 << 0)
-#define LIMA_CTX_BUFF_SUBMIT_PP (1 << 1)
-
-uint32_t lima_ctx_buff_va(struct lima_context *ctx, enum lima_ctx_buff buff,
-                          unsigned submit);
+uint32_t lima_ctx_buff_va(struct lima_context *ctx, enum lima_ctx_buff buff);
 void *lima_ctx_buff_map(struct lima_context *ctx, enum lima_ctx_buff buff);
 void *lima_ctx_buff_alloc(struct lima_context *ctx, enum lima_ctx_buff buff,
-                          unsigned size, bool uploader);
+                          unsigned size);
 
 void lima_state_init(struct lima_context *ctx);
 void lima_state_fini(struct lima_context *ctx);
@@ -291,6 +300,5 @@ lima_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags);
 void lima_flush(struct lima_context *ctx);
 
 bool lima_need_flush(struct lima_context *ctx, struct lima_bo *bo, bool write);
-bool lima_is_scanout(struct lima_context *ctx);
 
 #endif