summaryrefslogtreecommitdiff
path: root/include/linux/media-bus-format.h
AgeCommit message (Collapse)Author
2024-12-04include: media-bus-formats: Add Mali-C55 mbus codesJacopo Mondi
Add media bus codes introduced by the Mali C55 ISP support to describe the 20-bit input formats supported by the ISP. This manual addition is a temporary measure until the kernel driver changes are merged, from which point this will be managed through the usual merge of the upstream kernel headers. Add the following formats - MEDIA_BUS_FMT_RGB202020_1X60 for processed input formats https://lore.kernel.org/linux-media/20241106100534.768400-2-dan.scally@ideasonboard.com/ - MEDIA_BUS_FMT_SBGGR20_1X20 MEDIA_BUS_FMT_SGBRG20_1X20 MEDIA_BUS_FMT_SGRBG20_1X20 MEDIA_BUS_FMT_SRGGB20_1X20 for the RAW bayer input format https://lore.kernel.org/linux-media/20241106100534.768400-3-dan.scally@ideasonboard.com/ Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
2024-06-03include: linux: Update kernel headers to version v6.10-rc1Hans de Goede
Updated kernel headers to v6.10-rc1 using utils/update-kernel-headers.sh and re-instating libcamera local modifications. This includes adding include/linux/udmabuf.h which was not part of libcamera's include/linux headers before. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-01-17include: linux: Update kernel headers to version v6.7Laurent Pinchart
Update kernel headers to v6.7 using utils/update-kernel-headers.sh and re-instating libcamera local modifications. The V4L2_SUBDEV_CAP_MPLEXED flag has been renamed to V4L2_SUBDEV_CAP_STREAMS in the upstream streams API. Adapt the code base accordingly. The flag's numerical value hasn't changed, there is no ABI breakage introduced by the API update. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-03include: linux: Update Linux headers to v5.12-rc1Laurent Pinchart
Update Linux headers to v5.12-rc1, to provide the MEDIA_ENT_F_PROC_VIDEO_ISP entity function. The DRM FourCC and modifiers that were manually added in commits 9db0ed5e2065, 38f2efb05cef and 90c793c6989f are kept. New Intel DRM format modifiers are conflicting with IPU3_FORMAT_MOD_PACKED, which is updated as a result. The V4L2 controls and formats that were manually added in commit 43d81d43fe91 are kept. This causes a conflict in the V4L2 control base for V4L2_CID_USER_BCM2835_ISP_BASE that needs to be resolved in the downstream Raspberry Pi kernel first. The intel-ipu3.h header is manually exported with the scripts/headers_install.sh script. The script complained about a missing "WITH Linux-syscall-note" license extension, which has been worked around manually. The issue has been reported upstream in [1]. [1] https://lore.kernel.org/linux-media/20210207235610.15687-1-laurent.pinchart@ideasonboard.com/T/#u Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-10-28include: linux: Update headers to Linux v5.2Jacopo Mondi
Update headers to Linux v5.2. The Rockchip ISP1 formats that were added manually in commit 97dce7a13fa3 ("include: linux: Add rkisp1 kernel header and format definitions") are kept. Otherwise the headers come straight from the upstream kernel. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-01-17include: linux: Import V4L2 uAPI headers from Linux v4.19Kieran Bingham
Import the following files from the Linux UAPI to keep our V4L2 interface in sync: media-bus-format.h v4l2-common.h v4l2-controls.h v4l2-mediabus.h v4l2-subdev.h videodev2.h Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
id='n208' href='#n208'>208 209 210 211 212
#!/bin/bash

# SPDX-License-Identifier: GPL-2.0-or-later
# Generate and compare the ABI compatibilty of two libcamera versions

name=$(basename "$0")

usage() {
	cat << EOF
$name: Determine the ABI/API compatibility of two build versions

  $name [--help] [--abi-dir=<PATH>] [--tmp-dir=<PATH>] ARGS

The positional arguments (ARGS) determine the versions that will be compared and
take three variants:

  - No positional arguments:
      $name [optional arguments]

      It is assumed to compare the current git HEAD against the most recent TAG

  - One positional argument:
      $name [optional aguments] COMMITISH

      The given COMMITISH is compared against it's most recent TAG

  - Two positional arguments:
      $name [optional aguments] BASE COMMITISH

      The given COMMITISH is compared against the given BASE.

Optional Arguments:
  --abi-dir <path> Use <path> for storing (or retrieving existing) ABI data
                   files

  --tmp-dir <path> Specify temporary build location for building ABI data.
                   This could be a tmpfs/RAM disk to save on disk writes.
EOF
}

