Skip to contentSkip to conversation

amdgpu: sspl small piece of dieting to start

PATCH New Dave Airlie 2 participants 5 messages Jul 10 – Jul 17

Subsystems (3)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

I was just idling wandering around in dc and fell across this spl library imported from userspace, in the worst possible way, now I'm willing to forgive some bits, but this is horrible, and I'm not happy this passed review.

I've started by ripping out a bunch of duplication that at least drops by kernel driver build by 6k. 6k out of 12M but we all have to start somewhere.

Dave.

author maintainer
#1 lore raw

PATCH 1/3 amd/dc: move custom_float definition into custom_float.h

From: Dave Airlie <[email protected]>

Drop the unused custom_float_value and the spl one.

---
 drivers/gpu/drm/amd/display/dc/inc/custom_float.h   |  7 ++++++-
 drivers/gpu/drm/amd/display/dc/inc/hw/opp.h         | 13 -------------
 .../gpu/drm/amd/display/dc/sspl/spl_custom_float.h  |  7 -------
 3 files changed, 6 insertions(+), 21 deletions(-)
drivers/gpu/drm/amd/display/dc/inc/custom_float.h +6 -1
index f57239672216..c408fee8e181 100644
@@ -28,7 +28,12 @@
 
 #include "bw_fixed.h"
 #include "hw_shared.h"
