From patchwork Mon Apr 5 04:04:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 11836 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 8C84DBD695 for ; Mon, 5 Apr 2021 04:04:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AA2C16879E; Mon, 5 Apr 2021 06:04:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="g8tp4TDm"; dkim-atps=neutral Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7F5926877E for ; Mon, 5 Apr 2021 06:04:34 +0200 (CEST) Received: by mail-pg1-x533.google.com with SMTP id q10so7364016pgj.2 for ; Sun, 04 Apr 2021 21:04:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=diY1AJvEEveaSX6P6Pqvta/R8i/5Mh6qjEO/ucHTVpg=; b=g8tp4TDm5NeWitttOfYkeCgrwC84aqYyr48ZNnpIAR1gj5VBZNI8UA69oeWQ1LoAMv xCzSOWMRzu5i+U+JtIF3s23k04FP2JHe7b/ET0NxfBjhDhDazWAD9531hPXwGpOAltlz n8IsHrfrlyvfrSDe9N5/SHhc3PiU8zjzUYJXg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=diY1AJvEEveaSX6P6Pqvta/R8i/5Mh6qjEO/ucHTVpg=; b=WuYgyDo9KPqjng0jZIrl02EzgsyOld049GhHTVB6ox8cCMZ4SiTJXzsOPokClqYroo g+yY0lsKLElu2uueg+zaJYF78823ai5b+FwPD/t6qzGgnvUEt1b9joaShCLFmREltWGJ 65ecbcy6SiKu10u2/AUkGi+g+m35Uu7G91dfyQMFpyFB4W8Q3N+vCadAgrly8f+2769I 7lXz27o7/DlsHKpHHHewuqzL93Ej3b/NTJ5NHNJ02dDgsw8dwDgy/DBoNeJebgUgsOTK zz3RRnRNbuK4cKegfyJcFP1szw5BGaAQaEQ+m0pC6T+cWvr3uHagvQfl5BOOEy3UdjdK q52Q== X-Gm-Message-State: AOAM533FtX2zZ/Jg9LkpVi4F9L5QrofuPAkXducEWYD7kjKrvm1iVYmj D0y747QT4KWqEJr51knGcXZcelQRhFPUXA== X-Google-Smtp-Source: ABdhPJwr16jhf4xiJ3g4bRoJoEyrkzQPmWPDC90PEHLjnkzc5U5oKYO4rmLds17LHjxUqIGHOQ3O3w== X-Received: by 2002:a62:8857:0:b029:203:4d7a:ae8d with SMTP id l84-20020a6288570000b02902034d7aae8dmr22172728pfd.16.1617595472526; Sun, 04 Apr 2021 21:04:32 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:2581:afba:2075:466f]) by smtp.gmail.com with ESMTPSA id bb16sm7543783pjb.17.2021.04.04.21.04.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Apr 2021 21:04:32 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 5 Apr 2021 13:04:22 +0900 Message-Id: <20210405040424.1929737-1-hiroh@chromium.org> X-Mailer: git-send-email 2.31.0.208.g409f899ff0-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/2] Check a buffer validness by CameraBuffer::IsValid() 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" This patch series enables validating buffer_handle by CemeraBuffer::IsValid(). CameraBuffer may have a platform specific backend with which a platform specific validation is doable. For instance, cros::CameraBufferManager checks if a buffer has a magic number. Hirokazu Honda (2): android: CameraBuffer: Add option of not mapping a buffer android: CameraDevice: Validate buffer_handle by CameraBuffer::isValid() src/android/camera_buffer.h | 7 ++++--- src/android/camera_device.cpp | 8 ++++++++ src/android/mm/cros_camera_buffer.cpp | 17 +++++++++++++---- src/android/mm/generic_camera_buffer.cpp | 20 ++++++++++++-------- 4 files changed, 37 insertions(+), 15 deletions(-) --- 2.31.0.208.g409f899ff0-goog