• Pawel Osciak's avatar
    [media] s5p-mfc: Fixes for decode REQBUFS · 38beac65
    Pawel Osciak authored
    - Honor return values from vb2_reqbufs on REQBUFS(0).
    
    - Do not set the number of allocated buffers to 0 if userspace tries
      to request buffers again without freeing them.
    
    - There is no need to verify correct instance state on reqbufs, as we will
      verify this in queue_setup().
    
    - There is also no need to verify that vb2_reqbufs() was able to allocate enough
      buffers (pb_count) and call buf_init on that many buffers (i.e. dst_buf_count
      is at least pb_count), because this will be verified by second queue_setup()
      call as well and vb2_reqbufs() will fail otherwise.
    
    - Only verify state is MFCINST_INIT when allocating, not when freeing.
    
    - Refactor and simplify code.
    Signed-off-by: default avatarPawel Osciak <posciak@chromium.org>
    Signed-off-by: default avatarArun Kumar K <arun.kk@samsung.com>
    Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
    38beac65
s5p_mfc_dec.c 33.5 KB