From patchwork Fri Oct 7 12:49:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 13001069 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5143BC4332F for ; Fri, 7 Oct 2022 12:50:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADC0510E0F8; Fri, 7 Oct 2022 12:50:01 +0000 (UTC) Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by gabe.freedesktop.org (Postfix) with ESMTPS id B00A610E0F8 for ; Fri, 7 Oct 2022 12:49:55 +0000 (UTC) Received: by mail-ej1-x636.google.com with SMTP id b2so11113225eja.6 for ; Fri, 07 Oct 2022 05:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R1/Q7FM/6wVesragT+lLg++XOxeD1OeWXwDpmo+CaG4=; b=gaNnBrbV3Xpns8rk5Qd2ry9waUgicBEUDrQg2WurXif06s4ezs2estOIDdE2FEIiOA ObAzX3FwLvIYWmXxhhqpyItjUUQScNGn+4XGhSzOGzlYBzLlns9ejTj0T/ai0qtMrXm0 Zs1/YqHVjQUvudyKHj8viF3OLGZ5ql6YW21PKR9A5J4+QgtG2KJt3h+W8A7N1lGQNkp1 sHguNhGwf/DvgLRpiTo1kgkxhBwNK0FcB76BZyUHCkrVmspiVcbzteV/l1hVi2y2CO9G lnaJOupMuhh4zBKgdvVBPcT898mjZnGQgdSb5feisnV1/WUzlZXCsCG2XzBijUwbxr4+ H2+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R1/Q7FM/6wVesragT+lLg++XOxeD1OeWXwDpmo+CaG4=; b=kTS2hRoQ1yYPy3GFK3U9Q3pIQskUUHz57vEM2Wl4Uv+VE60bAzPMpRTWtIVnYsYa8p UAb25TkTet2EnAyykxfsUY05p1bkQBXEm2Wsgqv3HbFYPm7h8t2/32H/lAOzatibgI8B u9BoPK3rsm2OqP/nbrbQson6kSBTaV+A1ukgo4UbX+wVCbTLrJujaWvpT2YIFUAl7Sr0 moncmZU8sTqIty3mrHq/OXOp6VEyFTrh+0/PrfR6iOh72BqlhN493UwEUUxmb6tWbsfC Bw8t3bJ1JY5hfJspNEebyrYbECyVe6C5t06i8KyuOa3aDpvJXabnV9tcQkEhm9chVilR k1Mw== X-Gm-Message-State: ACrzQf3AWlBsz4xx8V57t8jzSlOM/79lnmm5+iNm/R9izf1h369mk7MT hdhRVFQogf5dNcVAg4EYIr0htWv4rec= X-Google-Smtp-Source: AMsMyM6j/Lz5Ph/6n8cFQ5VxJzYs0uHKqNXN6rVCej8vqUFmcXN0/IqXNi/OGIs9ykHYRMPeWm5aJg== X-Received: by 2002:a17:906:5d11:b0:787:807e:5b8a with SMTP id g17-20020a1709065d1100b00787807e5b8amr3895992ejt.559.1665146993991; Fri, 07 Oct 2022 05:49:53 -0700 (PDT) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id w22-20020a1709067c9600b007812ba2a360sm1186786ejo.149.2022.10.07.05.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 05:49:53 -0700 (PDT) From: Thierry Reding To: David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Thierry Reding Subject: [PATCH v2 1/7] dt-bindings: display: simple-framebuffer: Support system memory framebuffers Date: Fri, 7 Oct 2022 14:49:40 +0200 Message-Id: <20221007124946.406808-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221007124946.406808-1-thierry.reding@gmail.com> References: <20221007124946.406808-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Jon Hunter , Thomas Zimmermann , linux-tegra@vger.kernel.org, Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding In order to support framebuffers residing in system memory, allow the memory-region property to override the framebuffer memory specification in the "reg" property. Signed-off-by: Thierry Reding Reviewed-by: Rob Herring --- .../devicetree/bindings/display/simple-framebuffer.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/display/simple-framebuffer.yaml b/Documentation/devicetree/bindings/display/simple-framebuffer.yaml index dd64f70b5014..3e9857eb002e 100644 --- a/Documentation/devicetree/bindings/display/simple-framebuffer.yaml +++ b/Documentation/devicetree/bindings/display/simple-framebuffer.yaml @@ -63,6 +63,11 @@ properties: reg: description: Location and size of the framebuffer memory + memory-region: + maxItems: 1 + description: Phandle to a node describing the memory to be used for the + framebuffer. If present, overrides the "reg" property (if one exists). + clocks: description: List of clocks used by the framebuffer. From patchwork Fri Oct 7 12:49:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 13001074 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86140C433F5 for ; Fri, 7 Oct 2022 12:50:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FB9710E159; Fri, 7 Oct 2022 12:50:22 +0000 (UTC) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 51B4D10E0F8 for ; Fri, 7 Oct 2022 12:49:57 +0000 (UTC) Received: by mail-ed1-x52f.google.com with SMTP id x59so6886387ede.7 for ; Fri, 07 Oct 2022 05:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XBRkFBzTwr0Layx8yRFn/SH2RZGgfSe2fyII0Qe3/MM=; b=VJIgYJ/IoReLEy1bc3Rcmnyf0KVESE1k2s6upBKNnWGK0/OkkoEV+CCQRxl/02qvwP cpy0B/rotWFufIw72HjRUcPVPOGjXaVFbtjN54MGJu5bjXP3p5Rhk6k2QARA16TwgFh5 pnfrG/LATajYizVBkN+/cK0kOf7FuWDw4Gp3PpfrwxtKQBB/KWmQE/flEziV9X7SZkUr IQOV6ExJGxbJhd2A+E4qtgIp8B5eMtkgzbxZFQEU7TsrMGAAaLZZFqxm/iT21bHFF/yB ygp9BX6lCOVghc7yCie1sb8s7zi4yEJ1c33iGSpI6CfTARpgl0sObBO9jxLm1+TfsPev MFUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XBRkFBzTwr0Layx8yRFn/SH2RZGgfSe2fyII0Qe3/MM=; b=pKjE7CgVcLRjkC3dAOAFYiCBjWMLnAdWIAwdT8ahrW1B915PUKq/LI73MvoAkLJZRT UcVVpH0/UTtwLgwOgQ7LZQkaiS9M1OS/RgX3I4L+7zRkcp/PTSKBGBxilHc1VXdec8MX vJsEO149Szish22zeIzmSetTIVdTOBmMS0fLxD3QYyZodh07l6f7F/cmPwkM+V/bop/l 2tZGqL/7954Z3oNkey/afLR+5NmasSk2JF/fPRs+uBrUtx0Vp9Wmvb3aj1fLVbt94Yr9 IqMMEsa3ejwsQXZwpB3zzR/SnyPX8Ta9xcOXvp+vW8irsSMxqeJ7qlxZ97SqRKU2THWb pkpQ== X-Gm-Message-State: ACrzQf00AlmOquWq2jpOAMd2MeOLU1YC1b8LCP/Khu6Ti++liy/gsSAs +XogNHnFAUzdIFtZ3jro3fA= X-Google-Smtp-Source: AMsMyM68uGoAncrYPa2ZIbBvO4lb6WPzAUIT3HdjPZjERzYotAUTG3j5fbLxYS+OV9H8g0QARa9EOQ== X-Received: by 2002:a05:6402:26d4:b0:451:280d:3533 with SMTP id x20-20020a05640226d400b00451280d3533mr4330565edd.316.1665146995668; Fri, 07 Oct 2022 05:49:55 -0700 (PDT) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id k8-20020a17090632c800b007030c97ae62sm1153572ejk.191.2022.10.07.05.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 05:49:54 -0700 (PDT) From: Thierry Reding To: David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Thierry Reding Subject: [PATCH v2 2/7] dt-bindings: display: simple-framebuffer: Document 32-bit BGR format Date: Fri, 7 Oct 2022 14:49:41 +0200 Message-Id: <20221007124946.406808-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221007124946.406808-1-thierry.reding@gmail.com> References: <20221007124946.406808-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Jon Hunter , Thomas Zimmermann , linux-tegra@vger.kernel.org, Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding This is a variant of the 32-bit RGB format where the red and blue components are swapped. Signed-off-by: Thierry Reding Reviewed-by: Rob Herring --- .../devicetree/bindings/display/simple-framebuffer.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/display/simple-framebuffer.yaml b/Documentation/devicetree/bindings/display/simple-framebuffer.yaml index 3e9857eb002e..3c9f29e428a4 100644 --- a/Documentation/devicetree/bindings/display/simple-framebuffer.yaml +++ b/Documentation/devicetree/bindings/display/simple-framebuffer.yaml @@ -99,6 +99,7 @@ properties: * `x1r5g5b5` - 16-bit pixels, d[14:10]=r, d[9:5]=g, d[4:0]=b * `x2r10g10b10` - 32-bit pixels, d[29:20]=r, d[19:10]=g, d[9:0]=b * `x8r8g8b8` - 32-bit pixels, d[23:16]=r, d[15:8]=g, d[7:0]=b + * `x8b8g8r8` - 32-bit pixels, d[23:16]=b, d[15:8]=g, d[7:0]=r enum: - a1r5g5b5 - a2r10g10b10 @@ -110,6 +111,7 @@ properties: - x1r5g5b5 - x2r10g10b10 - x8r8g8b8 + - x8b8g8r8 display: $ref: /schemas/types.yaml#/definitions/phandle From patchwork Fri Oct 7 12:49:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 13001070 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C4251C433F5 for ; Fri, 7 Oct 2022 12:50:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 404CD10E105; Fri, 7 Oct 2022 12:50:05 +0000 (UTC) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by gabe.freedesktop.org (Postfix) with ESMTPS id 24ACB10E0F8 for ; Fri, 7 Oct 2022 12:49:59 +0000 (UTC) Received: by mail-ej1-x629.google.com with SMTP id ot12so11148077ejb.1 for ; Fri, 07 Oct 2022 05:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U/DGi9HQh/INO76ufx6qo153czghX5f9wyf4yTlgdnU=; b=aDPiK9wgDuCz4iykhw/dpIIa1iCJJIzfjVwFJPE05jLGwbOb5Y9Jbi7xRrJ0kFvAM+ 98DH35bLCCPbb1e+/VgtbQ8LI7kSQMlcv5xVOekSPdapMDYrkz7wPGujvri5ib/ySiXj VsfZykt2TboOSqvJMQ2/MqZmVM0cn13QoXKGy9U31p0sxTavg5vPRwdD89hf1tSNCw8a sHrNaSx61u8KPf03hPcVluNJo6QoWfp7ZxUE9x554yCb7XpN/Ds9+elOSdJTv02BPxv1 b2ZBrpI+RSF2egeWZF/DF/Kha7O049hgBhmEWkVkXhhhjqt021cLCOU33PhU5vwAyZHH XcSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U/DGi9HQh/INO76ufx6qo153czghX5f9wyf4yTlgdnU=; b=M+bp83xBd4rgQHyYJpAygxX/T5H7T8WlD+BhbPDT3A7afreDtMWDnhKpPFBIWpGVXB af2r1WVbFfrNIRc6WEQ7wwJMsYHzLWi6yWFdlT2YNoGOc0kDWvQHltsyXwIN6zlrLZNi hEgAUIWSTk3xhb9tks+QyP8rksRUA1Byfs1uhyl5Pa5+YVikXQgYmYM2mXBzFr06E7hB tc2LmAxHj3C5LMFvIDARl44c3PTrHEzzhguKtC6bH0dzrxm+Fq+8a+D8eEASEwEjBl+M xsUzVp1emKD/ReQNhPSiLIqeniRfjYLLNBMbXoY8kWjlpTVaJ89wYHM0yjcmLX+A2bf2 phfQ== X-Gm-Message-State: ACrzQf3Eho+Hyrh7/JGbJmJu1WaVIyFrX28HlJEnJg2hAC4ulCoVIoyO Cn7miwuXRavqXqWmoBvIfsU= X-Google-Smtp-Source: AMsMyM4pPVMkGNTzw9EHjcedFTuvHCXHVwUn1M83nCd/82dP2yu3uWlCgG662VxDuaHMUllmScMb0Q== X-Received: by 2002:a17:907:9603:b0:742:9ed3:3af2 with SMTP id gb3-20020a170907960300b007429ed33af2mr3886671ejc.510.1665146997436; Fri, 07 Oct 2022 05:49:57 -0700 (PDT) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id p9-20020a05640243c900b004573052bf5esm1424166edc.49.2022.10.07.05.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 05:49:56 -0700 (PDT) From: Thierry Reding To: David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Thierry Reding Subject: [PATCH v2 3/7] dt-bindings: reserved-memory: Support framebuffer reserved memory Date: Fri, 7 Oct 2022 14:49:42 +0200 Message-Id: <20221007124946.406808-4-thierry.reding@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221007124946.406808-1-thierry.reding@gmail.com> References: <20221007124946.406808-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Jon Hunter , Thomas Zimmermann , linux-tegra@vger.kernel.org, Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding Document the "framebuffer" compatible string for reserved memory nodes to annotate reserved memory regions used for framebuffer carveouts. Signed-off-by: Thierry Reding Reviewed-by: Rob Herring --- Changes in v2: - use four spaces for indentation in example (as recommended elsewhere) - add explicit root node - drop unneeded quotes .../bindings/reserved-memory/framebuffer.yaml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/reserved-memory/framebuffer.yaml diff --git a/Documentation/devicetree/bindings/reserved-memory/framebuffer.yaml b/Documentation/devicetree/bindings/reserved-memory/framebuffer.yaml new file mode 100644 index 000000000000..05b6648b3458 --- /dev/null +++ b/Documentation/devicetree/bindings/reserved-memory/framebuffer.yaml @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reserved-memory/framebuffer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: /reserved-memory framebuffer node bindings + +maintainers: + - devicetree-spec@vger.kernel.org + +allOf: + - $ref: reserved-memory.yaml + +properties: + compatible: + const: framebuffer + description: > + This indicates a region of memory meant to be used as a framebuffer for + a set of display devices. It can be used by an operating system to keep + the framebuffer from being overwritten and use it as the backing memory + for a display device (such as simple-framebuffer). + +unevaluatedProperties: false + +examples: + - | + / { + compatible = "foo"; + model = "foo"; + #address-cells = <1>; + #size-cells = <1>; + + chosen { + framebuffer { + compatible = "simple-framebuffer"; + memory-region = <&fb>; + }; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + fb: framebuffer@80000000 { + compatible = "framebuffer"; + reg = <0x80000000 0x007e9000>; + }; + }; + }; +... From patchwork Fri Oct 7 12:49:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 13001071 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE316C4332F for ; Fri, 7 Oct 2022 12:50:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A542610E109; Fri, 7 Oct 2022 12:50:05 +0000 (UTC) Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2EABE10E0F8 for ; Fri, 7 Oct 2022 12:50:01 +0000 (UTC) Received: by mail-ej1-x62b.google.com with SMTP id k2so11139523ejr.2 for ; Fri, 07 Oct 2022 05:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8upa/AE8nGpXl24ostbZMoh41mWOyaVWO9cdEU+UC6c=; b=KqioInl1OGok63D0PEYJEYdJmf6l6crQEOdxne1TXTN7RwWaTISgSVvmKDjkysZpfR xy2FVwlfn8rkJD7CWIknL7k6j7y2W97eeiTF59k+utBZWWUyCZbT4n9JQas3h95UJ/5p eJh4bwFMQW1xyrJNxmNohvs4C8x4nza/5StFnLEQ3XEcOok24nxiYEZxblZTESgEY7Yp iAD2Fs20vPrZJofrSG9H19Y/fy9d3ijnwVwcmvrtrQfcZ6Kv2ULIel2+Cpe5PBgcWuT0 nhAhHX6fJBvEGhHDLTfZbvd5JWMu9F9XpQAV6aXkd5DxcMRvfEvVjZvCntQYO97bckM7 1gew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8upa/AE8nGpXl24ostbZMoh41mWOyaVWO9cdEU+UC6c=; b=R7r+rDbQyHd+RyMk4b0tPoYbZ7iLfMiR2+NG+rbmiq5jjxI3+QnuOJxacemsUIEJ+I 15FCZ7GOckxqNiSezeLWfLvNhO3ZZVBMlVcA6uyjI3nAl9dO/lpeMiTE2v4tXF5cLPOy WFSMqluSKhNffr8Io487ul8c3zFXM1EKRDmGjlh/2Gl0NYSCOyFfw6a1pT25twHpvrvy kH0zgGfKmJPW10YsQb3GjIbw6YMyqfbrdnWCs3JUjkOYOvyQbFaNar5MBGm8kyEvoHO4 JEVk7fPvCe0ixvKi4kUiP7yAxBfiTAhII64sWAtW3n8McRWsyBT2jsxIsnnMgv6itJ+m H0Kg== X-Gm-Message-State: ACrzQf2TUW9WfG+OLTP0HmsZZaUnExlCIT2o3YJxlU/ABPvO4Z7ImyCd lfC6JrCdb2b6V7xp4vZ3jUM= X-Google-Smtp-Source: AMsMyM56DggySACNM4kUVGOr3nTN2K4x0R0idGdKggbS7mIKRxTkL/rKnQT+lLyDg2/BOtWmBl8koA== X-Received: by 2002:a17:906:eeca:b0:730:6880:c397 with SMTP id wu10-20020a170906eeca00b007306880c397mr3865892ejb.593.1665146999629; Fri, 07 Oct 2022 05:49:59 -0700 (PDT) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id j9-20020aa7ca49000000b00458d383a6ddsm1416515edt.44.2022.10.07.05.49.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 05:49:58 -0700 (PDT) From: Thierry Reding To: David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Thierry Reding Subject: [PATCH v2 4/7] drm/simpledrm: Add support for system memory framebuffers Date: Fri, 7 Oct 2022 14:49:43 +0200 Message-Id: <20221007124946.406808-5-thierry.reding@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221007124946.406808-1-thierry.reding@gmail.com> References: <20221007124946.406808-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Jon Hunter , Thomas Zimmermann , linux-tegra@vger.kernel.org, Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding Simple framebuffers can be set up in system memory, which cannot be requested and/or I/O remapped using the I/O resource helpers. Add a separate code path that obtains system memory framebuffers from the reserved memory region referenced in the memory-region property. v2: make screen base a struct iosys_map to avoid sparse warnings Signed-off-by: Thierry Reding --- drivers/gpu/drm/tiny/simpledrm.c | 177 ++++++++++++++++++++++++------- 1 file changed, 141 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index 18489779fb8a..cf36f67d22e4 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -207,7 +208,9 @@ struct simpledrm_device { unsigned int pitch; /* memory management */ - void __iomem *screen_base; + struct iosys_map screen_base; + phys_addr_t sysmem_start; + size_t sysmem_size; /* modesetting */ uint32_t formats[8]; @@ -441,6 +444,106 @@ static int simpledrm_device_init_regulators(struct simpledrm_device *sdev) } #endif +/* + * Memory management + */ + +static int simpledrm_device_init_mm_sysmem(struct simpledrm_device *sdev, phys_addr_t start, + size_t size) +{ + struct drm_device *dev = &sdev->dev; + phys_addr_t end = start + size - 1; + void *screen_base; + + drm_info(dev, "using system memory framebuffer at [%pa-%pa]\n", &start, &end); + + screen_base = devm_memremap(dev->dev, start, size, MEMREMAP_WC); + if (!screen_base) + return -ENOMEM; + + iosys_map_set_vaddr(&sdev->screen_base, screen_base); + + return 0; +} + +static int simpledrm_device_init_mm_io(struct simpledrm_device *sdev, phys_addr_t start, + size_t size) +{ + struct drm_device *dev = &sdev->dev; + phys_addr_t end = start + size - 1; + void __iomem *screen_base; + struct resource *mem; + + drm_info(dev, "using I/O memory framebuffer at [%pa-%pa]\n", &start, &end); + + mem = devm_request_mem_region(dev->dev, start, size, sdev->dev.driver->name); + if (!mem) { + /* + * We cannot make this fatal. Sometimes this comes from magic + * spaces our resource handlers simply don't know about. Use + * the I/O-memory resource as-is and try to map that instead. + */ + drm_warn(dev, "could not acquire memory region [%pa-%pa]\n", &start, &end); + } else { + size = resource_size(mem); + start = mem->start; + } + + screen_base = devm_ioremap_wc(dev->dev, start, size); + if (!screen_base) + return -ENOMEM; + + iosys_map_set_vaddr_iomem(&sdev->screen_base, screen_base); + + return 0; +} + +static void simpledrm_device_exit_mm(void *data) +{ + struct simpledrm_device *sdev = data; + struct drm_device *dev = &sdev->dev; + + of_reserved_mem_device_release(dev->dev); +} + +static int simpledrm_device_init_mm(struct simpledrm_device *sdev) +{ + int (*init)(struct simpledrm_device *sdev, phys_addr_t start, size_t size); + struct drm_device *dev = &sdev->dev; + struct platform_device *pdev = to_platform_device(dev->dev); + phys_addr_t start, end; + size_t size; + int ret; + + ret = of_reserved_mem_device_init_by_idx(dev->dev, dev->dev->of_node, 0); + if (ret) { + struct resource *res; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -EINVAL; + + init = simpledrm_device_init_mm_io; + size = resource_size(res); + start = res->start; + } else { + devm_add_action_or_reset(dev->dev, simpledrm_device_exit_mm, sdev); + init = simpledrm_device_init_mm_sysmem; + start = sdev->sysmem_start; + size = sdev->sysmem_size; + } + + end = start + size - 1; + + ret = devm_aperture_acquire_from_firmware(dev, start, size); + if (ret) { + drm_err(dev, "could not acquire memory range [%pa-%pa]: %d\n", &start, &end, ret); + return ret; + } + + return init(sdev, start, size); +} + /* * Modesetting */ @@ -491,15 +594,15 @@ static void simpledrm_primary_plane_helper_atomic_update(struct drm_plane *plane drm_atomic_helper_damage_iter_init(&iter, old_plane_state, plane_state); drm_atomic_for_each_plane_damage(&iter, &damage) { - struct iosys_map dst = IOSYS_MAP_INIT_VADDR(sdev->screen_base); struct drm_rect dst_clip = plane_state->dst; if (!drm_rect_intersect(&dst_clip, &damage)) continue; - iosys_map_incr(&dst, drm_fb_clip_offset(sdev->pitch, sdev->format, &dst_clip)); - drm_fb_blit(&dst, &sdev->pitch, sdev->format->format, shadow_plane_state->data, fb, - &damage); + iosys_map_incr(&sdev->screen_base, drm_fb_clip_offset(sdev->pitch, sdev->format, + &dst_clip)); + drm_fb_blit(&sdev->screen_base, &sdev->pitch, sdev->format->format, + shadow_plane_state->data, fb, &damage); } drm_dev_exit(idx); @@ -518,7 +621,7 @@ static void simpledrm_primary_plane_helper_atomic_disable(struct drm_plane *plan return; /* Clear screen to black if disabled */ - memset_io(sdev->screen_base, 0, sdev->pitch * sdev->mode.vdisplay); + iosys_map_memset(&sdev->screen_base, 0, 0, sdev->pitch * sdev->mode.vdisplay); drm_dev_exit(idx); } @@ -635,8 +738,6 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv, struct drm_device *dev; int width, height, stride; const struct drm_format_info *format; - struct resource *res, *mem; - void __iomem *screen_base; struct drm_plane *primary_plane; struct drm_crtc *crtc; struct drm_encoder *encoder; @@ -706,35 +807,9 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv, drm_dbg(dev, "framebuffer format=%p4cc, size=%dx%d, stride=%d byte\n", &format->format, width, height, stride); - /* - * Memory management - */ - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return ERR_PTR(-EINVAL); - - ret = devm_aperture_acquire_from_firmware(dev, res->start, resource_size(res)); - if (ret) { - drm_err(dev, "could not acquire memory range %pr: error %d\n", res, ret); + ret = simpledrm_device_init_mm(sdev); + if (ret) return ERR_PTR(ret); - } - - mem = devm_request_mem_region(&pdev->dev, res->start, resource_size(res), drv->name); - if (!mem) { - /* - * We cannot make this fatal. Sometimes this comes from magic - * spaces our resource handlers simply don't know about. Use - * the I/O-memory resource as-is and try to map that instead. - */ - drm_warn(dev, "could not acquire memory region %pr\n", res); - mem = res; - } - - screen_base = devm_ioremap_wc(&pdev->dev, mem->start, resource_size(mem)); - if (!screen_base) - return ERR_PTR(-ENOMEM); - sdev->screen_base = screen_base; /* * Modesetting @@ -878,5 +953,35 @@ static struct platform_driver simpledrm_platform_driver = { module_platform_driver(simpledrm_platform_driver); +static int simple_framebuffer_device_init(struct reserved_mem *rmem, struct device *dev) +{ + struct simpledrm_device *sdev = dev_get_drvdata(dev); + + sdev->sysmem_start = rmem->base; + sdev->sysmem_size = rmem->size; + + return 0; +} + +static void simple_framebuffer_device_release(struct reserved_mem *rmem, struct device *dev) +{ +} + +static const struct reserved_mem_ops simple_framebuffer_ops = { + .device_init = simple_framebuffer_device_init, + .device_release = simple_framebuffer_device_release, +}; + +static int simple_framebuffer_init(struct reserved_mem *rmem) +{ + pr_info("framebuffer memory at %pa, size %lu bytes\n", &rmem->base, + (unsigned long)rmem->size); + + rmem->ops = &simple_framebuffer_ops; + + return 0; +} +RESERVEDMEM_OF_DECLARE(simple_framebuffer, "framebuffer", simple_framebuffer_init); + MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL v2"); From patchwork Fri Oct 7 12:49:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 13001072 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D954C4332F for ; Fri, 7 Oct 2022 12:50:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 391FF10E150; Fri, 7 Oct 2022 12:50:11 +0000 (UTC) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by gabe.freedesktop.org (Postfix) with ESMTPS id CFDD310E109 for ; Fri, 7 Oct 2022 12:50:02 +0000 (UTC) Received: by mail-ed1-x52f.google.com with SMTP id x59so6886785ede.7 for ; Fri, 07 Oct 2022 05:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wrrrdznzTmRNvhxoL8SCZOK3Fq6gtgfxyHdbZJIJpnI=; b=CkS5WkwEuoScpkTqN/Vnex7SlTDJjmWf8ltwebDjzw/VuWw6FVU7zF8K5ztXKpeuba VS1xLXVshPj027dWbHUZcdS/Aqx0YvMDxeIjfjHni3JIso4h78Mljcc0v0+l6D8Pm4Le VGmDOswL/xq5CRRDXKCfl+Aqf6V8vsdF/NPHf5W3i9dV0QAzTQglQQCgEZzqWYbsCBCa GOcyi/3tT8Y/uHBoBWAKNAucE58ejBXYje4E1xJqCgs8sajAvLiDvVZQsQrdC3RFEbjm 11KxxuYoUM9uTPdeC3H1SPsWAanvMaQbQc0LS5VqUp9Q007tc7b90A+9HyDdizP7qpsw zFcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wrrrdznzTmRNvhxoL8SCZOK3Fq6gtgfxyHdbZJIJpnI=; b=171HZpmPJkbDU4GXzhsazj77XLocXMl18dIBGnM96ftiCarxZm8ooEwei3HOwHT0gC wGjnd4U5l9hyREnFzsaARTAnQzg36XC5h2dnPu/0/R0IXMVnZoA0n15/rFbZTKZQFrNM 40bjOrWgsBx8F6QITkYvQWjrTYGLsjHIlMxPgi1mw77sjCte4OYLnAC68Yp2MSshrm4D y1mPCq7vkKolLKceRjO7tge5SCFapYMM/5+/PswWn8BImBslUTaMO3C5zHQiswC90plJ vXmlH2OJ4HoaILsBuezlfa2b2cqARB9zhVZf7mQ4hXxquMg0e1m5c4x7t2VvtD4tiqCY MTqg== X-Gm-Message-State: ACrzQf3edf9KIOPf1PwcyjZ1LIp9qb4M0liLLRZTJsGdtJAW1nbGyxfh mOpzCgWtgUhkCwxupEO2ab4= X-Google-Smtp-Source: AMsMyM4k7Cw2VvtfHOta0Uf/xqpK0XGradDOXq7931skX0AqQ8CW2YMP4qvBGzzeZu89rWX/O1LqSg== X-Received: by 2002:a05:6402:35d4:b0:459:348d:a7ac with SMTP id z20-20020a05640235d400b00459348da7acmr4514891edc.149.1665147002327; Fri, 07 Oct 2022 05:50:02 -0700 (PDT) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id mf22-20020a1709071a5600b0074136cac2e7sm1183617ejc.81.2022.10.07.05.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 05:50:01 -0700 (PDT) From: Thierry Reding To: David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Thierry Reding Subject: [PATCH v2 5/7] drm/format-helper: Support the XB24 format Date: Fri, 7 Oct 2022 14:49:44 +0200 Message-Id: <20221007124946.406808-6-thierry.reding@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221007124946.406808-1-thierry.reding@gmail.com> References: <20221007124946.406808-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Jon Hunter , Thomas Zimmermann , linux-tegra@vger.kernel.org, Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding Add a conversion helper for the XB24 format to use in drm_fb_blit(). v2: support XB24 format instead of AB24 Signed-off-by: Thierry Reding --- drivers/gpu/drm/drm_format_helper.c | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/gpu/drm/drm_format_helper.c b/drivers/gpu/drm/drm_format_helper.c index e2f76621453c..8a7c200ecba9 100644 --- a/drivers/gpu/drm/drm_format_helper.c +++ b/drivers/gpu/drm/drm_format_helper.c @@ -503,6 +503,36 @@ static void drm_fb_rgb888_to_xrgb8888(struct iosys_map *dst, const unsigned int drm_fb_rgb888_to_xrgb8888_line); } +static void drm_fb_xrgb8888_to_xbgr8888_line(void *dbuf, const void *sbuf, unsigned int pixels) +{ + __le32 *dbuf32 = dbuf; + const __le32 *sbuf32 = sbuf; + unsigned int x; + u32 pix; + + for (x = 0; x < pixels; x++) { + pix = le32_to_cpu(sbuf32[x]); + pix = ((pix & 0x00ff0000) >> 16) << 0 | + ((pix & 0x0000ff00) >> 8) << 8 | + ((pix & 0x000000ff) >> 0) << 16 | + 0xff << 24; + *dbuf32++ = cpu_to_le32(pix); + } +} + +static void drm_fb_xrgb8888_to_xbgr8888(struct iosys_map *dst, const unsigned int *dst_pitch, + const struct iosys_map *src, + const struct drm_framebuffer *fb, + const struct drm_rect *clip) +{ + static const u8 dst_pixsize[DRM_FORMAT_MAX_PLANES] = { + 4, + }; + + drm_fb_xfrm(dst, dst_pitch, dst_pixsize, src, fb, clip, false, + drm_fb_xrgb8888_to_xbgr8888_line); +} + static void drm_fb_xrgb8888_to_xrgb2101010_line(void *dbuf, const void *sbuf, unsigned int pixels) { __le32 *dbuf32 = dbuf; @@ -646,6 +676,8 @@ int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t d fb_format = DRM_FORMAT_XRGB8888; if (dst_format == DRM_FORMAT_ARGB8888) dst_format = DRM_FORMAT_XRGB8888; + if (dst_format == DRM_FORMAT_ABGR8888) + dst_format = DRM_FORMAT_XBGR8888; if (fb_format == DRM_FORMAT_ARGB2101010) fb_format = DRM_FORMAT_XRGB2101010; if (dst_format == DRM_FORMAT_ARGB2101010) @@ -673,6 +705,11 @@ int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t d drm_fb_rgb565_to_xrgb8888(dst, dst_pitch, src, fb, clip); return 0; } + } else if (dst_format == DRM_FORMAT_XBGR8888) { + if (fb_format == DRM_FORMAT_XRGB8888) { + drm_fb_xrgb8888_to_xbgr8888(dst, dst_pitch, src, fb, clip); + return 0; + } } else if (dst_format == DRM_FORMAT_XRGB2101010) { if (fb_format == DRM_FORMAT_XRGB8888) { drm_fb_xrgb8888_to_xrgb2101010(dst, dst_pitch, src, fb, clip); From patchwork Fri Oct 7 12:49:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 13001073 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42243C433FE for ; Fri, 7 Oct 2022 12:50:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D13DA10E1B4; Fri, 7 Oct 2022 12:50:14 +0000 (UTC) Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by gabe.freedesktop.org (Postfix) with ESMTPS id 93F7310E159 for ; Fri, 7 Oct 2022 12:50:07 +0000 (UTC) Received: by mail-lj1-x231.google.com with SMTP id f9so5565081ljk.12 for ; Fri, 07 Oct 2022 05:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f59EU1a1WnDP8FmZf3wrh4O5KrGlofpHUXUgEfyspJQ=; b=CLZRyqPhA5+M6uyWDg31r6F8m+wKuz4Ptz9QRZt1FtszgNSWuDe5YGR3aeXy6AcqKT 9tOE+oHq71rji+2VsBi5nKN5iHMLBSeUkMBJFFz+0ivIJRjXu9Kj9soi41d9E1xo65QC EsOszCdKg8/8ejmsZ+fXL92Os6Z2ej9gn1sJYMqJLIS/RzwHFWeEjbCLhXXQ50kWYDJl dzx+anyHHwGvYJnFoC3GCmOw/kY+iPbdje81zsQEfcnU3tK667WRAKPvl+jbImBNLlSq cbxGJh61HQ3VB8T7VReug6JcELNSW7Ng/KgSNbbob6ktvF+UVt7pFPg7+Yln2vqdNypH wNJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f59EU1a1WnDP8FmZf3wrh4O5KrGlofpHUXUgEfyspJQ=; b=CMrcA05o+8ApR5A4jVTrA9bY2Anbz6XXKV3IRYv52Dqv83zkQf/+FCvRShtePpMDIe +kJADv0TVx8Zacej70wCTrO4mTp2oDBKibceT6H0sQZgBWPHLjXczmO2EzT5Nv2A01yz goy3rFROS+BeBewHlSPJIUHf52+77AY5TSMdn2tD3KNLXsfv0KA52DVY1HFBYvfqfHUZ UieIjPXdkRHXJk6ibu4UtqIyInZ2Ed3W8PPZin5SChO2G3oPaESgRJXkt2uyn/4dB8VE hqNEGfgnzyPZZZg4NNs50DfvAK/ee5sa5ncaCIyMz1CTKou138z6ZG9pcAKXDB3p2nsn GD1w== X-Gm-Message-State: ACrzQf32rXoqi6Fm8HBuRleqPlu5/GCATwMjpE2+yGhvpG5KdOkcv27L fM2g+GZBk8LqAij4iIN9RY0= X-Google-Smtp-Source: AMsMyM5SeUv5h3OUh7LPJ7KiK1szc0oaT23XlSZ9LQ469HdOnpVCJpK8bPnerKLBmkxqF7Uxlp8l/g== X-Received: by 2002:a2e:bcc3:0:b0:26c:4c59:75ed with SMTP id z3-20020a2ebcc3000000b0026c4c5975edmr1564412ljp.505.1665147004219; Fri, 07 Oct 2022 05:50:04 -0700 (PDT) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id a21-20020ac25055000000b0048b0099f40fsm281404lfm.216.2022.10.07.05.50.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 05:50:03 -0700 (PDT) From: Thierry Reding To: David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Thierry Reding Subject: [PATCH v2 6/7] drm/simpledrm: Support the XB24/AB24 format Date: Fri, 7 Oct 2022 14:49:45 +0200 Message-Id: <20221007124946.406808-7-thierry.reding@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221007124946.406808-1-thierry.reding@gmail.com> References: <20221007124946.406808-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Jon Hunter , Thomas Zimmermann , linux-tegra@vger.kernel.org, Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding Add XB24 and AB24 to the list of supported formats. The format helpers support conversion to these formats and they are documented in the simple-framebuffer device tree bindings. v2: treat AB24 as XB24 and support both at the same time Signed-off-by: Thierry Reding --- drivers/gpu/drm/tiny/simpledrm.c | 2 ++ include/linux/platform_data/simplefb.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index cf36f67d22e4..ecb303c89320 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -559,6 +559,8 @@ static int simpledrm_device_init_mm(struct simpledrm_device *sdev) static const uint32_t simpledrm_primary_plane_formats[] = { DRM_FORMAT_XRGB8888, DRM_FORMAT_ARGB8888, + DRM_FORMAT_XBGR8888, + DRM_FORMAT_ABGR8888, DRM_FORMAT_RGB565, //DRM_FORMAT_XRGB1555, //DRM_FORMAT_ARGB1555, diff --git a/include/linux/platform_data/simplefb.h b/include/linux/platform_data/simplefb.h index 27ea99af6e1d..4f94d52ac99f 100644 --- a/include/linux/platform_data/simplefb.h +++ b/include/linux/platform_data/simplefb.h @@ -22,6 +22,7 @@ { "r8g8b8", 24, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_RGB888 }, \ { "x8r8g8b8", 32, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_XRGB8888 }, \ { "a8r8g8b8", 32, {16, 8}, {8, 8}, {0, 8}, {24, 8}, DRM_FORMAT_ARGB8888 }, \ + { "x8b8g8r8", 32, {0, 8}, {8, 8}, {16, 8}, {0, 0}, DRM_FORMAT_XBGR8888 }, \ { "a8b8g8r8", 32, {0, 8}, {8, 8}, {16, 8}, {24, 8}, DRM_FORMAT_ABGR8888 }, \ { "x2r10g10b10", 32, {20, 10}, {10, 10}, {0, 10}, {0, 0}, DRM_FORMAT_XRGB2101010 }, \ { "a2r10g10b10", 32, {20, 10}, {10, 10}, {0, 10}, {30, 2}, DRM_FORMAT_ARGB2101010 }, \ From patchwork Fri Oct 7 12:49:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 13001075 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8F2FC433F5 for ; Fri, 7 Oct 2022 12:50:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4DE8A10E1CA; Fri, 7 Oct 2022 12:50:26 +0000 (UTC) Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by gabe.freedesktop.org (Postfix) with ESMTPS id ACFF910E1B4 for ; Fri, 7 Oct 2022 12:50:08 +0000 (UTC) Received: by mail-lj1-x234.google.com with SMTP id f9so5565193ljk.12 for ; Fri, 07 Oct 2022 05:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2Y5rrHwKLrZ4oqRyovAy2VnaQoMJrQoBHsrafxjglos=; b=G/OrJ8zqmuYb/kkS4UhLEWzbWimpcbgnoO9d6aBezAILPtzafFiTWoGM+F66GRzlIY LMgAgEJ7Pa0gdROKyt8NntQDeLrEljz9GLjSH4Ij0rmhfjVCx9vqEEYof2j6rHosktm7 owcS11xjt87jTesZhyoO3+2tL04cTlwYm2PanSbXSmttF/TZ7KDeRv4EODiWkEDn5bty VEhqWZpIN8w/fx+AvQb6Jb0okDEgwOy/GdZvwLB82j232EfKPsLKcbNV0TJB11M0jLzs FjZHe1UOO1A0JCJFHOPoXE1/zxW+6j0g+6TRHnU+5i+dw6Fic7iwCHfKeEYUUOSKDXw1 FWAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Y5rrHwKLrZ4oqRyovAy2VnaQoMJrQoBHsrafxjglos=; b=NlfNUVkxArwYJQg8G+LCNHK1ut6jfh9OL56UzxdFD3Y8ialOkerl9bOVjz+6XuqGtk z0A/FHNQPH8JLyklNQAt0GF4lI7Uo1VRg4kaoJtLJa+FfsaLVFMvTYoe4UoOS/nhXhcO PFzSMOVFdMqrqT36pFApvijahlbxgKWcy0wHanxlou+rbFfGMI50dO1OcnFWWkEVMb98 ew0FgBpM+Idl2Dk/9kCt+S87ppj2hlro+0eqsFgA2oCZfkvsAQ7ldYDorY8VrXCnd4Ip hxg1WxvSaT2OR/UymYJ62ouFumMHQqdJToelQQE6ylnZ7c/LSmEByLswHFwDICQ4+53H MCnA== X-Gm-Message-State: ACrzQf02+m7JoSaEQU+L70am6WnPqeaW093akf1HU+MZRm1TR0y52S86 TL9Hwgb1sy5LiIj2hBE+/5s= X-Google-Smtp-Source: AMsMyM5ifxC7UlGdvc8qqaOEFBsU8euuliNMcSqjfAmJ19hRmNULRYAXYUCwGxaNG7vixk8xgJwMYg== X-Received: by 2002:a2e:96d0:0:b0:26a:8a3c:861e with SMTP id d16-20020a2e96d0000000b0026a8a3c861emr1574575ljj.54.1665147006947; Fri, 07 Oct 2022 05:50:06 -0700 (PDT) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id t27-20020a2e8e7b000000b0026dfe55be7fsm241505ljk.63.2022.10.07.05.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 05:50:06 -0700 (PDT) From: Thierry Reding To: David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Thierry Reding Subject: [PATCH v2 7/7] arm64: tegra: Add simple framebuffer on Jetson Xavier NX Date: Fri, 7 Oct 2022 14:49:46 +0200 Message-Id: <20221007124946.406808-8-thierry.reding@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221007124946.406808-1-thierry.reding@gmail.com> References: <20221007124946.406808-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Jon Hunter , Thomas Zimmermann , linux-tegra@vger.kernel.org, Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding Add the framebuffer carveout reserved memory node as well as a simple- framebuffer node that is used to bind to the framebuffer that the bootloader has set up. Signed-off-by: Thierry Reding --- Changes in v2: - clear out dynamic fields and leave it up to firmware to fill them in - mark simple-framebuffer node as disabled by default .../nvidia/tegra194-p3509-0000+p3668-0001.dts | 33 +++++++++++++++++++ arch/arm64/boot/dts/nvidia/tegra194.dtsi | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p3509-0000+p3668-0001.dts b/arch/arm64/boot/dts/nvidia/tegra194-p3509-0000+p3668-0001.dts index 238fd98e8e45..44600479ea5f 100644 --- a/arch/arm64/boot/dts/nvidia/tegra194-p3509-0000+p3668-0001.dts +++ b/arch/arm64/boot/dts/nvidia/tegra194-p3509-0000+p3668-0001.dts @@ -7,4 +7,37 @@ / { model = "NVIDIA Jetson Xavier NX Developer Kit (eMMC)"; compatible = "nvidia,p3509-0000+p3668-0001", "nvidia,tegra194"; + + chosen { + framebuffer { + compatible = "simple-framebuffer"; + status = "disabled"; + memory-region = <&fb>; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_DISP>; + clocks = <&bpmp TEGRA194_CLK_SOR1_REF>, + <&bpmp TEGRA194_CLK_SOR1_OUT>, + <&bpmp TEGRA194_CLK_SOR1_PAD_CLKOUT>, + <&bpmp TEGRA194_CLK_PLLD2>, + <&bpmp TEGRA194_CLK_PLLDP>, + <&bpmp TEGRA194_CLK_NVDISPLAY_DISP>, + <&bpmp TEGRA194_CLK_NVDISPLAYHUB>, + <&bpmp TEGRA194_CLK_NVDISPLAY_P0>; + width = <0>; + height = <0>; + stride = <0>; + format = ""; + }; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + fb: framebuffer@0,0 { + compatible = "framebuffer"; + reg = <0x0 0x0 0x0 0x0>; + iommu-addresses = <&dc0 0x0 0x0 0x0 0x0>; + }; + }; }; diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi index 4d10b6b5324d..a961d42c81d6 100644 --- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi @@ -1960,7 +1960,7 @@ display-hub@15200000 { ranges = <0x15200000 0x15200000 0x40000>; - display@15200000 { + dc0: display@15200000 { compatible = "nvidia,tegra194-dc"; reg = <0x15200000 0x10000>; interrupts = ;