From patchwork Thu Oct 28 08:46:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 14376 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 25133BF415 for ; Thu, 28 Oct 2021 08:46:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4C603600C0; Thu, 28 Oct 2021 10:46:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="IiUrof3l"; 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 7316E600B5 for ; Thu, 28 Oct 2021 10:46:53 +0200 (CEST) Received: by mail-wm1-x32b.google.com with SMTP id 67-20020a1c1946000000b0030d4c90fa87so4447051wmz.2 for ; Thu, 28 Oct 2021 01:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DoKbgAcOJJxIWbOm/PaLjhPLWy9RpzmOGRb7vqnde/s=; b=IiUrof3lODZ97tMFnoz1Gy7WcLHfBCQ4MQwfQFRqI3RIcVgDEH01LooAoyhky6QrIq O9NpUTJA0bmxQdRRMjq9dFfko5WDlP6rKRVwpLYtJaHUTIa5dsHvu0aGLCtGl8uW545T gNBgvo3ukEhsc5jLWbNffXJ5jC6ELH03tHhFIBN38TREeMppwoDYn5gk9f3CExMQQSKZ j3kI0rI5ED5ZvbXGMUvBDD0BKMgRTsF/q1KJmGvEhASXglcT4lPuo7ayVCljjoY24Sxz 8sLOIeIyTNvXIcr6jFDhUNXB5GCNzgLGHLkuz+R4a16t18HZ0sERWty5ex2YoVNJoiqx aERQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DoKbgAcOJJxIWbOm/PaLjhPLWy9RpzmOGRb7vqnde/s=; b=dCFpGxR0MivZTwvsFfTjbm5faO8cfpWGv6bHusAhBy86bPsO3mxjDidULcyneW23wK EbNq5ZdQx9a3fsOuSVQVW/7Aanap9WhElLb6uPz6DChU71j3RuIrXtUgZ40euKKYWoxD gQi7wr9v8EdvdRILKFp5M28RlFKu9NK5fqOqlzFbXE2PZ6SqeYrTZIsUk2s1idGJnxEO hkT+/Yfm4VVtQA7I6433bFOv2ixkXwjjaFvE/MWkmvRB+rznuk005Z+1MxmeDC3GI8vM ouFXH+LALF/sZTw1/6r4IPE7N/B/en2H8PENSuZNjkDWgH3NCaRQzFgodPzjZX4ACgQH jEPw== X-Gm-Message-State: AOAM533I51fLLzbjzmqijMHrDvx0/ZefOtaGgyE/AdJOkUoEs2ILRRIu eM5Y8B+4i3zSaHlcktkX2jBkx4kxYCu8g7+i X-Google-Smtp-Source: ABdhPJxYp9SXfzob1mJd2XDwCuYGVPRpFf89oJnwj+pJ34pWxw9UK1VJa1tsdTDRDR2rnumUKJQ7WQ== X-Received: by 2002:a1c:8093:: with SMTP id b141mr1630282wmd.129.1635410812751; Thu, 28 Oct 2021 01:46:52 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:b894:feb0:b828:13b]) by smtp.gmail.com with ESMTPSA id z2sm1955281wmk.19.2021.10.28.01.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 01:46:52 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Thu, 28 Oct 2021 09:46:36 +0100 Message-Id: <20211028084646.453775-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 00/10] Raspberry Pi: Conversion to media controller 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" Hi, Version 4 of this series picks up a few more commits and changes: - Patch 3/10 from Laurent added to use scoped enums for BayerFormat::Packing. - Patch 4/10 adds formats::R10_CSI2P (10-bit mono packed) format. This can be merged with 2/10 if folks think that is more appropriate. - In 6/10 I've made the conversion table search success/failure return path consistent with the rest of the file. - I've moved the patch to setup h/v flips ahead of the other changes in 7/10. This reduces code churn and avoids making the MC changes in parts of the code that will eventually be deleted. - In 8/10, reverted back to using the BayerFormat conversion table instead of using a local one. - In 8/10 merged the packing considations that were previously in a spearate commit to reduce code churn in this series. - In 8/10 added a new helper mbusCodeToPixelFormat() to replace the old mbusCodeToBayerFormat(). This reduces the number of overall lookups needed for our conversions, and also accounts for packing options. Given the changes to 8/10, I've removed all existing tags for folk to have a re-review of that change. Thanks, Naush Laurent Pinchart (3): include: drm_fourcc: Add R10 and R12 FourCC libcamera: formats: Add R10 and R12 formats libcamera: bayer_format: Turn BayerFormat::Packing into scoped enum Naushir Patuck (7): libcamera: formats: Add R10_CSI2P format libcamera: bayer_format: Rework BayerFormat conversion table libcamera: bayer_format: Add PixelFormat conversion helpers to BayerFormat class pipeline: raspberrypi: Apply sensor flips at the start of configure() pipeline: raspberrypi: Convert the pipeline handler to use media controller pipeline: raspberrypi: Remove "unpacked" format penalty in mode selection pipeline: raspberrypi: Account for a missing Unicam embedded data node include/libcamera/internal/bayer_format.h | 10 +- include/linux/drm_fourcc.h | 6 + src/libcamera/bayer_format.cpp | 219 ++++++++++------ src/libcamera/formats.cpp | 39 +++ src/libcamera/formats.yaml | 8 + .../pipeline/raspberrypi/raspberrypi.cpp | 238 +++++++++++------- src/libcamera/v4l2_pixelformat.cpp | 4 + test/bayer-format.cpp | 28 +-- 8 files changed, 363 insertions(+), 189 deletions(-)