Commit a7bab6f8 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

Merge tag 'br-v6.2e' of git://linuxtv.org/hverkuil/media_tree into media_stage

Tag branch

* tag 'br-v6.2e' of git://linuxtv.org/hverkuil/media_tree: (29 commits)
  media: davinci/vpbe: Fix a typo ("defualt_mode")
  media: sun6i-csi: Remove unnecessary print function dev_err()
  media: Documentation: Drop deprecated bytesused == 0
  media: platform: exynos4-is: fix return value check in fimc_md_probe()
  media: dvb-core: remove variable n, turn for-loop to while-loop
  media: vivid: fix compose size exceed boundary
  media: rkisp1: make const arrays ae_wnd_num and hist_wnd_num static
  media: dvb-core: Fix UAF due to refcount races at releasing
  media: rkvdec: Add required padding
  media: aspeed: Extend debug message
  media: aspeed: Support aspeed mode to reduce compressed data
  media: Documentation: aspeed-video: Add user documentation for the aspeed-video driver
  media: v4l2-ctrls: Reserve controls for ASPEED
  media: v4l: Add definition for the Aspeed JPEG format
  staging: media: tegra-video: fix device_node use after free
  staging: media: tegra-video: fix chan->mipi value on error
  media: cedrus: initialize controls a bit later
  media: cedrus: prefer untiled capture format
  media: cedrus: Remove cedrus_codec enum
  media: cedrus: set codec ops immediately
  ...
parents 997149b8 d668c0a7
Loading
Loading
Loading
Loading
+65 −0
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

.. include:: <isonum.txt>

ASPEED video driver
===================

ASPEED Video Engine found on AST2400/2500/2600 SoC supports high performance
video compressions with a wide range of video quality and compression ratio
options. The adopted compressing algorithm is a modified JPEG algorithm.

There are 2 types of compressions in this IP.

* JPEG JFIF standard mode: for single frame and management compression
* ASPEED proprietary mode: for multi-frame and differential compression.
  Support 2-pass (high quality) video compression scheme (Patent pending by
  ASPEED). Provide visually lossless video compression quality or to reduce
  the network average loading under intranet KVM applications.

VIDIOC_S_FMT can be used to choose which format you want. V4L2_PIX_FMT_JPEG
stands for JPEG JFIF standard mode; V4L2_PIX_FMT_AJPG stands for ASPEED
proprietary mode.

More details on the ASPEED video hardware operations can be found in
*chapter 6.2.16 KVM Video Driver* of SDK_User_Guide which available on
AspeedTech-BMC/openbmc/releases.

The ASPEED video driver implements the following driver-specific control:

``V4L2_CID_ASPEED_HQ_MODE``
---------------------------
    Enable/Disable ASPEED's High quality mode. This is a private control
    that can be used to enable high quality for aspeed proprietary mode.

.. flat-table::
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 4

    * - ``(0)``
      - ASPEED HQ mode is disabled.
    * - ``(1)``
      - ASPEED HQ mode is enabled.

``V4L2_CID_ASPEED_HQ_JPEG_QUALITY``
-----------------------------------
    Define the quality of ASPEED's High quality mode. This is a private control
    that can be used to decide compression quality if High quality mode enabled
    . Higher the value, better the quality and bigger the size.

.. flat-table::
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 4

    * - ``(1)``
      - minimum
    * - ``(12)``
      - maximum
    * - ``(1)``
      - step
    * - ``(1)``
      - default

**Copyright** |copy| 2022 ASPEED Technology Inc.
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ For more details see the file COPYING in the source distribution of Linux.
	:maxdepth: 5
	:numbered:

	aspeed-video
	ccs
	cx2341x-uapi
	dw100
+3 −8
Original line number Diff line number Diff line
@@ -187,10 +187,8 @@ struct v4l2_buffer
	on the negotiated data format and may change with each buffer for
	compressed variable size data like JPEG images. Drivers must set
	this field when ``type`` refers to a capture stream, applications
	when it refers to an output stream. If the application sets this
	to 0 for an output stream, then ``bytesused`` will be set to the
	size of the buffer (see the ``length`` field of this struct) by
	the driver. For multiplanar formats this field is ignored and the
	when it refers to an output stream. For multiplanar formats this field
        is ignored and the
	``planes`` pointer is used instead.
    * - __u32
      - ``flags``
@@ -327,10 +325,7 @@ struct v4l2_plane
      - ``bytesused``
      - The number of bytes occupied by data in the plane (its payload).
	Drivers must set this field when ``type`` refers to a capture
	stream, applications when it refers to an output stream. If the
	application sets this to 0 for an output stream, then
	``bytesused`` will be set to the size of the plane (see the
	``length`` field of this struct) by the driver.
	stream, applications when it refers to an output stream.

	.. note::

+17 −0
Original line number Diff line number Diff line
@@ -258,6 +258,23 @@ please make a proposal on the linux-media mailing list.
        and it is used by various multimedia hardware blocks like GPU, display
        controllers, ISP and video accelerators.
        It contains four planes for progressive video.
    * .. _V4L2-PIX-FMT-AJPG:

      - ``V4L2_PIX_FMT_AJPG``
      - 'AJPG'
      - ASPEED JPEG format used by the aspeed-video driver on Aspeed platforms,
        which is generally adapted for remote KVM.
        On each frame compression, I will compare the new frame with previous
        one to decide which macroblock's data is changed, and only the changed
        macroblocks will be compressed.

        The implementation is based on AST2600 A3 datasheet, revision 0.9, which
        is not publicly available. Or you can reference Video stream data format
        – ASPEED mode compression of SDK_User_Guide which available on
        AspeedTech-BMC/openbmc/releases.

        Decoder's implementation can be found here,
        `aspeed_codec <https://github.com/AspeedTech-BMC/aspeed_codec/>`__
.. raw:: latex

    \normalsize
+8 −0
Original line number Diff line number Diff line
@@ -790,6 +790,11 @@ static int dvb_demux_open(struct inode *inode, struct file *file)
	if (mutex_lock_interruptible(&dmxdev->mutex))
		return -ERESTARTSYS;

	if (dmxdev->exit) {
		mutex_unlock(&dmxdev->mutex);
		return -ENODEV;
	}

	for (i = 0; i < dmxdev->filternum; i++)
		if (dmxdev->filter[i].state == DMXDEV_STATE_FREE)
			break;
@@ -1448,7 +1453,10 @@ EXPORT_SYMBOL(dvb_dmxdev_init);

void dvb_dmxdev_release(struct dmxdev *dmxdev)
{
	mutex_lock(&dmxdev->mutex);
	dmxdev->exit = 1;
	mutex_unlock(&dmxdev->mutex);

	if (dmxdev->dvbdev->users > 1) {
		wait_event(dmxdev->dvbdev->wait_queue,
				dmxdev->dvbdev->users == 1);
Loading