video: driver: refine refcount handling for release buffer
If current qbuf entry is already present in release buffer list, then as part of release done, refcount will get decremented and for current qbuf, there is 2 possibilities of outputs from fw. FBD with RO and wo RO. So if firmware gives FBD with RO, we are currently decrementing refcount from 1 -> 0. So mapping gets destroyed. But firmware is still holding RO referrence and leading to smmu fault issues. So added hadling to increment recount by 1, if current buffer(qbuf) is already present in release buf list. Change-Id: Icbe8ce0b1c9b47c4450d17650b63a575e1037ce3 Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
@@ -2159,6 +2159,7 @@ int msm_vidc_map_driver_buf(struct msm_vidc_inst *inst,
|
||||
int rc = 0;
|
||||
struct msm_vidc_mappings *mappings;
|
||||
struct msm_vidc_map *map;
|
||||
struct msm_vidc_buffer *rel_buf;
|
||||
bool found = false;
|
||||
|
||||
if (!inst || !buf) {
|
||||
@@ -2204,6 +2205,16 @@ int msm_vidc_map_driver_buf(struct msm_vidc_inst *inst,
|
||||
}
|
||||
}
|
||||
list_add_tail(&map->list, &mappings->list);
|
||||
} else {
|
||||
/* increment map ref_count, if buf already present in release list */
|
||||
list_for_each_entry(rel_buf, &inst->buffers.release.list, list) {
|
||||
if (rel_buf->device_addr == buf->device_addr) {
|
||||
rc = msm_vidc_memory_map(inst->core, map);
|
||||
if (rc)
|
||||
return rc;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
rc = msm_vidc_memory_map(inst->core, map);
|
||||
if (rc)
|
||||
|
Reference in New Issue
Block a user