From patchwork Sun Jan 31 18:43:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 11077 X-Patchwork-Delegate: laurent.pinchart@ideasonboard.com 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 A1D15C33BB for ; Sun, 31 Jan 2021 18:44:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D7007683D5; Sun, 31 Jan 2021 19:44:17 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="MIUI4o8I"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 529B068383 for ; Sun, 31 Jan 2021 19:44:16 +0100 (CET) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E1FF38A0 for ; Sun, 31 Jan 2021 19:44:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1612118656; bh=5WiEs1CH7EgrQiqHCMqYAvJaskAlVN5T7zqAhlck55c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MIUI4o8IRnHJJeD6QXLKDUIleZQ+QzDtElW6C5y7M5KQZupJDWVBn24dqUGW3CgRY AQg7kmORj/x/5Dn5qeOuswc20NRXHHk4wB2T5nIWWot85etw7yoYoBWH5VGg9br9kw LPXnN/00sU1/N/wlZXdFApjctiXtRc1ZiUqpN05Q= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sun, 31 Jan 2021 20:43:51 +0200 Message-Id: <20210131184352.10635-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210131184352.10635-1-laurent.pinchart@ideasonboard.com> References: <20210131184352.10635-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] utils: gen-formats: Support big-endian DRM formats 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" DRM 4CCs are defined in little-endian, and can be declined in a big-endian version by setting bit 31 (DRM_FORMAT_BIG_ENDIAN) in the 4CC value. Add support for such formats in the gen-formats.py script. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- utils/gen-formats.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/gen-formats.py b/utils/gen-formats.py index 60dcecc345d5..da79a8bbba3a 100755 --- a/utils/gen-formats.py +++ b/utils/gen-formats.py @@ -59,10 +59,13 @@ def generate_h(formats, drm_fourcc): for format in formats: name, format = format.popitem() + fourcc = drm_fourcc.fourcc(format['fourcc']) + if format.get('big-endian'): + fourcc += '| DRM_FORMAT_BIG_ENDIAN' data = { 'name': name, - 'fourcc': drm_fourcc.fourcc(format['fourcc']), + 'fourcc': fourcc, 'mod': '0, 0', }