From patchwork Thu May 20 11:05:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dillon Min X-Patchwork-Id: 443657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40DC7C43460 for ; Thu, 20 May 2021 12:17:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DFCC61186 for ; Thu, 20 May 2021 12:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235572AbhETMSz (ORCPT ); Thu, 20 May 2021 08:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235553AbhETMSn (ORCPT ); Thu, 20 May 2021 08:18:43 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F67AC07A822; Thu, 20 May 2021 04:05:38 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id e17so1482779pfl.5; Thu, 20 May 2021 04:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0oFfIWOdrNxxHDeBLAkvWpJ2lIKRgTWmgVtZro160nA=; b=NgzNWH/sWTyfspG523F3M89WfHPNXWnk/w5kyeLxo7FcaM+DuOjyCZbUk3FbfITIkI eXM5D7qbkqyA5IULgS2k4qu1LImkHPUUKnX8KyMyXc4UWFtgi3/UrsSqKPI1YKXBeafC yumG1AhjmP13RjNkrXNiNx8mJC3TCJb4Y3Z1jwLNWCRUPOxviTuGyLDSMw1EHGyjLfSI fQ6UFlKhtMtlh0+RtMANy6gCOVNBsO9O1OAWNYdc8A+S8hRSAnpkBEPFZDF2SJZUdnL+ HZs/K5ZVpzR86VO3Inhw/89ynPrZIaV22i19X8Qen6DI491cd9rJJFVWgkQzK+YiNAdt X0Og== 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:in-reply-to :references; bh=0oFfIWOdrNxxHDeBLAkvWpJ2lIKRgTWmgVtZro160nA=; b=me20e6Ln27AmW20z3cd09oS/bA+/1PHU56ng3e9mKfNijh9kuFCU9fMnk8Wqkip1jQ qr2rAFqkQ3IVQ8YrmhDi/OdzaMGdSaS1TqaPe8LqbzdzskSxenqGDEOy3CEhi0v8sxdC 1SuSrmaOhqXpuuFaBZGc6qpy5gbhnk553vDF4nv0YbJemU1A3+wyPPxwyEdKHsiSnhMC I9CE+sN6/wvEinMq0/Ki4vdkSLZhXIzD2jTH1fDZQC8UAkfgGC8l2CTbNui27m6K8mBZ ynBTg9gB+HuRgzY0F5+rthpoRK+QiY61XIRzszdLrezimMEl34V36H6UguMf8Pvqp/S3 JqPg== X-Gm-Message-State: AOAM531c1ducbM5p3igi5QwIKKSiYvxUKRzdRJO3qTLr/V2hYr3ikB8z AExYzdBZudNUspqOWBIY0fk= X-Google-Smtp-Source: ABdhPJwNSLnDX2NgTftaUo9jI4/HhJwLnQlxnfQwRUGa/5PdBWI9rxfBNoSJccRirWl2S1GSdeTn7g== X-Received: by 2002:a63:f443:: with SMTP id p3mr3993109pgk.378.1621508738022; Thu, 20 May 2021 04:05:38 -0700 (PDT) Received: from fmin-OptiPlex-7060.nreal.work ([137.59.103.165]) by smtp.gmail.com with ESMTPSA id hk15sm5839121pjb.53.2021.05.20.04.05.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 May 2021 04:05:37 -0700 (PDT) From: dillon.minfei@gmail.com To: mchehab@kernel.org, mchehab+huawei@kernel.org, hverkuil-cisco@xs4all.nl, ezequiel@collabora.com, gnurou@gmail.com, pihsun@chromium.org, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org Cc: patrice.chotard@foss.st.com, hugues.fruchet@foss.st.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, Dillon Min Subject: [PATCH 1/7] media: admin-guide: add stm32-dma2d description Date: Thu, 20 May 2021 19:05:21 +0800 Message-Id: <1621508727-24486-2-git-send-email-dillon.minfei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1621508727-24486-1-git-send-email-dillon.minfei@gmail.com> References: <1621508727-24486-1-git-send-email-dillon.minfei@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dillon Min add stm32-dma2d description for dma2d driver Signed-off-by: Dillon Min --- Documentation/admin-guide/media/platform-cardlist.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/admin-guide/media/platform-cardlist.rst b/Documentation/admin-guide/media/platform-cardlist.rst index 261e7772eb3e..ac73c4166d1e 100644 --- a/Documentation/admin-guide/media/platform-cardlist.rst +++ b/Documentation/admin-guide/media/platform-cardlist.rst @@ -60,6 +60,7 @@ s5p-mfc Samsung S5P MFC Video Codec sh_veu SuperH VEU mem2mem video processing sh_vou SuperH VOU video output stm32-dcmi STM32 Digital Camera Memory Interface (DCMI) +stm32-dma2d STM32 Chrom-Art Accelerator Unit sun4i-csi Allwinner A10 CMOS Sensor Interface Support sun6i-csi Allwinner V3s Camera Sensor Interface sun8i-di Allwinner Deinterlace From patchwork Thu May 20 11:05:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dillon Min X-Patchwork-Id: 443656 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54D05C43603 for ; Thu, 20 May 2021 12:17:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3360C611AD for ; Thu, 20 May 2021 12:17:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235553AbhETMS5 (ORCPT ); Thu, 20 May 2021 08:18:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235450AbhETMSt (ORCPT ); Thu, 20 May 2021 08:18:49 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2D4BC07A828; Thu, 20 May 2021 04:05:42 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id t21so8830582plo.2; Thu, 20 May 2021 04:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XBy9vet7ecbTieMl5w7ONcl3S+12Ffks8ZHajUtvih4=; b=X0HdMz5ZwR9zT2Q8z3IGYnpAH3nk/I9nRl2oFclAbogcoCLk1CobJMr5cU/P/NOLa5 K2ZDAgiCheDTEHXLpP3Ijky9EFzhg2GOHvjDSFWjzBTjZw1hE+ZPBe9GKe+KUE1bhA5A 1rQx5lquADoJXygBiqLId5iqY2DOe554IE4Q0vhEeRKzz46Rwb8eow89ytrRXs23vhXq PFODefq1UVbzZkkWFeJWA0PM8uWIs8zUF4IS2JS/5U1JzS09E1FVYRrfpFhnnAGxtYs/ z8qRxM6vTl0faDTzbRNmbEahovudKPlBcJLyFrSQwbINqwDF2gJcZnXIR38quKxH2+vD N6/Q== 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:in-reply-to :references; bh=XBy9vet7ecbTieMl5w7ONcl3S+12Ffks8ZHajUtvih4=; b=VRuyXLQID2QemLXzqX3KEsQU5aDUVGu6JoD2R6hQT3uIQTi1H7c+0eEN2giHWBv8Nt tShdNIZzkkHHWv6c711UhyAiFLiF0v0ibzEvPzWs+1WuiFYmwkEwrZBgIi1OHCxJFgHW /wV7JzRtFNOzXv2/rDvcysB/bP8lgLIHEkaMWfAz3s44N1fFPy7fC5EjEZJMtPlhmCTZ +02IJJg53odMsEkGeE3VsavFFrxtQC0FGsDFxZIX46QA8o9yTTrZa1CoxIv/94lMYp/L YEn9io03IDQkeGXydDdqSNkIAKZjz7QrHVoCI30ztfM4t9uHGx3OLkEBBHFvmA5IdhGR NJmA== X-Gm-Message-State: AOAM532/tL4ypDjstQ/WFZhyOtwNeEtfGXBmiXOnGQ/FejGacyAwlM/A 3bt/ZoivLBADO1PXoqPrjjk= X-Google-Smtp-Source: ABdhPJx4bbnNZMo/QBlVObti6Fy8xgBBS897VBNNSetxObrcuWvv34rqucpZqtf5HBvS8mfyWi9FQg== X-Received: by 2002:a17:90a:ab0c:: with SMTP id m12mr4249958pjq.179.1621508742496; Thu, 20 May 2021 04:05:42 -0700 (PDT) Received: from fmin-OptiPlex-7060.nreal.work ([137.59.103.165]) by smtp.gmail.com with ESMTPSA id hk15sm5839121pjb.53.2021.05.20.04.05.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 May 2021 04:05:42 -0700 (PDT) From: dillon.minfei@gmail.com To: mchehab@kernel.org, mchehab+huawei@kernel.org, hverkuil-cisco@xs4all.nl, ezequiel@collabora.com, gnurou@gmail.com, pihsun@chromium.org, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org Cc: patrice.chotard@foss.st.com, hugues.fruchet@foss.st.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, Dillon Min Subject: [PATCH 2/7] media: dt-bindings: media: add document for STM32 DMA2D bindings Date: Thu, 20 May 2021 19:05:22 +0800 Message-Id: <1621508727-24486-3-git-send-email-dillon.minfei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1621508727-24486-1-git-send-email-dillon.minfei@gmail.com> References: <1621508727-24486-1-git-send-email-dillon.minfei@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dillon Min This adds documentation of device tree bindings for the STM32 DMA2D Signed-off-by: Dillon Min Reviewed-by: Rob Herring --- .../devicetree/bindings/media/st,stm32-dma2d.yaml | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/st,stm32-dma2d.yaml diff --git a/Documentation/devicetree/bindings/media/st,stm32-dma2d.yaml b/Documentation/devicetree/bindings/media/st,stm32-dma2d.yaml new file mode 100644 index 000000000000..f97b4a246605 --- /dev/null +++ b/Documentation/devicetree/bindings/media/st,stm32-dma2d.yaml @@ -0,0 +1,71 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/st,stm32-dma2d.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectronics STM32 Chrom-Art Accelerator DMA2D binding + +description: + Chrom-ART Accelerator(DMA2D), graphical hardware accelerator + enabling enhanced graphical user interface with minimum CPU load + + It can perform the following operations. + + - Filling a part or the whole of a destination image with a specific color. + - Copying a part or the whole of a source image into a part or the whole of + a destination image. + - Copying a part or the whole of a source image into a part or the whole of + a destination image with a pixel format conversion. + - Blending a part and/or two complete source images with different pixel + format and copy the result into a part or the whole of a destination image + with a different color format. (TODO) + + +maintainers: + - Dillon Min + +properties: + compatible: + const: st,stm32-dma2d + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: dma2d + + resets: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + - resets + +additionalProperties: false + +examples: + - | + #include + #include + dma2d: dma2d@4002b000 { + compatible = "st,stm32-dma2d"; + reg = <0x4002b000 0xc00>; + interrupts = <90>; + resets = <&rcc STM32F4_AHB1_RESET(DMA2D)>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(DMA2D)>; + clock-names = "dma2d"; + }; + +... From patchwork Thu May 20 11:05:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dillon Min X-Patchwork-Id: 443655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7655CC433B4 for ; Thu, 20 May 2021 12:17:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D48561186 for ; Thu, 20 May 2021 12:17:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238655AbhETMTB (ORCPT ); Thu, 20 May 2021 08:19:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235159AbhETMSv (ORCPT ); Thu, 20 May 2021 08:18:51 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCA8CC07A830; Thu, 20 May 2021 04:05:51 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id ep16-20020a17090ae650b029015d00f578a8so5084520pjb.2; Thu, 20 May 2021 04:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GLGGQfl2zXFsccd/mr0oP139J15xn0Blxr/cx91Xd1M=; b=sep2NJZySqc16Z7h0JLim1OgBCyiF/Kd5UGwhx4Dy8Paia3Q0KZAXin+ZWoZysY/6X CI04pPq2AhXoLSJB1+RyKHmObdy81S4BfwyuYXwJLEyAk+yQlj9DtrzB5YRgbWBrNGqD auIWeQ+Y1a7LEcrmG3S+Ts226SoQgVJPbr1OFl+aPyz21jKcvA2EERzTgN7I/nLK1lT4 wB7OF6RLpJz4EKH8C7amR1sbtShKUy79MB+Jev++evuf6NnZm7GsgYzZuzePn6BJRQro deLMuyQGp9rNzx6CJTAYt1yQwpH3yNleOnIKDchlco8pjCWGZ3RLvsu6hc3GJv+5FHrz 6riQ== 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:in-reply-to :references; bh=GLGGQfl2zXFsccd/mr0oP139J15xn0Blxr/cx91Xd1M=; b=gtMhDWPpXGylsPZsqkQELR5SD38oWBZu4G9U/gNv+LuqvhB/46SGqZUH17PseeJ7l7 pE7N+tU5sErYwC0Zv3q2pp37vJVKphHvr6GbTeC7+2MrVWQv55E14leKCuDVlZ8l4H+i 00tKaUwQ2u3GHUX2vLOFLgas9lKvkPGvjDqZtUCguOhKjGrMgqc0X5S8QcTaNk1HlEUs XEgS4DMnUVy6upitg9GM5bdoZW7o14iLx2QZCwzgzqEganR30dmBaA0/6MLL1xDxvRoU 5Fg1aJtNP1XeIDEIeYhotXCcCm0Gar5EEd9hmMgz9NzaJAMw81haPpn6Yt6Zkjx1TvwZ Iv5A== X-Gm-Message-State: AOAM5336mtl2McTD+yiOxnsCPNA2CmRyQpDTUzj9Oar4HNP8p9osPHCo zVVJu1iJpE9si5UjPZsLjDM= X-Google-Smtp-Source: ABdhPJx8T9pnitbWBnKS183vbEq4rXMFbi8xW6C3PzRCVZBkhv2ideHXgWVdIntE4IGSl5tUaxK6Bw== X-Received: by 2002:a17:902:f704:b029:f4:228d:4dca with SMTP id h4-20020a170902f704b02900f4228d4dcamr5327214plo.26.1621508751436; Thu, 20 May 2021 04:05:51 -0700 (PDT) Received: from fmin-OptiPlex-7060.nreal.work ([137.59.103.165]) by smtp.gmail.com with ESMTPSA id hk15sm5839121pjb.53.2021.05.20.04.05.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 May 2021 04:05:51 -0700 (PDT) From: dillon.minfei@gmail.com To: mchehab@kernel.org, mchehab+huawei@kernel.org, hverkuil-cisco@xs4all.nl, ezequiel@collabora.com, gnurou@gmail.com, pihsun@chromium.org, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org Cc: patrice.chotard@foss.st.com, hugues.fruchet@foss.st.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, Dillon Min Subject: [PATCH 4/7] ARM: dts: stm32: Enable DMA2D support on STM32F429 MCU Date: Thu, 20 May 2021 19:05:24 +0800 Message-Id: <1621508727-24486-5-git-send-email-dillon.minfei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1621508727-24486-1-git-send-email-dillon.minfei@gmail.com> References: <1621508727-24486-1-git-send-email-dillon.minfei@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dillon Min Enable DMA2D on STM32F429 MCU. Signed-off-by: Dillon Min --- arch/arm/boot/dts/stm32f429.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/boot/dts/stm32f429.dtsi b/arch/arm/boot/dts/stm32f429.dtsi index f6530d724d00..2cd1506027b3 100644 --- a/arch/arm/boot/dts/stm32f429.dtsi +++ b/arch/arm/boot/dts/stm32f429.dtsi @@ -799,6 +799,16 @@ status = "disabled"; }; + dma2d: dma2d@4002b000 { + compatible = "st,stm32-dma2d"; + reg = <0x4002b000 0xc00>; + interrupts = <90>; + resets = <&rcc STM32F4_AHB1_RESET(DMA2D)>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(DMA2D)>; + clock-names = "dma2d"; + status = "disabled"; + }; + rng: rng@50060800 { compatible = "st,stm32-rng"; reg = <0x50060800 0x400>; From patchwork Thu May 20 11:05:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dillon Min X-Patchwork-Id: 443654 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52928C43470 for ; Thu, 20 May 2021 12:17:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 381F761186 for ; Thu, 20 May 2021 12:17:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240034AbhETMTF (ORCPT ); Thu, 20 May 2021 08:19:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233987AbhETMSy (ORCPT ); Thu, 20 May 2021 08:18:54 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B709CC07A838; Thu, 20 May 2021 04:06:00 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id cu11-20020a17090afa8bb029015d5d5d2175so5236937pjb.3; Thu, 20 May 2021 04:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IO9gCXt5G5Vx6kyEErgKK+AsLPPmYTdtrOpDyDyzIfE=; b=BaA/UJNpsKEcjBOX6ghvwnyih8vBBnH2fgzDmx2jktPD/xKfrOBuMX+9BdaReBeo6Q 3+wADgFOpDZJWOrJEb48CvtpVxcxerq3LOb0FiDdcBf3cF0k1z6vKM8KIslBr9ID4yKK +bn8BAL2ZC4idEELSHX2vuN+yXYFrK1Q5LCizjsQH4kjb2qak+kSHiK7Lth6cSHQdv+C HBYrwmraY/U7jMmtyYX2u+VlDQxHWV+FTDoA+mN/DqwcL5jq3aDGXAFannrTszrSP+M8 AxxOHC2Ihv4htsbhTHTGe2hGdYcF14tHPHjlvesVoaafhD/T0guBdSlPVgo5V++QD3EY 7vTQ== 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:in-reply-to :references; bh=IO9gCXt5G5Vx6kyEErgKK+AsLPPmYTdtrOpDyDyzIfE=; b=OagpEExIzmCRenm4zSuTtFa7bLnzaD01//T4NSsZPGMCd9R403FQzjJfwqT7zmnB2U cEC1hb7CvNTZvX2Vq1SGvfHzSFr1i2DuVan/iC017EForQ0ESvJy3kdMaV/jdGI67FOL rUKtZjbdGWMmsmyQKt4DpvPbNZAhpQiA20toNo8Lc9i6f1V1I8vrlYq9QpNJJGfjTd/G c07Osma6SuUEj8+TAxYhSrej6KgFyt5gP4OpKc2dsN8o9nh48qvKXerKPmnFhVNLU3Wz 8KuGnExd8SrDwydPJeDTz8qxFiTP+6/inI1qjb/u0PSxOs9NbaHlmZtD8THxOlXYcpjN +eiQ== X-Gm-Message-State: AOAM531gaflvdEoWAW1RR1Je/xT03wnltaSe1dRgdh983IKcGtEk0wyA HhEWyCLTUUKKt8DUJAjN7xQ= X-Google-Smtp-Source: ABdhPJxD360vWD89Doeb1D5W6uK02Tt1N3UM2GmGK7odaUpIi575QvqaXGc0IElISKF9+cphuXZbRA== X-Received: by 2002:a17:902:a70f:b029:ea:d4a8:6a84 with SMTP id w15-20020a170902a70fb02900ead4a86a84mr5271791plq.42.1621508760307; Thu, 20 May 2021 04:06:00 -0700 (PDT) Received: from fmin-OptiPlex-7060.nreal.work ([137.59.103.165]) by smtp.gmail.com with ESMTPSA id hk15sm5839121pjb.53.2021.05.20.04.05.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 May 2021 04:06:00 -0700 (PDT) From: dillon.minfei@gmail.com To: mchehab@kernel.org, mchehab+huawei@kernel.org, hverkuil-cisco@xs4all.nl, ezequiel@collabora.com, gnurou@gmail.com, pihsun@chromium.org, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org Cc: patrice.chotard@foss.st.com, hugues.fruchet@foss.st.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, Dillon Min Subject: [PATCH 6/7] media: v4l2-mem2mem: add v4l2_m2m_get_unmapped_area for no-mmu platform Date: Thu, 20 May 2021 19:05:26 +0800 Message-Id: <1621508727-24486-7-git-send-email-dillon.minfei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1621508727-24486-1-git-send-email-dillon.minfei@gmail.com> References: <1621508727-24486-1-git-send-email-dillon.minfei@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dillon Min For platforms without MMU the m2m provides a helper method v4l2_m2m_get_unmapped_area(), The mmap() routines will call this to get a proposed address for the mapping. More detailed information about get_unmapped_area can be found in Documentation/nommu-mmap.txt Signed-off-by: Dillon Min --- drivers/media/v4l2-core/v4l2-mem2mem.c | 20 ++++++++++++++++++++ include/media/v4l2-mem2mem.h | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c index e7f4bf5bc8dd..f82a18ecab2f 100644 --- a/drivers/media/v4l2-core/v4l2-mem2mem.c +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c @@ -966,6 +966,26 @@ int v4l2_m2m_mmap(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, } EXPORT_SYMBOL(v4l2_m2m_mmap); +#ifndef CONFIG_MMU +unsigned long v4l2_m2m_get_unmapped_area(struct file *file, unsigned long addr, + unsigned long len, unsigned long pgoff, unsigned long flags) +{ + struct v4l2_fh *fh = file->private_data; + unsigned long offset = pgoff << PAGE_SHIFT; + struct vb2_queue *vq; + + if (offset < DST_QUEUE_OFF_BASE) { + vq = v4l2_m2m_get_src_vq(fh->m2m_ctx); + } else { + vq = v4l2_m2m_get_dst_vq(fh->m2m_ctx); + pgoff -= (DST_QUEUE_OFF_BASE >> PAGE_SHIFT); + } + + return vb2_get_unmapped_area(vq, addr, len, pgoff, flags); +} +EXPORT_SYMBOL_GPL(v4l2_m2m_get_unmapped_area); +#endif + #if defined(CONFIG_MEDIA_CONTROLLER) void v4l2_m2m_unregister_media_controller(struct v4l2_m2m_dev *m2m_dev) { diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index 5a91b548ecc0..91269227c265 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h @@ -495,6 +495,10 @@ __poll_t v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, int v4l2_m2m_mmap(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, struct vm_area_struct *vma); +#ifndef CONFIG_MMU +unsigned long v4l2_m2m_get_unmapped_area(struct file *file, unsigned long addr, + unsigned long len, unsigned long pgoff, unsigned long flags); +#endif /** * v4l2_m2m_init() - initialize per-driver m2m data *