13f68c01bSZhan Liu /*
23f68c01bSZhan Liu  * Copyright 2016 Advanced Micro Devices, Inc.
33f68c01bSZhan Liu  *
43f68c01bSZhan Liu  * Permission is hereby granted, free of charge, to any person obtaining a
53f68c01bSZhan Liu  * copy of this software and associated documentation files (the "Software"),
63f68c01bSZhan Liu  * to deal in the Software without restriction, including without limitation
73f68c01bSZhan Liu  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
83f68c01bSZhan Liu  * and/or sell copies of the Software, and to permit persons to whom the
93f68c01bSZhan Liu  * Software is furnished to do so, subject to the following conditions:
103f68c01bSZhan Liu  *
113f68c01bSZhan Liu  * The above copyright notice and this permission notice shall be included in
123f68c01bSZhan Liu  * all copies or substantial portions of the Software.
133f68c01bSZhan Liu  *
143f68c01bSZhan Liu  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
153f68c01bSZhan Liu  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
163f68c01bSZhan Liu  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
173f68c01bSZhan Liu  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
183f68c01bSZhan Liu  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
193f68c01bSZhan Liu  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
203f68c01bSZhan Liu  * OTHER DEALINGS IN THE SOFTWARE.
213f68c01bSZhan Liu  *
223f68c01bSZhan Liu  * Authors: AMD
233f68c01bSZhan Liu  *
243f68c01bSZhan Liu  */
253f68c01bSZhan Liu 
263f68c01bSZhan Liu #include "dm_services.h"
273f68c01bSZhan Liu 
283f68c01bSZhan Liu #include "core_types.h"
293f68c01bSZhan Liu 
303f68c01bSZhan Liu #include "reg_helper.h"
313f68c01bSZhan Liu #include "dcn201_dpp.h"
323f68c01bSZhan Liu #include "basics/conversion.h"
333f68c01bSZhan Liu 
343f68c01bSZhan Liu #define REG(reg)\
353f68c01bSZhan Liu 	dpp->tf_regs->reg
363f68c01bSZhan Liu 
373f68c01bSZhan Liu #define CTX \
383f68c01bSZhan Liu 	dpp->base.ctx
393f68c01bSZhan Liu 
403f68c01bSZhan Liu #undef FN
413f68c01bSZhan Liu #define FN(reg_name, field_name) \
423f68c01bSZhan Liu 	dpp->tf_shift->field_name, dpp->tf_mask->field_name
433f68c01bSZhan Liu 
dpp201_cnv_setup(struct dpp * dpp_base,enum surface_pixel_format format,enum expansion_mode mode,struct dc_csc_transform input_csc_color_matrix,enum dc_color_space input_color_space,struct cnv_alpha_2bit_lut * alpha_2bit_lut)443f68c01bSZhan Liu static void dpp201_cnv_setup(
453f68c01bSZhan Liu 		struct dpp *dpp_base,
463f68c01bSZhan Liu 		enum surface_pixel_format format,
473f68c01bSZhan Liu 		enum expansion_mode mode,
483f68c01bSZhan Liu 		struct dc_csc_transform input_csc_color_matrix,
493f68c01bSZhan Liu 		enum dc_color_space input_color_space,
503f68c01bSZhan Liu 		struct cnv_alpha_2bit_lut *alpha_2bit_lut)
513f68c01bSZhan Liu {
523f68c01bSZhan Liu 	struct dcn201_dpp *dpp = TO_DCN201_DPP(dpp_base);
533f68c01bSZhan Liu 	uint32_t pixel_format = 0;
543f68c01bSZhan Liu 	uint32_t alpha_en = 1;
553f68c01bSZhan Liu 	enum dc_color_space color_space = COLOR_SPACE_SRGB;
563f68c01bSZhan Liu 	enum dcn10_input_csc_select select = INPUT_CSC_SELECT_BYPASS;
573f68c01bSZhan Liu 	bool force_disable_cursor = false;
583f68c01bSZhan Liu 	uint32_t is_2bit = 0;
593f68c01bSZhan Liu 
603f68c01bSZhan Liu 	REG_SET_2(FORMAT_CONTROL, 0,
613f68c01bSZhan Liu 		CNVC_BYPASS, 0,
623f68c01bSZhan Liu 		FORMAT_EXPANSION_MODE, mode);
633f68c01bSZhan Liu 
643f68c01bSZhan Liu 	REG_UPDATE(FORMAT_CONTROL, FORMAT_CNV16, 0);
653f68c01bSZhan Liu 	REG_UPDATE(FORMAT_CONTROL, CNVC_BYPASS_MSB_ALIGN, 0);
663f68c01bSZhan Liu 	REG_UPDATE(FORMAT_CONTROL, CLAMP_POSITIVE, 0);
673f68c01bSZhan Liu 	REG_UPDATE(FORMAT_CONTROL, CLAMP_POSITIVE_C, 0);
683f68c01bSZhan Liu 
693f68c01bSZhan Liu 	switch (format) {
703f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_ARGB1555:
713f68c01bSZhan Liu 		pixel_format = 1;
723f68c01bSZhan Liu 		break;
733f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_RGB565:
743f68c01bSZhan Liu 		pixel_format = 3;
753f68c01bSZhan Liu 		alpha_en = 0;
763f68c01bSZhan Liu 		break;
773f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888:
783f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_ABGR8888:
793f68c01bSZhan Liu 		pixel_format = 8;
803f68c01bSZhan Liu 		break;
813f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_ARGB2101010:
823f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010:
833f68c01bSZhan Liu 		pixel_format = 10;
843f68c01bSZhan Liu 		is_2bit = 1;
853f68c01bSZhan Liu 		break;
863f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_VIDEO_420_YCbCr:
873f68c01bSZhan Liu 		force_disable_cursor = false;
883f68c01bSZhan Liu 		pixel_format = 65;
893f68c01bSZhan Liu 		color_space = COLOR_SPACE_YCBCR709;
903f68c01bSZhan Liu 		select = INPUT_CSC_SELECT_ICSC;
913f68c01bSZhan Liu 		break;
923f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_VIDEO_420_YCrCb:
933f68c01bSZhan Liu 		force_disable_cursor = true;
943f68c01bSZhan Liu 		pixel_format = 64;
953f68c01bSZhan Liu 		color_space = COLOR_SPACE_YCBCR709;
963f68c01bSZhan Liu 		select = INPUT_CSC_SELECT_ICSC;
973f68c01bSZhan Liu 		break;
983f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCbCr:
993f68c01bSZhan Liu 		force_disable_cursor = true;
1003f68c01bSZhan Liu 		pixel_format = 67;
1013f68c01bSZhan Liu 		color_space = COLOR_SPACE_YCBCR709;
1023f68c01bSZhan Liu 		select = INPUT_CSC_SELECT_ICSC;
1033f68c01bSZhan Liu 		break;
1043f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCrCb:
1053f68c01bSZhan Liu 		force_disable_cursor = true;
1063f68c01bSZhan Liu 		pixel_format = 66;
1073f68c01bSZhan Liu 		color_space = COLOR_SPACE_YCBCR709;
1083f68c01bSZhan Liu 		select = INPUT_CSC_SELECT_ICSC;
1093f68c01bSZhan Liu 		break;
1103f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616:
1113f68c01bSZhan Liu 		pixel_format = 22;
1123f68c01bSZhan Liu 		break;
1133f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616F:
1143f68c01bSZhan Liu 		pixel_format = 24;
1153f68c01bSZhan Liu 		break;
1163f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616F:
1173f68c01bSZhan Liu 		pixel_format = 25;
1183f68c01bSZhan Liu 		break;
1193f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_VIDEO_AYCrCb8888:
1203f68c01bSZhan Liu 		pixel_format = 12;
1213f68c01bSZhan Liu 		color_space = COLOR_SPACE_YCBCR709;
1223f68c01bSZhan Liu 		select = INPUT_CSC_SELECT_ICSC;
1233f68c01bSZhan Liu 		break;
1243f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_RGB111110_FIX:
1253f68c01bSZhan Liu 		pixel_format = 112;
1263f68c01bSZhan Liu 		alpha_en = 0;
1273f68c01bSZhan Liu 		break;
1283f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_BGR101111_FIX:
1293f68c01bSZhan Liu 		pixel_format = 113;
1303f68c01bSZhan Liu 		alpha_en = 0;
1313f68c01bSZhan Liu 		break;
1323f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_VIDEO_ACrYCb2101010:
1333f68c01bSZhan Liu 		pixel_format = 114;
1343f68c01bSZhan Liu 		color_space = COLOR_SPACE_YCBCR709;
1353f68c01bSZhan Liu 		select = INPUT_CSC_SELECT_ICSC;
1363f68c01bSZhan Liu 		is_2bit = 1;
1373f68c01bSZhan Liu 		break;
1383f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_VIDEO_CrYCbA1010102:
1393f68c01bSZhan Liu 		pixel_format = 115;
1403f68c01bSZhan Liu 		color_space = COLOR_SPACE_YCBCR709;
1413f68c01bSZhan Liu 		select = INPUT_CSC_SELECT_ICSC;
1423f68c01bSZhan Liu 		is_2bit = 1;
1433f68c01bSZhan Liu 		break;
1443f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_RGB111110_FLOAT:
1453f68c01bSZhan Liu 		pixel_format = 118;
1463f68c01bSZhan Liu 		alpha_en = 0;
1473f68c01bSZhan Liu 		break;
1483f68c01bSZhan Liu 	case SURFACE_PIXEL_FORMAT_GRPH_BGR101111_FLOAT:
1493f68c01bSZhan Liu 		pixel_format = 119;
1503f68c01bSZhan Liu 		alpha_en = 0;
1513f68c01bSZhan Liu 		break;
1523f68c01bSZhan Liu 	default:
1533f68c01bSZhan Liu 		break;
1543f68c01bSZhan Liu 	}
1553f68c01bSZhan Liu 
156*e84131a8SJoshua Ashton 	/* Set default color space based on format if none is given. */
157*e84131a8SJoshua Ashton 	color_space = input_color_space ? input_color_space : color_space;
158*e84131a8SJoshua Ashton 
1593f68c01bSZhan Liu 	if (is_2bit == 1 && alpha_2bit_lut != NULL) {
1603f68c01bSZhan Liu 		REG_UPDATE(ALPHA_2BIT_LUT, ALPHA_2BIT_LUT0, alpha_2bit_lut->lut0);
1613f68c01bSZhan Liu 		REG_UPDATE(ALPHA_2BIT_LUT, ALPHA_2BIT_LUT1, alpha_2bit_lut->lut1);
1623f68c01bSZhan Liu 		REG_UPDATE(ALPHA_2BIT_LUT, ALPHA_2BIT_LUT2, alpha_2bit_lut->lut2);
1633f68c01bSZhan Liu 		REG_UPDATE(ALPHA_2BIT_LUT, ALPHA_2BIT_LUT3, alpha_2bit_lut->lut3);
1643f68c01bSZhan Liu 	}
1653f68c01bSZhan Liu 
1663f68c01bSZhan Liu 	REG_SET(CNVC_SURFACE_PIXEL_FORMAT, 0,
1673f68c01bSZhan Liu 			CNVC_SURFACE_PIXEL_FORMAT, pixel_format);
1683f68c01bSZhan Liu 	REG_UPDATE(FORMAT_CONTROL, FORMAT_CONTROL__ALPHA_EN, alpha_en);
1693f68c01bSZhan Liu 
1703f68c01bSZhan Liu 	dpp1_program_input_csc(dpp_base, color_space, select, NULL);
1713f68c01bSZhan Liu 
1723f68c01bSZhan Liu 	if (force_disable_cursor) {
1733f68c01bSZhan Liu 		REG_UPDATE(CURSOR_CONTROL,
1743f68c01bSZhan Liu 				CURSOR_ENABLE, 0);
1753f68c01bSZhan Liu 		REG_UPDATE(CURSOR0_CONTROL,
1763f68c01bSZhan Liu 				CUR0_ENABLE, 0);
1773f68c01bSZhan Liu 	}
1783f68c01bSZhan Liu 	dpp2_power_on_obuf(dpp_base, true);
1793f68c01bSZhan Liu }
1803f68c01bSZhan Liu 
1813f68c01bSZhan Liu #define IDENTITY_RATIO(ratio) (dc_fixpt_u3d19(ratio) == (1 << 19))
1823f68c01bSZhan Liu 
dpp201_get_optimal_number_of_taps(struct dpp * dpp,struct scaler_data * scl_data,const struct scaling_taps * in_taps)1833f68c01bSZhan Liu static bool dpp201_get_optimal_number_of_taps(
1843f68c01bSZhan Liu 		struct dpp *dpp,
1853f68c01bSZhan Liu 		struct scaler_data *scl_data,
1863f68c01bSZhan Liu 		const struct scaling_taps *in_taps)
1873f68c01bSZhan Liu {
1883f68c01bSZhan Liu 	if (scl_data->viewport.width  != scl_data->h_active &&
1893f68c01bSZhan Liu 		scl_data->viewport.height != scl_data->v_active &&
1903f68c01bSZhan Liu 		dpp->caps->dscl_data_proc_format == DSCL_DATA_PRCESSING_FIXED_FORMAT &&
1913f68c01bSZhan Liu 		scl_data->format == PIXEL_FORMAT_FP16)
1923f68c01bSZhan Liu 		return false;
1933f68c01bSZhan Liu 
1943f68c01bSZhan Liu 	if (scl_data->viewport.width > scl_data->h_active &&
1953f68c01bSZhan Liu 		dpp->ctx->dc->debug.max_downscale_src_width != 0 &&
1963f68c01bSZhan Liu 		scl_data->viewport.width > dpp->ctx->dc->debug.max_downscale_src_width)
1973f68c01bSZhan Liu 		return false;
1983f68c01bSZhan Liu 
1993f68c01bSZhan Liu 	if (scl_data->ratios.horz.value == (8ll << 32))
2003f68c01bSZhan Liu 		scl_data->ratios.horz.value--;
2013f68c01bSZhan Liu 	if (scl_data->ratios.vert.value == (8ll << 32))
2023f68c01bSZhan Liu 		scl_data->ratios.vert.value--;
2033f68c01bSZhan Liu 	if (scl_data->ratios.horz_c.value == (8ll << 32))
2043f68c01bSZhan Liu 		scl_data->ratios.horz_c.value--;
2053f68c01bSZhan Liu 	if (scl_data->ratios.vert_c.value == (8ll << 32))
2063f68c01bSZhan Liu 		scl_data->ratios.vert_c.value--;
2073f68c01bSZhan Liu 
2083f68c01bSZhan Liu 	if (in_taps->h_taps == 0) {
2093f68c01bSZhan Liu 		if (dc_fixpt_ceil(scl_data->ratios.horz) > 4)
2103f68c01bSZhan Liu 			scl_data->taps.h_taps = 8;
2113f68c01bSZhan Liu 		else
2123f68c01bSZhan Liu 			scl_data->taps.h_taps = 4;
2133f68c01bSZhan Liu 	} else
2143f68c01bSZhan Liu 		scl_data->taps.h_taps = in_taps->h_taps;
2153f68c01bSZhan Liu 
2163f68c01bSZhan Liu 	if (in_taps->v_taps == 0) {
2173f68c01bSZhan Liu 		if (dc_fixpt_ceil(scl_data->ratios.vert) > 4)
2183f68c01bSZhan Liu 			scl_data->taps.v_taps = 8;
2193f68c01bSZhan Liu 		else
2203f68c01bSZhan Liu 			scl_data->taps.v_taps = 4;
2213f68c01bSZhan Liu 	} else
2223f68c01bSZhan Liu 		scl_data->taps.v_taps = in_taps->v_taps;
2233f68c01bSZhan Liu 	if (in_taps->v_taps_c == 0) {
2243f68c01bSZhan Liu 		if (dc_fixpt_ceil(scl_data->ratios.vert_c) > 4)
2253f68c01bSZhan Liu 			scl_data->taps.v_taps_c = 4;
2263f68c01bSZhan Liu 		else
2273f68c01bSZhan Liu 			scl_data->taps.v_taps_c = 2;
2283f68c01bSZhan Liu 	} else
2293f68c01bSZhan Liu 		scl_data->taps.v_taps_c = in_taps->v_taps_c;
2303f68c01bSZhan Liu 	if (in_taps->h_taps_c == 0) {
2313f68c01bSZhan Liu 		if (dc_fixpt_ceil(scl_data->ratios.horz_c) > 4)
2323f68c01bSZhan Liu 			scl_data->taps.h_taps_c = 4;
2333f68c01bSZhan Liu 		else
2343f68c01bSZhan Liu 			scl_data->taps.h_taps_c = 2;
2353f68c01bSZhan Liu 	} else if ((in_taps->h_taps_c % 2) != 0 && in_taps->h_taps_c != 1)
2363f68c01bSZhan Liu 		scl_data->taps.h_taps_c = in_taps->h_taps_c - 1;
2373f68c01bSZhan Liu 	else
2383f68c01bSZhan Liu 		scl_data->taps.h_taps_c = in_taps->h_taps_c;
2393f68c01bSZhan Liu 
2403f68c01bSZhan Liu 	if (!dpp->ctx->dc->debug.always_scale) {
2413f68c01bSZhan Liu 		if (IDENTITY_RATIO(scl_data->ratios.horz))
2423f68c01bSZhan Liu 			scl_data->taps.h_taps = 1;
2433f68c01bSZhan Liu 		if (IDENTITY_RATIO(scl_data->ratios.vert))
2443f68c01bSZhan Liu 			scl_data->taps.v_taps = 1;
2453f68c01bSZhan Liu 		if (IDENTITY_RATIO(scl_data->ratios.horz_c))
2463f68c01bSZhan Liu 			scl_data->taps.h_taps_c = 1;
2473f68c01bSZhan Liu 		if (IDENTITY_RATIO(scl_data->ratios.vert_c))
2483f68c01bSZhan Liu 			scl_data->taps.v_taps_c = 1;
2493f68c01bSZhan Liu 	}
2503f68c01bSZhan Liu 
2513f68c01bSZhan Liu 	return true;
2523f68c01bSZhan Liu }
2533f68c01bSZhan Liu 
2543f68c01bSZhan Liu static struct dpp_funcs dcn201_dpp_funcs = {
2553f68c01bSZhan Liu 	.dpp_read_state = dpp20_read_state,
2563f68c01bSZhan Liu 	.dpp_reset = dpp_reset,
2573f68c01bSZhan Liu 	.dpp_set_scaler = dpp1_dscl_set_scaler_manual_scale,
2583f68c01bSZhan Liu 	.dpp_get_optimal_number_of_taps = dpp201_get_optimal_number_of_taps,
2593f68c01bSZhan Liu 	.dpp_set_gamut_remap = dpp1_cm_set_gamut_remap,
2603f68c01bSZhan Liu 	.dpp_set_csc_adjustment = NULL,
2613f68c01bSZhan Liu 	.dpp_set_csc_default = NULL,
2623f68c01bSZhan Liu 	.dpp_program_regamma_pwl = oppn20_dummy_program_regamma_pwl,
2633f68c01bSZhan Liu 	.dpp_set_degamma = dpp2_set_degamma,
2643f68c01bSZhan Liu 	.dpp_program_input_lut = dpp2_dummy_program_input_lut,
2653f68c01bSZhan Liu 	.dpp_full_bypass = dpp1_full_bypass,
2663f68c01bSZhan Liu 	.dpp_setup = dpp201_cnv_setup,
2673f68c01bSZhan Liu 	.dpp_program_degamma_pwl = dpp2_set_degamma_pwl,
2683f68c01bSZhan Liu 	.dpp_program_blnd_lut = dpp20_program_blnd_lut,
2693f68c01bSZhan Liu 	.dpp_program_shaper_lut = dpp20_program_shaper,
2703f68c01bSZhan Liu 	.dpp_program_3dlut = dpp20_program_3dlut,
2713f68c01bSZhan Liu 	.dpp_program_bias_and_scale = NULL,
2723f68c01bSZhan Liu 	.dpp_cnv_set_alpha_keyer = dpp2_cnv_set_alpha_keyer,
2733f68c01bSZhan Liu 	.set_cursor_attributes = dpp2_set_cursor_attributes,
2743f68c01bSZhan Liu 	.set_cursor_position = dpp1_set_cursor_position,
2753f68c01bSZhan Liu 	.set_optional_cursor_attributes = dpp1_cnv_set_optional_cursor_attributes,
2763f68c01bSZhan Liu 	.dpp_dppclk_control = dpp1_dppclk_control,
2773f68c01bSZhan Liu 	.dpp_set_hdr_multiplier = dpp2_set_hdr_multiplier,
2783f68c01bSZhan Liu };
2793f68c01bSZhan Liu 
2803f68c01bSZhan Liu static struct dpp_caps dcn201_dpp_cap = {
2813f68c01bSZhan Liu 	.dscl_data_proc_format = DSCL_DATA_PRCESSING_FLOAT_FORMAT,
2823f68c01bSZhan Liu 	.dscl_calc_lb_num_partitions = dscl2_calc_lb_num_partitions,
2833f68c01bSZhan Liu };
2843f68c01bSZhan Liu 
dpp201_construct(struct dcn201_dpp * dpp,struct dc_context * ctx,uint32_t inst,const struct dcn201_dpp_registers * tf_regs,const struct dcn201_dpp_shift * tf_shift,const struct dcn201_dpp_mask * tf_mask)2853f68c01bSZhan Liu bool dpp201_construct(
2863f68c01bSZhan Liu 	struct dcn201_dpp *dpp,
2873f68c01bSZhan Liu 	struct dc_context *ctx,
2883f68c01bSZhan Liu 	uint32_t inst,
2893f68c01bSZhan Liu 	const struct dcn201_dpp_registers *tf_regs,
2903f68c01bSZhan Liu 	const struct dcn201_dpp_shift *tf_shift,
2913f68c01bSZhan Liu 	const struct dcn201_dpp_mask *tf_mask)
2923f68c01bSZhan Liu {
2933f68c01bSZhan Liu 	dpp->base.ctx = ctx;
2943f68c01bSZhan Liu 
2953f68c01bSZhan Liu 	dpp->base.inst = inst;
2963f68c01bSZhan Liu 	dpp->base.funcs = &dcn201_dpp_funcs;
2973f68c01bSZhan Liu 	dpp->base.caps = &dcn201_dpp_cap;
2983f68c01bSZhan Liu 
2993f68c01bSZhan Liu 	dpp->tf_regs = tf_regs;
3003f68c01bSZhan Liu 	dpp->tf_shift = tf_shift;
3013f68c01bSZhan Liu 	dpp->tf_mask = tf_mask;
3023f68c01bSZhan Liu 
3033f68c01bSZhan Liu 	dpp->lb_pixel_depth_supported =
3043f68c01bSZhan Liu 		LB_PIXEL_DEPTH_18BPP |
3053f68c01bSZhan Liu 		LB_PIXEL_DEPTH_24BPP |
3063f68c01bSZhan Liu 		LB_PIXEL_DEPTH_30BPP;
3073f68c01bSZhan Liu 
3083f68c01bSZhan Liu 	dpp->lb_bits_per_entry = LB_BITS_PER_ENTRY;
3093f68c01bSZhan Liu 	dpp->lb_memory_size = LB_TOTAL_NUMBER_OF_ENTRIES;
3103f68c01bSZhan Liu 
3113f68c01bSZhan Liu 	return true;
3123f68c01bSZhan Liu }
313