Revert "video: driver: handle release during batching"
This reverts commit 0f066190b1
.
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
6b20be1d9b
commit
abe44a0089
@@ -2161,6 +2161,7 @@ int msm_vidc_map_driver_buf(struct msm_vidc_inst *inst,
|
|||||||
int rc = 0;
|
int rc = 0;
|
||||||
struct msm_vidc_mappings *mappings;
|
struct msm_vidc_mappings *mappings;
|
||||||
struct msm_vidc_map *map;
|
struct msm_vidc_map *map;
|
||||||
|
struct msm_vidc_buffer *rel_buf;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
if (!inst || !buf) {
|
if (!inst || !buf) {
|
||||||
@@ -2213,6 +2214,16 @@ int msm_vidc_map_driver_buf(struct msm_vidc_inst *inst,
|
|||||||
|
|
||||||
buf->device_addr = map->device_addr;
|
buf->device_addr = map->device_addr;
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2483,10 +2494,8 @@ exit:
|
|||||||
|
|
||||||
static int msm_vidc_queue_buffer(struct msm_vidc_inst *inst, struct msm_vidc_buffer *buf)
|
static int msm_vidc_queue_buffer(struct msm_vidc_inst *inst, struct msm_vidc_buffer *buf)
|
||||||
{
|
{
|
||||||
struct msm_vidc_buffer *meta, *rel_buf;
|
struct msm_vidc_buffer *meta;
|
||||||
struct msm_vidc_map *map;
|
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
bool found = false;
|
|
||||||
|
|
||||||
if (!inst || !buf || !inst->capabilities) {
|
if (!inst || !buf || !inst->capabilities) {
|
||||||
d_vpr_e("%s: invalid params\n", __func__);
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
@@ -2503,28 +2512,6 @@ static int msm_vidc_queue_buffer(struct msm_vidc_inst *inst, struct msm_vidc_buf
|
|||||||
rc = msm_vidc_process_readonly_buffers(inst, buf);
|
rc = msm_vidc_process_readonly_buffers(inst, buf);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
list_for_each_entry(map, &inst->mappings.output.list, list) {
|
|
||||||
if (map->dmabuf == buf->dmabuf) {
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found) {
|
|
||||||
print_vidc_buffer(VIDC_ERR, "err ", "missing map", inst, buf);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print_vidc_buffer(VIDC_HIGH, "high", "qbuf", inst, buf);
|
print_vidc_buffer(VIDC_HIGH, "high", "qbuf", inst, buf);
|
||||||
|
@@ -98,7 +98,7 @@ int msm_vidc_memory_map(struct msm_vidc_core *core, struct msm_vidc_map *map)
|
|||||||
|
|
||||||
if (map->refcount) {
|
if (map->refcount) {
|
||||||
map->refcount++;
|
map->refcount++;
|
||||||
goto exit;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cb = get_context_bank(core, map->region);
|
cb = get_context_bank(core, map->region);
|
||||||
@@ -153,11 +153,12 @@ int msm_vidc_memory_map(struct msm_vidc_core *core, struct msm_vidc_map *map)
|
|||||||
map->attach = attach;
|
map->attach = attach;
|
||||||
map->refcount++;
|
map->refcount++;
|
||||||
|
|
||||||
exit:
|
|
||||||
d_vpr_l(
|
d_vpr_l(
|
||||||
"%s: type %11s, device_addr %#x, refcount %d, region %d\n",
|
"%s: type %11s, device_addr %#x, refcount %d, region %d\n",
|
||||||
__func__, buf_name(map->type), map->device_addr, map->refcount, map->region);
|
__func__, buf_name(map->type), map->device_addr, map->refcount, map->region);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error_sg:
|
error_sg:
|
||||||
dma_buf_unmap_attachment(attach, table, DMA_BIDIRECTIONAL);
|
dma_buf_unmap_attachment(attach, table, DMA_BIDIRECTIONAL);
|
||||||
error_table:
|
error_table:
|
||||||
@@ -184,13 +185,13 @@ int msm_vidc_memory_unmap(struct msm_vidc_core *core,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (map->refcount)
|
||||||
|
goto exit;
|
||||||
|
|
||||||
d_vpr_l(
|
d_vpr_l(
|
||||||
"%s: type %11s, device_addr %#x, refcount %d, region %d\n",
|
"%s: type %11s, device_addr %#x, refcount %d, region %d\n",
|
||||||
__func__, buf_name(map->type), map->device_addr, map->refcount, map->region);
|
__func__, buf_name(map->type), map->device_addr, map->refcount, map->region);
|
||||||
|
|
||||||
if (map->refcount)
|
|
||||||
goto exit;
|
|
||||||
|
|
||||||
dma_buf_unmap_attachment(map->attach, map->table, DMA_BIDIRECTIONAL);
|
dma_buf_unmap_attachment(map->attach, map->table, DMA_BIDIRECTIONAL);
|
||||||
dma_buf_detach(map->dmabuf, map->attach);
|
dma_buf_detach(map->dmabuf, map->attach);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user