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

drm/amd/display: Connect dig_fe to otg directly instead of calling bios

[Why] After call bios table crtc_source_select, dal will program fmt
again. The bios table program dig_source_select and other fmt register
for bios usage which is redundancy and uncessary.

[How] Program dig_soruce_select register directly

Signed-off-by: hersen wu <hersenxs.wu@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

hersen wu and committed by
Alex Deucher
d2c460e7 0f74e484

+39 -280
-14
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
··· 835 835 return bp->cmd_tbl.enable_crtc(bp, id, enable); 836 836 } 837 837 838 - static enum bp_result bios_parser_crtc_source_select( 839 - struct dc_bios *dcb, 840 - struct bp_crtc_source_select *bp_params) 841 - { 842 - struct bios_parser *bp = BP_FROM_DCB(dcb); 843 - 844 - if (!bp->cmd_tbl.select_crtc_source) 845 - return BP_RESULT_FAILURE; 846 - 847 - return bp->cmd_tbl.select_crtc_source(bp, bp_params); 848 - } 849 - 850 838 static enum bp_result bios_parser_enable_disp_power_gating( 851 839 struct dc_bios *dcb, 852 840 enum controller_id controller_id, ··· 2829 2841 .enable_spread_spectrum_on_ppll = bios_parser_enable_spread_spectrum_on_ppll, 2830 2842 2831 2843 .program_crtc_timing = bios_parser_program_crtc_timing, /* still use. should probably retire and program directly */ 2832 - 2833 - .crtc_source_select = bios_parser_crtc_source_select, /* still use. should probably retire and program directly */ 2834 2844 2835 2845 .program_display_engine_pll = bios_parser_program_display_engine_pll, 2836 2846
-14
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
··· 1083 1083 return bp->cmd_tbl.enable_crtc(bp, id, enable); 1084 1084 } 1085 1085 1086 - static enum bp_result bios_parser_crtc_source_select( 1087 - struct dc_bios *dcb, 1088 - struct bp_crtc_source_select *bp_params) 1089 - { 1090 - struct bios_parser *bp = BP_FROM_DCB(dcb); 1091 - 1092 - if (!bp->cmd_tbl.select_crtc_source) 1093 - return BP_RESULT_FAILURE; 1094 - 1095 - return bp->cmd_tbl.select_crtc_source(bp, bp_params); 1096 - } 1097 - 1098 1086 static enum bp_result bios_parser_enable_disp_power_gating( 1099 1087 struct dc_bios *dcb, 1100 1088 enum controller_id controller_id, ··· 1902 1914 .set_dce_clock = bios_parser_set_dce_clock, 1903 1915 1904 1916 .program_crtc_timing = bios_parser_program_crtc_timing, 1905 - 1906 - .crtc_source_select = bios_parser_crtc_source_select, 1907 1917 1908 1918 .enable_disp_power_gating = bios_parser_enable_disp_power_gating, 1909 1919
-116
drivers/gpu/drm/amd/display/dc/bios/command_table.c
··· 55 55 static void init_dac_encoder_control(struct bios_parser *bp); 56 56 static void init_dac_output_control(struct bios_parser *bp); 57 57 static void init_set_crtc_timing(struct bios_parser *bp); 58 - static void init_select_crtc_source(struct bios_parser *bp); 59 58 static void init_enable_crtc(struct bios_parser *bp); 60 59 static void init_enable_crtc_mem_req(struct bios_parser *bp); 61 60 static void init_external_encoder_control(struct bios_parser *bp); ··· 72 73 init_dac_encoder_control(bp); 73 74 init_dac_output_control(bp); 74 75 init_set_crtc_timing(bp); 75 - init_select_crtc_source(bp); 76 76 init_enable_crtc(bp); 77 77 init_enable_crtc_mem_req(bp); 78 78 init_program_clock(bp); ··· 1888 1890 cpu_to_le16(le16_to_cpu(params.susModeMiscInfo.usAccess) | ATOM_DOUBLE_CLOCK_MODE); 1889 1891 1890 1892 if (EXEC_BIOS_CMD_TABLE(SetCRTC_UsingDTDTiming, params)) 1891 - result = BP_RESULT_OK; 1892 - 1893 - return result; 1894 - } 1895 - 1896 - /******************************************************************************* 1897 - ******************************************************************************** 1898 - ** 1899 - ** SELECT CRTC SOURCE 1900 - ** 1901 - ******************************************************************************** 1902 - *******************************************************************************/ 1903 - 1904 - static enum bp_result select_crtc_source_v2( 1905 - struct bios_parser *bp, 1906 - struct bp_crtc_source_select *bp_params); 1907 - static enum bp_result select_crtc_source_v3( 1908 - struct bios_parser *bp, 1909 - struct bp_crtc_source_select *bp_params); 1910 - 1911 - static void init_select_crtc_source(struct bios_parser *bp) 1912 - { 1913 - switch (BIOS_CMD_TABLE_PARA_REVISION(SelectCRTC_Source)) { 1914 - case 2: 1915 - bp->cmd_tbl.select_crtc_source = select_crtc_source_v2; 1916 - break; 1917 - case 3: 1918 - bp->cmd_tbl.select_crtc_source = select_crtc_source_v3; 1919 - break; 1920 - default: 1921 - dm_output_to_console("Don't select_crtc_source enable_crtc for v%d\n", 1922 - BIOS_CMD_TABLE_PARA_REVISION(SelectCRTC_Source)); 1923 - bp->cmd_tbl.select_crtc_source = NULL; 1924 - break; 1925 - } 1926 - } 1927 - 1928 - static enum bp_result select_crtc_source_v2( 1929 - struct bios_parser *bp, 1930 - struct bp_crtc_source_select *bp_params) 1931 - { 1932 - enum bp_result result = BP_RESULT_FAILURE; 1933 - SELECT_CRTC_SOURCE_PARAMETERS_V2 params; 1934 - uint8_t atom_controller_id; 1935 - uint32_t atom_engine_id; 1936 - enum signal_type s = bp_params->signal; 1937 - 1938 - memset(&params, 0, sizeof(params)); 1939 - 1940 - /* set controller id */ 1941 - if (bp->cmd_helper->controller_id_to_atom( 1942 - bp_params->controller_id, &atom_controller_id)) 1943 - params.ucCRTC = atom_controller_id; 1944 - else 1945 - return BP_RESULT_FAILURE; 1946 - 1947 - /* set encoder id */ 1948 - if (bp->cmd_helper->engine_bp_to_atom( 1949 - bp_params->engine_id, &atom_engine_id)) 1950 - params.ucEncoderID = (uint8_t)atom_engine_id; 1951 - else 1952 - return BP_RESULT_FAILURE; 1953 - 1954 - if (SIGNAL_TYPE_EDP == s || 1955 - (SIGNAL_TYPE_DISPLAY_PORT == s && 1956 - SIGNAL_TYPE_LVDS == bp_params->sink_signal)) 1957 - s = SIGNAL_TYPE_LVDS; 1958 - 1959 - params.ucEncodeMode = 1960 - (uint8_t)bp->cmd_helper->encoder_mode_bp_to_atom( 1961 - s, bp_params->enable_dp_audio); 1962 - 1963 - if (EXEC_BIOS_CMD_TABLE(SelectCRTC_Source, params)) 1964 - result = BP_RESULT_OK; 1965 - 1966 - return result; 1967 - } 1968 - 1969 - static enum bp_result select_crtc_source_v3( 1970 - struct bios_parser *bp, 1971 - struct bp_crtc_source_select *bp_params) 1972 - { 1973 - bool result = BP_RESULT_FAILURE; 1974 - SELECT_CRTC_SOURCE_PARAMETERS_V3 params; 1975 - uint8_t atom_controller_id; 1976 - uint32_t atom_engine_id; 1977 - enum signal_type s = bp_params->signal; 1978 - 1979 - memset(&params, 0, sizeof(params)); 1980 - 1981 - if (bp->cmd_helper->controller_id_to_atom(bp_params->controller_id, 1982 - &atom_controller_id)) 1983 - params.ucCRTC = atom_controller_id; 1984 - else 1985 - return result; 1986 - 1987 - if (bp->cmd_helper->engine_bp_to_atom(bp_params->engine_id, 1988 - &atom_engine_id)) 1989 - params.ucEncoderID = (uint8_t)atom_engine_id; 1990 - else 1991 - return result; 1992 - 1993 - if (SIGNAL_TYPE_EDP == s || 1994 - (SIGNAL_TYPE_DISPLAY_PORT == s && 1995 - SIGNAL_TYPE_LVDS == bp_params->sink_signal)) 1996 - s = SIGNAL_TYPE_LVDS; 1997 - 1998 - params.ucEncodeMode = 1999 - bp->cmd_helper->encoder_mode_bp_to_atom( 2000 - s, bp_params->enable_dp_audio); 2001 - /* Needed for VBIOS Random Spatial Dithering feature */ 2002 - params.ucDstBpc = (uint8_t)(bp_params->display_output_bit_depth); 2003 - 2004 - if (EXEC_BIOS_CMD_TABLE(SelectCRTC_Source, params)) 2005 1893 result = BP_RESULT_OK; 2006 1894 2007 1895 return result;
-3
drivers/gpu/drm/amd/display/dc/bios/command_table.h
··· 71 71 enum bp_result (*set_crtc_timing)( 72 72 struct bios_parser *bp, 73 73 struct bp_hw_crtc_timing_parameters *bp_params); 74 - enum bp_result (*select_crtc_source)( 75 - struct bios_parser *bp, 76 - struct bp_crtc_source_select *bp_params); 77 74 enum bp_result (*enable_crtc)( 78 75 struct bios_parser *bp, 79 76 enum controller_id controller_id,
-70
drivers/gpu/drm/amd/display/dc/bios/command_table2.c
··· 463 463 /****************************************************************************** 464 464 ****************************************************************************** 465 465 ** 466 - ** SELECT CRTC SOURCE 467 - ** 468 - ****************************************************************************** 469 - *****************************************************************************/ 470 - 471 - 472 - static enum bp_result select_crtc_source_v3( 473 - struct bios_parser *bp, 474 - struct bp_crtc_source_select *bp_params); 475 - 476 - static void init_select_crtc_source(struct bios_parser *bp) 477 - { 478 - switch (BIOS_CMD_TABLE_PARA_REVISION(selectcrtc_source)) { 479 - case 3: 480 - bp->cmd_tbl.select_crtc_source = select_crtc_source_v3; 481 - break; 482 - default: 483 - dm_output_to_console("Don't select_crtc_source enable_crtc for v%d\n", 484 - BIOS_CMD_TABLE_PARA_REVISION(selectcrtc_source)); 485 - bp->cmd_tbl.select_crtc_source = NULL; 486 - break; 487 - } 488 - } 489 - 490 - 491 - static enum bp_result select_crtc_source_v3( 492 - struct bios_parser *bp, 493 - struct bp_crtc_source_select *bp_params) 494 - { 495 - bool result = BP_RESULT_FAILURE; 496 - struct select_crtc_source_parameters_v2_3 params; 497 - uint8_t atom_controller_id; 498 - uint32_t atom_engine_id; 499 - enum signal_type s = bp_params->signal; 500 - 501 - memset(&params, 0, sizeof(params)); 502 - 503 - if (bp->cmd_helper->controller_id_to_atom(bp_params->controller_id, 504 - &atom_controller_id)) 505 - params.crtc_id = atom_controller_id; 506 - else 507 - return result; 508 - 509 - if (bp->cmd_helper->engine_bp_to_atom(bp_params->engine_id, 510 - &atom_engine_id)) 511 - params.encoder_id = (uint8_t)atom_engine_id; 512 - else 513 - return result; 514 - 515 - if (s == SIGNAL_TYPE_EDP || 516 - (s == SIGNAL_TYPE_DISPLAY_PORT && bp_params->sink_signal == 517 - SIGNAL_TYPE_LVDS)) 518 - s = SIGNAL_TYPE_LVDS; 519 - 520 - params.encode_mode = 521 - bp->cmd_helper->encoder_mode_bp_to_atom( 522 - s, bp_params->enable_dp_audio); 523 - /* Needed for VBIOS Random Spatial Dithering feature */ 524 - params.dst_bpc = (uint8_t)(bp_params->display_output_bit_depth); 525 - 526 - if (EXEC_BIOS_CMD_TABLE(selectcrtc_source, params)) 527 - result = BP_RESULT_OK; 528 - 529 - return result; 530 - } 531 - 532 - /****************************************************************************** 533 - ****************************************************************************** 534 - ** 535 466 ** ENABLE CRTC 536 467 ** 537 468 ****************************************************************************** ··· 739 808 740 809 init_set_crtc_timing(bp); 741 810 742 - init_select_crtc_source(bp); 743 811 init_enable_crtc(bp); 744 812 745 813 init_external_encoder_control(bp);
-3
drivers/gpu/drm/amd/display/dc/bios/command_table2.h
··· 71 71 enum bp_result (*set_crtc_timing)( 72 72 struct bios_parser *bp, 73 73 struct bp_hw_crtc_timing_parameters *bp_params); 74 - enum bp_result (*select_crtc_source)( 75 - struct bios_parser *bp, 76 - struct bp_crtc_source_select *bp_params); 77 74 enum bp_result (*enable_crtc)( 78 75 struct bios_parser *bp, 79 76 enum controller_id controller_id,
-4
drivers/gpu/drm/amd/display/dc/dc_bios_types.h
··· 121 121 enum bp_result (*program_crtc_timing)( 122 122 struct dc_bios *bios, 123 123 struct bp_hw_crtc_timing_parameters *bp_params); 124 - 125 - enum bp_result (*crtc_source_select)( 126 - struct dc_bios *bios, 127 - struct bp_crtc_source_select *bp_params); 128 124 enum bp_result (*program_display_engine_pll)( 129 125 struct dc_bios *bios, 130 126 struct bp_pixel_clock_parameters *bp_params);
+9 -1
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c
··· 1584 1584 REG_UPDATE(DIG_FE_CNTL, DIG_STEREOSYNC_GATE_EN, !enable); 1585 1585 } 1586 1586 1587 + static void dig_connect_to_otg( 1588 + struct stream_encoder *enc, 1589 + int tg_inst) 1590 + { 1591 + struct dce110_stream_encoder *enc110 = DCE110STRENC_FROM_STRENC(enc); 1592 + 1593 + REG_UPDATE(DIG_FE_CNTL, DIG_SOURCE_SELECT, tg_inst); 1594 + } 1587 1595 1588 1596 static const struct stream_encoder_funcs dce110_str_enc_funcs = { 1589 1597 .dp_set_stream_attribute = ··· 1626 1618 .hdmi_audio_disable = dce110_se_hdmi_audio_disable, 1627 1619 .setup_stereo_sync = setup_stereo_sync, 1628 1620 .set_avmute = dce110_stream_encoder_set_avmute, 1629 - 1621 + .dig_connect_to_otg = dig_connect_to_otg, 1630 1622 }; 1631 1623 1632 1624 void dce110_stream_encoder_construct(
+6 -2
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.h
··· 199 199 SE_SF(DP_SEC_CNTL, DP_SEC_ATP_ENABLE, mask_sh),\ 200 200 SE_SF(DP_SEC_CNTL, DP_SEC_AIP_ENABLE, mask_sh),\ 201 201 SE_SF(DP_SEC_CNTL, DP_SEC_ACM_ENABLE, mask_sh),\ 202 - SE_SF(AFMT_AUDIO_PACKET_CONTROL, AFMT_AUDIO_SAMPLE_SEND, mask_sh) 202 + SE_SF(AFMT_AUDIO_PACKET_CONTROL, AFMT_AUDIO_SAMPLE_SEND, mask_sh),\ 203 + SE_SF(DIG_FE_CNTL, DIG_SOURCE_SELECT, mask_sh) 203 204 204 205 #define SE_COMMON_MASK_SH_LIST_DCE_COMMON(mask_sh)\ 205 206 SE_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(mask_sh) ··· 285 284 SE_SF(DIG0_DIG_FE_CNTL, TMDS_PIXEL_ENCODING, mask_sh),\ 286 285 SE_SF(DIG0_DIG_FE_CNTL, TMDS_COLOR_FORMAT, mask_sh),\ 287 286 SE_SF(DIG0_DIG_FE_CNTL, DIG_STEREOSYNC_SELECT, mask_sh),\ 288 - SE_SF(DIG0_DIG_FE_CNTL, DIG_STEREOSYNC_GATE_EN, mask_sh) 287 + SE_SF(DIG0_DIG_FE_CNTL, DIG_STEREOSYNC_GATE_EN, mask_sh),\ 288 + SE_SF(DIG0_DIG_FE_CNTL, DIG_SOURCE_SELECT, mask_sh) 289 289 290 290 #define SE_COMMON_MASK_SH_LIST_SOC(mask_sh)\ 291 291 SE_COMMON_MASK_SH_LIST_SOC_BASE(mask_sh) ··· 496 494 uint8_t HDMI_DB_DISABLE; 497 495 uint8_t DP_VID_N_MUL; 498 496 uint8_t DP_VID_M_DOUBLE_VALUE_EN; 497 + uint8_t DIG_SOURCE_SELECT; 499 498 }; 500 499 501 500 struct dce_stream_encoder_mask { ··· 627 624 uint32_t HDMI_DB_DISABLE; 628 625 uint32_t DP_VID_N_MUL; 629 626 uint32_t DP_VID_M_DOUBLE_VALUE_EN; 627 + uint32_t DIG_SOURCE_SELECT; 630 628 }; 631 629 632 630 struct dce110_stream_enc_registers {
+3 -51
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
··· 614 614 return true; 615 615 } 616 616 617 - static enum dc_status bios_parser_crtc_source_select( 618 - struct pipe_ctx *pipe_ctx) 619 - { 620 - struct dc_bios *dcb = pipe_ctx->stream->ctx->dc_bios; 621 - /* call VBIOS table to set CRTC source for the HW 622 - * encoder block 623 - * note: video bios clears all FMT setting here. */ 624 - struct bp_crtc_source_select crtc_source_select = {0}; 625 - 626 - crtc_source_select.engine_id = pipe_ctx->stream_res.stream_enc->id; 627 - crtc_source_select.controller_id = pipe_ctx->stream_res.tg->inst + 1; 628 - /*TODO: Need to un-hardcode color depth, dp_audio and account for 629 - * the case where signal and sink signal is different (translator 630 - * encoder)*/ 631 - crtc_source_select.signal = pipe_ctx->stream->signal; 632 - crtc_source_select.enable_dp_audio = false; 633 - crtc_source_select.sink_signal = pipe_ctx->stream->signal; 634 - 635 - switch (pipe_ctx->stream->timing.display_color_depth) { 636 - case COLOR_DEPTH_666: 637 - crtc_source_select.display_output_bit_depth = PANEL_6BIT_COLOR; 638 - break; 639 - case COLOR_DEPTH_888: 640 - crtc_source_select.display_output_bit_depth = PANEL_8BIT_COLOR; 641 - break; 642 - case COLOR_DEPTH_101010: 643 - crtc_source_select.display_output_bit_depth = PANEL_10BIT_COLOR; 644 - break; 645 - case COLOR_DEPTH_121212: 646 - crtc_source_select.display_output_bit_depth = PANEL_12BIT_COLOR; 647 - break; 648 - default: 649 - BREAK_TO_DEBUGGER(); 650 - crtc_source_select.display_output_bit_depth = PANEL_8BIT_COLOR; 651 - break; 652 - } 653 - 654 - if (BP_RESULT_OK != dcb->funcs->crtc_source_select( 655 - dcb, 656 - &crtc_source_select)) { 657 - return DC_ERROR_UNEXPECTED; 658 - } 659 - 660 - return DC_OK; 661 - } 662 - 663 617 void dce110_update_info_frame(struct pipe_ctx *pipe_ctx) 664 618 { 665 619 bool is_hdmi; ··· 1341 1387 /* */ 1342 1388 dc->hwss.enable_stream_timing(pipe_ctx, context, dc); 1343 1389 1344 - /* TODO: move to stream encoder */ 1345 1390 if (pipe_ctx->stream->signal != SIGNAL_TYPE_VIRTUAL) 1346 - if (DC_OK != bios_parser_crtc_source_select(pipe_ctx)) { 1347 - BREAK_TO_DEBUGGER(); 1348 - return DC_ERROR_UNEXPECTED; 1349 - } 1391 + pipe_ctx->stream_res.stream_enc->funcs->dig_connect_to_otg( 1392 + pipe_ctx->stream_res.stream_enc, 1393 + pipe_ctx->stream_res.tg->inst); 1350 1394 1351 1395 pipe_ctx->stream_res.opp->funcs->opp_set_dyn_expansion( 1352 1396 pipe_ctx->stream_res.opp,
+9
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c
··· 1425 1425 REG_UPDATE(DIG_FE_CNTL, DIG_STEREOSYNC_GATE_EN, !enable); 1426 1426 } 1427 1427 1428 + void enc1_dig_connect_to_otg( 1429 + struct stream_encoder *enc, 1430 + int tg_inst) 1431 + { 1432 + struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc); 1433 + 1434 + REG_UPDATE(DIG_FE_CNTL, DIG_SOURCE_SELECT, tg_inst); 1435 + } 1428 1436 1429 1437 static const struct stream_encoder_funcs dcn10_str_enc_funcs = { 1430 1438 .dp_set_stream_attribute = ··· 1465 1457 .hdmi_audio_disable = enc1_se_hdmi_audio_disable, 1466 1458 .setup_stereo_sync = enc1_setup_stereo_sync, 1467 1459 .set_avmute = enc1_stream_encoder_set_avmute, 1460 + .dig_connect_to_otg = enc1_dig_connect_to_otg, 1468 1461 }; 1469 1462 1470 1463 void dcn10_stream_encoder_construct(
+8 -2
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.h
··· 274 274 SE_SF(DP0_DP_MSA_TIMING_PARAM4, DP_MSA_HWIDTH, mask_sh),\ 275 275 SE_SF(DP0_DP_MSA_TIMING_PARAM4, DP_MSA_VHEIGHT, mask_sh),\ 276 276 SE_SF(DIG0_HDMI_DB_CONTROL, HDMI_DB_DISABLE, mask_sh),\ 277 - SE_SF(DP0_DP_VID_TIMING, DP_VID_N_MUL, mask_sh) 277 + SE_SF(DP0_DP_VID_TIMING, DP_VID_N_MUL, mask_sh),\ 278 + SE_SF(DIG0_DIG_FE_CNTL, DIG_SOURCE_SELECT, mask_sh) 278 279 279 280 #define SE_COMMON_MASK_SH_LIST_SOC(mask_sh)\ 280 281 SE_COMMON_MASK_SH_LIST_SOC_BASE(mask_sh) ··· 427 426 type DP_MSA_VHEIGHT;\ 428 427 type HDMI_DB_DISABLE;\ 429 428 type DP_VID_N_MUL;\ 430 - type DP_VID_M_DOUBLE_VALUE_EN 429 + type DP_VID_M_DOUBLE_VALUE_EN;\ 430 + type DIG_SOURCE_SELECT 431 431 432 432 struct dcn10_stream_encoder_shift { 433 433 SE_REG_FIELD_LIST_DCN1_0(uint8_t); ··· 524 522 525 523 void enc1_se_hdmi_audio_disable( 526 524 struct stream_encoder *enc); 525 + 526 + void enc1_dig_connect_to_otg( 527 + struct stream_encoder *enc, 528 + int tg_inst); 527 529 528 530 #endif /* __DC_STREAM_ENCODER_DCN10_H__ */
+4
drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h
··· 161 161 void (*set_avmute)( 162 162 struct stream_encoder *enc, bool enable); 163 163 164 + void (*dig_connect_to_otg)( 165 + struct stream_encoder *enc, 166 + int tg_inst); 167 + 164 168 }; 165 169 166 170 #endif /* STREAM_ENCODER_H_ */