-#include "opp.h"
+
+struct custom_float_format {
+        uint32_t mantissa_bits;
+        uint32_t exponenta_bits;
+        bool sign;
+};
 
 
 bool convert_to_custom_float_format(
drivers/gpu/drm/amd/display/dc/inc/hw/opp.h +0 -13
index 73cc34ea7726..ce30eab16f86 100644
@@ -142,19 +142,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;
drivers/gpu/drm/amd/display/dc/sspl/spl_custom_float.h +0 -7
index f3fd8d30e638..60620537ae3e 100644
@@ -14,13 +14,6 @@ struct spl_custom_float_format {
 	bool sign;
 };
 
-struct spl_custom_float_value {
-	uint32_t mantissa;
-	uint32_t exponenta;
-	uint32_t value;
-	bool negative;
-};
-
 bool SPL_NAMESPACE(spl_convert_to_custom_float_format(
 	struct spl_fixed31_32 value,
 	const struct spl_custom_float_format *format,
Signature · 1 line
2.54.0
author maintainer
#2 lore raw

PATCH 2/3 amd/dc: drop spl copies of custom float and fixed pt libraries

In reply to Dave Airlie

From: Dave Airlie <[email protected]>

There are two copies of these libraries, like the upstream should just not do this, but in the kernel we definitely don't want this.

I haven't taken the next step of ripping out the spl_ changes, but maybe if I get in a bad mood.

This drops 5K from the amdgpu binary:
text data bss dec hex filename
12284141 705053 292544 13281738 caa9ca ../../drm-next-build/drivers/gpu/drm/amd/amdgpu/amdgpu.ko

text data bss dec hex filename
12279057 704445 292544 13276046 ca938e ../../drm-next-build/drivers/gpu/drm/amd/amdgpu/amdgpu.ko

---
 drivers/gpu/drm/amd/display/dc/sspl/Makefile  |   2 +-
 .../amd/display/dc/sspl/spl_custom_float.c    | 152 -----
 .../amd/display/dc/sspl/spl_custom_float.h    |  15 +-
 .../drm/amd/display/dc/sspl/spl_fixpt31_32.c  | 495 ----------------
 .../drm/amd/display/dc/sspl/spl_fixpt31_32.h  | 544 +-----------------
 5 files changed, 31 insertions(+), 1177 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/sspl/spl_custom_float.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/sspl/spl_fixpt31_32.c
drivers/gpu/drm/amd/display/dc/sspl/Makefile +1 -1
index 5e3e4aa13820..17f3e2c801cf 100644
@@ -23,7 +23,7 @@
 # Makefile for the 'spl' sub-component of DAL.
 # It provides the scaling library interface.
 
-SPL = dc_spl.o dc_spl_scl_filters.o dc_spl_scl_easf_filters.o dc_spl_isharp_filters.o dc_spl_filters.o spl_fixpt31_32.o spl_custom_float.o
+SPL = dc_spl.o dc_spl_scl_filters.o dc_spl_scl_easf_filters.o dc_spl_isharp_filters.o dc_spl_filters.o
 
 AMD_DAL_SPL = $(addprefix $(AMDDALPATH)/dc/sspl/,$(SPL))
 
drivers/gpu/drm/amd/display/dc/sspl/spl_custom_float.c deleted +0 -152

152 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/sspl/spl_custom_float.h +3 -12
index 60620537ae3e..7aaa2c5db1a5 100644
@@ -5,18 +5,9 @@
 #ifndef SPL_CUSTOM_FLOAT_H_
 #define SPL_CUSTOM_FLOAT_H_
 
-#include "spl_os_types.h"
-#include "spl_fixpt31_32.h"
+#include "dc/inc/custom_float.h"
 
-struct spl_custom_float_format {
-	uint32_t mantissa_bits;
-	uint32_t exponenta_bits;
-	bool sign;
-};
-
-bool SPL_NAMESPACE(spl_convert_to_custom_float_format(
-	struct spl_fixed31_32 value,
-	const struct spl_custom_float_format *format,
-	uint32_t *result));
+#define spl_custom_float_format custom_float_format
+#define spl_convert_to_custom_float_format convert_to_custom_float_format
 
 #endif //SPL_CUSTOM_FLOAT_H_
drivers/gpu/drm/amd/display/dc/sspl/spl_fixpt31_32.c deleted +0 -495

495 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/sspl/spl_fixpt31_32.h +27 -517

549 lines not on this page · raw message

Signature · 1 line
2.54.0
author maintainer
#3 lore raw

PATCH 3/3 amd/dc/spl: drop unused function.

In reply to Dave Airlie

From: Dave Airlie <[email protected]>

This function is never called anywhere.

---
 drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c | 17 -----------------
 drivers/gpu/drm/amd/display/dc/sspl/dc_spl.h |  2 --
 2 files changed, 19 deletions(-)
drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c +0 -17
index d8aebaff7c3f..4e73996e7779 100644
@@ -1915,20 +1915,3 @@ bool SPL_NAMESPACE(spl_calculate_scaler_params(struct spl_in *spl_in, struct spl
 
 	return res;
 }
-
-/* External interface to get number of taps only */
-bool SPL_NAMESPACE(spl_get_number_of_taps(struct spl_in *spl_in, struct spl_out *spl_out))
-{
-	bool res = false;
-	bool enable_easf_v = false;
-	bool enable_easf_h = false;
-	bool enable_isharp = false;
-	struct spl_scratch spl_scratch;
-	struct dscl_prog_data *dscl_prog_data = spl_out->dscl_prog_data;
-	const struct spl_scaler_data *data = &spl_scratch.scl_data;
-
-	res = spl_calculate_number_of_taps(spl_in, &spl_scratch, spl_out,
-		&enable_easf_v, &enable_easf_h, &enable_isharp);
-	spl_set_taps_data(dscl_prog_data, data);
-	return res;
-}
drivers/gpu/drm/amd/display/dc/sspl/dc_spl.h +0 -2
index f9503c368db5..a53a2c1f5508 100644
@@ -14,6 +14,4 @@
 
 bool SPL_NAMESPACE(spl_calculate_scaler_params(struct spl_in *spl_in, struct spl_out *spl_out));
 
-bool SPL_NAMESPACE(spl_get_number_of_taps(struct spl_in *spl_in, struct spl_out *spl_out));
-
 #endif /* __DC_SPL_H__ */
Signature · 1 line
2.54.0
maintainer
#4 lore raw
In reply to Dave Airlie
Quoted 9 lines · Dave Airlie

I was just idling wandering around in dc and fell across this spl library imported from userspace, in the worst possible way, now I'm willing to forgive some bits, but this is horrible, and I'm not happy this passed review.

I've started by ripping out a bunch of duplication that at least drops by kernel driver build by 6k. 6k out of 12M but we all have to start somewhere.

Dave.

Hi Dave, thanks for the patches. I'm talking with internal devs on removing the fixpt/custom_float cruft. There are some other dupes that we're looking into as well.

- Leo

Quoted 1 line