#include <pthread.h>
#include "drm-uapi/panfrost_drm.h"
+#include "pan_resource.h"
#include "pan_screen.h"
#include "pan_util.h"
#include "pandecode/decode.h"
ralloc_free(bo);
}
+void
+panfrost_bo_reference(struct panfrost_bo *bo)
+{
+ if (bo)
+ pipe_reference(NULL, &bo->reference);
+}
+
+void
+panfrost_bo_unreference(struct pipe_screen *screen, struct panfrost_bo *bo)
+{
+ if (!bo)
+ return;
+
+ /* When the reference count goes to zero, we need to cleanup */
+
+ if (pipe_reference(&bo->reference, NULL))
+ panfrost_bo_release(pan_screen(screen), bo, true);
+}
+
struct panfrost_bo *
panfrost_bo_import(struct panfrost_screen *screen, int fd)
{
return (struct pipe_resource *)so;
}
-void
-panfrost_bo_reference(struct panfrost_bo *bo)
-{
- if (bo)
- pipe_reference(NULL, &bo->reference);
-}
-
-void
-panfrost_bo_unreference(struct pipe_screen *screen, struct panfrost_bo *bo)
-{
- if (!bo)
- return;
-
- /* When the reference count goes to zero, we need to cleanup */
-
- if (pipe_reference(&bo->reference, NULL))
- panfrost_bo_release(pan_screen(screen), bo, true);
-}
-
static void
panfrost_resource_destroy(struct pipe_screen *screen,
struct pipe_resource *pt)