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

drm/amd/display: Move fixpt_from_s3132 to amdgpu_dm

Other environments don't like the unary minus operator on
an unsigned value.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Harry Wentland and committed by
Alex Deucher
d65e0e91 af7cefc6

+15 -15
+15 -3
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
··· 85 85 setup_x_points_distribution(); 86 86 } 87 87 88 + static inline struct fixed31_32 amdgpu_dm_fixpt_from_s3132(__u64 x) 89 + { 90 + struct fixed31_32 val; 91 + 92 + /* If negative, convert to 2's complement. */ 93 + if (x & (1ULL << 63)) 94 + x = -(x & ~(1ULL << 63)); 95 + 96 + val.value = x; 97 + return val; 98 + } 99 + 88 100 #ifdef AMD_PRIVATE_COLOR 89 101 /* Pre-defined Transfer Functions (TF) 90 102 * ··· 442 430 } 443 431 444 432 /* gamut_remap_matrix[i] = ctm[i - floor(i/4)] */ 445 - matrix[i] = dc_fixpt_from_s3132(ctm->matrix[i - (i / 4)]); 433 + matrix[i] = amdgpu_dm_fixpt_from_s3132(ctm->matrix[i - (i / 4)]); 446 434 } 447 435 } 448 436 ··· 464 452 */ 465 453 for (i = 0; i < 12; i++) { 466 454 /* gamut_remap_matrix[i] = ctm[i - floor(i/4)] */ 467 - matrix[i] = dc_fixpt_from_s3132(ctm->matrix[i]); 455 + matrix[i] = amdgpu_dm_fixpt_from_s3132(ctm->matrix[i]); 468 456 } 469 457 } 470 458 ··· 1148 1136 uint32_t shaper_size, lut3d_size, blend_size; 1149 1137 int ret; 1150 1138 1151 - dc_plane_state->hdr_mult = dc_fixpt_from_s3132(dm_plane_state->hdr_mult); 1139 + dc_plane_state->hdr_mult = amdgpu_dm_fixpt_from_s3132(dm_plane_state->hdr_mult); 1152 1140 1153 1141 shaper_lut = __extract_blob_lut(dm_plane_state->shaper_lut, &shaper_size); 1154 1142 shaper_size = shaper_lut != NULL ? shaper_size : 0;
-12
drivers/gpu/drm/amd/display/include/fixed31_32.h
··· 69 69 static const struct fixed31_32 dc_fixpt_half = { 0x80000000LL }; 70 70 static const struct fixed31_32 dc_fixpt_one = { 0x100000000LL }; 71 71 72 - static inline struct fixed31_32 dc_fixpt_from_s3132(__u64 x) 73 - { 74 - struct fixed31_32 val; 75 - 76 - /* If negative, convert to 2's complement. */ 77 - if (x & (1ULL << 63)) 78 - x = -(x & ~(1ULL << 63)); 79 - 80 - val.value = x; 81 - return val; 82 - } 83 - 84 72 /* 85 73 * @brief 86 74 * Initialization routines