drm/amd/display: Remove dml_common_def file
During the rework for removing the FPU issues, I found the following warning: [..] dml_common_defs.o: warning: objtool: dml_round()+0x9: FPU instruction outside of kernel_fpu_{begin,end}() This file has a single function that does not need to be in a specific file. This commit drop dml_common_defs file, and move dml_round function to dml_inline_defs. CC: Christian König <christian.koenig@amd.com> CC: Alexander Deucher <Alexander.Deucher@amd.com> CC: Peter Zijlstra <peterz@infradead.org> CC: Tony Cheng <tony.cheng@amd.com> CC: Harry Wentland <hwentlan@amd.com> Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
b6ef55ccba
commit
5aa82e35ca
|
@ -63,10 +63,8 @@ CFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_rq_dlg_calc_21.o := $(dml_ccflags)
|
||||||
endif
|
endif
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dml1_display_rq_dlg_calc.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/dml1_display_rq_dlg_calc.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/display_rq_dlg_helpers.o := $(dml_ccflags)
|
CFLAGS_$(AMDDALPATH)/dc/dml/display_rq_dlg_helpers.o := $(dml_ccflags)
|
||||||
CFLAGS_$(AMDDALPATH)/dc/dml/dml_common_defs.o := $(dml_ccflags)
|
|
||||||
|
|
||||||
DML = display_mode_lib.o display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
|
DML = display_mode_lib.o display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
|
||||||
dml_common_defs.o
|
|
||||||
|
|
||||||
ifdef CONFIG_DRM_AMD_DC_DCN
|
ifdef CONFIG_DRM_AMD_DC_DCN
|
||||||
DML += display_mode_vba.o dcn20/display_rq_dlg_calc_20.o dcn20/display_mode_vba_20.o
|
DML += display_mode_vba.o dcn20/display_rq_dlg_calc_20.o dcn20/display_mode_vba_20.o
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#ifndef __DML20_DISPLAY_RQ_DLG_CALC_H__
|
#ifndef __DML20_DISPLAY_RQ_DLG_CALC_H__
|
||||||
#define __DML20_DISPLAY_RQ_DLG_CALC_H__
|
#define __DML20_DISPLAY_RQ_DLG_CALC_H__
|
||||||
|
|
||||||
#include "../dml_common_defs.h"
|
|
||||||
#include "../display_rq_dlg_helpers.h"
|
#include "../display_rq_dlg_helpers.h"
|
||||||
|
|
||||||
struct display_mode_lib;
|
struct display_mode_lib;
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#ifndef __DML20V2_DISPLAY_RQ_DLG_CALC_H__
|
#ifndef __DML20V2_DISPLAY_RQ_DLG_CALC_H__
|
||||||
#define __DML20V2_DISPLAY_RQ_DLG_CALC_H__
|
#define __DML20V2_DISPLAY_RQ_DLG_CALC_H__
|
||||||
|
|
||||||
#include "../dml_common_defs.h"
|
|
||||||
#include "../display_rq_dlg_helpers.h"
|
#include "../display_rq_dlg_helpers.h"
|
||||||
|
|
||||||
struct display_mode_lib;
|
struct display_mode_lib;
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#ifndef __DML21_DISPLAY_RQ_DLG_CALC_H__
|
#ifndef __DML21_DISPLAY_RQ_DLG_CALC_H__
|
||||||
#define __DML21_DISPLAY_RQ_DLG_CALC_H__
|
#define __DML21_DISPLAY_RQ_DLG_CALC_H__
|
||||||
|
|
||||||
#include "../dml_common_defs.h"
|
#include "dm_services.h"
|
||||||
#include "../display_rq_dlg_helpers.h"
|
#include "../display_rq_dlg_helpers.h"
|
||||||
|
|
||||||
struct display_mode_lib;
|
struct display_mode_lib;
|
||||||
|
|
|
@ -25,8 +25,10 @@
|
||||||
#ifndef __DISPLAY_MODE_LIB_H__
|
#ifndef __DISPLAY_MODE_LIB_H__
|
||||||
#define __DISPLAY_MODE_LIB_H__
|
#define __DISPLAY_MODE_LIB_H__
|
||||||
|
|
||||||
|
#include "dm_services.h"
|
||||||
#include "dml_common_defs.h"
|
#include "dc_features.h"
|
||||||
|
#include "display_mode_structs.h"
|
||||||
|
#include "display_mode_enums.h"
|
||||||
#include "display_mode_vba.h"
|
#include "display_mode_vba.h"
|
||||||
|
|
||||||
enum dml_project {
|
enum dml_project {
|
||||||
|
|
|
@ -27,8 +27,6 @@
|
||||||
#ifndef __DML2_DISPLAY_MODE_VBA_H__
|
#ifndef __DML2_DISPLAY_MODE_VBA_H__
|
||||||
#define __DML2_DISPLAY_MODE_VBA_H__
|
#define __DML2_DISPLAY_MODE_VBA_H__
|
||||||
|
|
||||||
#include "dml_common_defs.h"
|
|
||||||
|
|
||||||
struct display_mode_lib;
|
struct display_mode_lib;
|
||||||
|
|
||||||
void ModeSupportAndSystemConfiguration(struct display_mode_lib *mode_lib);
|
void ModeSupportAndSystemConfiguration(struct display_mode_lib *mode_lib);
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#ifndef __DISPLAY_RQ_DLG_HELPERS_H__
|
#ifndef __DISPLAY_RQ_DLG_HELPERS_H__
|
||||||
#define __DISPLAY_RQ_DLG_HELPERS_H__
|
#define __DISPLAY_RQ_DLG_HELPERS_H__
|
||||||
|
|
||||||
#include "dml_common_defs.h"
|
|
||||||
#include "display_mode_lib.h"
|
#include "display_mode_lib.h"
|
||||||
|
|
||||||
/* Function: Printer functions
|
/* Function: Printer functions
|
||||||
|
|
|
@ -26,8 +26,6 @@
|
||||||
#ifndef __DISPLAY_RQ_DLG_CALC_H__
|
#ifndef __DISPLAY_RQ_DLG_CALC_H__
|
||||||
#define __DISPLAY_RQ_DLG_CALC_H__
|
#define __DISPLAY_RQ_DLG_CALC_H__
|
||||||
|
|
||||||
#include "dml_common_defs.h"
|
|
||||||
|
|
||||||
struct display_mode_lib;
|
struct display_mode_lib;
|
||||||
|
|
||||||
#include "display_rq_dlg_helpers.h"
|
#include "display_rq_dlg_helpers.h"
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
/*
|
|
||||||
* 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 "dml_common_defs.h"
|
|
||||||
#include "dcn_calc_math.h"
|
|
||||||
|
|
||||||
#include "dml_inline_defs.h"
|
|
||||||
|
|
||||||
double dml_round(double a)
|
|
||||||
{
|
|
||||||
double round_pt = 0.5;
|
|
||||||
double ceil = dml_ceil(a, 1);
|
|
||||||
double floor = dml_floor(a, 1);
|
|
||||||
|
|
||||||
if (a - floor >= round_pt)
|
|
||||||
return ceil;
|
|
||||||
else
|
|
||||||
return floor;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
/*
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __DC_COMMON_DEFS_H__
|
|
||||||
#define __DC_COMMON_DEFS_H__
|
|
||||||
|
|
||||||
#include "dm_services.h"
|
|
||||||
#include "dc_features.h"
|
|
||||||
#include "display_mode_structs.h"
|
|
||||||
#include "display_mode_enums.h"
|
|
||||||
|
|
||||||
|
|
||||||
double dml_round(double a);
|
|
||||||
|
|
||||||
#endif /* __DC_COMMON_DEFS_H__ */
|
|
|
@ -26,7 +26,6 @@
|
||||||
#ifndef __DML_INLINE_DEFS_H__
|
#ifndef __DML_INLINE_DEFS_H__
|
||||||
#define __DML_INLINE_DEFS_H__
|
#define __DML_INLINE_DEFS_H__
|
||||||
|
|
||||||
#include "dml_common_defs.h"
|
|
||||||
#include "dcn_calc_math.h"
|
#include "dcn_calc_math.h"
|
||||||
#include "dml_logger.h"
|
#include "dml_logger.h"
|
||||||
|
|
||||||
|
@ -75,6 +74,18 @@ static inline double dml_floor(double a, double granularity)
|
||||||
return (double) dcn_bw_floor2(a, granularity);
|
return (double) dcn_bw_floor2(a, granularity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline double dml_round(double a)
|
||||||
|
{
|
||||||
|
double round_pt = 0.5;
|
||||||
|
double ceil = dml_ceil(a, 1);
|
||||||
|
double floor = dml_floor(a, 1);
|
||||||
|
|
||||||
|
if (a - floor >= round_pt)
|
||||||
|
return ceil;
|
||||||
|
else
|
||||||
|
return floor;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int dml_log2(double x)
|
static inline int dml_log2(double x)
|
||||||
{
|
{
|
||||||
return dml_round((double)dcn_bw_log(x, 2));
|
return dml_round((double)dcn_bw_log(x, 2));
|
||||||
|
@ -112,7 +123,7 @@ static inline double dml_log(double x, double base)
|
||||||
|
|
||||||
static inline unsigned int dml_round_to_multiple(unsigned int num,
|
static inline unsigned int dml_round_to_multiple(unsigned int num,
|
||||||
unsigned int multiple,
|
unsigned int multiple,
|
||||||
bool up)
|
unsigned char up)
|
||||||
{
|
{
|
||||||
unsigned int remainder;
|
unsigned int remainder;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue