panfrost: Break out fragment to SFBD/MFBD files
[mesa.git] / src / gallium / drivers / panfrost / pan_context.h
index b1a0a09146daf29675bcc42cc96de17e9cdc301c..a304d83e4fe76fed892b680238b434fd0d7a3512 100644 (file)
@@ -59,6 +59,12 @@ struct prim_convert_context;
 #define PAN_DIRTY_SAMPLERS   (1 << 8)
 #define PAN_DIRTY_TEXTURES   (1 << 9)
 
+#define SET_BIT(lval, bit, cond) \
+       if (cond) \
+               lval |= (bit); \
+       else \
+               lval &= ~(bit);
+
 struct panfrost_constant_buffer {
         bool dirty;
         size_t size;
@@ -74,6 +80,11 @@ struct panfrost_query {
         struct panfrost_transfer transfer;
 };
 
+struct panfrost_fence {
+        struct pipe_reference reference;
+        int fd;
+};
+
 #define PANFROST_MAX_TRANSIENT_ENTRIES 64
 
 struct panfrost_transient_pool {
@@ -208,6 +219,18 @@ struct panfrost_context {
         struct pipe_blend_color blend_color;
         struct pipe_depth_stencil_alpha_state *depth_stencil;
         struct pipe_stencil_ref stencil_ref;
+
+        /* True for t6XX, false for t8xx. */
+        bool is_t6xx;
+
+        /* If set, we'll require the use of single render-target framebuffer
+         * descriptors (SFBD), for older hardware -- specifically, <T760 hardware, If
+         * false, we'll use the MFBD no matter what. New hardware -does- retain support
+         * for SFBD, and in theory we could flip between them on a per-RT basis, but
+         * there's no real advantage to doing so */
+        bool require_sfbd;
+
+       uint32_t out_sync;
 };
 
 /* Corresponds to the CSO */
@@ -344,6 +367,21 @@ panfrost_flush(
         struct pipe_fence_handle **fence,
         unsigned flags);
 
+bool
+panfrost_is_scanout(struct panfrost_context *ctx);
+
+mali_ptr
+panfrost_sfbd_fragment(struct panfrost_context *ctx);
+
+mali_ptr
+panfrost_mfbd_fragment(struct panfrost_context *ctx);
+
+struct bifrost_framebuffer
+panfrost_emit_mfbd(struct panfrost_context *ctx);
+
+struct mali_single_framebuffer
+panfrost_emit_sfbd(struct panfrost_context *ctx);
+
 mali_ptr
 panfrost_fragment_job(struct panfrost_context *ctx);