diff options
author | Tomeu Vizoso <[email protected]> | 2019-03-08 10:27:07 +0100 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-03-10 19:09:23 +0000 |
commit | 756f7b99895404bc7d7ce0cfcd84044cc21a799f (patch) | |
tree | 10eb58e22224f67c6c904aa7243404e6aada1fe3 /src/gallium/drivers/panfrost/pan_screen.h | |
parent | d4dc79df72e05346b4dd40d19e346ada9e4af98c (diff) |
panfrost: Add backend targeting the DRM driver
This backend interacts with the new DRM driver for Midgard GPUs which is
currently in development.
When using this backend, Panfrost has roughly on-par functionality as
when using the non-DRM driver from Arm.
Alyssa Rosenzweig: To do so, we implement additional routines for
runtime GPU version detection and fencing. We cleanup some duplicate
code interfering with the new driver. We fix a long-standing memory leak
which is aggravated on the new driver. Finally, we implement BO
import/export in a way compatible with the new driver. These changes are
squashed to preserve bisectability given the hard-to-track ABI shifts in
the nondrm module
Signed-off-by: Tomeu Vizoso <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_screen.h')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_screen.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gallium/drivers/panfrost/pan_screen.h b/src/gallium/drivers/panfrost/pan_screen.h index 0005b2feb15..882611e93e3 100644 --- a/src/gallium/drivers/panfrost/pan_screen.h +++ b/src/gallium/drivers/panfrost/pan_screen.h @@ -49,9 +49,11 @@ struct panfrost_screen; 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, 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, @@ -65,6 +67,15 @@ struct panfrost_driver { 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 { @@ -85,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 */ |