Skip to content
Permalink
Yunfei-Dong/Su…
Switch branches/tags

Commits on Dec 16, 2021

  1. media: mtk-vcodec: Remove mtk_vcodec_release_enc_pm

    There are only two lines in mtk_vcodec_release_enc_pm, using
    pm_runtime_disable and put_device instead directly.
    
    Move pm_runtime_enable outside mtk_vcodec_release_enc_pm to symmetry with
    pm_runtime_disable, after that, rename mtk_vcodec_init_enc_pm to *_clk since
    it only has clock operations now.
    
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Co-developed-by: Yong Wu <yong.wu@mediatek.com>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  2. media: mtk-vcodec: Remove mtk_vcodec_release_dec_pm

    There are only two lines in mtk_vcodec_release_dec_pm, using
    pm_runtime_disable and put_device instead directly.
    
    Move pm_runtime_enable outside mtk_vcodec_init_dec_pm to symmetry with
    pm_runtime_disable, after that, rename mtk_vcodec_init_dec_pm to *_clk since
    it only has clock operations now.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Co-developed-by: Yong Wu <yong.wu@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  3. media: mtk-vcodec: Use codec type to separate different hardware

    There is just one core thread, in order to separate different
    hardware, using codec type to separeate it in scp driver.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  4. media: mtk-vcodec: Add core dec and dec end ipi msg

    Add core dec and dec end ipi msg: AP_IPIMSG_DEC_CORE/AP_IPIMSG_DEC_CORE_END.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  5. dt-bindings: media: mtk-vcodec: Adds decoder dt-bindings for mt8192

    Adds decoder dt-bindings for mt8192.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: Rob Herring <robh@kernel.org>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  6. media: mtk-vcodec: Support 34bits dma address for vdec

    Use the dma_set_mask_and_coherent helper to set vdec
    DMA bit mask to support 34bits iova space(16GB) that
    the mt8192 iommu HW support.
    
    Whole the iova range separate to 0~4G/4G~8G/8G~12G/12G~16G,
    regarding which iova range VDEC actually locate, it
    depends on the dma-ranges property of vdec dtsi node.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  7. media: mtk-vcodec: Add work queue for core hardware decode

    Add work queue to process core hardware information.
    First, get lat_buf from message queue, then call core
    hardware of each codec(H264/VP9/AV1) to decode, finally
    puts lat_buf back to the message.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: Steve Cho <stevecho@chromium.org>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  8. media: mtk-vcodec: Add new interface to lock different hardware

    For add new hardware, not only need to lock lat hardware, also
    need to lock core hardware in case of different instance start
    to decoder at the same time.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  9. media: mtk-vcodec: Generalize power and clock on/off interfaces

    Generalizes power and clock on/off interfaces to support different hardware.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  10. media: mtk-vcodec: Add msg queue feature for lat and core architecture

    For lat and core architecture, lat thread will send message to core
    thread when lat decode done. Core hardware will use the message
    from lat to decode, then free message to lat thread when decode done.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  11. media: mtk-vcodec: Add irq interface for multi hardware

    Adds irq interface for multi hardware.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  12. media: mtk-vcodec: Use pure single core for MT8183

    Separates different architecture for hardware: pure_sin_core
    and lat_sin_core. MT8183 is pure single core. Uses .hw_arch to
    distinguish.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  13. dt-bindings: media: mtk-vcodec: Separate video encoder and decoder dt…

    …-bindings
    
    Separate decoder and encoder document for the dts are big difference.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: Rob Herring <robh@kernel.org>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  14. media: mtk-vcodec: Add to support multi hardware decode

    There are more than two hardwares for decoder: LAT0, LAT1 and CORE. In order to
    manage these hardwares, register each hardware as independent platform device
    for the larbs are different.
    
    Each hardware module controls its own information which includes interrupt/power/
    clocks/registers.
    
    Calling of_platform_populate in parent device, and use subdev_bitmap to record
    whether the hardwares are registered.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: Steve Cho <stevecho@chromium.org>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  15. media: mtk-vcodec: Support MT8192

    Adds MT8192's compatible "mediatek,mt8192-vcodec-dec".
    Adds MT8192's device private data mtk_lat_sig_core_pdata.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    Yunfei Dong authored and intel-lab-lkp committed Dec 16, 2021
  16. media: mtk-vcodec: export decoder pm functions

    When mtk vcodec decoder is build as a module, we need to export
    mtk-vcodec-dec pm functions to make them visible by the other components.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  17. media: mtk-vcodec: Refactor vcodec pm interface

    Using the needed params for pm init/release function and remove unused
    param mtkdev in 'struct mtk_vcodec_pm'.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    Reviewed-by: Steve Cho <stevecho@chromium.org>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  18. media: mtk-vcodec: Align vcodec wake up interrupt interface

    Vdec and venc can use the same function to wake up interrupt event.
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    Reviewed-by: Steve Cho <stevecho@chromium.org>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021
  19. media: mtk-vcodec: Get numbers of register bases from DT

    Different platforms may have different numbers of register bases. Gets the
    numbers of register bases from dts (sizeof(u32) * 4 bytes for each).
    
    Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
    Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
    yunfeidongmediatek authored and intel-lab-lkp committed Dec 16, 2021

