From patchwork Fri May 10 10:02:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 20038 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C4F7BBDE6B for ; Fri, 10 May 2024 10:02:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C763D63469; Fri, 10 May 2024 12:02:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Dah99LhO"; dkim-atps=neutral Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2DC5363415 for ; Fri, 10 May 2024 12:02:14 +0200 (CEST) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41ba1ba55ffso10120345e9.1 for ; Fri, 10 May 2024 03:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1715335333; x=1715940133; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ceeICVx/0+mSlumAmTACKoxliPx4dENowVAoNrtHPmc=; b=Dah99LhO3rtTdS0XnKyOegsavTL9G0GPD/ATuBx/tDf0ElzzQC2sIbiKz0CUrfgXTm lwcKCn3ZK+hRaaT2tfkaRvwuN0Litw4++g5o1YQ1JS0sLgHKr58/hgnUwWEaGdv4eflC Xf+sxsGG+XLxsPmuWl3Dda+4ZokdjHJMgPso3t3qoPeOdWYJD07wSw39LlRXmAQKt5lO nMX/eh8j7uDk/lbmoKIWtn2j+uaSLKvcwy39SUPmys2nL4+/3cwem/l2/yTJ/8bScH5i 2DFIWbZX8qZTU3Vz4ynCW7RPIzuqsxdML2kwH9gMwI21hL/EFvpue5I8COPdZ+K9qG9F BSUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715335333; x=1715940133; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ceeICVx/0+mSlumAmTACKoxliPx4dENowVAoNrtHPmc=; b=PsVLfIWF2H1s5eFFP4R9wuNHLZEhKC1M+iNSdpq8GIpbvCUrGJ2XcqiaBUYOJ6qNIQ wMr1iitdB0nOEpJwTkBD7dJ2P3qS2Yccgmx+GAcewzy4qdghLvhe3twyRCIzfiHXT0Zy j0v4dmQjHNclPWtIyaOsnNrk3P9hO2GUlK37/rYGkxj+8EHCV4tjABDRsuIadigKxQNl DhyJobtF0GcKYW8N2/rlFhrqJJOF+/6G8lpVsY7Hr1gxJ4INVAhwgYiypiu0O72HFYn9 Akx2smOFcchzPr2hnE9xKI/FlcpupDDklyZG+q2hwkaX2dnJuYiqHcirfk/heDV3IEHr HgVg== X-Gm-Message-State: AOJu0YyNvfsWaQBSnzTLxjJZD/NDsEmJD1SiQNL2D44K+BOSZhzdQaE+ XLt+lUrUS6BMxMwFr+SBUHkiyWGF0WAIwL+N0KlsoSV6hJe5m2ZPGzGgjL1logBzK9SfKRN2Adr E X-Google-Smtp-Source: AGHT+IFQZgkfC1LP35/IDOubLNXbveaZxW1XSMQf0nlYzdMiUdo3EeDMiPYpqa+IY6lw1ltEuUHUmg== X-Received: by 2002:a05:600c:4f06:b0:418:2981:c70f with SMTP id 5b1f17b1804b1-41fbcfb8473mr45665495e9.19.1715335333353; Fri, 10 May 2024 03:02:13 -0700 (PDT) Received: from localhost.localdomain ([188.39.149.98]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccee9318sm57936385e9.30.2024.05.10.03.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 03:02:12 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman , Jacopo Mondi Subject: [PATCH v3 3/7] include: linux: Add PiSP specific image and config buffer formats Date: Fri, 10 May 2024 11:02:04 +0100 Message-Id: <20240510100208.12188-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240510100208.12188-1-naush@raspberrypi.com> References: <20240510100208.12188-1-naush@raspberrypi.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add the Raspberry Pi 5 PiSP specific compressed Bayer format types 1/2: - V4L2_PIX_FMT_PISP_COMP1_xxx - V4L2_PIX_FMT_PISP_COMP2_xxx Add the Raspberry Pi 5 PiSP Frontend and Backend config formats: - V4L2_META_FMT_RPI_FE_CFG - V4L2_META_FMT_RPI_BE_CFG Add the Raspberry Pi 5 PiSP Frontend statistics format: - V4L2_META_FMT_RPI_FE_STATS The corresponding changes submitted to the linux-media mailing list can be found at: (series "media: raspberrypi: Add support for PiSP Back End") https://lore.kernel.org/linux-media/20240502110503.38412-4-jacopo.mondi@ideasonboard.com/ https://lore.kernel.org/linux-media/20240502110503.38412-5-jacopo.mondi@ideasonboard.com/ and for the DRM mailing at: (patch "[RFC] drm/fourcc: Add RPI modifiers") https://lore.kernel.org/dri-devel/20240226153854.99471-1-jacopo.mondi@ideasonboard.com/ Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Jacopo Mondi --- include/linux/drm_fourcc.h | 4 ++++ include/linux/videodev2.h | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h index 5133a6551a34..b4e1a09271f5 100644 --- a/include/linux/drm_fourcc.h +++ b/include/linux/drm_fourcc.h @@ -490,6 +490,7 @@ extern "C" { #define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09 #define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a #define DRM_FORMAT_MOD_VENDOR_MIPI 0x0b +#define DRM_FORMAT_MOD_VENDOR_RPI 0x0c /* add more to the end as needed */ @@ -1670,6 +1671,9 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) */ #define MIPI_FORMAT_MOD_CSI2_PACKED fourcc_mod_code(MIPI, 1) +#define PISP_FORMAT_MOD_COMPRESS_MODE1 fourcc_mod_code(RPI, 1) +#define PISP_FORMAT_MOD_COMPRESS_MODE2 fourcc_mod_code(RPI, 2) + #if defined(__cplusplus) } #endif diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 4fdd91494041..0b5482a07ae4 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -787,6 +787,18 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_IPU3_SGRBG10 v4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */ #define V4L2_PIX_FMT_IPU3_SRGGB10 v4l2_fourcc('i', 'p', '3', 'r') /* IPU3 packed 10-bit RGGB bayer */ +/* Raspberry Pi PiSP compressed formats. */ +#define V4L2_PIX_FMT_PISP_COMP1_RGGB v4l2_fourcc('P', 'C', '1', 'R') /* PiSP 8-bit mode 1 compressed RGGB bayer */ +#define V4L2_PIX_FMT_PISP_COMP1_GRBG v4l2_fourcc('P', 'C', '1', 'G') /* PiSP 8-bit mode 1 compressed GRBG bayer */ +#define V4L2_PIX_FMT_PISP_COMP1_GBRG v4l2_fourcc('P', 'C', '1', 'g') /* PiSP 8-bit mode 1 compressed GBRG bayer */ +#define V4L2_PIX_FMT_PISP_COMP1_BGGR v4l2_fourcc('P', 'C', '1', 'B') /* PiSP 8-bit mode 1 compressed BGGR bayer */ +#define V4L2_PIX_FMT_PISP_COMP1_MONO v4l2_fourcc('P', 'C', '1', 'M') /* PiSP 8-bit mode 1 compressed monochrome */ +#define V4L2_PIX_FMT_PISP_COMP2_RGGB v4l2_fourcc('P', 'C', '2', 'R') /* PiSP 8-bit mode 2 compressed RGGB bayer */ +#define V4L2_PIX_FMT_PISP_COMP2_GRBG v4l2_fourcc('P', 'C', '2', 'G') /* PiSP 8-bit mode 2 compressed GRBG bayer */ +#define V4L2_PIX_FMT_PISP_COMP2_GBRG v4l2_fourcc('P', 'C', '2', 'g') /* PiSP 8-bit mode 2 compressed GBRG bayer */ +#define V4L2_PIX_FMT_PISP_COMP2_BGGR v4l2_fourcc('P', 'C', '2', 'B') /* PiSP 8-bit mode 2 compressed BGGR bayer */ +#define V4L2_PIX_FMT_PISP_COMP2_MONO v4l2_fourcc('P', 'C', '2', 'M') /* PiSP 8-bit mode 2 compressed monochrome */ + /* SDR formats - used only for Software Defined Radio devices */ #define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */ #define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */ @@ -816,6 +828,15 @@ struct v4l2_pix_format { #define V4L2_META_FMT_RK_ISP1_PARAMS v4l2_fourcc('R', 'K', '1', 'P') /* Rockchip ISP1 3A Parameters */ #define V4L2_META_FMT_RK_ISP1_STAT_3A v4l2_fourcc('R', 'K', '1', 'S') /* Rockchip ISP1 3A Statistics */ +/* The metadata format identifier for BE configuration buffers. */ +#define V4L2_META_FMT_RPI_BE_CFG v4l2_fourcc('R', 'P', 'B', 'C') + +/* The metadata format identifier for FE configuration buffers. */ +#define V4L2_META_FMT_RPI_FE_CFG v4l2_fourcc('R', 'P', 'F', 'C') + +/* The metadata format identifier for FE stats buffers. */ +#define V4L2_META_FMT_RPI_FE_STATS v4l2_fourcc('R', 'P', 'F', 'S') + /* priv field value to indicates that subsequent fields are valid. */ #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe