author | Nanxin Qin <nanxin.qin@amlogic.com> | 2020-05-21 12:45:48 (GMT) |
---|---|---|
committer | Nanxin Qin <nanxin.qin@amlogic.com> | 2020-05-21 12:48:32 (GMT) |
commit | ceda840f3c26774319dcbac15b4a38a4dc0358a8 (patch) | |
tree | f502fb1bb63264fdc69d72c53c22731976751568 | |
parent | c51fd5a396b8f504e247fb6671a610a448dc141e (diff) | |
download | media_modules-ceda840f3c26774319dcbac15b4a38a4dc0358a8.zip media_modules-ceda840f3c26774319dcbac15b4a38a4dc0358a8.tar.gz media_modules-ceda840f3c26774319dcbac15b4a38a4dc0358a8.tar.bz2 |
esparser: the drm source playback abnormal. [1/1]
PD#SWPL-26251
Problem:
the drm source playback abnormal.
Solution:
the drm flag correct to set wirte func.
Verify:
u212
Change-Id: Idb25a1aede3899c6bf0cc821e5dc3392c78dc969
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
-rw-r--r-- | drivers/stream_input/amports/streambuf.h | 1 | ||||
-rw-r--r-- | drivers/stream_input/parser/esparser.c | 16 |
2 files changed, 10 insertions, 7 deletions
diff --git a/drivers/stream_input/amports/streambuf.h b/drivers/stream_input/amports/streambuf.h index 8e4d2e3..eb6ff8c 100644 --- a/drivers/stream_input/amports/streambuf.h +++ b/drivers/stream_input/amports/streambuf.h @@ -84,6 +84,7 @@ struct stream_buf_s { bool no_parser; bool is_phybuf; bool is_hevc; + u32 drm_flag; ulong ext_buf_addr; atomic_t payload; struct parser_args pars; diff --git a/drivers/stream_input/parser/esparser.c b/drivers/stream_input/parser/esparser.c index 5b34e85..2675551 100644 --- a/drivers/stream_input/parser/esparser.c +++ b/drivers/stream_input/parser/esparser.c @@ -216,7 +216,7 @@ static int esparser_stbuf_write(struct stream_buf_s *stbuf, const u8 *buf, u32 c } search_done = 0; - if (!(stbuf->is_phybuf & TYPE_PATTERN)) { + if (!(stbuf->drm_flag & TYPE_PATTERN)) { WRITE_PARSER_REG(PARSER_FETCH_CMD, (7 << FETCH_ENDIAN) | len); WRITE_PARSER_REG(PARSER_FETCH_ADDR, search_pattern_map); @@ -226,6 +226,7 @@ static int esparser_stbuf_write(struct stream_buf_s *stbuf, const u8 *buf, u32 c WRITE_PARSER_REG(PARSER_FETCH_CMD, (7 << FETCH_ENDIAN) | (len + 512)); } + ret = wait_event_interruptible_timeout(wq, search_done != 0, HZ / 5); if (ret == 0) { @@ -768,7 +769,7 @@ ssize_t drm_write(struct file *file, struct stream_buf_s *stbuf, struct drm_info tmpmm; struct drm_info *drm = &tmpmm; u32 res = 0; - int isphybuf = 0; + int drm_flag = 0; unsigned long realbuf; if (buf == NULL || count == 0) @@ -792,7 +793,7 @@ ssize_t drm_write(struct file *file, struct stream_buf_s *stbuf, /* buf only has drminfo not have esdata; */ realbuf = drm->drm_phy; realcount = drm->drm_pktsize; - isphybuf = drm->drm_flag; + drm_flag = drm->drm_flag; /* DRM_PRNT("drm_get_rawdata *onlydrminfo drm->drm_hasesdata[0x%x] * stbuf->type %d buf[0x%x]\n", @@ -805,14 +806,14 @@ ssize_t drm_write(struct file *file, struct stream_buf_s *stbuf, } realcount = drm->drm_pktsize; realbuf = (unsigned long)buf + sizeof(struct drm_info); - isphybuf = 0; + drm_flag = 0; /* DRM_PRNT("drm_get_rawdata * drminfo+es drm->drm_hasesdata[0x%x] * stbuf->type %d\n",drm->drm_hasesdata,stbuf->type); */ } else { /* buf is hwhead; */ realcount = count; - isphybuf = 0; + drm_flag = 0; realbuf = (unsigned long)buf; /* DRM_PRNT("drm_get_rawdata * drm->drm_hasesdata[0x%x] @@ -824,7 +825,8 @@ ssize_t drm_write(struct file *file, struct stream_buf_s *stbuf, len = realcount; count = realcount; totalcount = realcount; - stbuf->is_phybuf = isphybuf; + stbuf->drm_flag = drm_flag; + stbuf->is_phybuf = drm_flag ? 1 : 0; while (len > 0) { if (stbuf->type != BUF_TYPE_SUBTITLE @@ -842,7 +844,7 @@ ssize_t drm_write(struct file *file, struct stream_buf_s *stbuf, if (stbuf->type != BUF_TYPE_AUDIO) r = _esparser_write((const char __user *)realbuf, len, - stbuf, isphybuf); + stbuf, drm_flag); else r = _esparser_write_s((const char __user *)realbuf, len, stbuf); |