Mesa (master): panfrost: Stop including pan_device.h from pan_bo.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 7 09:12:39 UTC 2021


Module: Mesa
Branch: master
Commit: 9a08c9097fdb9e829478a264541739074da1a4c9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a08c9097fdb9e829478a264541739074da1a4c9

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Tue Apr  6 11:36:34 2021 +0200

panfrost: Stop including pan_device.h from pan_bo.h

We want to define structures containing pan_pool objects in pan_device.h
but it is prevented by the

      pan_device.h -> pan_pool.h -> pan_bo.h
          ^____________________________|

loop.

Break this loop by not including pan_device.h from pan_bo.h.

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8700>

---

 src/panfrost/lib/pan_bo.c      | 1 +
 src/panfrost/lib/pan_bo.h      | 4 +++-
 src/panfrost/lib/pan_pool.c    | 1 +
 src/panfrost/lib/pan_texture.h | 1 +
 4 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/lib/pan_bo.c b/src/panfrost/lib/pan_bo.c
index 0852ac63c7c..80239a9c241 100644
--- a/src/panfrost/lib/pan_bo.c
+++ b/src/panfrost/lib/pan_bo.c
@@ -31,6 +31,7 @@
 #include "drm-uapi/panfrost_drm.h"
 
 #include "pan_bo.h"
+#include "pan_device.h"
 #include "pan_util.h"
 #include "wrap.h"
 
diff --git a/src/panfrost/lib/pan_bo.h b/src/panfrost/lib/pan_bo.h
index 451e0e1534d..dcb131c03a2 100644
--- a/src/panfrost/lib/pan_bo.h
+++ b/src/panfrost/lib/pan_bo.h
@@ -27,7 +27,7 @@
 #define __PAN_BO_H__
 
 #include "util/list.h"
-#include "pan_device.h"
+#include "panfrost-job.h"
 #include <time.h>
 
 /* Flags for allocated memory */
@@ -68,6 +68,8 @@
 /* BO is accessed by the fragment job. */
 #define PAN_BO_ACCESS_FRAGMENT        (1 << 4)
 
+struct panfrost_device;
+
 struct panfrost_ptr {
         /* CPU address */
         void *cpu;
diff --git a/src/panfrost/lib/pan_pool.c b/src/panfrost/lib/pan_pool.c
index 6bd730bb218..8a269c396c2 100644
--- a/src/panfrost/lib/pan_pool.c
+++ b/src/panfrost/lib/pan_pool.c
@@ -24,6 +24,7 @@
  */
 
 #include "pan_bo.h"
+#include "pan_device.h"
 #include "pan_pool.h"
 
 /* Transient command stream pooling: command stream uploads try to simply copy
diff --git a/src/panfrost/lib/pan_texture.h b/src/panfrost/lib/pan_texture.h
index f91eaafcc66..f33eae73b17 100644
--- a/src/panfrost/lib/pan_texture.h
+++ b/src/panfrost/lib/pan_texture.h
@@ -34,6 +34,7 @@
 #include "compiler/shader_enums.h"
 #include "midgard_pack.h"
 #include "pan_bo.h"
+#include "pan_device.h"
 
 #define PAN_MODIFIER_COUNT 4
 extern uint64_t pan_best_modifiers[PAN_MODIFIER_COUNT];



More information about the mesa-commit mailing list