Skip to contentSkip to conversation

amdgpu/dc: inline a bunch of the dml wrappers.

PATCH New Harry Wentland 1 participant 2 messages Oct 17, 2017 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 amdgpu/dc: inline a bunch of the dml wrappers.

This reduces the code size.

This is basically a redo of Dave's change with the same name on top of the latest DML.

---
 .../gpu/drm/amd/display/dc/dml/display_mode_vba.c  |   2 +
 .../drm/amd/display/dc/dml/display_rq_dlg_calc.c   |   2 +
 .../amd/display/dc/dml/dml1_display_rq_dlg_calc.c  |   2 +
 .../gpu/drm/amd/display/dc/dml/dml_common_defs.c   |  67 +-------------
 .../gpu/drm/amd/display/dc/dml/dml_common_defs.h   |  14 ---
 .../gpu/drm/amd/display/dc/dml/dml_inline_defs.h   | 102 +++++++++++++++++++++
 .../gpu/drm/amd/display/dc/dml/soc_bounding_box.c  |   1 +
 7 files changed, 110 insertions(+), 80 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +2 -0
index e337c2cf2c09..f51a36449410 100644
@@ -1,6 +1,8 @@
 #include "display_mode_lib.h"
 #include "display_mode_vba.h"
 
+#include "dml_inline_defs.h"
+
 static const unsigned int NumberOfStates = DC__VOLTAGE_STATES;
 
 static void fetch_socbb_params(struct display_mode_lib *mode_lib);
drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.c +2 -0
index 657b7386021d..8ba962df42e6 100644
@@ -39,6 +39,8 @@ static void calculate_ttu_cursor(struct display_mode_lib *mode_lib,
 		unsigned int cur_width,
 		enum cursor_bpp cur_bpp);
 
+#include "dml_inline_defs.h"
+
 static unsigned int get_bytes_per_element(enum source_format_class source_format, bool is_chroma)
 {
 	unsigned int ret_val = 0;
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c +2 -0
index 8229f782260b..1e4b1e383401 100644
@@ -26,6 +26,8 @@
 #include "dml1_display_rq_dlg_calc.h"
 #include "display_mode_lib.h"
 
+#include "dml_inline_defs.h"
+
 static unsigned int get_bytes_per_element(enum source_format_class source_format, bool is_chroma)
 {
 	unsigned int ret_val = 0;
drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.c +1 -66

88 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.h +0 -14
index ba01bbb007fc..a55f4d5af36c 100644
@@ -34,23 +34,9 @@
 #define dml_print(str, ...) {dm_logger_write(mode_lib->logger, LOG_DML, str, ##__VA_ARGS__); }
 #define DTRACE(str, ...) {dm_logger_write(mode_lib->logger, LOG_DML, str, ##__VA_ARGS__); }
 
-double dml_min(double a, double b);
-double dml_max(double a, double b);
-double dml_max3(double a, double b, double c);
-double dml_max4(double a, double b, double c, double d);
-double dml_max5(double a, double b, double c, double d, double e);
 bool dml_util_is_420(enum source_format_class sorce_format);
-double dml_ceil_ex(double x, double granularity);
-double dml_floor_ex(double x, double granularity);
-double dml_log(double x, double base);
-double dml_ceil(double a, double granularity);
-double dml_floor(double a, double granularity);
 double dml_round(double a);
-int dml_log2(double x);
-double dml_pow(double a, int exp);
 unsigned int dml_round_to_multiple(
 			unsigned int num, unsigned int multiple, bool up);
-double dml_fmod(double f, int val);
-double dml_ceil_2(double f);
 
 #endif /* __DC_COMMON_DEFS_H__ */
drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h new file +102 -0

102 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dml/soc_bounding_box.c +1 -0
index 8b8512528af5..bc7d8c707221 100644
@@ -26,6 +26,7 @@
 #include "display_mode_lib.h"
 #include "dc_features.h"
 
+#include "dml_inline_defs.h"
 void dml_socbb_set_latencies(soc_bounding_box_st *to_box, soc_bounding_box_st *from_box)
 {
 	to_box->dram_clock_change_latency_us = from_box->dram_clock_change_latency_us;
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20171017031725.8371-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/2 drm/amd/display: Add bunch of missing license headers in DML

All files should have MIT headers.

---
 .../gpu/drm/amd/display/dc/dml/display_mode_vba.c  | 25 ++++++++++++++++++++++
 .../gpu/drm/amd/display/dc/dml/display_mode_vba.h  | 24 ++++++++++++++++++---
 2 files changed, 46 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +25 -0
index f51a36449410..ea661ee44674 100644
@@ -1,3 +1,28 @@
+/*
+ * Copyright 2017 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: AMD
+ *
+ */
+
 #include "display_mode_lib.h"
 #include "display_mode_vba.h"
 
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h +21 -3
index c8d1a0539541..4112409cd974 100644
@@ -1,8 +1,26 @@
 /*
- * display_mode_vba.h
+ * Copyright 2017 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: AMD
  *
- *  Created on: Aug 18, 2017
- *      Author: dlaktyus
  */
 
 #ifndef __DML2_DISPLAY_MODE_VBA_H__
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx