24 Oct, 2019

10 commits

  • Reset seek_flag and wait_res_change_done when receive
    VID_API_EVENT_STOPPED event.

    This also can fix an Andorid case indirectly:
    Seek in the beginning, but has not do capture port streamoff/on
    when receive res changed event, then will cause seek_flag status
    incorrect.
    If abort before receive seq_hdr_found evnt will call stop cmd to
    fw, then will reset seek_flag and wait_res_change_done.

    Signed-off-by: Shijie Qin
    Reviewed-by: ming_qian
    (cherry picked from commit 93019dc136f9ad3c294e6b4be73049977895aed4)

    Shijie Qin
     
  • refine code to make it more clear

    Signed-off-by: ming_qian
    Reviewed-by: Shijie Qin
    (cherry picked from commit 8e694ece0711d53339feacd22cbe99560b96957f)

    ming_qian
     
  • frame

    If the free space of stream buffer is not enough for one frame,
    vpu may overwrite the data or hang.
    so check before encode frame can avoid it.
    Add new ctrl V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE,
    user can use this ctrl to set the coded picture buffer size.

    Signed-off-by: ming_qian
    Reviewed-by: Shijie Qin
    (cherry picked from commit 1af0b35c6bfffa57e27f0a39c8b040b93d973278)

    ming_qian
     
  • 1. the start command is mixed with transfer data,
    separate them and make code more clear
    2. some condition of start_code_bypass is missing.
    3. config the pStreamBuffDesc only before send start command

    Signed-off-by: ming_qian
    Reviewed-by: Shijie Qin
    (cherry picked from commit 775033eb3dcba27a2b7093caccbc81c1df55ba46)

    ming_qian
     
  • If firmware report sequence header twice,
    and the user don't support the format, such as 10-bit NV12,
    user may close vpu decoder directly, it will send stop cmd.
    but when driver receive the second sequence header event,
    it may waiting for resolution change done,
    it'll block the stop command, and cause it timeout.

    Signed-off-by: ming_qian
    Reviewed-by: Shijie Qin
    (cherry picked from commit 9e1d28861a6f89b9f25641131f8db1ef17b81d3a)

    ming_qian
     
  • Correct frame_byte typedef to int in order to align with
    update_stream_addr_vpu() typedef, it maybe negative.

    Signed-off-by: Shijie Qin
    Reviewed-by: ming_qian
    (cherry picked from commit b04249f00b7cb28a17d3b7b992d565ca0edbee28)

    Shijie Qin
     
  • change event

    If b_firstseq is cleared after sending source change event,
    user may get invalid frame size.

    Signed-off-by: ming_qian
    Reviewed-by: Shijie Qin
    Reviewed-by: Zhou Peng
    (cherry picked from commit 6794c08937d4b9b1f8509935ebaeb1072af0b4aa)

    ming_qian
     
  • Free space may not enough when (end - wptr < SCODE_SIZE),
    add this check.

    Signed-off-by: Shijie Qin
    (cherry picked from commit ce944686a765f514a70e4731379179df30dbba0a)

    Shijie Qin
     
  • 1. change to use list record performance info for better trace each
    time-point and not limited to a fixed flow.
    2. add total time from open device to each time-point.

    Signed-off-by: Shijie Qin
    Reviewed-by: Zhou Peng
    Reviewed-by: ming_qian
    (cherry picked from commit 563d17921b33e3b1be96414ef80535146f00edb5)

    Shijie Qin
     
  • There are no u/v planars in the pixel formats
    IPU_PIX_FMT_BGRA4444/IPU_PIX_FMT_BGRA5551/IPU_PIX_FMT_AYUV,
    so we should explicitly get zero u/v_offset from __ipu_ch_offset_calc()
    for those pixel formats. Without this patch, '-EINVAL' will be
    returned from __ipu_ch_offset_calc() as the function return value
    and input parameter u/v_offset will not be touched, which is not a
    good behavior, because the caller is likely to ignore the function
    return value and take the u/v_offset as valid value. The MXC IPUv3 fb
    driver is a such kind of caller, which may get the u/v_offset
    for those pixel formats without checking the function return value,
    and hence wrongly pass the u/v_offset to PRE driver(finally causes
    malfunction).

    Signed-off-by: Liu Ying
    (cherry picked from commit c1ff0b03944e5196497be4f606979f5cb0c1b413)

    Liu Ying
     

23 Oct, 2019

4 commits


21 Oct, 2019

1 commit

  • When we do set-par for background framebuffer without on-the-fly
    flag being set, we should also unset the enabled overlay framebuffer's
    on-the-fly flag, otherwise the overlay framebuffer cannot be enabled
    again properly because a full mode set procedure is needed for overlay
    framebuffer as it experiences a period of time when background
    framebuffer stops fetching frames.

    Signed-off-by: Liu Ying
    (cherry picked from commit fad9437d99ae234f1c66087d47ad8a547f5f1142)

    Liu Ying
     

19 Oct, 2019

1 commit


12 Oct, 2019

6 commits


11 Oct, 2019

1 commit


08 Oct, 2019

1 commit


27 Sep, 2019

1 commit


26 Sep, 2019

4 commits

  • If CRTC is active, we should send vblank event in vblank
    interrupt handler to make sure it's sent precisely. This
    patch caches the event to be sent at dpu_crtc->event in
    the ->atomic_enable() and the ->atomic_flush() callbacks
    and finally sends it out in dpu_vbl_irq_handler(). Since
    we rely on the interrupt handler to send the event, we
    call drm_crtc_vblank_get() to get a vblank refcount to
    guarantee the interrupt is enabled when caching the event
    in dpu_crtc_queue_state_event() and call drm_crtc_vblank_put()
    to drop a vblank refcount in the interrupt handler.

    Signed-off-by: Liu Ying
    (cherry picked from commit c5f325790615eb16fe5a448e4b0afa122a33c23e)

    Liu Ying
     
  • The DRM atomic core ensures crtc->state->event is not NULL when
    calling the ->atomic_disable() or the ->atomic_flush() callbacks.
    So, let's remove the unnecessary NULL check warning on it.

    Signed-off-by: Liu Ying
    (cherry picked from commit 834bff532fe22a79708459ec976da0a74a2e97e2)

    Liu Ying
     
  • When a full modeset is needed, the CRTC could be totally disabled or
    enabled/re-enabled after the modeset. If it's re-enabled, a vblank
    event would be sent during the CRTC enablement procedure. So, a bogus
    event should be killed in the ->atomic_disable() callback.

    Signed-off-by: Liu Ying
    (cherry picked from commit cee2d80af5e38fb022973c023f548ff02a515882)

    Liu Ying
     
  • The Kdoc for the event entry of struct drm_crtc_state mentions that the
    simplest way to send vblank event when a CRTC is being disabled is that
    calling drm_crtc_send_vblank_event() somewhen after drm_crtc_vblank_off()
    has been called. This patch takes the way mentioned above to send vblank
    event in the ->atomic_disable() callback.

    Signed-off-by: Liu Ying
    (cherry picked from commit 5b1a8127d98daf13d9f9891dfad2589f339b63d5)

    Liu Ying
     

23 Sep, 2019

3 commits


21 Sep, 2019

1 commit

  • As DPU fetchunits support ITU601(limited range)/ITU601_FR(full range)
    and ITU709(limited range) YUV to RGB color space conversions, we may
    add color encoding and color range properties support for planes.
    Considering software backward compatibility, the default color encoding
    is set to ITU601 with full color range.

    Signed-off-by: Liu Ying
    (cherry picked from commit f491e24e65cb360fb0b3ce56f74d04fd80da77ab)

    Liu Ying
     

20 Sep, 2019

