[{"id":1968,"web_url":"https://patchwork.libcamera.org/comment/1968/","msgid":"<20190622203014.GF8156@pendragon.ideasonboard.com>","date":"2019-06-22T20:30:14","subject":"Re: [libcamera-devel] [PATCH v5 5/6] libcamera: ipu3: Set pipe_mode\n\tbased on stream configuration","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Thu, Jun 20, 2019 at 05:31:43PM +0200, Jacopo Mondi wrote:\n> Set the ImgU pipe_mode control based on the active stream configuration.\n> Use 'Video' pipe mode unless the viewfinder stream is not active.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 18 ++++++++++++++++++\n>  1 file changed, 18 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 1c0a9825b4cd..54a6735dfc87 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -22,6 +22,7 @@\n>  #include \"media_device.h\"\n>  #include \"pipeline_handler.h\"\n>  #include \"utils.h\"\n> +#include \"v4l2_controls.h\"\n>  #include \"v4l2_subdevice.h\"\n>  #include \"v4l2_videodevice.h\"\n>  \n> @@ -194,6 +195,12 @@ private:\n>  class PipelineHandlerIPU3 : public PipelineHandler\n>  {\n>  public:\n> +\tstatic constexpr unsigned int V4L2_CID_IPU3_PIPE_MODE = 0x009819c1;\n> +\tenum IPU3PipeModes {\n> +\t\tIPU3PipeModeVideo = 0,\n> +\t\tIPU3PipeModeStillCapture = 1,\n> +\t};\n> +\n>  \tPipelineHandlerIPU3(CameraManager *manager);\n>  \n>  \tCameraConfiguration *generateConfiguration(Camera *camera,\n> @@ -559,6 +566,17 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> +\t/* Apply the \"pipe_mode\" control to the ImgU subdevice. */\n> +\tV4L2Controls ctrls;\n> +\tctrls.add(V4L2_CID_IPU3_PIPE_MODE, vfStream->active_ ?\n> +\t\t       \t\t\t   IPU3PipeModeVideo :\n> +\t\t\t\t\t   IPU3PipeModeStillCapture);\n> +\tret = imgu->imgu_->setControls(&ctrls);\n> +\tif (ret) {\n> +\t\tLOG(IPU3, Error) << \"Unable to set pipe_mode control\";\n> +\t\treturn ret;\n> +\t}\n> +\n>  \treturn 0;\n>  }\n>","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1449E6002E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 22 Jun 2019 22:30:33 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8106067;\n\tSat, 22 Jun 2019 22:30:32 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1561235432;\n\tbh=jk7cmJis4Vvzv8LHnHlim7OzfDuCgozpZDehZDDDNf0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=AYL0NI6OvqCDw5Y2AQwJHfaVINYq1f/X0k0yCZ8tzNTLjAohqWDhWdsNuypPxn4jB\n\tenk2gGxYAP1ZLkfiKhsrByH8JHVePqKXdCkiAsCvukiaUqNHyI9jOWPcwLXSP9Juhl\n\tjJzDzGGHg3m/x7F+oZlejJQkVCP9nJoMSSOWurO8=","Date":"Sat, 22 Jun 2019 23:30:14 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190622203014.GF8156@pendragon.ideasonboard.com>","References":"<20190620153144.5394-1-jacopo@jmondi.org>\n\t<20190620153144.5394-6-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190620153144.5394-6-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v5 5/6] libcamera: ipu3: Set pipe_mode\n\tbased on stream configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Sat, 22 Jun 2019 20:30:33 -0000"}},{"id":1992,"web_url":"https://patchwork.libcamera.org/comment/1992/","msgid":"<2fa15799-1cdd-d3d1-7825-2e9f56c2348b@ideasonboard.com>","date":"2019-06-24T08:40:52","subject":"Re: [libcamera-devel] [PATCH v5 5/6] libcamera: ipu3: Set pipe_mode\n\tbased on stream configuration","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn 20/06/2019 16:31, Jacopo Mondi wrote:\n> Set the ImgU pipe_mode control based on the active stream configuration.\n> Use 'Video' pipe mode unless the viewfinder stream is not active.\n> \n\nThanks for adding in the \"enum IPU3PipeModes\".\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 18 ++++++++++++++++++\n>  1 file changed, 18 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 1c0a9825b4cd..54a6735dfc87 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -22,6 +22,7 @@\n>  #include \"media_device.h\"\n>  #include \"pipeline_handler.h\"\n>  #include \"utils.h\"\n> +#include \"v4l2_controls.h\"\n>  #include \"v4l2_subdevice.h\"\n>  #include \"v4l2_videodevice.h\"\n>  \n> @@ -194,6 +195,12 @@ private:\n>  class PipelineHandlerIPU3 : public PipelineHandler\n>  {\n>  public:\n> +\tstatic constexpr unsigned int V4L2_CID_IPU3_PIPE_MODE = 0x009819c1;\n> +\tenum IPU3PipeModes {\n> +\t\tIPU3PipeModeVideo = 0,\n> +\t\tIPU3PipeModeStillCapture = 1,\n> +\t};\n> +\n>  \tPipelineHandlerIPU3(CameraManager *manager);\n>  \n>  \tCameraConfiguration *generateConfiguration(Camera *camera,\n> @@ -559,6 +566,17 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> +\t/* Apply the \"pipe_mode\" control to the ImgU subdevice. */\n> +\tV4L2Controls ctrls;\n> +\tctrls.add(V4L2_CID_IPU3_PIPE_MODE, vfStream->active_ ?\n> +\t\t       \t\t\t   IPU3PipeModeVideo :\n> +\t\t\t\t\t   IPU3PipeModeStillCapture);\n> +\tret = imgu->imgu_->setControls(&ctrls);\n> +\tif (ret) {\n> +\t\tLOG(IPU3, Error) << \"Unable to set pipe_mode control\";\n> +\t\treturn ret;\n> +\t}\n> +\n>  \treturn 0;\n>  }\n>  \n>","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 64D4960C29\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Jun 2019 10:40:55 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B2EC5323;\n\tMon, 24 Jun 2019 10:40:54 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1561365654;\n\tbh=XageLY/cVym6fiPrDsMTZYsyrbmp40wEwPROxlf9c9o=;\n\th=Reply-To:Subject:To:References:From:Date:In-Reply-To:From;\n\tb=P6hdwUVlx0uSsPVZovEdV43oA1aoka2B9aOPTRUbcuYvyHfJvudTDPQB1CTyh9UML\n\tHkMjISYLTR8miHcnc++by20Hj3TIDK+k3gprpP8hkICB2y4+wVr/YnYg0AfIX2HsPO\n\t91r2VzhiXcd7jB5C8MOiIsffJts8vl46sQwuPciU=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Jacopo Mondi <jacopo@jmondi.org>, libcamera-devel@lists.libcamera.org","References":"<20190620153144.5394-1-jacopo@jmondi.org>\n\t<20190620153144.5394-6-jacopo@jmondi.org>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRan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Yem6pLwaw6IAL7oX+tEqIMPph/G/jwZcdS6Hkyt/esHPuHNwX4guqTbVEuRqbDzDI\n\t2DJO5FbxABEBAAGJAiUEGAEKAA8CGwwFAlnDlGsFCQeA/gIACgkQoR5GchCkYf1yYRAAq+Yo\n\tnbf9DGdK1kTAm2RTFg+w9oOp2Xjqfhds2PAhFFvrHQg1XfQR/UF/SjeUmaOmLSczM0s6XMeO\n\tVcE77UFtJ/+hLo4PRFKm5X1Pcar6g5m4xGqa+Xfzi9tRkwC29KMCoQOag1BhHChgqYaUH3yo\n\tUzaPwT/fY75iVI+yD0ih/e6j8qYvP8pvGwMQfrmN9YB0zB39YzCSdaUaNrWGD3iCBxg6lwSO\n\tLKeRhxxfiXCIYEf3vwOsP3YMx2JkD5doseXmWBGW1U0T/oJF+DVfKB6mv5UfsTzpVhJRgee7\n\t4jkjqFq4qsUGxcvF2xtRkfHFpZDbRgRlVmiWkqDkT4qMA+4q1y/dWwshSKi/uwVZNycuLsz+\n\t+OD8xPNCsMTqeUkAKfbD8xW4LCay3r/dD2ckoxRxtMD9eOAyu5wYzo/ydIPTh1QEj9SYyvp8\n\tO0g6CpxEwyHUQtF5oh15O018z3ZLztFJKR3RD42VKVsrnNDKnoY0f4U0z7eJv2NeF8xHMuiU\n\tRCIzqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA\n\tJxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<2fa15799-1cdd-d3d1-7825-2e9f56c2348b@ideasonboard.com>","Date":"Mon, 24 Jun 2019 09:40:52 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.7.0","MIME-Version":"1.0","In-Reply-To":"<20190620153144.5394-6-jacopo@jmondi.org>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v5 5/6] libcamera: ipu3: Set pipe_mode\n\tbased on stream configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Mon, 24 Jun 2019 08:40:55 -0000"}}]