struct s5p_mfc_buf {
struct vb2_v4l2_buffer vb;
struct list_head list;
- union {
- dma_addr_t raw[3];
- dma_addr_t stream;
- } planes;
+ dma_addr_t addr[MFC_MAX_PLANES];
int used;
unsigned char *vir_addr;
};
start_raw = s5p_mfc_mem_get_daddr_vb(vb, 0);
if (ctx->dst_fmt->fourcc == V4L2_PIX_FMT_NV12N) {
- buf->planes.raw[0] = start_raw;
- buf->planes.raw[1] = NV12N_CBCR_BASE(start_raw,
+ buf->addr[0] = start_raw;
+ buf->addr[1] = NV12N_CBCR_BASE(start_raw,
ctx->img_width,
ctx->img_height);
} else if (ctx->dst_fmt->fourcc == V4L2_PIX_FMT_NV12N_10B) {
- buf->planes.raw[0] = start_raw;
- buf->planes.raw[1] = NV12N_10B_CBCR_BASE(start_raw,
+ buf->addr[0] = start_raw;
+ buf->addr[1] = NV12N_10B_CBCR_BASE(start_raw,
ctx->img_width,
ctx->img_height);
} else if (ctx->dst_fmt->fourcc == V4L2_PIX_FMT_YUV420N) {
- buf->planes.raw[0] = start_raw;
- buf->planes.raw[1] = YUV420N_CB_BASE(start_raw,
+ buf->addr[0] = start_raw;
+ buf->addr[1] = YUV420N_CB_BASE(start_raw,
ctx->img_width,
ctx->img_height);
- buf->planes.raw[2] = YUV420N_CR_BASE(start_raw,
+ buf->addr[2] = YUV420N_CR_BASE(start_raw,
ctx->img_width,
ctx->img_height);
} else {
for (i = 0; i < ctx->dst_fmt->mem_planes; i++)
- buf->planes.raw[i] = s5p_mfc_mem_get_daddr_vb(vb, i);
+ buf->addr[i] = s5p_mfc_mem_get_daddr_vb(vb, i);
}
if (call_cop(ctx, init_buf_ctrls, ctx, MFC_CTRL_TYPE_DST,
if (ret < 0)
return ret;
- buf->planes.stream = s5p_mfc_mem_get_daddr_vb(vb, 0);
+ buf->addr[0] = s5p_mfc_mem_get_daddr_vb(vb, 0);
if (call_cop(ctx, init_buf_ctrls, ctx, MFC_CTRL_TYPE_SRC,
vb->index) < 0)
mfc_debug(2, "Src queue: %p\n", &ctx->src_buf_queue);
mfc_debug(2, "Adding to src: %p (0x%08llx, 0x%08llx)\n", vb,
s5p_mfc_mem_get_daddr_vb(vb, 0),
- buf->planes.stream);
+ buf->addr[0]);
if (dec->dst_memtype == V4L2_MEMORY_DMABUF &&
ctx->state < MFCINST_HEAD_PARSED && !ctx->is_drm) {
stream_vir = vb2_plane_vaddr(vb, 0);
s5p_mfc_add_tail_buf(&ctx->buf_queue_lock, &ctx->src_buf_queue, buf);
MFC_TRACE_CTX("Q src[%d] fd: %d, %#llx\n",
- vb->index, vb->planes[0].m.fd, buf->planes.stream);
+ vb->index, vb->planes[0].m.fd, buf->addr[0]);
} else if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
index = vb->index;
mfc_debug(2, "Dst queue: %p\n", &ctx->dst_buf_queue);
s5p_mfc_mem_get_daddr_vb(vb, 0));
for (i = 0; i < ctx->dst_fmt->num_planes; i++)
mfc_debug(2, "dec dst plane[%d]: %08llx\n",
- i, buf->planes.raw[i]);
+ i, buf->addr[i]);
s5p_mfc_store_dpb(ctx, vb);
if ((dec->dst_memtype == V4L2_MEMORY_USERPTR || dec->dst_memtype == V4L2_MEMORY_DMABUF) &&
ctx->capture_state = QUEUE_BUFS_MMAPED;
MFC_TRACE_CTX("Q dst[%d] fd: %d, %#llx / avail %#lx used %#x\n",
- index, vb->planes[0].m.fd, buf->planes.raw[0],
+ index, vb->planes[0].m.fd, buf->addr[0],
dec->available_dpb, dec->dynamic_used);
} else {
mfc_err_ctx("Unsupported buffer type (%d)\n", vq->type);
if (ret < 0)
return ret;
- buf->planes.stream = s5p_mfc_mem_get_daddr_vb(vb, 0);
+ buf->addr[0] = s5p_mfc_mem_get_daddr_vb(vb, 0);
if (call_cop(ctx, init_buf_ctrls, ctx, MFC_CTRL_TYPE_DST,
vb->index) < 0)
return -ENOMEM;
}
if (ctx->src_fmt->fourcc == V4L2_PIX_FMT_NV12N) {
- buf->planes.raw[0] = start_raw;
- buf->planes.raw[1] = NV12N_CBCR_BASE(start_raw,
+ buf->addr[0] = start_raw;
+ buf->addr[1] = NV12N_CBCR_BASE(start_raw,
ctx->img_width,
ctx->img_height);
} else if (ctx->src_fmt->fourcc == V4L2_PIX_FMT_YUV420N) {
- buf->planes.raw[0] = start_raw;
- buf->planes.raw[1] = YUV420N_CB_BASE(start_raw,
+ buf->addr[0] = start_raw;
+ buf->addr[1] = YUV420N_CB_BASE(start_raw,
ctx->img_width,
ctx->img_height);
- buf->planes.raw[2] = YUV420N_CR_BASE(start_raw,
+ buf->addr[2] = YUV420N_CR_BASE(start_raw,
ctx->img_width,
ctx->img_height);
} else {
for (i = 0; i < ctx->src_fmt->num_planes; i++)
- buf->planes.raw[i] = s5p_mfc_mem_get_daddr_vb(vb, i);
+ buf->addr[i] = s5p_mfc_mem_get_daddr_vb(vb, i);
}
if (call_cop(ctx, init_buf_ctrls, ctx, MFC_CTRL_TYPE_SRC,
if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
mfc_debug(2, "dst queue: %p\n", &ctx->dst_buf_queue);
- mfc_debug(2, "Adding to dst: %p (%08llx, %08llx)\n", vb,
- s5p_mfc_mem_get_daddr_vb(vb, 0),
- buf->planes.stream);
+ mfc_debug(2, "Adding to dst vb: %p, addr: %08llx\n", vb, buf->addr[0]);
/* Mark destination as available for use by MFC */
s5p_mfc_add_tail_buf(&ctx->buf_queue_lock, &ctx->dst_buf_queue, buf);
return;
}
- ref_mb = s5p_mfc_find_buf_vb(&ctx->buf_queue_lock,
- &ctx->ref_buf_queue, dec_y_addr);
+ ref_mb = s5p_mfc_find_buf(&ctx->buf_queue_lock, &ctx->ref_buf_queue, dec_y_addr);
if (ref_mb)
ref_mb->vb.vb2_buf.timestamp = src_mb->vb.vb2_buf.timestamp;
}
struct s5p_mfc_buf *ref_mb;
int index;
- ref_mb = s5p_mfc_find_move_buf_vb(&ctx->buf_queue_lock,
+ ref_mb = s5p_mfc_find_move_buf(&ctx->buf_queue_lock,
&ctx->dst_buf_queue, &ctx->ref_buf_queue, dspl_y_addr, released_flag);
if (ref_mb) {
mfc_debug(2, "Listing: %d\n", ref_mb->vb.vb2_buf.index);
/* Check if this is the buffer we're looking for */
mfc_debug(2, "Found 0x%08llx, looking for 0x%08llx\n",
- s5p_mfc_mem_get_daddr_vb(&ref_mb->vb.vb2_buf, 0), dspl_y_addr);
+ ref_mb->addr[0], dspl_y_addr);
index = ref_mb->vb.vb2_buf.index;
frame_type = s5p_mfc_get_disp_frame_type();
}
- ref_mb = s5p_mfc_find_del_buf_vb(&ctx->buf_queue_lock,
+ ref_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock,
&ctx->ref_buf_queue, dspl_y_addr);
if (ref_mb) {
mfc_debug(2, "Listing: %d\n", ref_mb->vb.vb2_buf.index);
/* Check if this is the buffer we're looking for */
mfc_debug(2, "Found 0x%08llx, looking for 0x%08llx\n",
- s5p_mfc_mem_get_daddr_vb(&ref_mb->vb.vb2_buf, 0), dspl_y_addr);
+ ref_mb->addr[0], dspl_y_addr);
index = ref_mb->vb.vb2_buf.index;
dec_addr = (dma_addr_t)s5p_mfc_get_dec_y_addr();
/* Try to search decoded address in whole dst queue */
- dst_mb = s5p_mfc_find_move_buf_vb_used(&ctx->buf_queue_lock,
+ dst_mb = s5p_mfc_find_move_buf_used(&ctx->buf_queue_lock,
&ctx->ref_buf_queue, &ctx->dst_buf_queue, dec_addr);
if (dst_mb) {
mfc_debug(2, "Found in dst queue = 0x%08llx, buf = 0x%08llx\n",
- dec_addr, s5p_mfc_mem_get_daddr_vb(&dst_mb->vb.vb2_buf, 0));
+ dec_addr, dst_mb->addr[0]);
if (!(dec->dynamic_set & s5p_mfc_get_dec_used_flag()))
dec->dynamic_used |= dec->dynamic_set;
mfc_debug(2, "encoded[%d] addr: 0x%08llx\n",
i, enc_addr[i]);
- src_mb = s5p_mfc_find_del_buf_raw(&ctx->buf_queue_lock,
+ src_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock,
&ctx->src_buf_queue, enc_addr[0]);
if (src_mb) {
index = src_mb->vb.vb2_buf.index;
s5p_mfc_raw_unprotect(ctx, src_mb, index);
}
- ref_mb = s5p_mfc_find_del_buf_raw(&ctx->buf_queue_lock,
+ ref_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock,
&ctx->ref_buf_queue, enc_addr[0]);
if (ref_mb) {
vb2_buffer_done(&ref_mb->vb.vb2_buf, VB2_BUF_STATE_DONE);
}
for (i = 0; i < raw->num_planes; i++) {
- src_addr[i] = s5p_mfc_mem_get_daddr_vb(&src_mb->vb.vb2_buf, i);
+ src_addr[i] = src_mb->addr[i];
mfc_debug(2, "NAL Q: enc src[%d] addr: 0x%08llx\n",
i, src_addr[i]);
}
return -EAGAIN;
}
- pInStr->StreamBufferAddr = s5p_mfc_mem_get_daddr_vb(&dst_mb->vb.vb2_buf, 0);
+ pInStr->StreamBufferAddr = dst_mb->addr[0];
pInStr->StreamBufferSize = (unsigned int)vb2_plane_size(&dst_mb->vb.vb2_buf, 0);
pInStr->StreamBufferSize = ALIGN(pInStr->StreamBufferSize, 512);
}
/* src buffer setting */
- buf_addr = s5p_mfc_mem_get_daddr_vb(&src_mb->vb.vb2_buf, 0);
+ buf_addr = src_mb->addr[0];
strm_size = src_mb->vb.vb2_buf.planes[0].bytesused;
cpb_buf_size = ALIGN(dec->src_buf_size, STREAM_BUF_ALIGN);
mfc_debug(2, "NAL Q: Src addr: 0x%08llx, size: %d\n", buf_addr, strm_size);
for (i = 0; i < raw->num_planes; i++) {
pInStr->FrameSize[i] = raw->plane_size[i];
- pInStr->FrameAddr[i] = dst_mb->planes.raw[i];
+ pInStr->FrameAddr[i] = dst_mb->addr[i];
}
mfc_debug(2, "NAL Q: dst addr[0]: 0x%08llx\n",
- dst_mb->planes.raw[0]);
+ dst_mb->addr[0]);
pInStr->ScratchBufAddr = ctx->codec_buf.daddr;
pInStr->ScratchBufSize = ctx->scratch_buf_size;
pInStr->AvailableDpbFlagLower = dec->dynamic_set;
MFC_TRACE_CTX("Set dst[%d] fd: %d, %#llx / avail %#lx used %#x\n",
- dst_index, dst_mb->vb.vb2_buf.planes[0].m.fd, dst_mb->planes.raw[0],
+ dst_index, dst_mb->vb.vb2_buf.planes[0].m.fd, dst_mb->addr[0],
dec->available_dpb, dec->dynamic_used);
mfc_debug_leave();
mfc_debug(2, "NAL Q: encoded[%d] addr: 0x%08llx\n", i,
enc_addr[i]);
- src_mb = s5p_mfc_find_del_buf_vb(&ctx->buf_queue_lock,
+ src_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock,
&ctx->src_buf_nal_queue, enc_addr[0]);
if (!src_mb) {
mfc_err_dev("NAL Q: no src buffers\n");
vb2_buffer_done(&src_mb->vb.vb2_buf, VB2_BUF_STATE_DONE);
- ref_mb = s5p_mfc_find_del_buf_vb(&ctx->buf_queue_lock,
+ ref_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock,
&ctx->ref_buf_queue, enc_addr[0]);
if (ref_mb)
vb2_buffer_done(&ref_mb->vb.vb2_buf, VB2_BUF_STATE_DONE);
mfc_debug(2, "NAL Q: dec addr: 0x%08llx, disp addr: 0x%08llx\n",
dec_addr, disp_addr);
- dst_mb = s5p_mfc_find_move_buf_vb_used(&ctx->buf_queue_lock,
+ dst_mb = s5p_mfc_find_move_buf_used(&ctx->buf_queue_lock,
&ctx->ref_buf_queue, &ctx->dst_buf_nal_queue, dec_addr);
if (dst_mb) {
- buf_addr = s5p_mfc_mem_get_daddr_vb(&dst_mb->vb.vb2_buf, 0);
+ buf_addr = dst_mb->addr[0];
mfc_debug(2, "NAL Q: Found in dst queue, "
"dec addr: 0x%08llx, buf addr: 0x%08llx, used: %d\n",
dec_addr, buf_addr, dst_mb->used);
return;
}
- ref_mb = s5p_mfc_find_buf_vb(&ctx->buf_queue_lock,
- &ctx->ref_buf_queue, dec_y_addr);
+ ref_mb = s5p_mfc_find_buf(&ctx->buf_queue_lock, &ctx->ref_buf_queue, dec_y_addr);
if (ref_mb)
ref_mb->vb.vb2_buf.timestamp = src_mb->vb.vb2_buf.timestamp;
struct s5p_mfc_buf *dst_mb;
unsigned int index;
- dst_mb = s5p_mfc_find_move_buf_vb(&ctx->buf_queue_lock,
+ dst_mb = s5p_mfc_find_move_buf(&ctx->buf_queue_lock,
&ctx->dst_buf_queue, &ctx->ref_buf_queue, dspl_y_addr, released_flag);
if (dst_mb) {
mfc_debug(2, "NAL Q: find display buf, index: %d\n", dst_mb->vb.vb2_buf.index);
/* Check if this is the buffer we're looking for */
mfc_debug(2, "NAL Q: buf addr: 0x%08llx, disp addr: 0x%08llx\n",
- s5p_mfc_mem_get_daddr_vb(&dst_mb->vb.vb2_buf, 0), dspl_y_addr);
+ dst_mb->addr[0], dspl_y_addr);
index = dst_mb->vb.vb2_buf.index;
frame_type = pOutStr->DisplayFrameType & S5P_FIMV_DISPLAY_FRAME_MASK;
}
- ref_mb = s5p_mfc_find_del_buf_vb(&ctx->buf_queue_lock,
+ ref_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock,
&ctx->ref_buf_queue, dspl_y_addr);
if (ref_mb) {
mfc_debug(2, "NAL Q: find display buf, index: %d\n", ref_mb->vb.vb2_buf.index);
/* Check if this is the buffer we're looking for */
mfc_debug(2, "NAL Q: buf addr: 0x%08llx, disp addr: 0x%08llx\n",
- s5p_mfc_mem_get_daddr_vb(&ref_mb->vb.vb2_buf, 0), dspl_y_addr);
+ ref_mb->addr[0], dspl_y_addr);
index = ref_mb->vb.vb2_buf.index;
0, src_mb->vb.vb2_buf.planes[0].bytesused);
}
- mfc_debug(2, "Header addr: 0x%08llx\n", s5p_mfc_mem_get_daddr_vb(&src_mb->vb.vb2_buf, 0));
+ mfc_debug(2, "Header addr: 0x%08llx\n", src_mb->addr[0]);
s5p_mfc_clean_ctx_int_flags(ctx);
s5p_mfc_init_decode(ctx);
s5p_mfc_set_enc_stride(ctx);
- mfc_debug(2, "Header addr: 0x%08llx\n", s5p_mfc_mem_get_daddr_vb(&dst_mb->vb.vb2_buf, 0));
+ mfc_debug(2, "Header addr: 0x%08llx\n", dst_mb->addr[0]);
s5p_mfc_clean_ctx_int_flags(ctx);
ret = s5p_mfc_init_encode(ctx);
csd = mfc_buf->vb.reserved2 & FLAG_CSD ? 1 : 0;
mfc_debug(2, "mfc_buf: %p\n", mfc_buf);
- mfc_debug(2, "First plane address: 0x%08llx\n",
- s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0));
+ mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0]);
spin_unlock_irqrestore(plock, flags);
return csd;
mfc_buf->used = used;
mfc_debug(2, "mfc_buf: %p\n", mfc_buf);
- mfc_debug(2, "First plane address: 0x%08llx\n",
- s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0));
+ mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0]);
spin_unlock_irqrestore(plock, flags);
return mfc_buf;
mfc_buf->used = used;
mfc_debug(2, "mfc_buf: %p\n", mfc_buf);
- mfc_debug(2, "First plane address: 0x%08llx\n",
- s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0));
+ mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0]);
list_del(&mfc_buf->list);
queue->count--;
mfc_buf = list_entry(queue->head.next, struct s5p_mfc_buf, list);
mfc_debug(2, "mfc_buf: %p\n", mfc_buf);
- mfc_debug(2, "First plane address: 0x%08llx\n",
- s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0));
+ mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0]);
remained = (unsigned int)(mfc_buf->vb.vb2_buf.planes[0].bytesused - consumed);
mfc_buf->used = used;
mfc_debug(2, "mfc_buf: %p\n", mfc_buf);
- mfc_debug(2, "First plane address: 0x%08llx\n",
- s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0));
+ mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0]);
list_del(&mfc_buf->list);
from_queue->count--;
if (mfc_buf->used) {
mfc_debug(2, "mfc_buf: %p\n", mfc_buf);
- mfc_debug(2, "First plane address: 0x%08llx\n",
- s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0));
+ mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0]);
list_del(&mfc_buf->list);
from_queue->count--;
mfc_buf = list_entry(from_queue->head.next, struct s5p_mfc_buf, list);
- if (s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0) == addr) {
- mfc_debug(2, "First plane address: 0x%08llx\n",
- s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0));
+ if (mfc_buf->addr[0] == addr) {
+ mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0]);
list_del(&mfc_buf->list);
from_queue->count--;
}
}
-struct s5p_mfc_buf *s5p_mfc_find_buf_vb(spinlock_t *plock, struct s5p_mfc_buf_queue *queue,
+struct s5p_mfc_buf *s5p_mfc_find_buf(spinlock_t *plock, struct s5p_mfc_buf_queue *queue,
dma_addr_t addr)
{
unsigned long flags;
mfc_debug(2, "Looking for this address: 0x%08llx\n", addr);
list_for_each_entry(mfc_buf, &queue->head, list) {
- mb_addr = s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0);
+ mb_addr = mfc_buf->addr[0];
mfc_debug(2, "plane[0] addr: 0x%08llx\n", mb_addr);
if (addr == mb_addr) {
return NULL;
}
-struct s5p_mfc_buf *s5p_mfc_find_del_buf_raw(spinlock_t *plock, struct s5p_mfc_buf_queue *queue,
+struct s5p_mfc_buf *s5p_mfc_find_del_buf(spinlock_t *plock, struct s5p_mfc_buf_queue *queue,
dma_addr_t addr)
{
unsigned long flags;
mfc_debug(2, "Looking for this address: 0x%08llx\n", addr);
list_for_each_entry(mfc_buf, &queue->head, list) {
- mb_addr = mfc_buf->planes.raw[0];
+ mb_addr = mfc_buf->addr[0];
mfc_debug(2, "plane[0] addr: 0x%08llx\n", mb_addr);
if (addr == mb_addr) {
}
}
-struct s5p_mfc_buf *s5p_mfc_find_del_buf_vb(spinlock_t *plock, struct s5p_mfc_buf_queue *queue,
- dma_addr_t addr)
-{
- unsigned long flags;
- struct s5p_mfc_buf *mfc_buf = NULL;
- dma_addr_t mb_addr;
- int found = 0;
-
- spin_lock_irqsave(plock, flags);
-
- mfc_debug(2, "Looking for this address: 0x%08llx\n", addr);
- list_for_each_entry(mfc_buf, &queue->head, list) {
- mb_addr = s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0);
- mfc_debug(2, "plane[0] addr: 0x%08llx\n", mb_addr);
-
- if (addr == mb_addr) {
- found = 1;
- break;
- }
- }
-
- if (found == 1) {
- list_del(&mfc_buf->list);
- queue->count--;
-
- spin_unlock_irqrestore(plock, flags);
- return mfc_buf;
- } else {
- spin_unlock_irqrestore(plock, flags);
- return NULL;
- }
-}
-
-struct s5p_mfc_buf *s5p_mfc_find_move_buf_vb(spinlock_t *plock,
+struct s5p_mfc_buf *s5p_mfc_find_move_buf(spinlock_t *plock,
struct s5p_mfc_buf_queue *to_queue, struct s5p_mfc_buf_queue *from_queue,
dma_addr_t addr, unsigned int released_flag)
{
mfc_debug(2, "Looking for this address: 0x%08llx\n", addr);
list_for_each_entry(mfc_buf, &from_queue->head, list) {
- mb_addr = s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0);
+ mb_addr = mfc_buf->addr[0];
mfc_debug(2, "plane[0] addr: 0x%08llx\n", mb_addr);
if (addr == mb_addr) {
}
}
-struct s5p_mfc_buf *s5p_mfc_find_move_buf_vb_used(spinlock_t *plock,
+struct s5p_mfc_buf *s5p_mfc_find_move_buf_used(spinlock_t *plock,
struct s5p_mfc_buf_queue *to_queue, struct s5p_mfc_buf_queue *from_queue,
dma_addr_t addr)
{
mfc_debug(2, "Looking for this address: 0x%08llx\n", addr);
list_for_each_entry(mfc_buf, &from_queue->head, list) {
- mb_addr = s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0);
+ mb_addr = mfc_buf->addr[0];
mfc_debug(2, "plane[0] addr: 0x%08llx, used: %d\n",
mb_addr, mfc_buf->used);
src_mb = list_entry(ctx->src_buf_queue.head.next, struct s5p_mfc_buf, list);
mfc_debug(2, "mfc_buf: %p\n", src_mb);
- mfc_debug(2, "First plane address: 0x%08llx\n",
- s5p_mfc_mem_get_daddr_vb(&src_mb->vb.vb2_buf, 0));
+ mfc_debug(2, "First plane address: 0x%08llx\n", src_mb->addr[0]);
if (src_mb->vb.reserved2 & FLAG_LAST_FRAME) {
mfc_debug(2, "last frame!\n");
struct s5p_mfc_buf_queue *to_queue, struct s5p_mfc_buf_queue *from_queue,
dma_addr_t addr);
-struct s5p_mfc_buf *s5p_mfc_find_buf_vb(spinlock_t *plock, struct s5p_mfc_buf_queue *queue,
+struct s5p_mfc_buf *s5p_mfc_find_buf(spinlock_t *plock, struct s5p_mfc_buf_queue *queue,
dma_addr_t addr);
-struct s5p_mfc_buf *s5p_mfc_find_del_buf_raw(spinlock_t *plock, struct s5p_mfc_buf_queue *queue,
+struct s5p_mfc_buf *s5p_mfc_find_del_buf(spinlock_t *plock, struct s5p_mfc_buf_queue *queue,
dma_addr_t addr);
-struct s5p_mfc_buf *s5p_mfc_find_del_buf_vb(spinlock_t *plock, struct s5p_mfc_buf_queue *queue,
- dma_addr_t addr);
-struct s5p_mfc_buf *s5p_mfc_find_move_buf_vb(spinlock_t *plock,
+struct s5p_mfc_buf *s5p_mfc_find_move_buf(spinlock_t *plock,
struct s5p_mfc_buf_queue *to_queue, struct s5p_mfc_buf_queue *from_queue,
dma_addr_t addr, unsigned int released_flag);
-struct s5p_mfc_buf *s5p_mfc_find_move_buf_vb_used(spinlock_t *plock,
+struct s5p_mfc_buf *s5p_mfc_find_move_buf_used(spinlock_t *plock,
struct s5p_mfc_buf_queue *to_queue, struct s5p_mfc_buf_queue *from_queue,
dma_addr_t addr);
cpb_buf_size = ALIGN(dec->src_buf_size, STREAM_BUF_ALIGN);
if (mfc_buf) {
- addr = s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0);
+ addr = mfc_buf->addr[0];
if (strm_size > set_strm_size_max(cpb_buf_size)) {
mfc_info_ctx("Decrease strm_size because of %d align: %u -> %u\n",
STREAM_BUF_ALIGN, strm_size, set_strm_size_max(cpb_buf_size));
if (mfc_buf) {
for (i = 0; i < num_planes; i++) {
- addr[i] = mfc_buf->planes.raw[i];
+ addr[i] = mfc_buf->addr[i];
mfc_debug(2, "enc src[%d] addr: 0x%08llx\n", i, addr[i]);
}
-
- if (mfc_buf->planes.raw[0] != s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0))
- mfc_err_ctx("enc src yaddr: 0x%08llx != vb2 yaddr: 0x%08llx\n",
- mfc_buf->planes.raw[i],
- s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, i));
}
for (i = 0; i < num_planes; i++)
dma_addr_t addr;
unsigned int size, offset;
- addr = s5p_mfc_mem_get_daddr_vb(&mfc_buf->vb.vb2_buf, 0);
+ addr = mfc_buf->addr[0];
offset = mfc_buf->vb.vb2_buf.planes[0].data_offset;
size = (unsigned int)vb2_plane_size(&mfc_buf->vb.vb2_buf, 0);
size = ALIGN(size, 512);
set_bit(dst_index, &dec->available_dpb);
dec->dynamic_set = 1 << dst_index;
mfc_debug(2, "ADDING Flag after: 0x%lx\n", dec->available_dpb);
- mfc_debug(2, "Dst addr [%d] = 0x%08llx\n", dst_index, dst_mb->planes.raw[0]);
+ mfc_debug(2, "Dst addr [%d] = 0x%08llx\n", dst_index, dst_mb->addr[0]);
/* for debugging about black bar detection */
if (FW_HAS_BLACK_BAR_DETECT(dev) && dec->detect_black_bar) {
for (i = 0; i < raw->num_planes; i++) {
dec->frame_vaddr[i][dec->frame_cnt] = vb2_plane_vaddr(&dst_mb->vb.vb2_buf, i);
- dec->frame_daddr[i][dec->frame_cnt] = dst_mb->planes.raw[i];
+ dec->frame_daddr[i][dec->frame_cnt] = dst_mb->addr[i];
dec->frame_size[i][dec->frame_cnt] = raw->plane_size[i];
dec->index[i][dec->frame_cnt] = dst_index;
dec->fd[i][dec->frame_cnt] = dst_mb->vb.vb2_buf.planes[0].m.fd;
for (i = 0; i < raw->num_planes; i++) {
MFC_WRITEL(raw->plane_size[i],
S5P_FIMV_D_FIRST_PLANE_DPB_SIZE + i*4);
- MFC_WRITEL(dst_mb->planes.raw[i],
+ MFC_WRITEL(dst_mb->addr[i],
S5P_FIMV_D_FIRST_PLANE_DPB0 + (i*0x100 + dst_index*4));
}
MFC_TRACE_CTX("Set dst[%d] fd: %d, %#llx / avail %#lx used %#x\n",
- dst_index, dst_mb->vb.vb2_buf.planes[0].m.fd, dst_mb->planes.raw[0],
+ dst_index, dst_mb->vb.vb2_buf.planes[0].m.fd, dst_mb->addr[0],
dec->available_dpb, dec->dynamic_used);
return 0;
int s5p_mfc_check_vb_with_fmt(struct s5p_mfc_fmt *fmt, struct vb2_buffer *vb)
{
- int i;
-
if (!fmt)
return -EINVAL;
return -EINVAL;
}
- for (i = 0; i < vb->num_planes; i++) {
- if (!s5p_mfc_mem_get_daddr_vb(vb, i)) {
- mfc_err_dev("failed to get plane cookie\n");
- return -ENOMEM;
- }
-
- mfc_debug(2, "index: %d, plane[%d] cookie: 0x%08llx\n",
- vb->index, i,
- s5p_mfc_mem_get_daddr_vb(vb, i));
- }
-
return 0;
}