7 commits

  • This patch adds mulitple pixel blend modes for DPU plane.
    The modes are "None", "Pre-multiplied" and "Coverage".

    Signed-off-by: Liu Ying
    (cherry picked from commit 1259fedbcf2a54f58b47e8531a09b35cc60a43f7)

    Liu Ying
     
  • Now that we've already got proper default blend mode support,
    we may introduce alpha in pixel feature for overlay planes.

    Signed-off-by: Liu Ying
    (cherry picked from commit 4881b188f809d1e3de8662dff94b1b2dfc00a62a)

    Liu Ying
     
  • DPU has no limitations on the plane's zpos, so we don't
    have to limit the primary plane zpos to be zero and the
    overlay plane zpos to be non-zero.

    Signed-off-by: Liu Ying
    (cherry picked from commit 4487aca4ab19623e1995322871e6f14d48bfef74)

    Liu Ying
     
  • This patch improves bailout path of dpu_plane_init().
    As we'll add more drm properties to the planes later,
    this would simply the code.

    Signed-off-by: Liu Ying
    (cherry picked from commit 1a6ab9246b5d6e71e8a4a0a0b5ea15d7af0c9879)

    Liu Ying
     
  • Without the new blend modes("None", "Pre-multiplied" and "Coverage")
    introduced in the below commit, the old userspace assumes alpha in
    pixel is per-premultiplied by default. So, let's support the default
    blend mode properly.

    commit 468dba6432ca ("drm: Add per-plane pixel blend mode property")

    Signed-off-by: Liu Ying
    (cherry picked from commit ebb7b4874493a8fb42de636e9421877a54399177)

    Liu Ying
     
  • Pixel blend modes represent the alpha blending equation
    selection, describing how the pixels from the current
    plane are composited with the background.

    Adds a pixel_blend_mode to drm_plane_state and a
    blend_mode_property to drm_plane, and related support
    functions.

    Defines three blend modes in drm_blend.h.

    Changes since v1:
    - Moves the blending equation into the DOC comment
    - Refines the comments of drm_plane_create_blend_mode_property to not
    enumerate the #defines, but instead the string values
    - Uses fg.* instead of pixel.* and plane_alpha instead of plane.alpha
    Changes since v2:
    - Refines the comments of drm_plane_create_blend_mode_property:
    1) Puts the descriptions (after the ":") on a new line
    2) Adds explaining why @supported_modes need PREMUL as default
    Changes since v3:
    - Refines drm_plane_create_blend_mode_property(). drm_property_add_enum()
    can calculate the index itself just fine, so no point in having the
    caller pass it in.
    - Since the current DRM assumption is that alpha is premultiplied
    as default, define DRM_MODE_BLEND_PREMULTI as 0 will be better.
    - Refines some comments.
    Changes since v4:
    - Adds comments in drm_blend.h.
    - Removes setting default value in drm_plane_create_blend_mode_property()
    as it is already in __drm_atomic_helper_plane_reset().
    - Fixes to use state->pixel_blend_mode instead of using
    plane->state->pixel_blend_mode in reset function.
    - Rebases on drm-misc-next.

    Reviewed-by: Liviu Dudau
    Signed-off-by: Lowry Li
    Signed-off-by: Ayan Kumar Halder
    Reviewed-by: Sean Paul
    Link: https://patchwork.freedesktop.org/patch/245734/
    (cherry picked from commit a5ec8332d4280500544e316f76c04a7adc02ce03)
    (cherry picked from commit 468dba6432ca97eedc2b8d6e6cc8905cd1e1f34e)

    Lowry Li
     
  • There are a lot of drivers that subclass drm_plane_state, all of them
    duplicate the code that links together the plane with plane_state.

    On top of that, drivers that enable core properties also have to
    duplicate the code for initializing the properties to their default
    values, which in all cases are the same as the defaults from core.

    Change since v1:
    - Make it consistent with the other helpers and require that both
    plane and state not be NULL, suggested by Boris Brezillon and
    Philipp Zabel.

    Reviewed-by: Laurent Pinchart
    Signed-off-by: Alexandru Gheorghe
    Reviewed-by: Philipp Zabel
    Link: https://patchwork.freedesktop.org/patch/msgid/20180804161530.12275-2-alexandru-cosmin.gheorghe@arm.com
    (cherry picked from commit 7f4de521001f4ea705d505c9f91f58d0f56a0e6d)
    (cherry picked from commit f09b192bf1316f0e65fa2dbb5ba4c82a558867ae)

    Alexandru Gheorghe