dbg () {
	echo "$@" >&2
}

die () {
	echo "$name: $*" >&2
	exit 1
}

describe () {
	git describe --tags "$1" \
		|| die "Failed to describe $1"
}

prev_release () {
	git describe --tags --abbrev=0 "$1"^ \
		|| die "Failed to identify previous release tag from $1"
}

# Make sure we exit on errors during argument parsing.
set -Eeuo pipefail

positional=()
while [[ $# -gt 0 ]] ; do
	option="$1"
	shift

	case $option in
	-h|--help)
		usage
		exit 0
	        ;;

	--abi-dir)
		abi_dir=$1
		shift
		;;

	--tmp-dir)
		tmp=$1
		shift
		;;

	-*)
		die "Unrecognised argument $option"
		;;

	*) # Parse unidentified arguments based on position.
		positional+=("$option")
		;;
	esac
done
set -- "${positional[@]}" # restore positional parameters.

# Parse positional arguments.
case $# in
	0) 	# Check HEAD against previous 'release'.
		from=$(prev_release HEAD)
		to=$(describe HEAD)
		;;

	1)	# Check COMMIT against previous release.
		from=$(prev_release "$1")
		to=$(describe "$1")
		;;

	2)	# Check ABI between FROM and TO explicitly.
		from=$(describe "$1")
		to=$(describe "$2")
		;;

	*)
		die "Invalid arguments"
		;;
esac

if ! which abi-compliance-checker; then
	die "This tool requires 'abi-compliance-checker' to be installed."
fi


abi_dir=${abi_dir:-abi}
tmp=${tmp:-"$abi_dir/tmp/"}

echo "Validating ABI compatibility between $from and $to"

mkdir -p "$abi_dir"
mkdir -p "$tmp"

# Generate an abi-compliance-checker xml description file.
create_xml() {
	local output="$1"
	local version="$2"
	local root="$3"

	echo "<version>$version</version>" > "$output"
	echo "<headers>$root/usr/local/include/</headers>" >> "$output"
	echo "<libs>$root/usr/local/lib/</libs>" >> "$output"
}

# Check if an ABI dump file exists, and if not create one by building a minimal
# configuration of libcamera at the specified version using a clean worktree.
create_abi_dump() {
	local version="$1"
	local abi_file="$abi_dir/$version.abi.dump"
	local worktree="$tmp/$version"
	local build="$tmp/$version-build"

	# Use a fully qualified path when calling ninja -C.
	install=$(realpath "$tmp/$version-install")

	if [[ ! -e "$abi_file" ]] ; then
		dbg "Creating ABI dump for $version in $abi_dir"
		git worktree add --force "$worktree" "$version"

		# Generate a minimal libcamera build. "lib" and "prefix" are
		# defined explicitly to avoid system default ambiguities.
		meson setup "$build" "$worktree" \
			-Dlibdir=lib \
			-Dprefix=/usr/local/ \
			-Ddocumentation=disabled \
			-Dcam=disabled \
			-Dqcam=disabled \
			-Dgstreamer=disabled \
			-Dlc-compliance=disabled \
			-Dtracing=disabled \
			-Dpipelines=

		ninja -C "$build"
		DESTDIR="$install" ninja -C "$build" install

		# Create an xml descriptor with parameters to generate the dump file.
		create_xml \
			"$install/libcamera-abi-dump.xml" \
			"$version" \
			"$install"

		abi-compliance-checker \
			-lib libcamera \
			-v1 "$version" \
			-dump "$install/libcamera-abi-dump.xml" \
			-dump-path "$abi_file"

		dbg Created "$abi_file"

		dbg Removing Worktree "$worktree"
		git worktree remove -f "$worktree"

		dbg Removing "$build"
		rm -r "$build"

		dbg Removing "$install"
		rm -r "$install"
	fi
}

# Create the requested ABI dump files if they don't yet exist.
create_abi_dump "$from"
create_abi_dump "$to"

# TODO: Future iterations and extensions here could add "-stdout -xml" and
# parse the results automatically.
abi-compliance-checker -l libcamera \
	-old "$abi_dir/$from.abi.dump" \
	-new "$abi_dir/$to.abi.dump"

# On (far too many) occasions, the tools keep running leaving a cpu core @ 100%
# CPU usage. Perhaps some subprocess gets launched but never rejoined. Stop
# them all.
#
# TODO: Investigate this and report upstream.
killall abi-compliance-checker 2>/dev/null