]> git.baikalelectronics.ru Git - kernel.git/commit
media: s5p-mfc: Fix buffer look up in s5p_mfc_handle_frame_{new, copy_time} functions
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Tue, 5 Jun 2018 13:33:59 +0000 (09:33 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 27 Jul 2018 17:09:40 +0000 (13:09 -0400)
commit026858825e192ef02aead1b7318ed8e8664f07a8
tree2b801a63915033fac99829be838046accf0480d4
parent7b09bf5a3bc50adc6a894650f4d51fde1b3966a7
media: s5p-mfc: Fix buffer look up in s5p_mfc_handle_frame_{new, copy_time} functions

Look up of buffers in s5p_mfc_handle_frame_new, s5p_mfc_handle_frame_copy_time
functions is not working properly for DMA addresses above 2 GiB. As a result
flags and timestamp of returned buffers are not set correctly and it breaks
operation of GStreamer/OMX plugins which rely on the CAPTURE buffer queue
flags.

Due to improper return type of the get_dec_y_adr, get_dspl_y_adr callbacks
and sign bit extension these callbacks return incorrect address values,
e.g. 0xfffffffffefc0000 instead of 0x00000000fefc0000. Then the statement:

"if (vb2_dma_contig_plane_dma_addr(&dst_buf->b->vb2_buf, 0) == dec_y_addr)"

is always false, which breaks looking up capture queue buffers.

To ensure proper matching by address u32 type is used for the DMA
addresses. This should work on all related SoCs, since the MFC DMA
address width is not larger than 32-bit.

Changes done in this patch are minimal as there is a larger patch series
pending refactoring the whole driver.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/s5p-mfc/s5p_mfc.c