hdmirx: optimize for audio fifo [1/1]

PD#SWPL-2114

Problem:
When change audio channel count on VG-877, the subpkts of skipped
middle channels are still carried, thus causing afifo overflow

Solution:
When afifo overflow, then store all audio subpkts(8ch)
into afifo, and output 8ch audio from afifo

Verify:
R321

Change-Id: I4b0933935d3a1aed20be10a7a8d3fe23c3a39323
Signed-off-by: Hang Cheng <hang.cheng@amlogic.com>
This commit is contained in:
Hang Cheng
2018-11-14 16:30:17 +08:00
committed by Luke Go
parent 3cdf2534fb
commit 63a76404db
4 changed files with 30 additions and 1 deletions

View File

@@ -46,7 +46,7 @@
*
*
*/
#define RX_VER2 "ver.2018/10/30"
#define RX_VER2 "ver.2018/11/14"
/*print type*/
#define LOG_EN 0x01

View File

@@ -1004,6 +1004,28 @@ else
return false;
}
void rx_afifo_store_all_subpkt(bool all_pkt)
{
static bool flag = true;
if (all_pkt) {
if (log_level & AUDIO_LOG)
rx_pr("afifo store all subpkts: %d\n", flag);
/* when afifo overflow, try afifo store
* configuration alternatively
*/
if (flag)
hdmirx_wr_bits_dwc(DWC_AUD_FIFO_CTRL,
AFIF_SUBPACKETS, 0);
else
hdmirx_wr_bits_dwc(DWC_AUD_FIFO_CTRL,
AFIF_SUBPACKETS, 1);
flag = !flag;
} else
hdmirx_wr_bits_dwc(DWC_AUD_FIFO_CTRL,
AFIF_SUBPACKETS, 1);
}
/*
* hdmirx_audio_fifo_rst - reset afifo
*/

View File

@@ -1173,6 +1173,7 @@ extern void rx_hpd_to_esm_handle(struct work_struct *work);
extern void rx_hdcp14_resume(void);
extern void hdmirx_load_firm_reset(int type);
extern unsigned int hdmirx_packet_fifo_rst(void);
extern void rx_afifo_store_all_subpkt(bool all_pkt);
extern unsigned int hdmirx_audio_fifo_rst(void);
extern void hdmirx_phy_init(void);
extern void hdmirx_hw_config(void);

View File

@@ -444,6 +444,11 @@ static int hdmi_rx_ctrl_irq_handler(void)
if (log_level & 0x100)
rx_pr("[irq] OVERFL\n");
rx.irq_flag |= IRQ_AUD_FLAG;
/* when afifo overflow in multi-channel case(VG-877),
* then store all subpkts into afifo, 8ch in and 8ch out
*/
if (rx.aud_info.auds_layout)
rx_afifo_store_all_subpkt(true);
//if (rx.aud_info.real_sr != 0)
//error |= hdmirx_audio_fifo_rst();
}
@@ -2257,6 +2262,7 @@ void rx_main_state_machine(void)
rx_get_audinfo(&rx.aud_info);
hdmirx_config_audio();
rx_aud_pll_ctl(1);
rx_afifo_store_all_subpkt(false);
hdmirx_audio_fifo_rst();
rx.stable_timestamp = rx.timestamp;
rx_pr("Sig ready\n");