panfrost: Allocate a state uploader
[mesa.git] / src / gallium / drivers / panfrost / pan_context.h
index a53db0d611f85f54f8cf54743cbac88553dbcc9d..d490f4aca564755937c3ac1b1173fe78b4aa612c 100644 (file)
@@ -96,6 +96,11 @@ struct panfrost_context {
         /* Gallium context */
         struct pipe_context base;
 
+        /* Upload manager for small resident GPU-internal data structures, like
+         * sampler descriptors. We use an upload manager since the minimum BO
+         * size from the kernel is 4kb */
+        struct u_upload_mgr *state_uploader;
+
         /* Bound job batch and map of panfrost_batch_key to job batches */
         struct panfrost_batch *batch;
         struct hash_table *batches;
@@ -183,12 +188,13 @@ struct panfrost_rasterizer {
 struct panfrost_shader_state {
         /* Compiled, mapped descriptor, ready for the hardware */
         bool compiled;
+        struct mali_shader_packed shader;
+        struct mali_midgard_properties_packed properties;
+        struct mali_preload_packed preload;
 
         /* Non-descript information */
-        int uniform_count;
-        unsigned uniform_cutoff;
+        unsigned uniform_count;
         unsigned work_reg_count;
-        unsigned attribute_count;
         bool can_discard;
         bool writes_point_size;
         bool writes_depth;
@@ -207,7 +213,7 @@ struct panfrost_shader_state {
         /* For Bifrost - output type for each RT */
         enum bifrost_shader_type blend_types[BIFROST_MAX_RENDER_TARGET_COUNT];
 
-        unsigned int varying_count;
+        unsigned attribute_count, varying_count, ubo_count;
         enum mali_format varyings[PIPE_MAX_ATTRIBS];
         gl_varying_slot varyings_loc[PIPE_MAX_ATTRIBS];
         struct pipe_stream_output_info stream_output;
@@ -222,7 +228,7 @@ struct panfrost_shader_state {
         /* Should we enable helper invocations */
         bool helper_invocations;
 
-        unsigned first_tag;
+        /* GPU-executable memory */
         struct panfrost_bo *bo;
 
         BITSET_WORD outputs_read;
@@ -254,7 +260,7 @@ struct panfrost_vertex_state {
         unsigned num_elements;
 
         struct pipe_vertex_element pipe[PIPE_MAX_ATTRIBS];
-        struct mali_attr_meta hw[PIPE_MAX_ATTRIBS];
+        unsigned formats[PIPE_MAX_ATTRIBS];
 };
 
 struct panfrost_zsa_state {
@@ -303,9 +309,6 @@ panfrost_get_shader_state(struct panfrost_context *ctx,
 struct pipe_context *
 panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags);
 
-void
-panfrost_invalidate_frame(struct panfrost_context *ctx);
-
 bool
 panfrost_writes_point_size(struct panfrost_context *ctx);
 
@@ -341,9 +344,6 @@ panfrost_shader_compile(struct panfrost_context *ctx,
                         struct panfrost_shader_state *state,
                         uint64_t *outputs_written);
 
-unsigned
-panfrost_ubo_count(struct panfrost_context *ctx, enum pipe_shader_type stage);
-
 void
 panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
                                 struct pipe_context *pctx,