Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: Add configurable SPL namespace prefix

[WHY]
SPL is a shared library that is used both in kernel and userspace.
When multiple libraries use SPL as statically linked, namespace
collision occur.

[HOW]
Create a configurable namespace prefix.
Add the prefix to all the public functions of the library to
distinguish between the SPL functions in each library.

Reviewed-by: Samson Tam <samson.tam@amd.com>
Signed-off-by: Navid Assadian <Navid.Assadian@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Navid Assadian and committed by
Alex Deucher
25888a46 0e7f7b3a

+327 -300
+97 -89
drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c
··· 7 7 #include "dc_spl_isharp_filters.h" 8 8 #include "spl_debug.h" 9 9 10 - #define IDENTITY_RATIO(ratio) (spl_fixpt_u3d19(ratio) == (1 << 19)) 10 + #define IDENTITY_RATIO(ratio) (SPL_NAMESPACE(spl_fixpt_u3d19(ratio)) == (1 << 19)) 11 11 #define MIN_VIEWPORT_SIZE 12 12 12 13 13 static bool spl_is_yuv420(enum spl_pixel_format format) ··· 161 161 struct spl_fixed31_32 temp; 162 162 163 163 164 - temp = spl_fixpt_from_fraction(rec_in->x * (long long)stream_dst->width, 165 - stream_src->width); 164 + temp = SPL_NAMESPACE(spl_fixpt_from_fraction( 165 + rec_in->x * (long long)stream_dst->width, 166 + stream_src->width)); 166 167 rec_out.x = stream_dst->x + spl_fixpt_round(temp); 167 168 168 - temp = spl_fixpt_from_fraction( 169 + temp = SPL_NAMESPACE(spl_fixpt_from_fraction( 169 170 (rec_in->x + rec_in->width) * (long long)stream_dst->width, 170 - stream_src->width); 171 + stream_src->width)); 171 172 rec_out.width = stream_dst->x + spl_fixpt_round(temp) - rec_out.x; 172 173 173 - temp = spl_fixpt_from_fraction(rec_in->y * (long long)stream_dst->height, 174 - stream_src->height); 174 + temp = SPL_NAMESPACE(spl_fixpt_from_fraction( 175 + rec_in->y * (long long)stream_dst->height, 176 + stream_src->height)); 175 177 rec_out.y = stream_dst->y + spl_fixpt_round(temp); 176 178 177 - temp = spl_fixpt_from_fraction( 179 + temp = SPL_NAMESPACE(spl_fixpt_from_fraction( 178 180 (rec_in->y + rec_in->height) * (long long)stream_dst->height, 179 - stream_src->height); 181 + stream_src->height)); 180 182 rec_out.height = stream_dst->y + spl_fixpt_round(temp) - rec_out.y; 181 183 182 184 return rec_out; ··· 444 442 spl_in->basic_in.rotation == SPL_ROTATION_ANGLE_270) 445 443 spl_swap(surf_src.height, surf_src.width); 446 444 447 - spl_scratch->scl_data.ratios.horz = spl_fixpt_from_fraction( 445 + spl_scratch->scl_data.ratios.horz = SPL_NAMESPACE(spl_fixpt_from_fraction( 448 446 surf_src.width, 449 - spl_in->basic_in.dst_rect.width); 450 - spl_scratch->scl_data.ratios.vert = spl_fixpt_from_fraction( 447 + spl_in->basic_in.dst_rect.width)); 448 + spl_scratch->scl_data.ratios.vert = SPL_NAMESPACE(spl_fixpt_from_fraction( 451 449 surf_src.height, 452 - spl_in->basic_in.dst_rect.height); 450 + spl_in->basic_in.dst_rect.height)); 453 451 454 452 if (spl_in->basic_out.view_format == SPL_VIEW_3D_SIDE_BY_SIDE) 455 453 spl_scratch->scl_data.ratios.horz.value *= 2; ··· 482 480 * that is output/input. Currently we calculate input/output 483 481 * Store 1/ratio in recip_ratio for those lookups 484 482 */ 485 - spl_scratch->scl_data.recip_ratios.horz = spl_fixpt_recip( 486 - spl_scratch->scl_data.ratios.horz); 487 - spl_scratch->scl_data.recip_ratios.vert = spl_fixpt_recip( 488 - spl_scratch->scl_data.ratios.vert); 489 - spl_scratch->scl_data.recip_ratios.horz_c = spl_fixpt_recip( 490 - spl_scratch->scl_data.ratios.horz_c); 491 - spl_scratch->scl_data.recip_ratios.vert_c = spl_fixpt_recip( 492 - spl_scratch->scl_data.ratios.vert_c); 483 + spl_scratch->scl_data.recip_ratios.horz = SPL_NAMESPACE(spl_fixpt_recip( 484 + spl_scratch->scl_data.ratios.horz)); 485 + spl_scratch->scl_data.recip_ratios.vert = SPL_NAMESPACE(spl_fixpt_recip( 486 + spl_scratch->scl_data.ratios.vert)); 487 + spl_scratch->scl_data.recip_ratios.horz_c = SPL_NAMESPACE(spl_fixpt_recip( 488 + spl_scratch->scl_data.ratios.horz_c)); 489 + spl_scratch->scl_data.recip_ratios.vert_c = SPL_NAMESPACE(spl_fixpt_recip( 490 + spl_scratch->scl_data.ratios.vert_c)); 493 491 } 494 492 495 493 /* Calculate Viewport size */ ··· 648 646 649 647 switch (spl_in->basic_in.cositing) { 650 648 case CHROMA_COSITING_TOPLEFT: 651 - init_adj_h = spl_fixpt_from_fraction(h_sign, 4); 652 - init_adj_v = spl_fixpt_from_fraction(v_sign, 4); 649 + init_adj_h = SPL_NAMESPACE(spl_fixpt_from_fraction(h_sign, 4)); 650 + init_adj_v = SPL_NAMESPACE(spl_fixpt_from_fraction(v_sign, 4)); 653 651 break; 654 652 case CHROMA_COSITING_LEFT: 655 - init_adj_h = spl_fixpt_from_fraction(h_sign, 4); 653 + init_adj_h = SPL_NAMESPACE(spl_fixpt_from_fraction(h_sign, 4)); 656 654 init_adj_v = spl_fixpt_zero; 657 655 break; 658 656 case CHROMA_COSITING_NONE: ··· 941 939 * Max downscale supported is 6.0x. Add ASSERT to catch if go beyond that 942 940 */ 943 941 check_max_downscale = spl_fixpt_le(spl_scratch->scl_data.ratios.horz, 944 - spl_fixpt_from_fraction(6, 1)); 942 + SPL_NAMESPACE(spl_fixpt_from_fraction(6, 1))); 945 943 SPL_ASSERT(check_max_downscale); 946 944 check_max_downscale = spl_fixpt_le(spl_scratch->scl_data.ratios.vert, 947 - spl_fixpt_from_fraction(6, 1)); 945 + SPL_NAMESPACE(spl_fixpt_from_fraction(6, 1))); 948 946 SPL_ASSERT(check_max_downscale); 949 947 check_max_downscale = spl_fixpt_le(spl_scratch->scl_data.ratios.horz_c, 950 - spl_fixpt_from_fraction(6, 1)); 948 + SPL_NAMESPACE(spl_fixpt_from_fraction(6, 1))); 951 949 SPL_ASSERT(check_max_downscale); 952 950 check_max_downscale = spl_fixpt_le(spl_scratch->scl_data.ratios.vert_c, 953 - spl_fixpt_from_fraction(6, 1)); 951 + SPL_NAMESPACE(spl_fixpt_from_fraction(6, 1))); 954 952 SPL_ASSERT(check_max_downscale); 955 953 956 954 ··· 1196 1194 { 1197 1195 struct spl_fixed31_32 bot; 1198 1196 1199 - dscl_prog_data->ratios.h_scale_ratio = spl_fixpt_u3d19(scl_data->ratios.horz) << 5; 1200 - dscl_prog_data->ratios.v_scale_ratio = spl_fixpt_u3d19(scl_data->ratios.vert) << 5; 1201 - dscl_prog_data->ratios.h_scale_ratio_c = spl_fixpt_u3d19(scl_data->ratios.horz_c) << 5; 1202 - dscl_prog_data->ratios.v_scale_ratio_c = spl_fixpt_u3d19(scl_data->ratios.vert_c) << 5; 1197 + dscl_prog_data->ratios.h_scale_ratio = SPL_NAMESPACE(spl_fixpt_u3d19( 1198 + scl_data->ratios.horz)) << 5; 1199 + dscl_prog_data->ratios.v_scale_ratio = SPL_NAMESPACE(spl_fixpt_u3d19( 1200 + scl_data->ratios.vert)) << 5; 1201 + dscl_prog_data->ratios.h_scale_ratio_c = SPL_NAMESPACE(spl_fixpt_u3d19( 1202 + scl_data->ratios.horz_c)) << 5; 1203 + dscl_prog_data->ratios.v_scale_ratio_c = SPL_NAMESPACE(spl_fixpt_u3d19( 1204 + scl_data->ratios.vert_c)) << 5; 1203 1205 /* 1204 1206 * 0.24 format for fraction, first five bits zeroed 1205 1207 */ 1206 1208 dscl_prog_data->init.h_filter_init_frac = 1207 - spl_fixpt_u0d19(scl_data->inits.h) << 5; 1209 + SPL_NAMESPACE(spl_fixpt_u0d19(scl_data->inits.h)) << 5; 1208 1210 dscl_prog_data->init.h_filter_init_int = 1209 1211 spl_fixpt_floor(scl_data->inits.h); 1210 1212 dscl_prog_data->init.h_filter_init_frac_c = 1211 - spl_fixpt_u0d19(scl_data->inits.h_c) << 5; 1213 + SPL_NAMESPACE(spl_fixpt_u0d19(scl_data->inits.h_c)) << 5; 1212 1214 dscl_prog_data->init.h_filter_init_int_c = 1213 1215 spl_fixpt_floor(scl_data->inits.h_c); 1214 1216 dscl_prog_data->init.v_filter_init_frac = 1215 - spl_fixpt_u0d19(scl_data->inits.v) << 5; 1217 + SPL_NAMESPACE(spl_fixpt_u0d19(scl_data->inits.v)) << 5; 1216 1218 dscl_prog_data->init.v_filter_init_int = 1217 1219 spl_fixpt_floor(scl_data->inits.v); 1218 1220 dscl_prog_data->init.v_filter_init_frac_c = 1219 - spl_fixpt_u0d19(scl_data->inits.v_c) << 5; 1221 + SPL_NAMESPACE(spl_fixpt_u0d19(scl_data->inits.v_c)) << 5; 1220 1222 dscl_prog_data->init.v_filter_init_int_c = 1221 1223 spl_fixpt_floor(scl_data->inits.v_c); 1222 1224 1223 1225 bot = spl_fixpt_add(scl_data->inits.v, scl_data->ratios.vert); 1224 - dscl_prog_data->init.v_filter_init_bot_frac = spl_fixpt_u0d19(bot) << 5; 1226 + dscl_prog_data->init.v_filter_init_bot_frac = SPL_NAMESPACE(spl_fixpt_u0d19(bot)) << 5; 1225 1227 dscl_prog_data->init.v_filter_init_bot_int = spl_fixpt_floor(bot); 1226 1228 bot = spl_fixpt_add(scl_data->inits.v_c, scl_data->ratios.vert_c); 1227 - dscl_prog_data->init.v_filter_init_bot_frac_c = spl_fixpt_u0d19(bot) << 5; 1229 + dscl_prog_data->init.v_filter_init_bot_frac_c = SPL_NAMESPACE(spl_fixpt_u0d19(bot)) << 5; 1228 1230 dscl_prog_data->init.v_filter_init_bot_int_c = spl_fixpt_floor(bot); 1229 1231 } 1230 1232 ··· 1276 1270 // Set viewport_c 1277 1271 dscl_prog_data->viewport_c = spl_scratch->scl_data.viewport_c; 1278 1272 // Set filters data 1279 - spl_set_filters_data(dscl_prog_data, data, enable_easf_v, enable_easf_h); 1273 + SPL_NAMESPACE(spl_set_filters_data(dscl_prog_data, data, enable_easf_v, enable_easf_h)); 1280 1274 } 1281 1275 1282 1276 /* Calculate C0-C3 coefficients based on HDR_mult */ ··· 1292 1286 else 1293 1287 hdr_multx100_int = 100; /* default for 80 nits otherwise */ 1294 1288 1295 - hdr_mult = spl_fixpt_from_fraction((long long)hdr_multx100_int, 100LL); 1296 - c0_mult = spl_fixpt_from_fraction(2126LL, 10000LL); 1297 - c1_mult = spl_fixpt_from_fraction(7152LL, 10000LL); 1298 - c2_mult = spl_fixpt_from_fraction(722LL, 10000LL); 1289 + hdr_mult = SPL_NAMESPACE(spl_fixpt_from_fraction((long long)hdr_multx100_int, 100LL)); 1290 + c0_mult = SPL_NAMESPACE(spl_fixpt_from_fraction(2126LL, 10000LL)); 1291 + c1_mult = SPL_NAMESPACE(spl_fixpt_from_fraction(7152LL, 10000LL)); 1292 + c2_mult = SPL_NAMESPACE(spl_fixpt_from_fraction(722LL, 10000LL)); 1299 1293 1300 - c0_calc = spl_fixpt_mul(hdr_mult, spl_fixpt_mul(c0_mult, spl_fixpt_from_fraction( 1301 - 16384LL, 125LL))); 1302 - c1_calc = spl_fixpt_mul(hdr_mult, spl_fixpt_mul(c1_mult, spl_fixpt_from_fraction( 1303 - 16384LL, 125LL))); 1304 - c2_calc = spl_fixpt_mul(hdr_mult, spl_fixpt_mul(c2_mult, spl_fixpt_from_fraction( 1305 - 16384LL, 125LL))); 1294 + c0_calc = SPL_NAMESPACE(spl_fixpt_mul(hdr_mult, SPL_NAMESPACE(spl_fixpt_mul(c0_mult, 1295 + SPL_NAMESPACE(spl_fixpt_from_fraction(16384LL, 125LL)))))); 1296 + c1_calc = SPL_NAMESPACE(spl_fixpt_mul(hdr_mult, SPL_NAMESPACE(spl_fixpt_mul(c1_mult, 1297 + SPL_NAMESPACE(spl_fixpt_from_fraction(16384LL, 125LL)))))); 1298 + c2_calc = SPL_NAMESPACE(spl_fixpt_mul(hdr_mult, SPL_NAMESPACE(spl_fixpt_mul(c2_mult, 1299 + SPL_NAMESPACE(spl_fixpt_from_fraction(16384LL, 125LL)))))); 1306 1300 1307 1301 fmt.exponenta_bits = 5; 1308 1302 fmt.mantissa_bits = 10; 1309 1303 fmt.sign = true; 1310 1304 1311 1305 // fp1.5.10, C0 coefficient (LN_rec709: HDR_MULT * 0.212600 * 2^14/125) 1312 - spl_convert_to_custom_float_format(c0_calc, &fmt, &dscl_prog_data->easf_matrix_c0); 1306 + SPL_NAMESPACE(spl_convert_to_custom_float_format(c0_calc, &fmt, 1307 + &dscl_prog_data->easf_matrix_c0)); 1313 1308 // fp1.5.10, C1 coefficient (LN_rec709: HDR_MULT * 0.715200 * 2^14/125) 1314 - spl_convert_to_custom_float_format(c1_calc, &fmt, &dscl_prog_data->easf_matrix_c1); 1309 + SPL_NAMESPACE(spl_convert_to_custom_float_format(c1_calc, &fmt, 1310 + &dscl_prog_data->easf_matrix_c1)); 1315 1311 // fp1.5.10, C2 coefficient (LN_rec709: HDR_MULT * 0.072200 * 2^14/125) 1316 - spl_convert_to_custom_float_format(c2_calc, &fmt, &dscl_prog_data->easf_matrix_c2); 1312 + SPL_NAMESPACE(spl_convert_to_custom_float_format(c2_calc, &fmt, 1313 + &dscl_prog_data->easf_matrix_c2)); 1317 1314 dscl_prog_data->easf_matrix_c3 = 0x0; // fp1.5.10, C3 coefficient 1318 1315 } 1319 1316 ··· 1334 1325 dscl_prog_data->easf_v_bf1_en = 1; // 1-bit, BF1 calculation enable, 0=disable, 1=enable 1335 1326 dscl_prog_data->easf_v_bf2_mode = 0xF; // 4-bit, BF2 calculation mode 1336 1327 /* 2-bit, BF3 chroma mode correction calculation mode */ 1337 - dscl_prog_data->easf_v_bf3_mode = spl_get_v_bf3_mode( 1338 - spl_scratch->scl_data.recip_ratios.vert); 1328 + dscl_prog_data->easf_v_bf3_mode = SPL_NAMESPACE(spl_get_v_bf3_mode( 1329 + spl_scratch->scl_data.recip_ratios.vert)); 1339 1330 /* FP1.5.10 [ minCoef ]*/ 1340 1331 dscl_prog_data->easf_v_ringest_3tap_dntilt_uptilt = 1341 - spl_get_3tap_dntilt_uptilt_offset(spl_scratch->scl_data.taps.v_taps, 1342 - spl_scratch->scl_data.recip_ratios.vert); 1332 + SPL_NAMESPACE(spl_get_3tap_dntilt_uptilt_offset(spl_scratch->scl_data.taps.v_taps, 1333 + spl_scratch->scl_data.recip_ratios.vert)); 1343 1334 /* FP1.5.10 [ upTiltMaxVal ]*/ 1344 1335 dscl_prog_data->easf_v_ringest_3tap_uptilt_max = 1345 - spl_get_3tap_uptilt_maxval(spl_scratch->scl_data.taps.v_taps, 1346 - spl_scratch->scl_data.recip_ratios.vert); 1336 + SPL_NAMESPACE(spl_get_3tap_uptilt_maxval(spl_scratch->scl_data.taps.v_taps, 1337 + spl_scratch->scl_data.recip_ratios.vert)); 1347 1338 /* FP1.5.10 [ dnTiltSlope ]*/ 1348 1339 dscl_prog_data->easf_v_ringest_3tap_dntilt_slope = 1349 - spl_get_3tap_dntilt_slope(spl_scratch->scl_data.taps.v_taps, 1350 - spl_scratch->scl_data.recip_ratios.vert); 1340 + SPL_NAMESPACE(spl_get_3tap_dntilt_slope(spl_scratch->scl_data.taps.v_taps, 1341 + spl_scratch->scl_data.recip_ratios.vert)); 1351 1342 /* FP1.5.10 [ upTilt1Slope ]*/ 1352 1343 dscl_prog_data->easf_v_ringest_3tap_uptilt1_slope = 1353 - spl_get_3tap_uptilt1_slope(spl_scratch->scl_data.taps.v_taps, 1354 - spl_scratch->scl_data.recip_ratios.vert); 1344 + SPL_NAMESPACE(spl_get_3tap_uptilt1_slope(spl_scratch->scl_data.taps.v_taps, 1345 + spl_scratch->scl_data.recip_ratios.vert)); 1355 1346 /* FP1.5.10 [ upTilt2Slope ]*/ 1356 1347 dscl_prog_data->easf_v_ringest_3tap_uptilt2_slope = 1357 - spl_get_3tap_uptilt2_slope(spl_scratch->scl_data.taps.v_taps, 1358 - spl_scratch->scl_data.recip_ratios.vert); 1348 + SPL_NAMESPACE(spl_get_3tap_uptilt2_slope(spl_scratch->scl_data.taps.v_taps, 1349 + spl_scratch->scl_data.recip_ratios.vert)); 1359 1350 /* FP1.5.10 [ upTilt2Offset ]*/ 1360 1351 dscl_prog_data->easf_v_ringest_3tap_uptilt2_offset = 1361 - spl_get_3tap_uptilt2_offset(spl_scratch->scl_data.taps.v_taps, 1362 - spl_scratch->scl_data.recip_ratios.vert); 1352 + SPL_NAMESPACE(spl_get_3tap_uptilt2_offset(spl_scratch->scl_data.taps.v_taps, 1353 + spl_scratch->scl_data.recip_ratios.vert)); 1363 1354 /* FP1.5.10; (2.0) Ring reducer gain for 4 or 6-tap mode [H_REDUCER_GAIN4] */ 1364 1355 dscl_prog_data->easf_v_ringest_eventap_reduceg1 = 1365 - spl_get_reducer_gain4(spl_scratch->scl_data.taps.v_taps, 1366 - spl_scratch->scl_data.recip_ratios.vert); 1356 + SPL_NAMESPACE(spl_get_reducer_gain4(spl_scratch->scl_data.taps.v_taps, 1357 + spl_scratch->scl_data.recip_ratios.vert)); 1367 1358 /* FP1.5.10; (2.5) Ring reducer gain for 6-tap mode [V_REDUCER_GAIN6] */ 1368 1359 dscl_prog_data->easf_v_ringest_eventap_reduceg2 = 1369 - spl_get_reducer_gain6(spl_scratch->scl_data.taps.v_taps, 1370 - spl_scratch->scl_data.recip_ratios.vert); 1360 + SPL_NAMESPACE(spl_get_reducer_gain6(spl_scratch->scl_data.taps.v_taps, 1361 + spl_scratch->scl_data.recip_ratios.vert)); 1371 1362 /* FP1.5.10; (-0.135742) Ring gain for 6-tap set to -139/1024 */ 1372 1363 dscl_prog_data->easf_v_ringest_eventap_gain1 = 1373 - spl_get_gainRing4(spl_scratch->scl_data.taps.v_taps, 1374 - spl_scratch->scl_data.recip_ratios.vert); 1364 + SPL_NAMESPACE(spl_get_gainRing4(spl_scratch->scl_data.taps.v_taps, 1365 + spl_scratch->scl_data.recip_ratios.vert)); 1375 1366 /* FP1.5.10; (-0.024414) Ring gain for 6-tap set to -25/1024 */ 1376 1367 dscl_prog_data->easf_v_ringest_eventap_gain2 = 1377 - spl_get_gainRing6(spl_scratch->scl_data.taps.v_taps, 1378 - spl_scratch->scl_data.recip_ratios.vert); 1368 + SPL_NAMESPACE(spl_get_gainRing6(spl_scratch->scl_data.taps.v_taps, 1369 + spl_scratch->scl_data.recip_ratios.vert)); 1379 1370 dscl_prog_data->easf_v_bf_maxa = 63; //Vertical Max BF value A in U0.6 format.Selected if V_FCNTL == 0 1380 1371 dscl_prog_data->easf_v_bf_maxb = 63; //Vertical Max BF value A in U0.6 format.Selected if V_FCNTL == 1 1381 1372 dscl_prog_data->easf_v_bf_mina = 0; //Vertical Min BF value A in U0.6 format.Selected if V_FCNTL == 0 ··· 1500 1491 dscl_prog_data->easf_h_bf2_mode = 1501 1492 0xF; // 4-bit, BF2 calculation mode 1502 1493 /* 2-bit, BF3 chroma mode correction calculation mode */ 1503 - dscl_prog_data->easf_h_bf3_mode = spl_get_h_bf3_mode( 1504 - spl_scratch->scl_data.recip_ratios.horz); 1494 + dscl_prog_data->easf_h_bf3_mode = SPL_NAMESPACE(spl_get_h_bf3_mode( 1495 + spl_scratch->scl_data.recip_ratios.horz)); 1505 1496 /* FP1.5.10; (2.0) Ring reducer gain for 4 or 6-tap mode [H_REDUCER_GAIN4] */ 1506 1497 dscl_prog_data->easf_h_ringest_eventap_reduceg1 = 1507 - spl_get_reducer_gain4(spl_scratch->scl_data.taps.h_taps, 1508 - spl_scratch->scl_data.recip_ratios.horz); 1498 + SPL_NAMESPACE(spl_get_reducer_gain4(spl_scratch->scl_data.taps.h_taps, 1499 + spl_scratch->scl_data.recip_ratios.horz)); 1509 1500 /* FP1.5.10; (2.5) Ring reducer gain for 6-tap mode [V_REDUCER_GAIN6] */ 1510 1501 dscl_prog_data->easf_h_ringest_eventap_reduceg2 = 1511 - spl_get_reducer_gain6(spl_scratch->scl_data.taps.h_taps, 1512 - spl_scratch->scl_data.recip_ratios.horz); 1502 + SPL_NAMESPACE(spl_get_reducer_gain6(spl_scratch->scl_data.taps.h_taps, 1503 + spl_scratch->scl_data.recip_ratios.horz)); 1513 1504 /* FP1.5.10; (-0.135742) Ring gain for 6-tap set to -139/1024 */ 1514 1505 dscl_prog_data->easf_h_ringest_eventap_gain1 = 1515 - spl_get_gainRing4(spl_scratch->scl_data.taps.h_taps, 1516 - spl_scratch->scl_data.recip_ratios.horz); 1506 + SPL_NAMESPACE(spl_get_gainRing4(spl_scratch->scl_data.taps.h_taps, 1507 + spl_scratch->scl_data.recip_ratios.horz)); 1517 1508 /* FP1.5.10; (-0.024414) Ring gain for 6-tap set to -25/1024 */ 1518 1509 dscl_prog_data->easf_h_ringest_eventap_gain2 = 1519 - spl_get_gainRing6(spl_scratch->scl_data.taps.h_taps, 1520 - spl_scratch->scl_data.recip_ratios.horz); 1510 + SPL_NAMESPACE(spl_get_gainRing6(spl_scratch->scl_data.taps.h_taps, 1511 + spl_scratch->scl_data.recip_ratios.horz)); 1521 1512 dscl_prog_data->easf_h_bf_maxa = 63; //Horz Max BF value A in U0.6 format.Selected if H_FCNTL==0 1522 1513 dscl_prog_data->easf_h_bf_maxb = 63; //Horz Max BF value B in U0.6 format.Selected if H_FCNTL==1 1523 1514 dscl_prog_data->easf_h_bf_mina = 0; //Horz Min BF value B in U0.6 format.Selected if H_FCNTL==0 ··· 1698 1689 return; 1699 1690 } 1700 1691 1701 - spl_build_isharp_1dlut_from_reference_curve(ratio, setup, adp_sharpness, 1702 - scale_to_sharpness_policy); 1703 - memcpy(dscl_prog_data->isharp_delta, spl_get_pregen_filter_isharp_1D_lut(setup), 1692 + SPL_NAMESPACE(spl_build_isharp_1dlut_from_reference_curve(ratio, setup, adp_sharpness, 1693 + scale_to_sharpness_policy)); 1694 + memcpy(dscl_prog_data->isharp_delta, SPL_NAMESPACE(spl_get_pregen_filter_isharp_1D_lut(setup)), 1704 1695 sizeof(uint32_t) * ISHARP_LUT_TABLE_SIZE); 1705 1696 dscl_prog_data->sharpness_level = adp_sharpness.sharpness_level; 1706 1697 ··· 1819 1810 } 1820 1811 1821 1812 // Set the values as per lookup table 1822 - spl_set_blur_scale_data(dscl_prog_data, data); 1813 + SPL_NAMESPACE(spl_set_blur_scale_data(dscl_prog_data, data)); 1823 1814 } 1824 1815 1825 1816 /* Calculate recout, scaling ratio, and viewport, then get optimal number of taps */ ··· 1931 1922 spl_set_taps_data(dscl_prog_data, data); 1932 1923 return res; 1933 1924 } 1934 -
-8
drivers/gpu/drm/amd/display/dc/sspl/dc_spl.h
··· 9 9 #define BLACK_OFFSET_RGB_Y 0x0 10 10 #define BLACK_OFFSET_CBCR 0x8000 11 11 12 - #ifndef SPL_PFX_ 13 - #define SPL_PFX_ 14 - #endif 15 - 16 - #define SPL_EXPAND2(a, b) a##b 17 - #define SPL_EXPAND(a, b) SPL_EXPAND2(a, b) 18 - #define SPL_NAMESPACE(symbol) SPL_EXPAND(SPL_PFX_, symbol) 19 - 20 12 21 13 /* SPL interfaces */ 22 14
+2 -2
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_filters.c
··· 4 4 5 5 #include "dc_spl_filters.h" 6 6 7 - void convert_filter_s1_10_to_s1_12(const uint16_t *s1_10_filter, 8 - uint16_t *s1_12_filter, int num_taps) 7 + void SPL_NAMESPACE(convert_filter_s1_10_to_s1_12(const uint16_t *s1_10_filter, 8 + uint16_t *s1_12_filter, int num_taps)) 9 9 { 10 10 int num_entries = NUM_PHASES_COEFF * num_taps; 11 11 int i;
+2 -2
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_filters.h
··· 9 9 10 10 #define NUM_PHASES_COEFF 33 11 11 12 - void convert_filter_s1_10_to_s1_12(const uint16_t *s1_10_filter, 13 - uint16_t *s1_12_filter, int num_taps); 12 + void SPL_NAMESPACE(convert_filter_s1_10_to_s1_12(const uint16_t *s1_10_filter, 13 + uint16_t *s1_12_filter, int num_taps)); 14 14 15 15 #endif /* __DC_SPL_FILTERS_H__ */
+16 -15
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_isharp_filters.c
··· 367 367 sharpness_level_down_adj = 0; 368 368 lookup_ptr = sharpness_level_adj; 369 369 while (j < NUM_SHARPNESS_ADJ_LEVELS) { 370 - ratio_level = spl_fixpt_from_fraction(lookup_ptr->ratio_numer, 371 - lookup_ptr->ratio_denom); 370 + ratio_level = SPL_NAMESPACE(spl_fixpt_from_fraction(lookup_ptr->ratio_numer, 371 + lookup_ptr->ratio_denom)); 372 372 if (ratio.value >= ratio_level.value) { 373 373 sharpness_level_down_adj = lookup_ptr->level_down_adj; 374 374 break; ··· 447 447 return sharpness_level; 448 448 } 449 449 450 - void spl_build_isharp_1dlut_from_reference_curve(struct spl_fixed31_32 ratio, enum system_setup setup, 451 - struct adaptive_sharpness sharpness, enum scale_to_sharpness_policy scale_to_sharpness_policy) 450 + void SPL_NAMESPACE(spl_build_isharp_1dlut_from_reference_curve( 451 + struct spl_fixed31_32 ratio, enum system_setup setup, 452 + struct adaptive_sharpness sharpness, enum scale_to_sharpness_policy scale_to_sharpness_policy)) 452 453 { 453 454 uint8_t *byte_ptr_1dlut_src, *byte_ptr_1dlut_dst; 454 455 struct spl_fixed31_32 sharp_base, sharp_calc, sharp_level; ··· 462 461 unsigned int sharpnessX1000 = spl_calculate_sharpness_level(ratio, 463 462 sharpness.sharpness_level, setup, 464 463 sharpness.sharpness_range, scale_to_sharpness_policy); 465 - sharp_level = spl_fixpt_from_fraction(sharpnessX1000, 1000); 464 + sharp_level = SPL_NAMESPACE(spl_fixpt_from_fraction(sharpnessX1000, 1000)); 466 465 467 466 /* 468 467 * Check if pregen 1dlut table is already precalculated ··· 487 486 memset(byte_ptr_1dlut_dst, 0, size_1dlut); 488 487 for (j = 0; j < size_1dlut; j++) { 489 488 sharp_base = spl_fixpt_from_int((int)*byte_ptr_1dlut_src); 490 - sharp_calc = spl_fixpt_mul(sharp_base, sharp_level); 489 + sharp_calc = SPL_NAMESPACE(spl_fixpt_mul(sharp_base, sharp_level)); 491 490 sharp_calc = spl_fixpt_div(sharp_calc, spl_fixpt_from_int(3)); 492 491 sharp_calc = spl_fixpt_min(spl_fixpt_from_int(255), sharp_calc); 493 - sharp_calc = spl_fixpt_add(sharp_calc, spl_fixpt_from_fraction(1, 2)); 492 + sharp_calc = spl_fixpt_add(sharp_calc, 493 + SPL_NAMESPACE(spl_fixpt_from_fraction(1, 2))); 494 494 sharp_calc_int = spl_fixpt_floor(sharp_calc); 495 495 /* Clamp it at 0x7F so it doesn't wrap */ 496 496 if (sharp_calc_int > 127) ··· 508 506 filter_isharp_1D_lut_pregen[setup].sharpness_denom = 1000; 509 507 } 510 508 511 - uint32_t *spl_get_pregen_filter_isharp_1D_lut(enum system_setup setup) 509 + uint32_t *SPL_NAMESPACE(spl_get_pregen_filter_isharp_1D_lut(enum system_setup setup)) 512 510 { 513 511 return filter_isharp_1D_lut_pregen[setup].value; 514 512 } 515 513 516 - const uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps) 514 + const uint16_t *SPL_NAMESPACE(spl_dscl_get_blur_scale_coeffs_64p(int taps)) 517 515 { 518 516 if (taps == 3) 519 517 return filter_isharp_bs_3tap_64p_s1_12; ··· 528 526 } 529 527 } 530 528 531 - const uint16_t *spl_dscl_get_blur_scale_coeffs_64p_s1_10(int taps) 529 + const uint16_t *SPL_NAMESPACE(spl_dscl_get_blur_scale_coeffs_64p_s1_10(int taps)) 532 530 { 533 531 if (taps == 3) 534 532 return filter_isharp_bs_3tap_64p; ··· 543 541 } 544 542 } 545 543 546 - void spl_set_blur_scale_data(struct dscl_prog_data *dscl_prog_data, 547 - const struct spl_scaler_data *data) 544 + void SPL_NAMESPACE(spl_set_blur_scale_data(struct dscl_prog_data *dscl_prog_data, 545 + const struct spl_scaler_data *data)) 548 546 { 549 547 dscl_prog_data->filter_blur_scale_h = 550 - spl_dscl_get_blur_scale_coeffs_64p(data->taps.h_taps); 548 + SPL_NAMESPACE(spl_dscl_get_blur_scale_coeffs_64p(data->taps.h_taps)); 551 549 552 550 dscl_prog_data->filter_blur_scale_v = 553 - spl_dscl_get_blur_scale_coeffs_64p(data->taps.v_taps); 551 + SPL_NAMESPACE(spl_dscl_get_blur_scale_coeffs_64p(data->taps.v_taps)); 554 552 } 555 -
+9 -7
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_isharp_filters.h
··· 28 28 NUM_SHARPNESS_SETUPS 29 29 }; 30 30 31 - void spl_set_blur_scale_data(struct dscl_prog_data *dscl_prog_data, 32 - const struct spl_scaler_data *data); 31 + void SPL_NAMESPACE(spl_set_blur_scale_data(struct dscl_prog_data *dscl_prog_data, 32 + const struct spl_scaler_data *data)); 33 33 34 - void spl_build_isharp_1dlut_from_reference_curve(struct spl_fixed31_32 ratio, enum system_setup setup, 35 - struct adaptive_sharpness sharpness, enum scale_to_sharpness_policy scale_to_sharpness_policy); 36 - uint32_t *spl_get_pregen_filter_isharp_1D_lut(enum system_setup setup); 34 + void SPL_NAMESPACE(spl_build_isharp_1dlut_from_reference_curve( 35 + struct spl_fixed31_32 ratio, enum system_setup setup, 36 + struct adaptive_sharpness sharpness, 37 + enum scale_to_sharpness_policy scale_to_sharpness_policy)); 38 + uint32_t *SPL_NAMESPACE(spl_get_pregen_filter_isharp_1D_lut(enum system_setup setup)); 37 39 38 40 // public API 39 - const uint16_t *spl_dscl_get_blur_scale_coeffs_64p(int taps); 40 - const uint16_t *spl_dscl_get_blur_scale_coeffs_64p_s1_10(int taps); 41 + const uint16_t *SPL_NAMESPACE(spl_dscl_get_blur_scale_coeffs_64p(int taps)); 42 + const uint16_t *SPL_NAMESPACE(spl_dscl_get_blur_scale_coeffs_64p_s1_10(int taps)); 41 43 42 44 #endif /* __DC_SPL_ISHARP_FILTERS_H__ */
+79 -76
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_scl_easf_filters.c
··· 2194 2194 2195 2195 static const uint16_t *spl_get_easf_filter_3tap_64p(struct spl_fixed31_32 ratio) 2196 2196 { 2197 - if (ratio.value < spl_fixpt_from_fraction(3, 10).value) 2197 + if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(3, 10)).value) 2198 2198 return easf_filter_3tap_64p_ratio_0_30_s1_12; 2199 - else if (ratio.value < spl_fixpt_from_fraction(4, 10).value) 2199 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(4, 10)).value) 2200 2200 return easf_filter_3tap_64p_ratio_0_40_s1_12; 2201 - else if (ratio.value < spl_fixpt_from_fraction(5, 10).value) 2201 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(5, 10)).value) 2202 2202 return easf_filter_3tap_64p_ratio_0_50_s1_12; 2203 - else if (ratio.value < spl_fixpt_from_fraction(6, 10).value) 2203 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(6, 10)).value) 2204 2204 return easf_filter_3tap_64p_ratio_0_60_s1_12; 2205 - else if (ratio.value < spl_fixpt_from_fraction(7, 10).value) 2205 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(7, 10)).value) 2206 2206 return easf_filter_3tap_64p_ratio_0_70_s1_12; 2207 - else if (ratio.value < spl_fixpt_from_fraction(8, 10).value) 2207 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(8, 10)).value) 2208 2208 return easf_filter_3tap_64p_ratio_0_80_s1_12; 2209 - else if (ratio.value < spl_fixpt_from_fraction(9, 10).value) 2209 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(9, 10)).value) 2210 2210 return easf_filter_3tap_64p_ratio_0_90_s1_12; 2211 2211 else 2212 2212 return easf_filter_3tap_64p_ratio_1_00_s1_12; ··· 2214 2214 2215 2215 static const uint16_t *spl_get_easf_filter_4tap_64p(struct spl_fixed31_32 ratio) 2216 2216 { 2217 - if (ratio.value < spl_fixpt_from_fraction(3, 10).value) 2217 + if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(3, 10)).value) 2218 2218 return easf_filter_4tap_64p_ratio_0_30_s1_12; 2219 - else if (ratio.value < spl_fixpt_from_fraction(4, 10).value) 2219 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(4, 10)).value) 2220 2220 return easf_filter_4tap_64p_ratio_0_40_s1_12; 2221 - else if (ratio.value < spl_fixpt_from_fraction(5, 10).value) 2221 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(5, 10)).value) 2222 2222 return easf_filter_4tap_64p_ratio_0_50_s1_12; 2223 - else if (ratio.value < spl_fixpt_from_fraction(6, 10).value) 2223 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(6, 10)).value) 2224 2224 return easf_filter_4tap_64p_ratio_0_60_s1_12; 2225 - else if (ratio.value < spl_fixpt_from_fraction(7, 10).value) 2225 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(7, 10)).value) 2226 2226 return easf_filter_4tap_64p_ratio_0_70_s1_12; 2227 - else if (ratio.value < spl_fixpt_from_fraction(8, 10).value) 2227 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(8, 10)).value) 2228 2228 return easf_filter_4tap_64p_ratio_0_80_s1_12; 2229 - else if (ratio.value < spl_fixpt_from_fraction(9, 10).value) 2229 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(9, 10)).value) 2230 2230 return easf_filter_4tap_64p_ratio_0_90_s1_12; 2231 2231 else 2232 2232 return easf_filter_4tap_64p_ratio_1_00_s1_12; ··· 2234 2234 2235 2235 static const uint16_t *spl_get_easf_filter_6tap_64p(struct spl_fixed31_32 ratio) 2236 2236 { 2237 - if (ratio.value < spl_fixpt_from_fraction(3, 10).value) 2237 + if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(3, 10)).value) 2238 2238 return easf_filter_6tap_64p_ratio_0_30_s1_12; 2239 - else if (ratio.value < spl_fixpt_from_fraction(4, 10).value) 2239 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(4, 10)).value) 2240 2240 return easf_filter_6tap_64p_ratio_0_40_s1_12; 2241 - else if (ratio.value < spl_fixpt_from_fraction(5, 10).value) 2241 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(5, 10)).value) 2242 2242 return easf_filter_6tap_64p_ratio_0_50_s1_12; 2243 - else if (ratio.value < spl_fixpt_from_fraction(6, 10).value) 2243 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(6, 10)).value) 2244 2244 return easf_filter_6tap_64p_ratio_0_60_s1_12; 2245 - else if (ratio.value < spl_fixpt_from_fraction(7, 10).value) 2245 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(7, 10)).value) 2246 2246 return easf_filter_6tap_64p_ratio_0_70_s1_12; 2247 - else if (ratio.value < spl_fixpt_from_fraction(8, 10).value) 2247 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(8, 10)).value) 2248 2248 return easf_filter_6tap_64p_ratio_0_80_s1_12; 2249 - else if (ratio.value < spl_fixpt_from_fraction(9, 10).value) 2249 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(9, 10)).value) 2250 2250 return easf_filter_6tap_64p_ratio_0_90_s1_12; 2251 2251 else 2252 2252 return easf_filter_6tap_64p_ratio_1_00_s1_12; 2253 2253 } 2254 2254 2255 - const uint16_t *spl_dscl_get_easf_filter_coeffs_64p(int taps, struct spl_fixed31_32 ratio) 2255 + const uint16_t *SPL_NAMESPACE(spl_dscl_get_easf_filter_coeffs_64p( 2256 + int taps, struct spl_fixed31_32 ratio)) 2256 2257 { 2257 2258 if (taps == 6) 2258 2259 return spl_get_easf_filter_6tap_64p(ratio); ··· 2270 2269 2271 2270 static const uint16_t *spl_get_easf_filter_3tap_64p_s1_10(struct spl_fixed31_32 ratio) 2272 2271 { 2273 - if (ratio.value < spl_fixpt_from_fraction(3, 10).value) 2272 + if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(3, 10)).value) 2274 2273 return easf_filter_3tap_64p_ratio_0_30; 2275 - else if (ratio.value < spl_fixpt_from_fraction(4, 10).value) 2274 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(4, 10)).value) 2276 2275 return easf_filter_3tap_64p_ratio_0_40; 2277 - else if (ratio.value < spl_fixpt_from_fraction(5, 10).value) 2276 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(5, 10)).value) 2278 2277 return easf_filter_3tap_64p_ratio_0_50; 2279 - else if (ratio.value < spl_fixpt_from_fraction(6, 10).value) 2278 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(6, 10)).value) 2280 2279 return easf_filter_3tap_64p_ratio_0_60; 2281 - else if (ratio.value < spl_fixpt_from_fraction(7, 10).value) 2280 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(7, 10)).value) 2282 2281 return easf_filter_3tap_64p_ratio_0_70; 2283 - else if (ratio.value < spl_fixpt_from_fraction(8, 10).value) 2282 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(8, 10)).value) 2284 2283 return easf_filter_3tap_64p_ratio_0_80; 2285 - else if (ratio.value < spl_fixpt_from_fraction(9, 10).value) 2284 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(9, 10)).value) 2286 2285 return easf_filter_3tap_64p_ratio_0_90; 2287 2286 else 2288 2287 return easf_filter_3tap_64p_ratio_1_00; ··· 2290 2289 2291 2290 static const uint16_t *spl_get_easf_filter_4tap_64p_s1_10(struct spl_fixed31_32 ratio) 2292 2291 { 2293 - if (ratio.value < spl_fixpt_from_fraction(3, 10).value) 2292 + if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(3, 10)).value) 2294 2293 return easf_filter_4tap_64p_ratio_0_30; 2295 - else if (ratio.value < spl_fixpt_from_fraction(4, 10).value) 2294 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(4, 10)).value) 2296 2295 return easf_filter_4tap_64p_ratio_0_40; 2297 - else if (ratio.value < spl_fixpt_from_fraction(5, 10).value) 2296 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(5, 10)).value) 2298 2297 return easf_filter_4tap_64p_ratio_0_50; 2299 - else if (ratio.value < spl_fixpt_from_fraction(6, 10).value) 2298 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(6, 10)).value) 2300 2299 return easf_filter_4tap_64p_ratio_0_60; 2301 - else if (ratio.value < spl_fixpt_from_fraction(7, 10).value) 2300 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(7, 10)).value) 2302 2301 return easf_filter_4tap_64p_ratio_0_70; 2303 - else if (ratio.value < spl_fixpt_from_fraction(8, 10).value) 2302 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(8, 10)).value) 2304 2303 return easf_filter_4tap_64p_ratio_0_80; 2305 - else if (ratio.value < spl_fixpt_from_fraction(9, 10).value) 2304 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(9, 10)).value) 2306 2305 return easf_filter_4tap_64p_ratio_0_90; 2307 2306 else 2308 2307 return easf_filter_4tap_64p_ratio_1_00; ··· 2310 2309 2311 2310 static const uint16_t *spl_get_easf_filter_6tap_64p_s1_10(struct spl_fixed31_32 ratio) 2312 2311 { 2313 - if (ratio.value < spl_fixpt_from_fraction(3, 10).value) 2312 + if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(3, 10)).value) 2314 2313 return easf_filter_6tap_64p_ratio_0_30; 2315 - else if (ratio.value < spl_fixpt_from_fraction(4, 10).value) 2314 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(4, 10)).value) 2316 2315 return easf_filter_6tap_64p_ratio_0_40; 2317 - else if (ratio.value < spl_fixpt_from_fraction(5, 10).value) 2316 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(5, 10)).value) 2318 2317 return easf_filter_6tap_64p_ratio_0_50; 2319 - else if (ratio.value < spl_fixpt_from_fraction(6, 10).value) 2318 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(6, 10)).value) 2320 2319 return easf_filter_6tap_64p_ratio_0_60; 2321 - else if (ratio.value < spl_fixpt_from_fraction(7, 10).value) 2320 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(7, 10)).value) 2322 2321 return easf_filter_6tap_64p_ratio_0_70; 2323 - else if (ratio.value < spl_fixpt_from_fraction(8, 10).value) 2322 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(8, 10)).value) 2324 2323 return easf_filter_6tap_64p_ratio_0_80; 2325 - else if (ratio.value < spl_fixpt_from_fraction(9, 10).value) 2324 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(9, 10)).value) 2326 2325 return easf_filter_6tap_64p_ratio_0_90; 2327 2326 else 2328 2327 return easf_filter_6tap_64p_ratio_1_00; 2329 2328 } 2330 2329 2331 - const uint16_t *spl_dscl_get_easf_filter_coeffs_64p_s1_10(int taps, struct spl_fixed31_32 ratio) 2330 + const uint16_t *SPL_NAMESPACE(spl_dscl_get_easf_filter_coeffs_64p_s1_10( 2331 + int taps, struct spl_fixed31_32 ratio)) 2332 2332 { 2333 2333 if (taps == 6) 2334 2334 return spl_get_easf_filter_6tap_64p_s1_10(ratio); ··· 2344 2342 } 2345 2343 } 2346 2344 2347 - void spl_set_filters_data(struct dscl_prog_data *dscl_prog_data, 2345 + void SPL_NAMESPACE(spl_set_filters_data(struct dscl_prog_data *dscl_prog_data, 2348 2346 const struct spl_scaler_data *data, bool enable_easf_v, 2349 - bool enable_easf_h) 2347 + bool enable_easf_h)) 2350 2348 { 2351 2349 /* 2352 2350 * Old coefficients calculated scaling ratio = input / output 2353 2351 * New coefficients are calculated based on = output / input 2354 2352 */ 2355 2353 if (enable_easf_h) { 2356 - dscl_prog_data->filter_h = spl_dscl_get_easf_filter_coeffs_64p( 2357 - data->taps.h_taps, data->recip_ratios.horz); 2354 + dscl_prog_data->filter_h = SPL_NAMESPACE(spl_dscl_get_easf_filter_coeffs_64p( 2355 + data->taps.h_taps, data->recip_ratios.horz)); 2358 2356 2359 - dscl_prog_data->filter_h_c = spl_dscl_get_easf_filter_coeffs_64p( 2360 - data->taps.h_taps_c, data->recip_ratios.horz_c); 2357 + dscl_prog_data->filter_h_c = SPL_NAMESPACE(spl_dscl_get_easf_filter_coeffs_64p( 2358 + data->taps.h_taps_c, data->recip_ratios.horz_c)); 2361 2359 } else { 2362 - dscl_prog_data->filter_h = spl_dscl_get_filter_coeffs_64p( 2363 - data->taps.h_taps, data->ratios.horz); 2360 + dscl_prog_data->filter_h = SPL_NAMESPACE(spl_dscl_get_filter_coeffs_64p( 2361 + data->taps.h_taps, data->ratios.horz)); 2364 2362 2365 - dscl_prog_data->filter_h_c = spl_dscl_get_filter_coeffs_64p( 2366 - data->taps.h_taps_c, data->ratios.horz_c); 2363 + dscl_prog_data->filter_h_c = SPL_NAMESPACE(spl_dscl_get_filter_coeffs_64p( 2364 + data->taps.h_taps_c, data->ratios.horz_c)); 2367 2365 } 2368 2366 if (enable_easf_v) { 2369 - dscl_prog_data->filter_v = spl_dscl_get_easf_filter_coeffs_64p( 2370 - data->taps.v_taps, data->recip_ratios.vert); 2367 + dscl_prog_data->filter_v = SPL_NAMESPACE(spl_dscl_get_easf_filter_coeffs_64p( 2368 + data->taps.v_taps, data->recip_ratios.vert)); 2371 2369 2372 - dscl_prog_data->filter_v_c = spl_dscl_get_easf_filter_coeffs_64p( 2373 - data->taps.v_taps_c, data->recip_ratios.vert_c); 2370 + dscl_prog_data->filter_v_c = SPL_NAMESPACE(spl_dscl_get_easf_filter_coeffs_64p( 2371 + data->taps.v_taps_c, data->recip_ratios.vert_c)); 2374 2372 } else { 2375 - dscl_prog_data->filter_v = spl_dscl_get_filter_coeffs_64p( 2376 - data->taps.v_taps, data->ratios.vert); 2373 + dscl_prog_data->filter_v = SPL_NAMESPACE(spl_dscl_get_filter_coeffs_64p( 2374 + data->taps.v_taps, data->ratios.vert)); 2377 2375 2378 - dscl_prog_data->filter_v_c = spl_dscl_get_filter_coeffs_64p( 2379 - data->taps.v_taps_c, data->ratios.vert_c); 2376 + dscl_prog_data->filter_v_c = SPL_NAMESPACE(spl_dscl_get_filter_coeffs_64p( 2377 + data->taps.v_taps_c, data->ratios.vert_c)); 2380 2378 } 2381 2379 } 2382 2380 ··· 2397 2395 if (lookup_table_index_ptr->numer < 0) 2398 2396 break; 2399 2397 2400 - if (ratio.value < spl_fixpt_from_fraction( 2398 + if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction( 2401 2399 lookup_table_index_ptr->numer, 2402 - lookup_table_index_ptr->denom).value) { 2400 + lookup_table_index_ptr->denom)).value) { 2403 2401 value = lookup_table_index_ptr->reg_value; 2404 2402 break; 2405 2403 } ··· 2408 2406 } 2409 2407 return value; 2410 2408 } 2411 - uint32_t spl_get_v_bf3_mode(struct spl_fixed31_32 ratio) 2409 + uint32_t SPL_NAMESPACE(spl_get_v_bf3_mode(struct spl_fixed31_32 ratio)) 2412 2410 { 2413 2411 uint32_t value; 2414 2412 unsigned int num_entries = sizeof(easf_v_bf3_mode_lookup) / ··· 2417 2415 easf_v_bf3_mode_lookup, num_entries); 2418 2416 return value; 2419 2417 } 2420 - uint32_t spl_get_h_bf3_mode(struct spl_fixed31_32 ratio) 2418 + uint32_t SPL_NAMESPACE(spl_get_h_bf3_mode(struct spl_fixed31_32 ratio)) 2421 2419 { 2422 2420 uint32_t value; 2423 2421 unsigned int num_entries = sizeof(easf_h_bf3_mode_lookup) / ··· 2426 2424 easf_h_bf3_mode_lookup, num_entries); 2427 2425 return value; 2428 2426 } 2429 - uint32_t spl_get_reducer_gain6(int taps, struct spl_fixed31_32 ratio) 2427 + uint32_t SPL_NAMESPACE(spl_get_reducer_gain6(int taps, struct spl_fixed31_32 ratio)) 2430 2428 { 2431 2429 uint32_t value; 2432 2430 unsigned int num_entries; ··· 2445 2443 value = 0; 2446 2444 return value; 2447 2445 } 2448 - uint32_t spl_get_reducer_gain4(int taps, struct spl_fixed31_32 ratio) 2446 + uint32_t SPL_NAMESPACE(spl_get_reducer_gain4(int taps, struct spl_fixed31_32 ratio)) 2449 2447 { 2450 2448 uint32_t value; 2451 2449 unsigned int num_entries; ··· 2464 2462 value = 0; 2465 2463 return value; 2466 2464 } 2467 - uint32_t spl_get_gainRing6(int taps, struct spl_fixed31_32 ratio) 2465 + uint32_t SPL_NAMESPACE(spl_get_gainRing6(int taps, struct spl_fixed31_32 ratio)) 2468 2466 { 2469 2467 uint32_t value; 2470 2468 unsigned int num_entries; ··· 2483 2481 value = 0; 2484 2482 return value; 2485 2483 } 2486 - uint32_t spl_get_gainRing4(int taps, struct spl_fixed31_32 ratio) 2484 + uint32_t SPL_NAMESPACE(spl_get_gainRing4(int taps, struct spl_fixed31_32 ratio)) 2487 2485 { 2488 2486 uint32_t value; 2489 2487 unsigned int num_entries; ··· 2502 2500 value = 0; 2503 2501 return value; 2504 2502 } 2505 - uint32_t spl_get_3tap_dntilt_uptilt_offset(int taps, struct spl_fixed31_32 ratio) 2503 + uint32_t SPL_NAMESPACE(spl_get_3tap_dntilt_uptilt_offset( 2504 + int taps, struct spl_fixed31_32 ratio)) 2506 2505 { 2507 2506 uint32_t value; 2508 2507 unsigned int num_entries; ··· 2517 2514 value = 0; 2518 2515 return value; 2519 2516 } 2520 - uint32_t spl_get_3tap_uptilt_maxval(int taps, struct spl_fixed31_32 ratio) 2517 + uint32_t SPL_NAMESPACE(spl_get_3tap_uptilt_maxval(int taps, struct spl_fixed31_32 ratio)) 2521 2518 { 2522 2519 uint32_t value; 2523 2520 unsigned int num_entries; ··· 2531 2528 value = 0; 2532 2529 return value; 2533 2530 } 2534 - uint32_t spl_get_3tap_dntilt_slope(int taps, struct spl_fixed31_32 ratio) 2531 + uint32_t SPL_NAMESPACE(spl_get_3tap_dntilt_slope(int taps, struct spl_fixed31_32 ratio)) 2535 2532 { 2536 2533 uint32_t value; 2537 2534 unsigned int num_entries; ··· 2545 2542 value = 0; 2546 2543 return value; 2547 2544 } 2548 - uint32_t spl_get_3tap_uptilt1_slope(int taps, struct spl_fixed31_32 ratio) 2545 + uint32_t SPL_NAMESPACE(spl_get_3tap_uptilt1_slope(int taps, struct spl_fixed31_32 ratio)) 2549 2546 { 2550 2547 uint32_t value; 2551 2548 unsigned int num_entries; ··· 2559 2556 value = 0; 2560 2557 return value; 2561 2558 } 2562 - uint32_t spl_get_3tap_uptilt2_slope(int taps, struct spl_fixed31_32 ratio) 2559 + uint32_t SPL_NAMESPACE(spl_get_3tap_uptilt2_slope(int taps, struct spl_fixed31_32 ratio)) 2563 2560 { 2564 2561 uint32_t value; 2565 2562 unsigned int num_entries; ··· 2573 2570 value = 0; 2574 2571 return value; 2575 2572 } 2576 - uint32_t spl_get_3tap_uptilt2_offset(int taps, struct spl_fixed31_32 ratio) 2573 + uint32_t SPL_NAMESPACE(spl_get_3tap_uptilt2_offset(int taps, struct spl_fixed31_32 ratio)) 2577 2574 { 2578 2575 uint32_t value; 2579 2576 unsigned int num_entries;
+19 -16
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_scl_easf_filters.h
··· 13 13 const uint32_t reg_value; 14 14 }; 15 15 16 - void spl_set_filters_data(struct dscl_prog_data *dscl_prog_data, 16 + void SPL_NAMESPACE(spl_set_filters_data(struct dscl_prog_data *dscl_prog_data, 17 17 const struct spl_scaler_data *data, bool enable_easf_v, 18 - bool enable_easf_h); 18 + bool enable_easf_h)); 19 19 20 - uint32_t spl_get_v_bf3_mode(struct spl_fixed31_32 ratio); 21 - uint32_t spl_get_h_bf3_mode(struct spl_fixed31_32 ratio); 22 - uint32_t spl_get_reducer_gain6(int taps, struct spl_fixed31_32 ratio); 23 - uint32_t spl_get_reducer_gain4(int taps, struct spl_fixed31_32 ratio); 24 - uint32_t spl_get_gainRing6(int taps, struct spl_fixed31_32 ratio); 25 - uint32_t spl_get_gainRing4(int taps, struct spl_fixed31_32 ratio); 26 - uint32_t spl_get_3tap_dntilt_uptilt_offset(int taps, struct spl_fixed31_32 ratio); 27 - uint32_t spl_get_3tap_uptilt_maxval(int taps, struct spl_fixed31_32 ratio); 28 - uint32_t spl_get_3tap_dntilt_slope(int taps, struct spl_fixed31_32 ratio); 29 - uint32_t spl_get_3tap_uptilt1_slope(int taps, struct spl_fixed31_32 ratio); 30 - uint32_t spl_get_3tap_uptilt2_slope(int taps, struct spl_fixed31_32 ratio); 31 - uint32_t spl_get_3tap_uptilt2_offset(int taps, struct spl_fixed31_32 ratio); 20 + uint32_t SPL_NAMESPACE(spl_get_v_bf3_mode(struct spl_fixed31_32 ratio)); 21 + uint32_t SPL_NAMESPACE(spl_get_h_bf3_mode(struct spl_fixed31_32 ratio)); 22 + uint32_t SPL_NAMESPACE(spl_get_reducer_gain6(int taps, struct spl_fixed31_32 ratio)); 23 + uint32_t SPL_NAMESPACE(spl_get_reducer_gain4(int taps, struct spl_fixed31_32 ratio)); 24 + uint32_t SPL_NAMESPACE(spl_get_gainRing6(int taps, struct spl_fixed31_32 ratio)); 25 + uint32_t SPL_NAMESPACE(spl_get_gainRing4(int taps, struct spl_fixed31_32 ratio)); 26 + uint32_t SPL_NAMESPACE(spl_get_3tap_dntilt_uptilt_offset( 27 + int taps, struct spl_fixed31_32 ratio)); 28 + uint32_t SPL_NAMESPACE(spl_get_3tap_uptilt_maxval(int taps, struct spl_fixed31_32 ratio)); 29 + uint32_t SPL_NAMESPACE(spl_get_3tap_dntilt_slope(int taps, struct spl_fixed31_32 ratio)); 30 + uint32_t SPL_NAMESPACE(spl_get_3tap_uptilt1_slope(int taps, struct spl_fixed31_32 ratio)); 31 + uint32_t SPL_NAMESPACE(spl_get_3tap_uptilt2_slope(int taps, struct spl_fixed31_32 ratio)); 32 + uint32_t SPL_NAMESPACE(spl_get_3tap_uptilt2_offset(int taps, struct spl_fixed31_32 ratio)); 32 33 33 34 /* public API */ 34 - const uint16_t *spl_dscl_get_easf_filter_coeffs_64p(int taps, struct spl_fixed31_32 ratio); 35 - const uint16_t *spl_dscl_get_easf_filter_coeffs_64p_s1_10(int taps, struct spl_fixed31_32 ratio); 35 + const uint16_t *SPL_NAMESPACE(spl_dscl_get_easf_filter_coeffs_64p( 36 + int taps, struct spl_fixed31_32 ratio)); 37 + const uint16_t *SPL_NAMESPACE(spl_dscl_get_easf_filter_coeffs_64p_s1_10( 38 + int taps, struct spl_fixed31_32 ratio)); 36 39 37 40 #endif /* __DC_SPL_SCL_EASF_FILTERS_H__ */
+14 -13
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_scl_filters.c
··· 1134 1134 { 1135 1135 if (ratio.value < spl_fixpt_one.value) 1136 1136 return filter_3tap_64p_upscale; 1137 - else if (ratio.value < spl_fixpt_from_fraction(4, 3).value) 1137 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(4, 3)).value) 1138 1138 return filter_3tap_64p_116; 1139 - else if (ratio.value < spl_fixpt_from_fraction(5, 3).value) 1139 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(5, 3)).value) 1140 1140 return filter_3tap_64p_149; 1141 1141 else 1142 1142 return filter_3tap_64p_183; ··· 1146 1146 { 1147 1147 if (ratio.value < spl_fixpt_one.value) 1148 1148 return filter_4tap_64p_upscale; 1149 - else if (ratio.value < spl_fixpt_from_fraction(4, 3).value) 1149 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(4, 3)).value) 1150 1150 return filter_4tap_64p_116; 1151 - else if (ratio.value < spl_fixpt_from_fraction(5, 3).value) 1151 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(5, 3)).value) 1152 1152 return filter_4tap_64p_149; 1153 1153 else 1154 1154 return filter_4tap_64p_183; ··· 1158 1158 { 1159 1159 if (ratio.value < spl_fixpt_one.value) 1160 1160 return filter_5tap_64p_upscale; 1161 - else if (ratio.value < spl_fixpt_from_fraction(4, 3).value) 1161 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(4, 3)).value) 1162 1162 return filter_5tap_64p_116; 1163 - else if (ratio.value < spl_fixpt_from_fraction(5, 3).value) 1163 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(5, 3)).value) 1164 1164 return filter_5tap_64p_149; 1165 1165 else 1166 1166 return filter_5tap_64p_183; ··· 1170 1170 { 1171 1171 if (ratio.value < spl_fixpt_one.value) 1172 1172 return filter_6tap_64p_upscale; 1173 - else if (ratio.value < spl_fixpt_from_fraction(4, 3).value) 1173 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(4, 3)).value) 1174 1174 return filter_6tap_64p_116; 1175 - else if (ratio.value < spl_fixpt_from_fraction(5, 3).value) 1175 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(5, 3)).value) 1176 1176 return filter_6tap_64p_149; 1177 1177 else 1178 1178 return filter_6tap_64p_183; ··· 1182 1182 { 1183 1183 if (ratio.value < spl_fixpt_one.value) 1184 1184 return filter_7tap_64p_upscale; 1185 - else if (ratio.value < spl_fixpt_from_fraction(4, 3).value) 1185 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(4, 3)).value) 1186 1186 return filter_7tap_64p_116; 1187 - else if (ratio.value < spl_fixpt_from_fraction(5, 3).value) 1187 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(5, 3)).value) 1188 1188 return filter_7tap_64p_149; 1189 1189 else 1190 1190 return filter_7tap_64p_183; ··· 1194 1194 { 1195 1195 if (ratio.value < spl_fixpt_one.value) 1196 1196 return filter_8tap_64p_upscale; 1197 - else if (ratio.value < spl_fixpt_from_fraction(4, 3).value) 1197 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(4, 3)).value) 1198 1198 return filter_8tap_64p_116; 1199 - else if (ratio.value < spl_fixpt_from_fraction(5, 3).value) 1199 + else if (ratio.value < SPL_NAMESPACE(spl_fixpt_from_fraction(5, 3)).value) 1200 1200 return filter_8tap_64p_149; 1201 1201 else 1202 1202 return filter_8tap_64p_183; ··· 1207 1207 return filter_2tap_64p; 1208 1208 } 1209 1209 1210 - const uint16_t *spl_dscl_get_filter_coeffs_64p(int taps, struct spl_fixed31_32 ratio) 1210 + const uint16_t *SPL_NAMESPACE(spl_dscl_get_filter_coeffs_64p( 1211 + int taps, struct spl_fixed31_32 ratio)) 1211 1212 { 1212 1213 if (taps == 8) 1213 1214 return spl_get_filter_8tap_64p(ratio);
+2 -1
drivers/gpu/drm/amd/display/dc/sspl/dc_spl_scl_filters.h
··· 8 8 #include "dc_spl_types.h" 9 9 10 10 /* public API */ 11 - const uint16_t *spl_dscl_get_filter_coeffs_64p(int taps, struct spl_fixed31_32 ratio); 11 + const uint16_t *SPL_NAMESPACE(spl_dscl_get_filter_coeffs_64p( 12 + int taps, struct spl_fixed31_32 ratio)); 12 13 13 14 #endif /* __DC_SPL_SCL_FILTERS_H__ */
+6 -5
drivers/gpu/drm/amd/display/dc/sspl/spl_custom_float.c
··· 14 14 uint32_t exp_offset = (1 << (format->exponenta_bits - 1)) - 1; 15 15 16 16 const struct spl_fixed31_32 mantissa_constant_plus_max_fraction = 17 - spl_fixpt_from_fraction((1LL << (format->mantissa_bits + 1)) - 1, 18 - 1LL << format->mantissa_bits); 17 + SPL_NAMESPACE(spl_fixpt_from_fraction((1LL << (format->mantissa_bits + 1)) - 1, 18 + 1LL << format->mantissa_bits)); 19 19 20 20 struct spl_fixed31_32 mantiss; 21 21 ··· 134 134 return true; 135 135 } 136 136 137 - bool spl_convert_to_custom_float_format(struct spl_fixed31_32 value, 138 - const struct spl_custom_float_format *format, 139 - uint32_t *result) 137 + bool SPL_NAMESPACE(spl_convert_to_custom_float_format( 138 + struct spl_fixed31_32 value, 139 + const struct spl_custom_float_format *format, 140 + uint32_t *result)) 140 141 { 141 142 uint32_t mantissa; 142 143 uint32_t exponenta;
+2 -2
drivers/gpu/drm/amd/display/dc/sspl/spl_custom_float.h
··· 21 21 bool negative; 22 22 }; 23 23 24 - bool spl_convert_to_custom_float_format( 24 + bool SPL_NAMESPACE(spl_convert_to_custom_float_format( 25 25 struct spl_fixed31_32 value, 26 26 const struct spl_custom_float_format *format, 27 - uint32_t *result); 27 + uint32_t *result)); 28 28 29 29 #endif //SPL_CUSTOM_FLOAT_H_
+40 -38
drivers/gpu/drm/amd/display/dc/sspl/spl_fixpt31_32.c
··· 44 44 #define GET_FRACTIONAL_PART(x) \ 45 45 (FRACTIONAL_PART_MASK & (x)) 46 46 47 - struct spl_fixed31_32 spl_fixpt_from_fraction(long long numerator, long long denominator) 47 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_from_fraction( 48 + long long numerator, long long denominator)) 48 49 { 49 50 struct spl_fixed31_32 res; 50 51 ··· 97 96 return res; 98 97 } 99 98 100 - struct spl_fixed31_32 spl_fixpt_mul(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2) 99 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_mul( 100 + struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2)) 101 101 { 102 102 struct spl_fixed31_32 res; 103 103 ··· 149 147 return res; 150 148 } 151 149 152 - struct spl_fixed31_32 spl_fixpt_sqr(struct spl_fixed31_32 arg) 150 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_sqr(struct spl_fixed31_32 arg)) 153 151 { 154 152 struct spl_fixed31_32 res; 155 153 ··· 189 187 return res; 190 188 } 191 189 192 - struct spl_fixed31_32 spl_fixpt_recip(struct spl_fixed31_32 arg) 190 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_recip(struct spl_fixed31_32 arg)) 193 191 { 194 192 /* 195 193 * @note 196 194 * Good idea to use Newton's method 197 195 */ 198 196 199 - return spl_fixpt_from_fraction( 197 + return SPL_NAMESPACE(spl_fixpt_from_fraction( 200 198 spl_fixpt_one.value, 201 - arg.value); 199 + arg.value)); 202 200 } 203 201 204 - struct spl_fixed31_32 spl_fixpt_sinc(struct spl_fixed31_32 arg) 202 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_sinc(struct spl_fixed31_32 arg)) 205 203 { 206 204 struct spl_fixed31_32 square; 207 205 ··· 223 221 spl_fixpt_two_pi.value))); 224 222 } 225 223 226 - square = spl_fixpt_sqr(arg_norm); 224 + square = SPL_NAMESPACE(spl_fixpt_sqr(arg_norm)); 227 225 228 226 do { 229 227 res = spl_fixpt_sub( 230 228 spl_fixpt_one, 231 229 spl_fixpt_div_int( 232 - spl_fixpt_mul( 230 + SPL_NAMESPACE(spl_fixpt_mul( 233 231 square, 234 - res), 232 + res)), 235 233 n * (n - 1))); 236 234 237 235 n -= 2; ··· 239 237 240 238 if (arg.value != arg_norm.value) 241 239 res = spl_fixpt_div( 242 - spl_fixpt_mul(res, arg_norm), 240 + SPL_NAMESPACE(spl_fixpt_mul(res, arg_norm)), 243 241 arg); 244 242 245 243 return res; 246 244 } 247 245 248 - struct spl_fixed31_32 spl_fixpt_sin(struct spl_fixed31_32 arg) 246 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_sin(struct spl_fixed31_32 arg)) 249 247 { 250 - return spl_fixpt_mul( 248 + return SPL_NAMESPACE(spl_fixpt_mul( 251 249 arg, 252 - spl_fixpt_sinc(arg)); 250 + SPL_NAMESPACE(spl_fixpt_sinc(arg)))); 253 251 } 254 252 255 - struct spl_fixed31_32 spl_fixpt_cos(struct spl_fixed31_32 arg) 253 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_cos(struct spl_fixed31_32 arg)) 256 254 { 257 255 /* TODO implement argument normalization */ 258 256 259 - const struct spl_fixed31_32 square = spl_fixpt_sqr(arg); 257 + const struct spl_fixed31_32 square = SPL_NAMESPACE(spl_fixpt_sqr(arg)); 260 258 261 259 struct spl_fixed31_32 res = spl_fixpt_one; 262 260 ··· 266 264 res = spl_fixpt_sub( 267 265 spl_fixpt_one, 268 266 spl_fixpt_div_int( 269 - spl_fixpt_mul( 267 + SPL_NAMESPACE(spl_fixpt_mul( 270 268 square, 271 - res), 269 + res)), 272 270 n * (n - 1))); 273 271 274 272 n -= 2; ··· 288 286 { 289 287 unsigned int n = 9; 290 288 291 - struct spl_fixed31_32 res = spl_fixpt_from_fraction( 289 + struct spl_fixed31_32 res = SPL_NAMESPACE(spl_fixpt_from_fraction( 292 290 n + 2, 293 - n + 1); 291 + n + 1)); 294 292 /* TODO find correct res */ 295 293 296 294 SPL_ASSERT(spl_fixpt_lt(arg, spl_fixpt_one)); ··· 299 297 res = spl_fixpt_add( 300 298 spl_fixpt_one, 301 299 spl_fixpt_div_int( 302 - spl_fixpt_mul( 300 + SPL_NAMESPACE(spl_fixpt_mul( 303 301 arg, 304 - res), 302 + res)), 305 303 n)); 306 304 while (--n != 1); 307 305 308 306 return spl_fixpt_add( 309 307 spl_fixpt_one, 310 - spl_fixpt_mul( 308 + SPL_NAMESPACE(spl_fixpt_mul( 311 309 arg, 312 - res)); 310 + res))); 313 311 } 314 312 315 - struct spl_fixed31_32 spl_fixpt_exp(struct spl_fixed31_32 arg) 313 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_exp(struct spl_fixed31_32 arg)) 316 314 { 317 315 /* 318 316 * @brief ··· 355 353 return spl_fixpt_one; 356 354 } 357 355 358 - struct spl_fixed31_32 spl_fixpt_log(struct spl_fixed31_32 arg) 356 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_log(struct spl_fixed31_32 arg)) 359 357 { 360 358 struct spl_fixed31_32 res = spl_fixpt_neg(spl_fixpt_one); 361 359 /* TODO improve 1st estimation */ ··· 373 371 spl_fixpt_one), 374 372 spl_fixpt_div( 375 373 arg, 376 - spl_fixpt_exp(res))); 374 + SPL_NAMESPACE(spl_fixpt_exp(res)))); 377 375 378 376 error = spl_fixpt_sub( 379 377 res, ··· 429 427 return min_clamp; 430 428 } 431 429 432 - unsigned int spl_fixpt_u4d19(struct spl_fixed31_32 arg) 430 + unsigned int SPL_NAMESPACE(spl_fixpt_u4d19(struct spl_fixed31_32 arg)) 433 431 { 434 432 return spl_ux_dy(arg.value, 4, 19); 435 433 } 436 434 437 - unsigned int spl_fixpt_u3d19(struct spl_fixed31_32 arg) 435 + unsigned int SPL_NAMESPACE(spl_fixpt_u3d19(struct spl_fixed31_32 arg)) 438 436 { 439 437 return spl_ux_dy(arg.value, 3, 19); 440 438 } 441 439 442 - unsigned int spl_fixpt_u2d19(struct spl_fixed31_32 arg) 440 + unsigned int SPL_NAMESPACE(spl_fixpt_u2d19(struct spl_fixed31_32 arg)) 443 441 { 444 442 return spl_ux_dy(arg.value, 2, 19); 445 443 } 446 444 447 - unsigned int spl_fixpt_u0d19(struct spl_fixed31_32 arg) 445 + unsigned int SPL_NAMESPACE(spl_fixpt_u0d19(struct spl_fixed31_32 arg)) 448 446 { 449 447 return spl_ux_dy(arg.value, 0, 19); 450 448 } 451 449 452 - unsigned int spl_fixpt_clamp_u0d14(struct spl_fixed31_32 arg) 450 + unsigned int SPL_NAMESPACE(spl_fixpt_clamp_u0d14(struct spl_fixed31_32 arg)) 453 451 { 454 452 return spl_clamp_ux_dy(arg.value, 0, 14, 1); 455 453 } 456 454 457 - unsigned int spl_fixpt_clamp_u0d10(struct spl_fixed31_32 arg) 455 + unsigned int SPL_NAMESPACE(spl_fixpt_clamp_u0d10(struct spl_fixed31_32 arg)) 458 456 { 459 457 return spl_clamp_ux_dy(arg.value, 0, 10, 1); 460 458 } 461 459 462 - int spl_fixpt_s4d19(struct spl_fixed31_32 arg) 460 + int SPL_NAMESPACE(spl_fixpt_s4d19(struct spl_fixed31_32 arg)) 463 461 { 464 462 if (arg.value < 0) 465 463 return -(int)spl_ux_dy(spl_fixpt_abs(arg).value, 4, 19); ··· 467 465 return spl_ux_dy(arg.value, 4, 19); 468 466 } 469 467 470 - struct spl_fixed31_32 spl_fixpt_from_ux_dy(unsigned int value, 468 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_from_ux_dy(unsigned int value, 471 469 unsigned int integer_bits, 472 - unsigned int fractional_bits) 470 + unsigned int fractional_bits)) 473 471 { 474 472 struct spl_fixed31_32 fixpt_value = spl_fixpt_zero; 475 473 struct spl_fixed31_32 fixpt_int_value = spl_fixpt_zero; ··· 483 481 return fixpt_value; 484 482 } 485 483 486 - struct spl_fixed31_32 spl_fixpt_from_int_dy(unsigned int int_value, 484 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_from_int_dy(unsigned int int_value, 487 485 unsigned int frac_value, 488 486 unsigned int integer_bits, 489 - unsigned int fractional_bits) 487 + unsigned int fractional_bits)) 490 488 { 491 489 struct spl_fixed31_32 fixpt_value = spl_fixpt_from_int(int_value); 492 490
+30 -26
drivers/gpu/drm/amd/display/dc/sspl/spl_fixpt31_32.h
··· 60 60 * @brief 61 61 * result = numerator / denominator 62 62 */ 63 - struct spl_fixed31_32 spl_fixpt_from_fraction(long long numerator, long long denominator); 63 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_from_fraction( 64 + long long numerator, long long denominator)); 64 65 65 66 /* 66 67 * @brief ··· 281 280 * @brief 282 281 * result = arg1 * arg2 283 282 */ 284 - struct spl_fixed31_32 spl_fixpt_mul(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2); 283 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_mul( 284 + struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2)); 285 285 286 286 287 287 /* ··· 291 289 */ 292 290 static inline struct spl_fixed31_32 spl_fixpt_mul_int(struct spl_fixed31_32 arg1, int arg2) 293 291 { 294 - return spl_fixpt_mul(arg1, spl_fixpt_from_int(arg2)); 292 + return SPL_NAMESPACE(spl_fixpt_mul(arg1, spl_fixpt_from_int(arg2))); 295 293 } 296 294 297 295 /* 298 296 * @brief 299 297 * result = square(arg) := arg * arg 300 298 */ 301 - struct spl_fixed31_32 spl_fixpt_sqr(struct spl_fixed31_32 arg); 299 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_sqr(struct spl_fixed31_32 arg)); 302 300 303 301 /* 304 302 * @brief ··· 306 304 */ 307 305 static inline struct spl_fixed31_32 spl_fixpt_div_int(struct spl_fixed31_32 arg1, long long arg2) 308 306 { 309 - return spl_fixpt_from_fraction(arg1.value, spl_fixpt_from_int((int)arg2).value); 307 + return SPL_NAMESPACE(spl_fixpt_from_fraction(arg1.value, 308 + spl_fixpt_from_int((int)arg2).value)); 310 309 } 311 310 312 311 /* ··· 316 313 */ 317 314 static inline struct spl_fixed31_32 spl_fixpt_div(struct spl_fixed31_32 arg1, struct spl_fixed31_32 arg2) 318 315 { 319 - return spl_fixpt_from_fraction(arg1.value, arg2.value); 316 + return SPL_NAMESPACE(spl_fixpt_from_fraction(arg1.value, arg2.value)); 320 317 } 321 318 322 319 /* ··· 331 328 * @note 332 329 * No special actions taken in case argument is zero. 333 330 */ 334 - struct spl_fixed31_32 spl_fixpt_recip(struct spl_fixed31_32 arg); 331 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_recip(struct spl_fixed31_32 arg)); 335 332 336 333 /* 337 334 * @brief ··· 346 343 * Argument specified in radians, 347 344 * internally it's normalized to [-2pi...2pi] range. 348 345 */ 349 - struct spl_fixed31_32 spl_fixpt_sinc(struct spl_fixed31_32 arg); 346 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_sinc(struct spl_fixed31_32 arg)); 350 347 351 348 /* 352 349 * @brief ··· 356 353 * Argument specified in radians, 357 354 * internally it's normalized to [-2pi...2pi] range. 358 355 */ 359 - struct spl_fixed31_32 spl_fixpt_sin(struct spl_fixed31_32 arg); 356 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_sin(struct spl_fixed31_32 arg)); 360 357 361 358 /* 362 359 * @brief ··· 368 365 * passing arguments outside that range 369 366 * will cause incorrect result! 370 367 */ 371 - struct spl_fixed31_32 spl_fixpt_cos(struct spl_fixed31_32 arg); 368 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_cos(struct spl_fixed31_32 arg)); 372 369 373 370 /* 374 371 * @brief ··· 382 379 * @note 383 380 * Currently, function is verified for abs(arg) <= 1. 384 381 */ 385 - struct spl_fixed31_32 spl_fixpt_exp(struct spl_fixed31_32 arg); 382 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_exp(struct spl_fixed31_32 arg)); 386 383 387 384 /* 388 385 * @brief ··· 394 391 * Currently, no special actions taken 395 392 * in case of invalid argument(s). Take care! 396 393 */ 397 - struct spl_fixed31_32 spl_fixpt_log(struct spl_fixed31_32 arg); 394 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_log(struct spl_fixed31_32 arg)); 398 395 399 396 /* 400 397 * @brief ··· 413 410 if (arg1.value == 0) 414 411 return arg2.value == 0 ? spl_fixpt_one : spl_fixpt_zero; 415 412 416 - return spl_fixpt_exp( 417 - spl_fixpt_mul( 418 - spl_fixpt_log(arg1), 419 - arg2)); 413 + return SPL_NAMESPACE(spl_fixpt_exp( 414 + SPL_NAMESPACE(spl_fixpt_mul( 415 + SPL_NAMESPACE(spl_fixpt_log(arg1)), 416 + arg2)))); 420 417 } 421 418 422 419 /* ··· 485 482 * fractional 486 483 */ 487 484 488 - unsigned int spl_fixpt_u4d19(struct spl_fixed31_32 arg); 485 + unsigned int SPL_NAMESPACE(spl_fixpt_u4d19(struct spl_fixed31_32 arg)); 489 486 490 - unsigned int spl_fixpt_u3d19(struct spl_fixed31_32 arg); 487 + unsigned int SPL_NAMESPACE(spl_fixpt_u3d19(struct spl_fixed31_32 arg)); 491 488 492 - unsigned int spl_fixpt_u2d19(struct spl_fixed31_32 arg); 489 + unsigned int SPL_NAMESPACE(spl_fixpt_u2d19(struct spl_fixed31_32 arg)); 493 490 494 - unsigned int spl_fixpt_u0d19(struct spl_fixed31_32 arg); 491 + unsigned int SPL_NAMESPACE(spl_fixpt_u0d19(struct spl_fixed31_32 arg)); 495 492 496 - unsigned int spl_fixpt_clamp_u0d14(struct spl_fixed31_32 arg); 493 + unsigned int SPL_NAMESPACE(spl_fixpt_clamp_u0d14(struct spl_fixed31_32 arg)); 497 494 498 - unsigned int spl_fixpt_clamp_u0d10(struct spl_fixed31_32 arg); 495 + unsigned int SPL_NAMESPACE(spl_fixpt_clamp_u0d10(struct spl_fixed31_32 arg)); 499 496 500 - int spl_fixpt_s4d19(struct spl_fixed31_32 arg); 497 + int SPL_NAMESPACE(spl_fixpt_s4d19(struct spl_fixed31_32 arg)); 501 498 502 499 static inline struct spl_fixed31_32 spl_fixpt_truncate(struct spl_fixed31_32 arg, unsigned int frac_bits) 503 500 { ··· 516 513 return arg; 517 514 } 518 515 519 - struct spl_fixed31_32 spl_fixpt_from_ux_dy(unsigned int value, unsigned int integer_bits, unsigned int fractional_bits); 520 - struct spl_fixed31_32 spl_fixpt_from_int_dy(unsigned int int_value, 516 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_from_ux_dy(unsigned int value, 517 + unsigned int integer_bits, unsigned int fractional_bits)); 518 + struct spl_fixed31_32 SPL_NAMESPACE(spl_fixpt_from_int_dy(unsigned int int_value, 521 519 unsigned int frac_value, 522 520 unsigned int integer_bits, 523 - unsigned int fractional_bits); 521 + unsigned int fractional_bits)); 524 522 525 523 #endif
+9
drivers/gpu/drm/amd/display/dc/sspl/spl_os_types.h
··· 53 53 #define spl_min(a, b) (((a) < (b)) ? (a):(b)) 54 54 #endif 55 55 56 + /* SPL namespace macros */ 57 + #ifndef SPL_PFX_ 58 + #define SPL_PFX_ 59 + #endif 60 + 61 + #define SPL_EXPAND2(a, b) a##b 62 + #define SPL_EXPAND(a, b) SPL_EXPAND2(a, b) 63 + #define SPL_NAMESPACE(symbol) SPL_EXPAND(SPL_PFX_, symbol) 64 + 56 65 #endif /* _SPL_OS_TYPES_H_ */