From patchwork Mon Mar 23 17:35:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3266 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9349D60417 for ; Mon, 23 Mar 2020 18:36:16 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 15793308 for ; Mon, 23 Mar 2020 18:36:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1584984976; bh=VIPqAhVXoNyQDftX18gdNBV7kPi0pZkwtJaK+lIObOw=; h=From:To:Subject:Date:From; b=ut7mred5JifjnToUXZLMG8FkQgj1Ht+Qrl/pxkc3wIwjVX1v4T+5BVN52gMxzteiS QJ/ZLMjSC6NrPV3QiLxl1SNTWfbDGAol1QdVw7bDq+ogSiK7QXmTQdYiGYRbmh12AA Vt74XfBE3QiwxZwIzSi13I2EtABYljIkUUlnzyGg= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Mar 2020 19:35:38 +0200 Message-Id: <20200323173559.21109-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 00/21] qcam: Bypass format conversion when not required 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: Mon, 23 Mar 2020 17:36:16 -0000 Hello, This small patch series improves performances in qcam when the captured format matches one of the formats natively supported by the viewfinder. It allows skipping conversion and using zero-copy in that case. The series includes a few miscellaneous drive-by fixes and improvements that are documented in individual patches from 01/21 to 12/21. From 13/21 onwards the viewfinder code is refactored, and patch 19/21 adds zero-copy support. Patch 20/21 fixes an isse where the last buffer isn't released when stopping capture (it could be squashed with 19/21, but I decided to submit it separately for now to ease review). Patch 21/21 finally adds support for more native RGB formats in the viewfinder, and in particular for DRM_FORMAT_BGR888 that the VIMC pipeline handler defaults to. BGR888 however requires Qt 5.14, which isn't widely shipped by distros, so it's disabled if the Qt version is too old. Changes compared to v1 are minor, I've taken into account all the review received so far, and fixed compilation with Qt 5.12. Laurent Pinchart (21): qcam: Remove custom event dispatcher qcam: Ensure headers are self-contained qcam: Use QSize through the code base qcam: main_window: Move request queuing to a separate function qcam: main_window: Move capture event processing to main thread qcam: main_window: Replace start and stop actions with a toggle action qcam: main_window: Use icons from system icon theme qcam: main_window: Add shortcuts for toolbar actions qcam: main_window: Don't print message when saving a picture qcam: main_window: Document functions and reorganize member data qcam: main_window: Remove unneeded debug message qcam: Use Qt qInfo() and qWarning() logging facilities qcam: viewfinder: Add MappedBuffer to store memory mapping information qcam: viewfinder: Move multi-planar check into viewfinder qcam: viewfinder: Make the viewfinder hold a reference to a buffer qcam: viewfinder: Embed QImage in ViewFinder qcam: viewfinder: Use PixelFormat default constructor qcam: viewfinder: Reorder methods to match header file qcam: viewfinder: Avoid memory copy when conversion isn't needed qcam: viewfinder: Display icon when stopping capture qcam: viewfinder: Add support for more native formats src/qcam/assets/feathericons/feathericons.qrc | 1 + src/qcam/format_converter.cpp | 10 +- src/qcam/format_converter.h | 5 +- src/qcam/main.cpp | 11 +- src/qcam/main_window.cpp | 279 +++++++++++++----- src/qcam/main_window.h | 42 ++- src/qcam/meson.build | 2 +- src/qcam/qt_event_dispatcher.cpp | 152 ---------- src/qcam/qt_event_dispatcher.h | 62 ---- src/qcam/viewfinder.cpp | 144 +++++++-- src/qcam/viewfinder.h | 36 ++- 11 files changed, 391 insertions(+), 353 deletions(-) delete mode 100644 src/qcam/qt_event_dispatcher.cpp delete mode 100644 src/qcam/qt_event_dispatcher.h