From: Samson Tam <[email protected]>

[WHY]
Currently it needs to include opp.h to access custom_float structures,
which pulls in additional include files that are not necessary.

[HOW]
Move custom_float structures to custom_float.h, and include this header in
opp.h. Add only os_types.h and fixed31_32.h in custom_float.h

Suggested-by: Dave Airlie <[email protected]>
Reviewed-by: Alvin Lee <[email protected]>
Signed-off-by: Samson Tam <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
---
 .../gpu/drm/amd/display/dc/inc/custom_float.h | 21 ++++++++++++++++---
 drivers/gpu/drm/amd/display/dc/inc/hw/opp.h   | 14 +------------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/inc/custom_float.h 
b/drivers/gpu/drm/amd/display/dc/inc/custom_float.h
index f57239672216..897759a041e4 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/custom_float.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/custom_float.h
@@ -26,10 +26,25 @@
 #ifndef CUSTOM_FLOAT_H_
 #define CUSTOM_FLOAT_H_
 
-#include "bw_fixed.h"
-#include "hw_shared.h"
-#include "opp.h"
+#include "os_types.h"    /* uint32_t, bool */
+#include "fixed31_32.h"  /* struct fixed31_32 (used by value) */
 
+/*
+ * Moved here from opp.h so consumers of custom-float do not have to pull in 
the
+ * heavy opp.h
+ */
+struct custom_float_format {
+       uint32_t mantissa_bits;
+       uint32_t exponenta_bits;
+       bool sign;
+};
+
+struct custom_float_value {
+       uint32_t mantissa;
+       uint32_t exponenta;
+       uint32_t value;
+       bool negative;
+};
 
 bool convert_to_custom_float_format(
        struct fixed31_32 value,
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h 
b/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
index 73cc34ea7726..f2d16d88b0bc 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
@@ -43,6 +43,7 @@
 #define __DAL_OPP_H__
 
 #include "hw_shared.h"
+#include "../custom_float.h"
 #include "dc_hw_types.h"
 #include "transform.h"
 #include "mpc.h"
@@ -142,19 +143,6 @@ enum channel_name {
        CHANNEL_NAME_BLUE
 };
 
-struct custom_float_format {
-       uint32_t mantissa_bits;
-       uint32_t exponenta_bits;
-       bool sign;
-};
-
-struct custom_float_value {
-       uint32_t mantissa;
-       uint32_t exponenta;
-       uint32_t value;
-       bool negative;
-};
-
 struct hw_x_point {
        uint32_t custom_float_x;
        struct fixed31_32 x;
-- 
2.43.0

Reply via email to