mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
ge2d/gdc: fix the problem of variable memory not being released [1/1]
PD#SWPL-163798 Problem: memory usage keeps increasing Solution: modify logic errors and solve the problem of not being released Verify: s1a Change-Id: Ia5d1c863a0941067c861d8cd2c8634d26210583c Signed-off-by: Jian Cao <jian.cao@amlogic.com>
This commit is contained in:
committed by
gerrit autosubmit
parent
c82399acbc
commit
9fd68773eb
@@ -976,6 +976,7 @@ void ge2d_wq_set_scale_coef(struct ge2d_context_s *wq,
|
||||
int ge2d_wq_add_work(struct ge2d_context_s *wq, int enqueue)
|
||||
{
|
||||
struct ge2d_queue_item_s *pitem;
|
||||
unsigned int block = 0;
|
||||
|
||||
ge2d_log_dbg("add new work @@%s:%d\n", __func__, __LINE__);
|
||||
pitem = kmalloc(sizeof(*pitem), GFP_KERNEL);
|
||||
@@ -990,6 +991,7 @@ int ge2d_wq_add_work(struct ge2d_context_s *wq, int enqueue)
|
||||
if (enqueue)
|
||||
pitem->flag.cmd_queue_mode = 1;
|
||||
|
||||
block = pitem->cmd.wait_done_flag;
|
||||
spin_lock(&wq->lock);
|
||||
list_add_tail(&pitem->list, &wq->work_queue);
|
||||
spin_unlock(&wq->lock);
|
||||
@@ -1000,7 +1002,7 @@ int ge2d_wq_add_work(struct ge2d_context_s *wq, int enqueue)
|
||||
if (ge2d_manager.event.cmd_in_com.done == 0)
|
||||
complete(&ge2d_manager.event.cmd_in_com);/* new cmd come in */
|
||||
/* add block mode if() */
|
||||
if (pitem->cmd.wait_done_flag) {
|
||||
if (block) {
|
||||
wait_event_interruptible(wq->cmd_complete,
|
||||
pitem->cmd.wait_done_flag == 0);
|
||||
/* interruptible_sleep_on(&wq->cmd_complete); */
|
||||
@@ -1032,7 +1034,7 @@ int post_queue_to_process(struct ge2d_context_s *wq, int block)
|
||||
if (ge2d_manager.event.cmd_in_com.done == 0)
|
||||
complete(&ge2d_manager.event.cmd_in_com);/* new cmd come in */
|
||||
|
||||
if (pitem->cmd.wait_done_flag) {
|
||||
if (block) {
|
||||
wait_event_interruptible(wq->cmd_complete,
|
||||
pitem->cmd.wait_done_flag == 0);
|
||||
kfree(pitem);
|
||||
|
||||
@@ -505,6 +505,7 @@ int gdc_wq_add_work(struct gdc_context_s *wq,
|
||||
int polling_ms = 100;
|
||||
int ret = -1;
|
||||
u32 time_cost;
|
||||
unsigned int block = pitem->cmd.wait_done_flag;
|
||||
|
||||
gdc_log(LOG_DEBUG, "gdc add work\n");
|
||||
spin_lock(&wq->lock);
|
||||
@@ -515,7 +516,7 @@ int gdc_wq_add_work(struct gdc_context_s *wq,
|
||||
if (gdc_manager.event.cmd_in_sem.count == 0)
|
||||
up(&gdc_manager.event.cmd_in_sem);/* new cmd come in */
|
||||
|
||||
if (pitem->cmd.wait_done_flag) {
|
||||
if (block) {
|
||||
while (1) {
|
||||
ret = wait_event_interruptible_timeout
|
||||
(wq->cmd_complete,
|
||||
|
||||
Reference in New Issue
Block a user