panfrost/midgard: Add more ball/bany, iabs ops
[mesa.git] / src / gallium / drivers / panfrost / pan_screen.h
index afb3d34b5b13c1b9521ca140d2ba3101597b9839..cbadf8136751cb81002191019e06f1641b605ba3 100644 (file)
 
 #include <panfrost-misc.h>
 #include "pan_allocate.h"
+#include "pan_trace.h"
 
 struct panfrost_context;
 struct panfrost_resource;
 struct panfrost_screen;
 
-//#define DUMP_PERFORMANCE_COUNTERS
-
 /* Flags for allocated memory */
 #define PAN_ALLOCATE_EXECUTE (1 << 0)
 #define PAN_ALLOCATE_GROWABLE (1 << 1)
+#define PAN_ALLOCATE_INVISIBLE (1 << 2)
+#define PAN_ALLOCATE_COHERENT_LOCAL (1 << 3)
 
 struct panfrost_driver {
        struct panfrost_bo * (*import_bo) (struct panfrost_screen *screen, struct winsys_handle *whandle);
+       int (*export_bo) (struct panfrost_screen *screen, int gem_handle, unsigned int stride, struct winsys_handle *whandle);
 
        int (*submit_vs_fs_job) (struct panfrost_context *ctx, bool has_draws, bool is_scanout);
-       void (*force_flush_fragment) (struct panfrost_context *ctx);
+       void (*force_flush_fragment) (struct panfrost_context *ctx,
+                                     struct pipe_fence_handle **fence);
        void (*allocate_slab) (struct panfrost_screen *screen,
                               struct panfrost_memory *mem,
                               size_t pages,
@@ -60,7 +63,19 @@ struct panfrost_driver {
                               int extent);
         void (*free_slab) (struct panfrost_screen *screen,
                            struct panfrost_memory *mem);
+        void (*free_imported_bo) (struct panfrost_screen *screen,
+                             struct panfrost_bo *bo);
         void (*enable_counters) (struct panfrost_screen *screen);
+        void (*dump_counters) (struct panfrost_screen *screen);
+       unsigned (*query_gpu_version) (struct panfrost_screen *screen);
+       int (*init_context) (struct panfrost_context *ctx);
+       void (*fence_reference) (struct pipe_screen *screen,
+                         struct pipe_fence_handle **ptr,
+                         struct pipe_fence_handle *fence);
+       boolean (*fence_finish) (struct pipe_screen *screen,
+                      struct pipe_context *ctx,
+                      struct pipe_fence_handle *fence,
+                      uint64_t timeout);
 };
 
 struct panfrost_screen {
@@ -81,10 +96,4 @@ struct panfrost_screen {
        int last_fragment_flushed;
 };
 
-static inline struct panfrost_screen *
-panfrost_screen( struct pipe_screen *pipe )
-{
-        return (struct panfrost_screen *)pipe;
-}
-
 #endif /* PAN_SCREEN_H */