From patchwork Fri Jan 20 17:30:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1729752 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=KOAy7Wqe; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Nz63z2nf4z23hD for ; Sat, 21 Jan 2023 04:31:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230131AbjATRbU (ORCPT ); Fri, 20 Jan 2023 12:31:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230242AbjATRbR (ORCPT ); Fri, 20 Jan 2023 12:31:17 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B9D2DBC8; Fri, 20 Jan 2023 09:31:09 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id o17-20020a05600c511100b003db021ef437so4234707wms.4; Fri, 20 Jan 2023 09:31:09 -0800 (PST) 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=D4HRh/xECMVrkAQ+rHzLh2y2hx0e7txexSDUMhaR4Ks=; b=KOAy7WqeTvP8+Sbxusk9elhvfXIfyG8QADBBoywCpEcBPcOP35aZ2eFIxNC8ba5J8S ejgpcz6IZhgQ9jtjJjsXnZV8qJ3lJwF/gXp3RXcD5Iw1lT+tDbvTzl1pEy1IdC7jjqks yrCtZnhYlBkJhI1HGOBOIu/IUvgeZdegsizv94t/ybFUOdb+mmXUSDb2bH5EWTiF1JzI 57P7OTdbT1iHUgcpQCsP8xnLFNOvrS4oIzSOG+/fb3avZa5o9MFFxqRWHjUjLDWYqSMu tscKRJ9ohqkJvPnS9tyfJBUYEd+eLXgcDKmf9/3Im+aZ6ONe0YLvaVpYyujNycdX2gXP EQNA== 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=D4HRh/xECMVrkAQ+rHzLh2y2hx0e7txexSDUMhaR4Ks=; b=iT8x8NtOr0pT3UnS4CgDLIqehEc3roZkqMBG7Ea5+K9iz65vC3qKM3yEEqR2ffeWZ1 exQVO18WttMiFlUADVumxr86LAkUpA54gTZVOLkOCiZGP3tI9lJs1uRbDMlNYo0DI8jV kEx+2paxnnEtFCsD/aJ8DvfLLZec3BTSXA1OQJ9m0OtOCnXCUUkfDeU4De9kOJGSrJo9 ktYWNKcO9WfsjmJBUJ5+B/JnC58YMd2gQv8Wih4FIj/dA6bR3Ut9kDRO4dgsonQ0tjzr X96Zemyps1SnqfHVYWpgeWQ+mKDOFXvz3aC4yHaj07DnnmzZZD4aKCtIKk3XfROW75I9 FO8w== X-Gm-Message-State: AFqh2krfcp//2133qW67ZB2dSBg7E+/Bnt16Eo+y6QbI9R4IeVbxq7Qv ivWl5CgLhU989QcN30I5wy0= X-Google-Smtp-Source: AMrXdXs++sNuHqUOoSyqqneB+mzWpppVn+a3j8F11wwCSMf5OEMNBjzUd4wpvTw9gp8LCE0jyfcYHA== X-Received: by 2002:a05:600c:1c23:b0:3db:b9f:f2e with SMTP id j35-20020a05600c1c2300b003db0b9f0f2emr13321794wms.14.1674235867778; Fri, 20 Jan 2023 09:31:07 -0800 (PST) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id p8-20020a5d4588000000b002bdfb97e029sm14413258wrq.19.2023.01.20.09.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 09:31:07 -0800 (PST) From: Thierry Reding To: David Airlie , Daniel Vetter , Thomas Zimmermann Cc: Jon Hunter , Robin Murphy , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring Subject: [PATCH v4 1/8] dt-bindings: display: simple-framebuffer: Support system memory framebuffers Date: Fri, 20 Jan 2023 18:30:56 +0100 Message-Id: <20230120173103.4002342-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120173103.4002342-1-thierry.reding@gmail.com> References: <20230120173103.4002342-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org 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. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding --- .../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 Jan 20 17:30:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1729753 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=qjJVGDJH; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Nz63z5mBwz23gR for ; Sat, 21 Jan 2023 04:31:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230224AbjATRbU (ORCPT ); Fri, 20 Jan 2023 12:31:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbjATRbR (ORCPT ); Fri, 20 Jan 2023 12:31:17 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BDC08BA89; Fri, 20 Jan 2023 09:31:10 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id g10so4656915wmo.1; Fri, 20 Jan 2023 09:31:10 -0800 (PST) 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=GBbS1vR/mSuCPWTVaI9sYUbEGcKE+xDxJZ9yOEMjCrg=; b=qjJVGDJH0jKQ0b4gzTbkmZrDvUkl0cBq7dqS3DzmJkGXk0cUiGw8MiLlBytpyxXpe5 nPd0+VJ6zqdQsWok6dWwpaQBGSKGsvLc4gOrnwT1BVZvQK+0aLewi7lVVZHJUFxJPn06 g41pppSD132BYkYxl21lBvFQjz6pO66N66lmvbCaP3vkyAEGnAD2nlCuZ1R5vEuUmPxZ 2KTrzvHbb3+2zUKcoGlUfsJmTEiwjhSdt2OYDX1MXzRcV6vsbD50CYFwRnlVDpQNTUq2 QwOeJ4cLfmobuPYC8LGX27KOOZ0rqd+21etuwUqfegxoR29BVSHH88bVUIv61f2xTjHx edOg== 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=GBbS1vR/mSuCPWTVaI9sYUbEGcKE+xDxJZ9yOEMjCrg=; b=fqB1jCDpTP2QFOmX0O/tCNdjD1o07GaoIFh2DNmp0LJZZRkeT2DwZJbA9/WhCHj57X UBP1esBnEL64MdLVLY/r0G3Qy350yU1SqNmWykgVyZBL9v7l0RHmTTJl6DMEOEBniAuW FZkWxv+SQw50xpzxGB2Jdfi5CSVdfN9KZ6DSYK80DXNt/sby5HduFDJvFpHCi+kXj2Xc HEE0l/ig1vqAqGsrSDIaN+d28MLguPgDq7YuN13RelkJPE5b3/hgW1xW228dxZYOBWT8 59Kz4KYsnG8bALeFWJYiffiYDBItGSRj3Ms4ioqoi2US/HmodgAgPNYSlomBVhOfCEv8 Vb1g== X-Gm-Message-State: AFqh2kqUaQTLK6OtK3mUuVrWsGViqBAHPj3OyCpJsP3m2Oaqzrma72KS lRRhx8FzocM271GWmwuAxuo= X-Google-Smtp-Source: AMrXdXsbFPG+yPqtgN9BXP7pJsSnwZmnCuFETW1Ckv3V7VUiLfVY2ra6BoEUOfuxX5YKtYvRx/HBcg== X-Received: by 2002:a05:600c:6006:b0:3db:21b8:5f58 with SMTP id az6-20020a05600c600600b003db21b85f58mr7162938wmb.2.1674235868713; Fri, 20 Jan 2023 09:31:08 -0800 (PST) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id w4-20020adfee44000000b0029100e8dedasm36214943wro.28.2023.01.20.09.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 09:31:08 -0800 (PST) From: Thierry Reding To: David Airlie , Daniel Vetter , Thomas Zimmermann Cc: Jon Hunter , Robin Murphy , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring Subject: [PATCH v4 2/8] dt-bindings: display: simple-framebuffer: Document 32-bit BGR format Date: Fri, 20 Jan 2023 18:30:57 +0100 Message-Id: <20230120173103.4002342-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120173103.4002342-1-thierry.reding@gmail.com> References: <20230120173103.4002342-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Thierry Reding This is a variant of the 32-bit RGB format where the red and blue components are swapped. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding --- .../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 Jan 20 17:30:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1729755 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=GNFViGqK; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Nz6404b1lz23gR for ; Sat, 21 Jan 2023 04:31:28 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230145AbjATRbV (ORCPT ); Fri, 20 Jan 2023 12:31:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230142AbjATRbS (ORCPT ); Fri, 20 Jan 2023 12:31:18 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31B95AED90; Fri, 20 Jan 2023 09:31:11 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id o17-20020a05600c511100b003db021ef437so4234778wms.4; Fri, 20 Jan 2023 09:31:11 -0800 (PST) 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=DdoQo1d/Fewt3gQuyYh4h+Gkl8pP1KOY6qOThytv+hI=; b=GNFViGqK9tTqpMZxDI3CBJeCm+MDtwGO3ieRWsOwQy6zL8z7EvKqrmid1acMPEBvIR in4jNFQkQoqort6U/nPqcaiKrfUyDdEPY4TKthYQ0p+pCDv/17zZGDoPs7CkjxJullPf 9Xkiq5p7aQpALvn9z9bwAp0Shg+fTP92laBL28OOj8DyWOa3kGJ0X3e9xDyuN61kv8iE fIptJO2I2rfSVo8tJv4sTWYekeKn7iozC4CM3Nf6ObF0tl89+zKA+LTcgHFznUQ8tQ40 AVPXJo85vEEB5LGBlsQsswxZjIFL2qC34FulqyYrkQZQ7N3tf7/FIjdysOtdA3rPS9kH naZw== 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=DdoQo1d/Fewt3gQuyYh4h+Gkl8pP1KOY6qOThytv+hI=; b=DUXkAvBPhWi2xw8Kzdi+iALcZx99t/GdraKTgqYeU5U3DGswXLhOBbPIqGcVzwLQgK gEcU5EI7UcAGTpcSAaNmqHlbgVtYgkcr1eZEG0CCjvxfZjNPs1u03n7dDlbqOeLEJLnq kfs6bo4FZ6D7f8CYyjAShYWTAcFJ9VzKxK50tYeFQFviP8f07kdebyJNUCE24v0dgGr5 zBgVuokqomc6is7tCZBvhkcPiykrKSlU+vBkNl6ResTk7jk3+ndF0+KpqBsAosovN8NY mvV7z+ka0trdhGVpTPn1Kl+rLlt8jb4Rieg48oCqfPTpl5EPBEFzErP5VFOdJwCP3IXJ vkwg== X-Gm-Message-State: AFqh2kpTGIsn50eSXwMQ92JmyXAbNu6yWvQoDGlGohr51r/+UW9YCJGr VtiH41TdhYryEUuhedGL/YI= X-Google-Smtp-Source: AMrXdXtgdksTbxRuG65zLEjDS1QUbMxH8ikWgpCZ64qimjbW2UYEGnrJEg6MWlLS/MimjoSmAWPcaw== X-Received: by 2002:a05:600c:4e93:b0:3db:d3f:a91f with SMTP id f19-20020a05600c4e9300b003db0d3fa91fmr12757322wmq.23.1674235869712; Fri, 20 Jan 2023 09:31:09 -0800 (PST) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id l30-20020a05600c1d1e00b003c6b70a4d69sm3311363wms.42.2023.01.20.09.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 09:31:09 -0800 (PST) From: Thierry Reding To: David Airlie , Daniel Vetter , Thomas Zimmermann Cc: Jon Hunter , Robin Murphy , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring Subject: [PATCH v4 3/8] dt-bindings: reserved-memory: Support framebuffer reserved memory Date: Fri, 20 Jan 2023 18:30:58 +0100 Message-Id: <20230120173103.4002342-4-thierry.reding@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120173103.4002342-1-thierry.reding@gmail.com> References: <20230120173103.4002342-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Thierry Reding Document the "framebuffer" compatible string for reserved memory nodes to annotate reserved memory regions used for framebuffer carveouts. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding --- 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 Jan 20 17:30:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1729757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=ekmCbRnQ; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Nz6413vPlz23gR for ; Sat, 21 Jan 2023 04:31:29 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230079AbjATRbV (ORCPT ); Fri, 20 Jan 2023 12:31:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230217AbjATRbT (ORCPT ); Fri, 20 Jan 2023 12:31:19 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91ED9DBC1; Fri, 20 Jan 2023 09:31:12 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id h12so1480071wrv.10; Fri, 20 Jan 2023 09:31:12 -0800 (PST) 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=SZNLi/l9wxy+mypxiXIZ6SYlQ5ADDjWtmD5zsC5Iu7U=; b=ekmCbRnQ3AKTSQE0uIHwanjK5e6WP9TSnmmjfarZxQgBhR/oiLwMIm/Zsd4JZ810NX /12FvuVLMlj3cBThnm4vG/SGhZDBu1ZwSGoeOc1QYfGVHmv2vLI1rKmYu3w2Qa6bcatW bihB3PpG/qNnfJ1XcPQw+mWakCZdhXFdABhR2Vx8o5xJCCvQjDdPoy3qbclJna8o6m+/ vooPj/OdMhGZupkhaDS6ttD+war33jtqb+hJCukHGDvgVn3Df5FeDPXpeC2ch0SZoNuH Hh7ONe2kRy1EHHoJ8YqG8/qzCZ/IGBFMKzm+aUF0ILgAdTAcd5nyMcGo3JF+6wBpWOFB CDCQ== 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=SZNLi/l9wxy+mypxiXIZ6SYlQ5ADDjWtmD5zsC5Iu7U=; b=exlqxMQph5Qy6nMoo7Yaw/MbObJbxOTYvTxXnSCe0muifbidUjNlz0u6ma0P8QvYop B3KBr0+erih8sP/YpFnjNPPwXLgOfWBKg6U21krgNm2TbMr6yiMziIwUBpJANXmu5ldX 9/4MMBk47SdB83+kzTbL6KB1NcvRbhwuD7kd7V0sVe1DI5ZKKu8ET2SAYF3Vf0ZDtBMF 7/ww2Hlp9SoYq/bX82hoBuYJ0+0ST8FyqjaBcx4xt35DLIUB4uaDRQNstzL/mIPuJANV 9Xg13RQikOKM61sGrEsqwkFNcEYfltBOtGsK7zkYj2cf3puyJ5eykf9ub+QH1faEe/mz dUzg== X-Gm-Message-State: AFqh2kom98YRYDF0eHMWDTisYc+II/E7iP6vDh1BDNf/mmITOT0SCvYe nx5Y8vucak5IEVQ21uZFV6w= X-Google-Smtp-Source: AMrXdXt7beT4QiPFE5mJktjpvop0RXCXl2JkSoxV5JPJmVDP+OojVEZhXyRjj+HLM0Q78WAZAizSiw== X-Received: by 2002:adf:a31e:0:b0:2be:5cff:5d00 with SMTP id c30-20020adfa31e000000b002be5cff5d00mr2463881wrb.70.1674235871083; Fri, 20 Jan 2023 09:31:11 -0800 (PST) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id l4-20020a05600012c400b002bbb2d43f65sm33297181wrx.14.2023.01.20.09.31.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 09:31:10 -0800 (PST) From: Thierry Reding To: David Airlie , Daniel Vetter , Thomas Zimmermann Cc: Jon Hunter , Robin Murphy , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 4/8] drm/simpledrm: Use struct iosys_map consistently Date: Fri, 20 Jan 2023 18:30:59 +0100 Message-Id: <20230120173103.4002342-5-thierry.reding@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120173103.4002342-1-thierry.reding@gmail.com> References: <20230120173103.4002342-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Thierry Reding The majority of the driver already uses struct iosys_map to encapsulate accesses to I/O remapped vs. system memory. Accesses via the screen base pointer still use __iomem annotations, which can lead to inconsistencies and conflicts with subsequent patches. Convert the screen base to a struct iosys_map as well for consistency and to avoid these issues. Reviewed-by: Thomas Zimmermann Signed-off-by: Thierry Reding --- Changes in v4: - rename screen variable to dst for consistency with other drivers - add Reviewed-by from Thomas drivers/gpu/drm/tiny/simpledrm.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index f658b99c796a..c1ed6dd426ec 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -208,7 +208,7 @@ struct simpledrm_device { unsigned int pitch; /* memory management */ - void __iomem *screen_base; + struct iosys_map screen_base; /* modesetting */ uint32_t formats[8]; @@ -473,15 +473,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; + struct iosys_map dst = sdev->screen_base; 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); + drm_fb_blit(&dst, &sdev->pitch, sdev->format->format, shadow_plane_state->data, + fb, &damage); } drm_dev_exit(idx); @@ -500,7 +500,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); } @@ -703,7 +703,8 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv, screen_base = devm_ioremap_wc(&pdev->dev, mem->start, resource_size(mem)); if (!screen_base) return ERR_PTR(-ENOMEM); - sdev->screen_base = screen_base; + + iosys_map_set_vaddr_iomem(&sdev->screen_base, screen_base); /* * Modesetting From patchwork Fri Jan 20 17:31:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1729758 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Fn5m8NLD; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Nz6430dHxz23gR for ; Sat, 21 Jan 2023 04:31:31 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230307AbjATRbZ (ORCPT ); Fri, 20 Jan 2023 12:31:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230226AbjATRbV (ORCPT ); Fri, 20 Jan 2023 12:31:21 -0500 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D0D6C9246; Fri, 20 Jan 2023 09:31:13 -0800 (PST) Received: by mail-wr1-x434.google.com with SMTP id r2so5472345wrv.7; Fri, 20 Jan 2023 09:31:13 -0800 (PST) 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=YOqgdpqToWA5S18UMLkfS63Q0Xl2lO+o2375eUlRgI8=; b=Fn5m8NLD2sIpmyLtR/VrUuV3fgp+Xy4nvnxpCrxirKNblkgociu5lzX1mVT78Fg3Tp DfI+ajWMD53UpjZFoCDaYzZIwgwh7oPwgyvJ3gLcttwV2rwWbU2XWP0cIpVs24ha79z0 Bbz8rcK3zpt7EFQZS7Cx6gbM9d5uVT2hcHqSYbolDVqMPwworHPQtKgza+lqCqjUY49P sWYaP6sYWSLnJ8kxgoU8LR4rDmearyXrkPK1DnCIYPRZP32qWKOO1BO4aCA64GKz70t3 6vMCOccfxd7C0UDVdZ7r6yEde6m0zaWtESJ4ba9AnTmsWbZNkIdo4HSFU6DNDSQqJBaN uTYA== 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=YOqgdpqToWA5S18UMLkfS63Q0Xl2lO+o2375eUlRgI8=; b=YAUo0oz/yDFep9VLkrVB+VY2k535IZAqNs3ZHeHzxbW6Ww23rlOJV3McD77oU0zVrO PGN3i19L7LMXJNpDW4WqqEvKhaPtvpE45tnX6n511uj1hZpbYGVoeNDad5+n+s0cnF3s 4W/8ckNEMg32t52S2FBnSBrfG9DbAbdgVilL4J6giWiybj+UmLDZ2kgy+bA0/QGA0zt6 IvDA95DTPl0NKvL5T6ew/C0JJyMy7qUySYQGcxRVecWFCLhVjGDGLHtggGF4oulP3Jmy mTzIfyqvmeIh8egqGsNUKfefwTYOVUVh5n75N4NhgkwKN+nJHcUtup1asJVwv9gzMLKD Kg7g== X-Gm-Message-State: AFqh2ko35/y8559EASHeMIr9Xjc9pQNlwS7sc+iYO/h1CWfHkl4N8160 3Yxz4pt/oAooU3BBoVRBWtM= X-Google-Smtp-Source: AMrXdXuPyUil8dJ4H1vXqJh1dFD3RGgBy+Yg2OV3pzxReYLYgMKMw5l6i3wq1EvjMMzZ84xqKCoJgQ== X-Received: by 2002:a05:6000:16ce:b0:2be:d04:3667 with SMTP id h14-20020a05600016ce00b002be0d043667mr16249463wrf.26.1674235871963; Fri, 20 Jan 2023 09:31:11 -0800 (PST) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id b11-20020a05600018ab00b002be2279f100sm11342632wri.96.2023.01.20.09.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 09:31:11 -0800 (PST) From: Thierry Reding To: David Airlie , Daniel Vetter , Thomas Zimmermann Cc: Jon Hunter , Robin Murphy , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 5/8] drm/simpledrm: Add support for system memory framebuffers Date: Fri, 20 Jan 2023 18:31:00 +0100 Message-Id: <20230120173103.4002342-6-thierry.reding@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120173103.4002342-1-thierry.reding@gmail.com> References: <20230120173103.4002342-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org 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. Reviewed-by: Thomas Zimmermann Signed-off-by: Thierry Reding --- Changes in v4: - rebase onto latest format helper changes - turn drm_info() into drm_dbg() - add Reviewed-by from Thomas Changes in v3: - simplify memory code and move back to simpledrm_device_create() - extract screen_base iosys_map fix into separate patch Changes in v2: - make screen base a struct iosys_map to avoid sparse warnings drivers/gpu/drm/tiny/simpledrm.c | 99 ++++++++++++++++++++++++-------- 1 file changed, 75 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index c1ed6dd426ec..2acc0eb32489 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -184,6 +185,31 @@ simplefb_get_format_of(struct drm_device *dev, struct device_node *of_node) return simplefb_get_validated_format(dev, format); } +static struct resource * +simplefb_get_memory_of(struct drm_device *dev, struct device_node *of_node) +{ + struct device_node *np; + struct resource *res; + int err; + + np = of_parse_phandle(of_node, "memory-region", 0); + if (!np) + return NULL; + + res = devm_kzalloc(dev->dev, sizeof(*res), GFP_KERNEL); + if (!res) + return ERR_PTR(-ENOMEM); + + err = of_address_to_resource(np, 0, res); + if (err) + return ERR_PTR(err); + + if (of_get_property(of_node, "reg", NULL)) + drm_warn(dev, "preferring \"memory-region\" over \"reg\" property\n"); + + return res; +} + /* * Simple Framebuffer device */ @@ -604,8 +630,7 @@ 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 resource *res, *mem = NULL; struct drm_plane *primary_plane; struct drm_crtc *crtc; struct drm_encoder *encoder; @@ -657,6 +682,9 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv, format = simplefb_get_format_of(dev, of_node); if (IS_ERR(format)) return ERR_CAST(format); + mem = simplefb_get_memory_of(dev, of_node); + if (IS_ERR(mem)) + return ERR_CAST(mem); } else { drm_err(dev, "no simplefb configuration found\n"); return ERR_PTR(-ENODEV); @@ -679,32 +707,55 @@ static struct simpledrm_device *simpledrm_device_create(struct drm_driver *drv, * Memory management */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return ERR_PTR(-EINVAL); + if (mem) { + void *screen_base; - 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); - return ERR_PTR(ret); - } + ret = devm_aperture_acquire_from_firmware(dev, mem->start, resource_size(mem)); + if (ret) { + drm_err(dev, "could not acquire memory range %pr: %d\n", mem, 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; - } + drm_dbg(dev, "using system memory framebuffer at %pr\n", mem); - screen_base = devm_ioremap_wc(&pdev->dev, mem->start, resource_size(mem)); - if (!screen_base) - return ERR_PTR(-ENOMEM); + screen_base = devm_memremap(dev->dev, mem->start, resource_size(mem), MEMREMAP_WC); + if (!screen_base) + return ERR_PTR(-ENOMEM); + + iosys_map_set_vaddr(&sdev->screen_base, screen_base); + } else { + void __iomem *screen_base; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return ERR_PTR(-EINVAL); - iosys_map_set_vaddr_iomem(&sdev->screen_base, screen_base); + ret = devm_aperture_acquire_from_firmware(dev, res->start, resource_size(res)); + if (ret) { + drm_err(dev, "could not acquire memory range %pr: %d\n", &res, ret); + return ERR_PTR(ret); + } + + drm_dbg(dev, "using I/O memory framebuffer at %pr\n", res); + + 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); + + iosys_map_set_vaddr_iomem(&sdev->screen_base, screen_base); + } /* * Modesetting From patchwork Fri Jan 20 17:31:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1729759 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=SEm/NiYw; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Nz6436Zhvz23gR for ; Sat, 21 Jan 2023 04:31:31 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230218AbjATRb0 (ORCPT ); Fri, 20 Jan 2023 12:31:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230252AbjATRbW (ORCPT ); Fri, 20 Jan 2023 12:31:22 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDD6AD05EB; Fri, 20 Jan 2023 09:31:14 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id iv8-20020a05600c548800b003db04a0a46bso1505168wmb.0; Fri, 20 Jan 2023 09:31:14 -0800 (PST) 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=78W7IXXHqgUZh6eEXtc3i7yBwKfecEIjh9aXPYe7GEA=; b=SEm/NiYw03IrJVONYxj8S6CudMwJbwnQfEfMv8WLW+xrm/hl+XwebXhF8UgZukrwEQ jEv1Rtvs+sMjog6lwpKrVMWAdjWu010pPjDx+WW4QkKGsTndKABZNJiJ+rvtclb6RMVN M1Sd0fFcCG00kXHifJF8Msn4iIDPEsq7nastKIeqsyv0hPcKNsJUj6I8Pc0PtlL9kLSV H0r0Ruqec02yVK5SNpbCM0LfHjQmulKCvAOHPRZrK5qjSfYMW3ZONTLefeEtpIivMyLe fmo36tXCle53zltWf++reGaIShW4IzLLaZjB0x77h/FLc4I1R7UI2hjG4VwdOEfRQ32u vAjA== 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=78W7IXXHqgUZh6eEXtc3i7yBwKfecEIjh9aXPYe7GEA=; b=pr/awh8mBMz8IdygW/mkNWkgFzMMFzcYlbx1sfqEN2lYj/w3bXkMPq78uK7Qj19kBc QMTvOGj0p/lFsC5G9xvHwORgIztEhtOuQvS6i8Qb4DgGODhSzli1flriXGc/yDcEm4MZ 5b8J36YUCubjQA8iAw5VMtl3iq4oM3zUDjksYBKLWYTNI6R3uwLO2ozBwvnkCZh5zkec CiBpgpK1jGBsCYr+P8foE0KN2bRlxoSb7xn8GIxxR9fWJKgFA0xAME4tlVb5/aHQcQ5l 66PxnMk8Rx/ZPsr29mFrSzeZumqkoUPquDCtu7i9GT07pOUCpw/yxRlYC7xui1/Hz7RR aSzQ== X-Gm-Message-State: AFqh2kq8ZDSmJvoJpUMBkJUYr207p6mBld7+7pQNWtsZIiLNk6l7cwlT K1OZsrjcx8p/ti/TZbeSpvjJWYzXdxs= X-Google-Smtp-Source: AMrXdXvzEgbI7Tp8Tw5Ds4T0d245b1GQLC4LVo8SfXduEZQri0QCyUWQpHLjGRzU3haJg1/JO1ieQA== X-Received: by 2002:a7b:cc14:0:b0:3da:50b0:e96a with SMTP id f20-20020a7bcc14000000b003da50b0e96amr15053406wmh.29.1674235872923; Fri, 20 Jan 2023 09:31:12 -0800 (PST) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id g10-20020a05600c310a00b003d99da8d30asm3193070wmo.46.2023.01.20.09.31.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 09:31:12 -0800 (PST) From: Thierry Reding To: David Airlie , Daniel Vetter , Thomas Zimmermann Cc: Jon Hunter , Robin Murphy , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 6/8] drm/format-helper: Support the AB24/XB24 formats Date: Fri, 20 Jan 2023 18:31:01 +0100 Message-Id: <20230120173103.4002342-7-thierry.reding@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120173103.4002342-1-thierry.reding@gmail.com> References: <20230120173103.4002342-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Thierry Reding Add a conversion helper for the AB24 and XB24 formats to use in drm_fb_blit(). Reviewed-by: Thomas Zimmermann Signed-off-by: Thierry Reding --- Changes in v4: - rebased on top of latest drm-format-helper rework, add back AB24 support - add Reviewed-by from Thomas Changes in v3: - rebase onto latest drm-next Changes in v2: - support XB24 format instead of AB24 drivers/gpu/drm/drm_format_helper.c | 66 +++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/drivers/gpu/drm/drm_format_helper.c b/drivers/gpu/drm/drm_format_helper.c index 994f8fb71f45..f93a4efcee90 100644 --- a/drivers/gpu/drm/drm_format_helper.c +++ b/drivers/gpu/drm/drm_format_helper.c @@ -649,6 +649,66 @@ void drm_fb_xrgb8888_to_argb8888(struct iosys_map *dst, const unsigned int *dst_ } EXPORT_SYMBOL(drm_fb_xrgb8888_to_argb8888); +static void drm_fb_xrgb8888_to_abgr8888_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 | + GENMASK(31, 24); /* fill alpha bits */ + *dbuf32++ = cpu_to_le32(pix); + } +} + +static void drm_fb_xrgb8888_to_abgr8888(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_abgr8888_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 | + ((pix & 0xff000000) >> 24) << 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; @@ -868,6 +928,12 @@ int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t d } else if (dst_format == DRM_FORMAT_ARGB8888) { drm_fb_xrgb8888_to_argb8888(dst, dst_pitch, src, fb, clip); return 0; + } else if (dst_format == DRM_FORMAT_XBGR8888) { + drm_fb_xrgb8888_to_xbgr8888(dst, dst_pitch, src, fb, clip); + return 0; + } else if (dst_format == DRM_FORMAT_ABGR8888) { + drm_fb_xrgb8888_to_abgr8888(dst, dst_pitch, src, fb, clip); + return 0; } else if (dst_format == DRM_FORMAT_XRGB2101010) { drm_fb_xrgb8888_to_xrgb2101010(dst, dst_pitch, src, fb, clip); return 0; From patchwork Fri Jan 20 17:31:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1729760 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=ZraDywh9; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Nz6443lgGz23hD for ; Sat, 21 Jan 2023 04:31:32 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230336AbjATRba (ORCPT ); Fri, 20 Jan 2023 12:31:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230217AbjATRbX (ORCPT ); Fri, 20 Jan 2023 12:31:23 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6950AC63BE; Fri, 20 Jan 2023 09:31:15 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id h16so5455079wrz.12; Fri, 20 Jan 2023 09:31:15 -0800 (PST) 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=nZwFqfU6/YlqXS0KBaaVZd4JCQGAwP0xqxEd37sKS24=; b=ZraDywh9d7ehyDd9uKX3TzphmkT+E5LNT1jeGuMQiAwElzDgSj32j/nA8VVs53vtxb DIs82zif+vzWKP7v+s/OuPziFrvvXXt5szsSjD4j8FsDTLrZ9AHKuRco4wHJCbA4+Bw3 S0b00m67OTdztpqXchCIY5nc5ds0HV7jYmvtNersWalRGSREGllMl9GGvvgboBCuXGg5 kWld85tqFRFu2sNSSKSG1wnTGsiDFSRSpivVwHyTkp1TLGxBbim8VlO/2ecc745x+bnu sBusHCcwNWB7nLCGGeS+nvF0ciOEfBkGaw+Vvxbgjy302bRCbIpJk/dEigJ2Y5zKCAIM z7Ig== 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=nZwFqfU6/YlqXS0KBaaVZd4JCQGAwP0xqxEd37sKS24=; b=OdtJubQY7stBt26Mbq0vdYJ4QIvLqOhLtbjjKRIdvGSubH43kBI3ji26bdeco3wErK Y7acmfTMbv4q1XjkHYP0fUPuT7hRRmOYyeahQUv0vilwp9Akdd0r9NW/gRgmIyGDYfKR OPY3P2NkJp+/cqIOZWirD+2Z8DDsTJLQzUq4Luw7eNDNZTduwP79EIFcFGrJycuuTSzw UhcBHo3W0msL26j2lYahw43pXCFjzAmPfOUX+b1zJIbtpvT5aILbyrNj3aXEHuVfXOJC xrPR79H8MQwoGfSDeFwBLfLVRmCmWG8aIipwNNLPhoqV4iS1ij8N3/roAFgUL8NYTeWT ySFA== X-Gm-Message-State: AFqh2kqLJeGDy4hY0DpUwFrHVY4HWPztUHNjQRT8rg59dgZXmyei3l8l bHkp5S4JSAqRdBp7aEJgj8bxo0BabdI= X-Google-Smtp-Source: AMrXdXvjz/KDGIlKl769j7Os1enZRYBV2a7KiNGRFtoo8j34hnu9C0I3CKnEFtbtc2qSZ9NCcV11hg== X-Received: by 2002:adf:ec88:0:b0:256:ff7d:2346 with SMTP id z8-20020adfec88000000b00256ff7d2346mr13712276wrn.51.1674235873809; Fri, 20 Jan 2023 09:31:13 -0800 (PST) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id g11-20020a5d488b000000b002bc7e5a1171sm29510955wrq.116.2023.01.20.09.31.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 09:31:13 -0800 (PST) From: Thierry Reding To: David Airlie , Daniel Vetter , Thomas Zimmermann Cc: Jon Hunter , Robin Murphy , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 7/8] drm/simpledrm: Support the XB24/AB24 format Date: Fri, 20 Jan 2023 18:31:02 +0100 Message-Id: <20230120173103.4002342-8-thierry.reding@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120173103.4002342-1-thierry.reding@gmail.com> References: <20230120173103.4002342-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org 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. Signed-off-by: Thierry Reding Reviewed-by: Thomas Zimmermann --- Changes in v4: - rebase on top of latest drm-format-helper rework Changes in v2: - treat AB24 as XB24 and support both at the same time include/linux/platform_data/simplefb.h | 1 + 1 file changed, 1 insertion(+) 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 Jan 20 17:31:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1729761 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=HxB+Fql7; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Nz6455D06z23gR for ; Sat, 21 Jan 2023 04:31:33 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230340AbjATRbc (ORCPT ); Fri, 20 Jan 2023 12:31:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230222AbjATRbY (ORCPT ); Fri, 20 Jan 2023 12:31:24 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56C4ADBD8; Fri, 20 Jan 2023 09:31:16 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id r9so5484964wrw.4; Fri, 20 Jan 2023 09:31:16 -0800 (PST) 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=kXw2j+x/kse2yPakxaPEW51TbrZ6J1HBieALff4c+rE=; b=HxB+Fql78ZELN8ESqJE0nr2QjjtSelDWlhBG63jeCWznR746a2arSU5WR3Dewrng8J hpKPCB/+XGVCnjaTSb1hBPnnCks1ywfdHU+gPv3prNvf2m9uSypF49PArI3DIbh+dhY7 4nVMQ4nvctMibIveBehx3EiUs32eAwRfj6lK57zOYWSAtKFH4lWEpBYZGqeGbe9KSThS 04EFH383Mi+M8yIjSXIltHW3DxMU4XvnnpWXjQ0sSXERqs9JfRb2KWddyQcV84rKHvjs bMNZ0JF7OgQ40n613YIyLOzpeSBfnd7bwq5wCtQ1EbPLfPanVxxa+hjUM/JnY9bEAgX/ bhoA== 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=kXw2j+x/kse2yPakxaPEW51TbrZ6J1HBieALff4c+rE=; b=T5Mf6zdstogWfCFhB85vhzecHRi/Ar90oI2+U1wAEDsm1fbedkEma4gERBT4ZyrLal 3VKNmC3GoHq2P1XxtXAN8VMtRj25K+S3oDtWPJO8f0RZFJZbUYoC7Uoc1rOEwjOOP8om Rqlan0kollQnvNPETCT0/2mXBm9j1y0XrIlaHx9ps1A7nm9hci2djU04pNP4oA11mOtz 3Qz9KJ6L5B4vpwPf/4Fkjugd+RBFIXMutgcxat0ykdsyKZEryxSVe1qGFF992k6WoE9K VFrEO9TbGw5atCUl2MGC5AovK26GlBhmAgYvACVOmOHbhwGnY7AvGCw0lh/esxXt+BBs XSjA== X-Gm-Message-State: AFqh2koO1TDv/2Y2mkT2c/s3c8ypRWn/2o8wLbHjerpQJDyWOeHoc86y Cnr+igC7mvmCpAsyt794pcU= X-Google-Smtp-Source: AMrXdXsb64RJIKDpmJTAga1GYyceTGETa/aMFyd6rGzsds7lxOLOWxwF53TLNJ7Cy29mMswL5rWqhA== X-Received: by 2002:adf:ce90:0:b0:2bb:edc7:504 with SMTP id r16-20020adfce90000000b002bbedc70504mr14353213wrn.26.1674235874883; Fri, 20 Jan 2023 09:31:14 -0800 (PST) Received: from localhost (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id z12-20020adfd0cc000000b002bdff778d87sm13470524wrh.34.2023.01.20.09.31.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 09:31:14 -0800 (PST) From: Thierry Reding To: David Airlie , Daniel Vetter , Thomas Zimmermann Cc: Jon Hunter , Robin Murphy , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 8/8] arm64: tegra: Add simple framebuffer on Jetson Xavier NX Date: Fri, 20 Jan 2023 18:31:03 +0100 Message-Id: <20230120173103.4002342-9-thierry.reding@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120173103.4002342-1-thierry.reding@gmail.com> References: <20230120173103.4002342-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org 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 | 43 +++++++++++++++++++ arch/arm64/boot/dts/nvidia/tegra194.dtsi | 2 +- 2 files changed, 44 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..85b4aaa2ad4e 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,47 @@ / { 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 = "x8b8g8r8"; + }; + }; + + 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>; + }; + }; + + bus@0 { + host1x@13e00000 { + display-hub@15200000 { + display@15200000 { + memory-region = <&fb>; + }; + }; + }; + }; }; diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi index 5ce2650128b1..e0ce54eae17d 100644 --- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi @@ -1975,7 +1975,7 @@ display-hub@15200000 { #size-cells = <2>; ranges = <0x0 0x15200000 0x0 0x15200000 0x0 0x40000>; - display@15200000 { + dc0: display@15200000 { compatible = "nvidia,tegra194-dc"; reg = <0x0 0x15200000 0x0 0x10000>; interrupts = ;