uint32_t offset = 0;
int8_t begin = curve_config->begin;
int32_t region_number = 0;
- struct fixed31_32 magic_number =
- dal_fixed31_32_from_fraction(249, 1000);
i = begin;
++i;
}
- points[index].x =
- dal_fixed31_32_add(region1, magic_number);
- points[index].adjusted_x =
- dal_fixed31_32_add(region1, magic_number);
+ points[index].x = region1;
+ points[index].adjusted_x = region1;
*number_of_points = index;
struct curve_points *arr_points,
struct pwl_result_data *rgb_resulted,
const struct hw_x_point *coordinates_x,
- uint32_t hw_points_num)
+ uint32_t hw_points_num,
+ enum dc_transfer_func_predefined tf)
{
struct fixed31_32 y_r;
struct fixed31_32 y_g;
arr_points[2].y = y3_max;
arr_points[2].slope = dal_fixed31_32_zero;
+
+ /* for PQ, we want to have a straight line from last HW X point, and the
+ * slope to be such that we hit 1.0 at 10000 nits.
+ */
+ if (tf == TRANSFER_FUNCTION_PQ) {
+ const struct fixed31_32 end_value =
+ dal_fixed31_32_from_int(125);
+
+ arr_points[2].slope = dal_fixed31_32_div(
+ dal_fixed31_32_sub(dal_fixed31_32_one, arr_points[1].y),
+ dal_fixed31_32_sub(end_value, arr_points[1].x));
+ }
}
static bool convert_to_custom_float_format(
struct pixel_gamma_point *coeff128_oem = NULL;
struct pixel_gamma_point *coeff128 = NULL;
+ enum dc_transfer_func_predefined tf = TRANSFER_FUNCTION_SRGB;
+
bool ret = false;
coordinates_x = dm_alloc(sizeof(*coordinates_x)*(256 + 3));
dividers.divider2 = dal_fixed31_32_from_int(2);
dividers.divider3 = dal_fixed31_32_from_fraction(5, 2);
+ if (stream->public.out_transfer_func)
+ tf = stream->public.out_transfer_func->tf;
+
build_evenly_distributed_points(
axix_x_256,
256,
scale_gamma(rgb_user, ramp, dividers);
- if (stream->public.out_transfer_func &&
- stream->public.out_transfer_func->tf == TRANSFER_FUNCTION_PQ) {
+ if (tf == TRANSFER_FUNCTION_PQ) {
setup_distribution_points_pq(arr_curve_points, arr_points,
¶ms->hw_points_num, coordinates_x,
surface->public.format);
arr_points,
rgb_resulted,
coordinates_x,
- params->hw_points_num);
+ params->hw_points_num,
+ tf);
convert_to_custom_float(rgb_resulted, arr_points,
params->hw_points_num);