From patchwork Tue May 26 16:06:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 3868 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4AAAF60E08 for ; Tue, 26 May 2020 18:06:52 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="fvJ1cQ/B"; dkim-atps=neutral Received: from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A2FDD814; Tue, 26 May 2020 18:06:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1590509211; bh=Mu16Lv1baSxwJSRdsEtbpgVGzmnJxHIttHnouvCxqNk=; h=From:To:Cc:Subject:Date:From; b=fvJ1cQ/BjhSHmeQARw/bHKNcdHPccxkl3qrm6A6JZaLJL5y/EVXb3qyZaDk4QMq29 cuJenVTFoY4Y3mX6IuSzoijkA6uAYaaACQ7xZJXvhJDB43aFskY8Yh9lVilrMyqFVR sMzgCOb81qqpVFcjA0SV5xPWRK/L1opxDw6sXDH0= From: Kieran Bingham To: libcamera devel Cc: Kaaira Gupta , Kieran Bingham Date: Tue, 26 May 2020 17:06:44 +0100 Message-Id: <20200526160644.154051-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] qcam: viewfinder: Use correct DRM/QImage mappings 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: , X-List-Received-Date: Tue, 26 May 2020 16:06:52 -0000 When the native pixel formats supported by QT were introduced, the RGB/BGR formats were inverted. Swap the BGR888 and RGB888 mappings accordingly. Fixes: f890a57b7a06 ("qcam: viewfinder: Add support for more native formats") Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/qcam/viewfinder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qcam/viewfinder.cpp b/src/qcam/viewfinder.cpp index 0d68f62ee6d7..7a308f53f576 100644 --- a/src/qcam/viewfinder.cpp +++ b/src/qcam/viewfinder.cpp @@ -26,9 +26,9 @@ static const QMap nativeFormats #endif { libcamera::PixelFormat{ DRM_FORMAT_ARGB8888 }, QImage::Format_RGB32 }, #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) - { libcamera::PixelFormat{ DRM_FORMAT_BGR888 }, QImage::Format_BGR888 }, + { libcamera::PixelFormat{ DRM_FORMAT_RGB888 }, QImage::Format_BGR888 }, #endif - { libcamera::PixelFormat{ DRM_FORMAT_RGB888 }, QImage::Format_RGB888 }, + { libcamera::PixelFormat{ DRM_FORMAT_BGR888 }, QImage::Format_RGB888 }, }; ViewFinder::ViewFinder(QWidget *parent)