Commits on Dec 7, 2021

  1. media: bttv: use DEVICE_ATTR_RO() helper macro

    Use DEVICE_ATTR_RO() helper macro instead of DEVICE_ATTR(), which is
    simpler and more readable.
    
    Due to the name of the read function of the sysfs attribute is normalized,
    there is a natural association.
    
    Link: https://lore.kernel.org/linux-media/20210603071009.11438-1-thunder.leizhen@huawei.com
    
    Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Zhen Lei authored and mchehab committed Dec 7, 2021
  2. media: b2c2: flexcop: Convert to SPDX identifier

    use SPDX-License-Identifier instead of a verbose license text
    
    Link: https://lore.kernel.org/linux-media/20210916020006.8497-1-caihuoqing@baidu.com
    
    CC: Mauro Carvalho Chehab <mchehab@kernel.org>, <linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>
    Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Cai Huoqing authored and mchehab committed Dec 7, 2021
  3. media: siano: remove duplicate USB device IDs

    The devices 0x187f,0x0202 and 0x187f,0x0301 are already on the list.
    
    Link: https://lore.kernel.org/linux-media/20210917092132.19576-1-krzysztof.kozlowski@canonical.com
    
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    krzk authored and mchehab committed Dec 7, 2021
  4. media: m920x: don't use stack on USB reads

    Using stack-allocated pointers for USB message data don't work.
    This driver is almost OK with that, except for the I2C read
    logic.
    
    Fix it by using a temporary read buffer, just like on all other
    calls to m920x_read().
    
    Link: https://lore.kernel.org/all/ccc99e48-de4f-045e-0fe4-61e3118e3f74@mida.se/
    Reported-by: rkardell@mida.se
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    mchehab committed Dec 7, 2021
  5. media: cxd2880: Eliminate dead code

    An spi remove callback is never called with an spi_device pointer that
    is NULL. Also it is only called for devices that probed successfully. As
    cxd2880_spi_probe() always sets driver data, spi_get_drvdata() cannot be
    NULL.
    
    Also the return value of spi remove callbacks is ignored anyway and not
    freeing resources in .remove() is a bad idea.
    
    Link: https://lore.kernel.org/linux-media/20211012153945.2651412-8-u.kleine-koenig@pengutronix.de
    
    Cc: Mark Brown <broonie@kernel.org>, kernel@pengutronix.de, linux-media@vger.kernel.org, linux-spi@vger.kernel.org
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    ukleinek authored and mchehab committed Dec 7, 2021
  6. media: tua9001: Improve messages in .remove's error path

    If disabling the hardware fails the driver propagates the error code to
    the i2c core. However this only results in a generic error message; the
    device still disappears.
    
    So instead emit a message that better describes the actual problem than
    the i2c core's "remove failed (ESOMETHING), will be ignored" and return
    0 to suppress the generic message.
    
    Link: https://lore.kernel.org/linux-media/20211026194010.109029-1-u.kleine-koenig@pengutronix.de
    
    Cc: linux-media@vger.kernel.org, kernel@pengutronix.de
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    ukleinek authored and mchehab committed Dec 7, 2021
  7. media: Print chip type explicitly when loading the Rafael Micro r820t…

    … module
    
    The module currently prints only "Rafael Micro r820t successfully
    identified" when successfully loaded, which might be misleading as the
    module actually supports various chip types.
    
    Link: https://lore.kernel.org/linux-media/20211119234401.271193-1-dkk089@gmail.com
    
    Cc: linux-kernel@vger.kernel.org, Daniel Kamil Kozar <dkk089@gmail.com>
    Signed-off-by: Daniel Kamil Kozar <dkk089@gmail.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    xavery authored and mchehab committed Dec 7, 2021
  8. media: media si2168: Fix spelling mistake "previsously" -> "previously"

    There is a spelling mistake in a dev_dbg message. Fix it.
    
    Link: https://lore.kernel.org/linux-media/20211123090645.165299-1-colin.i.king@gmail.com
    
    Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
    Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    ColinIanKing authored and mchehab committed Dec 7, 2021
  9. media: si2157: Fix "warm" tuner state detection

    Commit e955f95 ("media: si2157: Better check for running tuner in
    init") completely broke the "warm" tuner detection of the si2157 driver
    due to a simple endian error: The Si2157 CRYSTAL_TRIM property code is
    0x0402 and needs to be transmitted LSB first. However, it was inserted
    MSB first, causing the warm detection to always fail and spam the kernel
    log with tuner initialization messages each time the DVB frontend
    device was closed and reopened:
    
    [  312.215682] si2157 16-0060: found a 'Silicon Labs Si2157-A30'
    [  312.264334] si2157 16-0060: firmware version: 3.0.5
    [  342.248593] si2157 16-0060: found a 'Silicon Labs Si2157-A30'
    [  342.295743] si2157 16-0060: firmware version: 3.0.5
    [  372.328574] si2157 16-0060: found a 'Silicon Labs Si2157-A30'
    [  372.385035] si2157 16-0060: firmware version: 3.0.5
    
    Also, the reinitializations were observed disturb _other_ tuners on
    multi-tuner cards such as the Hauppauge WinTV-QuadHD, leading to missed
    or errored packets when one of the other DVB frontend devices on that
    card was opened.
    
    Fix the order of the property code bytes to make the warm detection work
    again, also reducing the tuner initialization message in the kernel log
    to once per power-on, as well as fixing the interference with other
    tuners.
    
    Link: https://lore.kernel.org/linux-media/trinity-2a86eb9d-6264-4387-95e1-ba7b79a4050f-1638392923493@3c-app-gmx-bap03
    
    Fixes: e955f95 ("media: si2157: Better check for running tuner in init")
    Reported-by: Robert Schlabbach <robert_s@gmx.net>
    Signed-off-by: Robert Schlabbach <robert_s@gmx.net>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    robert-sc authored and mchehab committed Dec 7, 2021
  10. media: c8sectpfe: remove redundant assignment to pointer tsin

    Pointer tsin is being assigned a value that is never read. The assignment
    is redundant and can be removed.
    
    Link: https://lore.kernel.org/linux-media/20211205003745.227491-1-colin.i.king@gmail.com
    
    Cc: kernel-janitors@vger.kernel.org
    Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
    Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    ColinIanKing authored and mchehab committed Dec 7, 2021
  11. media: docs: media: Fix imbalance of LaTeX group

    The beginning part of the "existing HSV/HSL formats" table (line 7742)
    reads:
    
      .. raw:: latex
    
          \begingroup
          \tiny
          \setlength{\tabcolsep}{2pt}
    
    However, the ending part (line 7834) reads:
    
      .. raw:: latex
    
          \normalsize
    
    Fix the imbalance by replacing the \normalsize with \endgroup.
    
    Note:
        Actually, the imbalance is harmless and just results in an
        informative message near the bottom of userspace-api.log:
    
          (\end occurred inside a group at level 1)
    
          ### semi simple group (level 1) entered at line 70696 (\begingroup)
          ### bottom level
    
    Link: https://lore.kernel.org/linux-media/b3eeec4d-1a34-0a1a-3097-1ddea3b5f1c8@gmail.com
    Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    akiyks authored and mchehab committed Dec 7, 2021
  12. media: atomisp: fix "variable dereferenced before check 'asd'"

    There are two occurrences where the variable 'asd' is dereferenced
    before check. Fix this issue by using the variable after the check.
    
    Link: https://lore.kernel.org/linux-media/20211122074122.GA6581@kili/
    
    Link: https://lore.kernel.org/linux-media/20211201141904.47231-1-kitakar@gmail.com
    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Tsuchiya Yuto <kitakar@gmail.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    kitakar5525 authored and mchehab committed Dec 7, 2021
  13. media: atomisp: make array idx_map static const

    Don't populate the array idx_map on the stack but instead make it
    static const. Also makes the object code smaller by 16 bytes.
    
    Link: https://lore.kernel.org/linux-media/20211129230626.549090-1-colin.i.king@gmail.com
    Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Colin Ian King authored and mchehab committed Dec 7, 2021
  14. media: videobuf2: add WARN_ON_ONCE if bytesused is bigger than buffer…

    … length
    
    In function vb2_set_plane_payload, report if the given bytesused is
    bigger than the buffer size, and clamp it to the buffer size.
    
    Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Dafna Hirschfeld authored and mchehab committed Dec 7, 2021
  15. media: replace setting of bytesused with vb2_set_plane_payload

    In many places the bytesused field of struct vb2_buffer is set
    directly. Replace that with the function call
    vb2_set_plane_payload
    
    Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Dafna Hirschfeld authored and mchehab committed Dec 7, 2021
  16. media: cec: fix a deadlock situation

    The cec_devnode struct has a lock meant to serialize access
    to the fields of this struct. This lock is taken during
    device node (un)registration and when opening or releasing a
    filehandle to the device node. When the last open filehandle
    is closed the cec adapter might be disabled by calling the
    adap_enable driver callback with the devnode.lock held.
    
    However, if during that callback a message or event arrives
    then the driver will call one of the cec_queue_event()
    variants in cec-adap.c, and those will take the same devnode.lock
    to walk the open filehandle list.
    
    This obviously causes a deadlock.
    
    This is quite easy to reproduce with the cec-gpio driver since that
    uses the cec-pin framework which generated lots of events and uses
    a kernel thread for the processing, so when adap_enable is called
    the thread is still running and can generate events.
    
    But I suspect that it might also happen with other drivers if an
    interrupt arrives signaling e.g. a received message before adap_enable
    had a chance to disable the interrupts.
    
    This patch adds a new mutex to serialize access to the fhs list.
    When adap_enable() is called the devnode.lock mutex is held, but
    not devnode.lock_fhs. The event functions in cec-adap.c will now
    use devnode.lock_fhs instead of devnode.lock, ensuring that it is
    safe to call those functions from the adap_enable callback.
    
    This specific issue only happens if the last open filehandle is closed
    and the physical address is invalid. This is not something that
    happens during normal operation, but it does happen when monitoring
    CEC traffic (e.g. cec-ctl --monitor) with an unconfigured CEC adapter.
    
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Cc: <stable@vger.kernel.org>  # for v5.13 and up
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Hans Verkuil authored and mchehab committed Dec 7, 2021
Older