From patchwork Thu Nov 17 18:40:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1705264 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=VkGk+0U6; 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 4NCpdd1yBZz23mL for ; Fri, 18 Nov 2022 05:40:53 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234461AbiKQSkt (ORCPT ); Thu, 17 Nov 2022 13:40:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235064AbiKQSks (ORCPT ); Thu, 17 Nov 2022 13:40:48 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E107F7FF1B; Thu, 17 Nov 2022 10:40:47 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id n21so7270442ejb.9; Thu, 17 Nov 2022 10:40:47 -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=C1Y534FPxsILKuYr941GBaBsx9fst1FUuLv6sIi19Vk=; b=VkGk+0U6cBBKtd2N73D6xUj20mWTYj9z2tO2H7ULxskuzctUAZqtq+JcJL2RtdlPsC lQ0ap0XqRcig/75B4gx/g7uWtUYLJbrMMa5+nJXa6AjOpVz1A1RDtSrEMRkKTP2KocYZ qhxM1BlzZuIjImn045YYAj7aTqzJ2KnQuGyhMx8UZxzLEP33xjzJP6Y7E8Mh5093BEMN dzYtBOd4EGkOgMofNN9JyHuBhAMVNgRJ523p57BbfezDEwibZxv7WvVc21VgMEFIXUyG HJj9KrknPq/JG0NRRhbJgG8rRKu5lOyFP3GfGaKI0uHa1fdZQHdtaAin1901+luOjktW 4H2Q== 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=C1Y534FPxsILKuYr941GBaBsx9fst1FUuLv6sIi19Vk=; b=ZbHitENNlOmkIXof7e9a3oUQ0DwYMX1WPqDy3NfGQZrWCeeO2ZHYiH2EIx31aCoYFW kKnS0W5UnnGGYQi9r2fBHMF5zkMae1TE4vZ4E5CP3oiDQ5Nu47dcB7SXZfxIlvMp+g25 aGb7VppJWvyapJCimHixg+N1B+M//vjXK0sO2GjUv7oFZeeiD/rMuHsGDMvPJQp9IED7 HVn6LmHAYxEjzM/k+kznQbyGxrAn1ZdoFt+kSA52nxTpGecoP8qrrY+wCZFxQIYAevvV E46izSXCB6d4XHPGySRZu5DjpCJr73iogFAG9sRnsPhaKAqW6ZY6EkbzJgoEBpNnl7PK lTKA== X-Gm-Message-State: ANoB5pm7XsqgGjLUT+v2zZe7zeyVne3lJDZXmno2m58nz9o46i6Iqekj KSQvv4Ouf3p3WHnL0MWbbtQ= X-Google-Smtp-Source: AA0mqf4gUTPwjVT7ASJewg8oNP3zMRDM6ATE7vRgNDo94NVRs0c0OcvNjf3/6CDgJqmkO5mUA7OA2w== X-Received: by 2002:a17:907:98ea:b0:7ae:c1af:89af with SMTP id ke10-20020a17090798ea00b007aec1af89afmr3133088ejc.550.1668710446390; Thu, 17 Nov 2022 10:40:46 -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 p9-20020a170906604900b007b2a58e31dasm700772ejj.145.2022.11.17.10.40.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 10:40:45 -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 v3 1/8] dt-bindings: display: simple-framebuffer: Support system memory framebuffers Date: Thu, 17 Nov 2022 19:40:32 +0100 Message-Id: <20221117184039.2291937-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221117184039.2291937-1-thierry.reding@gmail.com> References: <20221117184039.2291937-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 Thu Nov 17 18:40:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1705266 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=N7v2MmJA; 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 4NCpdf1QQCz23mL for ; Fri, 18 Nov 2022 05:40:54 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240121AbiKQSkv (ORCPT ); Thu, 17 Nov 2022 13:40:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235064AbiKQSku (ORCPT ); Thu, 17 Nov 2022 13:40:50 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB6227FF33; Thu, 17 Nov 2022 10:40:49 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id a5so3830607edb.11; Thu, 17 Nov 2022 10:40:49 -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=kGgALic+DS30S9ojwPdceibK9s2MAtsj8xO33zz+Z+0=; b=N7v2MmJAOX3Kmxwd0jdOood/vNl6v21crSGC2mYfyU1BFBOaMCdfIqjKeYPA3RE1+q uPu3PDYPkhadmdoQuUDlVvIw1eOFBirFTHLq2MsfL0JjxvusJNCc2dvn2174kPre+Uqb tJxUq9Ce0hqAR7fkDjEZGmUtfVLx3JUnzl8iI9PbDY7NcJ7dmtHlpmKXDjq0xcDvzENc QOtOTMpPccGzZ6ScUnyNMLls09dACDKTSEJjifFV8x3MPx6CJOPx3BX8OBnZwZ1E8fp1 YWHcB97GAXh9WAAWNCTpKl513LQkRJzatUZ+VTf+kPwb28BnexS72xWZkFgmPG0K6Iax tXBw== 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=kGgALic+DS30S9ojwPdceibK9s2MAtsj8xO33zz+Z+0=; b=yk4nssyF9cY1f7FqeyU+XRhMfZq7HC8UbXvnLbG4plxdFdh5tkFlz9CaFQdEDWvmU3 MC7wYzqq0oEY4tvz4P3WWbb1IH3Q13pqaXH1KSDpuE7zD0aX3juK02sNLp2DY3Zq4cQT z4cHWbLUE0dBeV+1VLEs8NXyhky2G2p2BkXGZp0fzMGLzMHC6wPbqh80cXisQdfhmnRg Fr0DCJkHr+FpJ3/VnB7+y4Z4rGJ5uCY9oH5CN8YpHfF4JzSWAirEhrg0+d0ftcFZYIJq 3Lmq5kBi79G+WiS96Y1Q05iT7V0TnFcoGSp9OFsOH8SQZIESSbQzQiCJT6pVF+/D4g1z DHAg== X-Gm-Message-State: ANoB5pkb/A4ec+V/cICvEvkAzTdYd7VbBVjHTtPJXQeWjpTHPf37ydEM 80Qs4YuYJUIrAn6EUB8YzbnWbUU4ANQ= X-Google-Smtp-Source: AA0mqf6T53dT7P1u6RpvE4BnHTqtPV7QDbZHfM/zbVoHXOKBSCvcYjV8zXOiBCE4ZTH8FiwEafnEBQ== X-Received: by 2002:a50:9fa7:0:b0:469:4e6:344f with SMTP id c36-20020a509fa7000000b0046904e6344fmr396962edf.226.1668710448409; Thu, 17 Nov 2022 10:40:48 -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 ew20-20020a170907951400b0073d84a321c8sm680132ejc.166.2022.11.17.10.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 10:40:47 -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 v3 2/8] dt-bindings: display: simple-framebuffer: Document 32-bit BGR format Date: Thu, 17 Nov 2022 19:40:33 +0100 Message-Id: <20221117184039.2291937-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221117184039.2291937-1-thierry.reding@gmail.com> References: <20221117184039.2291937-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 Thu Nov 17 18:40:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1705269 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=A71LMLct; 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 4NCpdg70zPz23mV for ; Fri, 18 Nov 2022 05:40:55 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240509AbiKQSkx (ORCPT ); Thu, 17 Nov 2022 13:40:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235064AbiKQSkw (ORCPT ); Thu, 17 Nov 2022 13:40:52 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 564587FF33; Thu, 17 Nov 2022 10:40:51 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id i21so3849676edj.10; Thu, 17 Nov 2022 10:40:51 -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=oWVJf0S9kqs87h9L8NvjpGJOac1XzRow1tUHd0R/FGA=; b=A71LMLctjhFiGB+nzlkmn8+VI54b2dfeC6yJdUT/jMVgQ9Bhm3+spI29djFRnYJG+t Jrs0YL7rFykG6AsiuJLGbVz0MCUVGrvxsgqH2CphFUZm1rzNZss7Fy6IrCK1749DnPhP cGD0aU4PCo0oYeMThSZw3FMjv3gQrIlSBEE2ehNkGJ3SDOcNW6EZqSepWQRi/lYlSxWW YviuzuzCw9pDq48d9B3bLNfLX6Q6+LsTAIKBYqi3D5Zy/1mxNJqIdqg3hcmh6ohpRL0X gdp1MXvzqoIhiY2i3GjweP6APYPTXVnQUuk+vopyhfIqSvoCNYRfrlq1FgNOddTjlaWD Oebg== 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=oWVJf0S9kqs87h9L8NvjpGJOac1XzRow1tUHd0R/FGA=; b=AhE1GKdGKicPMGC4JdDLw6iZcWEaSCh9WCVrVVCDhuXjTZLxOCtc+wpJbtwNMtkUqP gjHoCXKhfHsJwgaFgID2OlQq7pnwk/SCqxfdsWscHZ7lG7RY1ZpJ855xTKnOjtlE2J2Y Xyny2HN6+K0mUp1wvVLq46sd1lDTgSE073TVCJTjnL1AAE0o/+1s01AOhfRDVMOi92Hp mvXYoh8xOFurMpDusdiOmZehfOfP2NK9RJPiithk8djTHpKfEtRjPJR/1vWZ3jtd8trM f+C8XxqYui/U4HuNbnhpXi3vhyh2qd5KxRyEkNM130R9q2RhHzqP5zo4mMbO3jKWBA8N sNNA== X-Gm-Message-State: ANoB5pmkij16pzwS9GLgr7VUjz03m08Fp8MdrQmQDu1Tl2j+wy6jTkPH fC5jJ3ac/3nUOm7TNK6mr78= X-Google-Smtp-Source: AA0mqf4ZN5qTTfZsCmLUrTJuTNa2VWaQn9Ue2FfHJHLlMaOUGDKOLjB1jb8zyRCSe523ljqglGha9w== X-Received: by 2002:aa7:dd45:0:b0:45a:3c66:b0e4 with SMTP id o5-20020aa7dd45000000b0045a3c66b0e4mr3373267edw.33.1668710449770; Thu, 17 Nov 2022 10:40:49 -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 u22-20020aa7d896000000b00459f4974128sm874496edq.50.2022.11.17.10.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 10:40:49 -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 v3 3/8] dt-bindings: reserved-memory: Support framebuffer reserved memory Date: Thu, 17 Nov 2022 19:40:34 +0100 Message-Id: <20221117184039.2291937-4-thierry.reding@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221117184039.2291937-1-thierry.reding@gmail.com> References: <20221117184039.2291937-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 Thu Nov 17 18:40:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1705270 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=E90mIeGW; 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 4NCpdh39yqz23mL for ; Fri, 18 Nov 2022 05:40:56 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240554AbiKQSky (ORCPT ); Thu, 17 Nov 2022 13:40:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235064AbiKQSkx (ORCPT ); Thu, 17 Nov 2022 13:40:53 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3E6F7DEFF; Thu, 17 Nov 2022 10:40:52 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id f27so7379996eje.1; Thu, 17 Nov 2022 10:40:52 -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=pUtZmWalnQKWM5ERQ4dIqTHxh9HaSKYh4Nk5lsYsOGo=; b=E90mIeGWkAHZT8kjF/dtZAkCNw1ExinoGrCn05GM8RvygqrPUsmI5MEkEHBqezbhGM TAw/4Tz0ucODj2MstSnfQfAsOYGcLWojIFb0rNvH5FTjqYFx5Y8nyJGgPWkDxmNP88fP xRZ2nofJ27QVOuaPgx2Z2WJuyHd3G1F9zeWGJB+AOyrC3RuV1d0wHgOKe46rbqP+dsGT DCTGF1z23v3J6bX2nbl8JL6r9pRANpgQSQngl4CPPNvdX7/sH26H1Vq/BhWNqzbL6I/s PMkVidGPc7LAkl7at8N9CktkJ/8IBbGK8d33ySrvC96vTBYWDqe/OYaeO5LZrzHh4GYd IpWA== 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=pUtZmWalnQKWM5ERQ4dIqTHxh9HaSKYh4Nk5lsYsOGo=; b=xKx/ebX1PS27JfUmgcIz3S+CxI14gmOZNmXX0RTg8Kx4F3G2kM2mzj6DsSLJh+zAXp L9NE08emW7Y58HwpX4i5KqYgU0R6KmdiAgtd/vw0N84UFJkX97oQncUQ5eI6VPEhKCWi 17iUik04FDwn6br4aLcLru51PYbqCmy5Ggw7lHTCFTx6Z3/JtJZttObepnzVHeZEQ+/z sIMM6a7i1duCikjDR8hYwTi+qjrBtTuLcWFM7cBZQ+piejR6izCXIWJmrZMn7hk/+kTB Sq4u+UYbAhOq+k40nD0O2FA5met2qRvoLzJeCjvFIoeHc9ny64R1Z1j8Aq2rtFoquPL3 e4Ig== X-Gm-Message-State: ANoB5pn7X9UDvO2mFKXu09ioiLS3MVhsZKD7UaRALGG1fjGI+gCcMXDo Vtks+8DPucpMUauhsQDGt9qzVopnqc0= X-Google-Smtp-Source: AA0mqf5xwnlYcLA9SvYwuazA2YElRV37/cwpxPvOcWKJv7jhRNjkIHWvKvvQSEXIBAIBFpyaAn1mOQ== X-Received: by 2002:a17:906:a2d8:b0:7ad:fa6c:5e69 with SMTP id by24-20020a170906a2d800b007adfa6c5e69mr3179354ejb.199.1668710451323; Thu, 17 Nov 2022 10:40:51 -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 15-20020a170906310f00b0078cf8a743d6sm684681ejx.100.2022.11.17.10.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 10:40:50 -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 v3 4/8] drm/simpledrm: Use struct iosys_map consistently Date: Thu, 17 Nov 2022 19:40:35 +0100 Message-Id: <20221117184039.2291937-5-thierry.reding@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221117184039.2291937-1-thierry.reding@gmail.com> References: <20221117184039.2291937-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. Signed-off-by: Thierry Reding Reviewed-by: Thomas Zimmermann --- Changes in v3: - properly reinitialize struct iosys_map to avoid bogus increments drivers/gpu/drm/tiny/simpledrm.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index 162eb44dcba8..3673a42e4bf4 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]; @@ -492,15 +492,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 screen = 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); + iosys_map_incr(&screen, drm_fb_clip_offset(sdev->pitch, sdev->format, &dst_clip)); + drm_fb_blit(&screen, &sdev->pitch, sdev->format->format, shadow_plane_state->data, + fb, &damage); } drm_dev_exit(idx); @@ -519,7 +519,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); } @@ -722,7 +722,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 Thu Nov 17 18:40:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1705271 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=Z2oFSHjx; 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 4NCpdj3sxZz23mL for ; Fri, 18 Nov 2022 05:40:57 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240556AbiKQSk4 (ORCPT ); Thu, 17 Nov 2022 13:40:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235064AbiKQSkz (ORCPT ); Thu, 17 Nov 2022 13:40:55 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 780AC8517D; Thu, 17 Nov 2022 10:40:54 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id x102so3938381ede.0; Thu, 17 Nov 2022 10:40:54 -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=y9ybMF44ncbpQoXYyiY7lvPsBZDR1qvcdQC2snJ8L7M=; b=Z2oFSHjxMyTLeBJdW63lx3g14aObCExggZ2/c0n10fJznrPFxEocVHwSt6iy9bwPe8 S0wHqBzjKK+YGv3M1MJ3CHLOYxsHllNyMlkWRHEARhHGBgkLPsj1qJsUq9u7p+pmSmfR cp2wZS2Kqmvhw+DJtpHVpk98VTrwWpAmVN60Vr2nJiVE7cDzv1cww0whTYNYnXXuBfrZ aBT5j3Xj2e/Vq4RYmvOGJEbxvJEp46/tZbnLZ1giRz+1tL+H88YSrvnKZi5ReJriXDUR HctMRqVN6IYZcWvnKQZbHdlulc3RfpQ+gflyr2n1uet4IPkmHp6RWoyN49UXrKEVT9PV bW3Q== 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=y9ybMF44ncbpQoXYyiY7lvPsBZDR1qvcdQC2snJ8L7M=; b=nXEMhL161gkNQ3vgJkIj/9CAiGkLqStxxlnIwOywa2zYafCEckqAPpMuSzt+RnXYfS 04icFnJyKdd4gjdXz0hLs1E/YVC4Jk2az5RBB1e5t3XhZeaokW7ZRnQt0ZC1ARuIRsk8 6hBuMXPXv3mt2vhHYfFWmQ9yiFYEEE+OnanIeXAMRC8PAcRnxR14U6r8/UL6MYSzm4e0 FcZ/rojFCvGktHblEIWI1Bs0sv6wF4PjF2LIHoKP/CvjIcr2MoZ47sioyalvMH2hHKhL rkbO1Jq6ZdfsD0Sj3SESDol3SqV1c8FFZZuqxigYWfMM7YNrteBsstomNZRFjNsTJJMx vftQ== X-Gm-Message-State: ANoB5pm6WfKxZeVxzVAbzhqN9dS0q1aX7cSlHzGiXuH8bLDyrvGoIhKo vCmBFvF534WTTc/wtZkQqCM= X-Google-Smtp-Source: AA0mqf4gKS6SyACL8go73wSupq8QD6MR3unyxjPLzc47n0ptJniRvbm/hsRn7J9GaGm2Uo5dOLADaw== X-Received: by 2002:aa7:cb8d:0:b0:467:bc1f:ca16 with SMTP id r13-20020aa7cb8d000000b00467bc1fca16mr3339753edt.269.1668710452922; Thu, 17 Nov 2022 10:40:52 -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 kw1-20020a170907770100b0078246b1360fsm700529ejc.131.2022.11.17.10.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 10:40:51 -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 v3 5/8] drm/simpledrm: Add support for system memory framebuffers Date: Thu, 17 Nov 2022 19:40:36 +0100 Message-Id: <20221117184039.2291937-6-thierry.reding@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221117184039.2291937-1-thierry.reding@gmail.com> References: <20221117184039.2291937-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. Signed-off-by: Thierry Reding Reviewed-by: Thomas Zimmermann --- 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 3673a42e4bf4..7f39bc58da52 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 */ @@ -623,8 +649,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; @@ -676,6 +701,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); @@ -698,32 +726,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_info(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_WB); + 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_info(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 Thu Nov 17 18:40:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1705272 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=VfM3fZj3; 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 4NCpdl2lSsz23mL for ; Fri, 18 Nov 2022 05:40:59 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240594AbiKQSk6 (ORCPT ); Thu, 17 Nov 2022 13:40:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235064AbiKQSk5 (ORCPT ); Thu, 17 Nov 2022 13:40:57 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D57B86A44; Thu, 17 Nov 2022 10:40:56 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id v17so3845393edc.8; Thu, 17 Nov 2022 10:40:56 -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=8GRAXf35/9spkghPeO95WIhuP6nXSVmFKXeRYmNMois=; b=VfM3fZj30J8Y3lxGELBmZekOwuOm+C85b2/WhmB+VL/comM5ERPj0Ss1oErFBEvW0m dmqF4IwE8Dh8o82/6yGHriLAVJN9ypue+ym9GLR9d0wyhNiuMDB0mZuXUNmWOndArJLM Z0e/j6uFBeXJNWuuOymbqFt5GGu7vWKsp95LrNwR7lxsHZy6nq9N/duc8kk6nfdgHdtJ mAo5hvE9gw3y7JHysNZEcgaM32/DfAfow8PpvVPSLeVN9YdjbSTnm9s5YsI4s10hX67S oTJn8WebkCb448knh7LId7+hM19J0yIvHLTY5GsEa1zjE9GZK4UhhfjW+hJKcInE63hA Oy8A== 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=8GRAXf35/9spkghPeO95WIhuP6nXSVmFKXeRYmNMois=; b=sBmIyA3Kve/BVFCWDkBMGoS4dRvguP02rGx2pBMnlD/c+uGZWvvcpydxOlpEg4/Ngj E2WhJHYciZeSWfhUPHivSauTQy/GrKAGP40SH0GPHOgdOic2XQLV7LDQV61KviC6ZlNN gyKzJXwRk2DHhTIYoCfj4Bs32egTG6gKi9APuduBsRKGIQX6EjPExNlYlxoK3wodHGZm E9bdXeuV+JxjYiPGBEke1rZHW3KPXTANii+Me6534uMZJA1N73wK62ceSagyK5nEZ0dF iAxci5vpK8Rx3prx1ifrgQk5fuhD6X8CUcCSv+TT9UkxQyJBX3cgWhLkVM/RFOT96lvq WWlw== X-Gm-Message-State: ANoB5plCTbq2nkT/z5bzm5IC2osWxffgJHgows7DOIXR0RPjqJaZ3Y7L BtJpxO2WO2iD1GJnGaHJmLs= X-Google-Smtp-Source: AA0mqf6F4ZxtEVFJDiBDlqw0CRtxE45eikuyc0FSJF9QizBo31wexjxks18m46tF2gcdPlzxpFnOgQ== X-Received: by 2002:aa7:d803:0:b0:467:f948:6df4 with SMTP id v3-20020aa7d803000000b00467f9486df4mr3213754edq.217.1668710454692; Thu, 17 Nov 2022 10:40:54 -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 10-20020a170906308a00b00782fbb7f5f7sm690526ejv.113.2022.11.17.10.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 10:40:53 -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 v3 6/8] drm/format-helper: Support the XB24 format Date: Thu, 17 Nov 2022 19:40:37 +0100 Message-Id: <20221117184039.2291937-7-thierry.reding@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221117184039.2291937-1-thierry.reding@gmail.com> References: <20221117184039.2291937-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 XB24 format to use in drm_fb_blit(). Signed-off-by: Thierry Reding Reviewed-by: Thomas Zimmermann --- Changes in v3: - rebase onto latest drm-next Changes in v2: - support XB24 format instead of AB24 drivers/gpu/drm/drm_format_helper.c | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/drivers/gpu/drm/drm_format_helper.c b/drivers/gpu/drm/drm_format_helper.c index 74ff33c2ddaa..c8764cc61e87 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) @@ -678,6 +710,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); @@ -820,6 +857,8 @@ static bool is_listed_fourcc(const uint32_t *fourccs, size_t nfourccs, uint32_t static const uint32_t conv_from_xrgb8888[] = { DRM_FORMAT_XRGB8888, DRM_FORMAT_ARGB8888, + DRM_FORMAT_ABGR8888, + DRM_FORMAT_XBGR8888, DRM_FORMAT_XRGB2101010, DRM_FORMAT_ARGB2101010, DRM_FORMAT_RGB565, From patchwork Thu Nov 17 18:40:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1705273 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=PN2H4Xym; 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 4NCpdm2X0Nz23mL for ; Fri, 18 Nov 2022 05:41:00 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234569AbiKQSk7 (ORCPT ); Thu, 17 Nov 2022 13:40:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240548AbiKQSk5 (ORCPT ); Thu, 17 Nov 2022 13:40:57 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ED577FF1B; Thu, 17 Nov 2022 10:40:56 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id a5so3831098edb.11; Thu, 17 Nov 2022 10:40:56 -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=KBWaH/vKohLUzSe6QLXlh4Mx7QgSFZjyZMz+JYtKxxI=; b=PN2H4XymqqWem8S5cTcjWj54sE7zShRhQiFrsQNFZmaqE4nDDPF+zx1c/CGLFv2OSy 3Gswa2GOYRqjT76c748Qwv9+8xkpJ8/cRmmME4jfzEt9cT5e9FDF436nO11EQ6QzGdih KLWGcIHS8regNMFEAkWFvgEmOdmqBduf/vLBjRP+LlMPBmM4im0dIXJv8dhxbFF82WID rvhXXAMbBcbNEfnREGGf636/VVz8o0mi4XCKYk6sioZWhM8v3XxqNe2zU7H/m+j/bqqR pmP9S9PfENRTyn99XM6bP4pJf+D54gYGqXBRWRd08QTQRk6cCJzD/adaeTiP2gsR5K9b Wb3g== 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=KBWaH/vKohLUzSe6QLXlh4Mx7QgSFZjyZMz+JYtKxxI=; b=0jjSR91gJf03BZemvHefrvWooAoipXR82H8mzKV55BstQV7HgV6meb3pffKpfDgv0K 9OiQd4Z4wYdDtLxY/kAETIoz9fWCEOGO/NBPICdw9pwjFLFhzb8tC/Y9AJ1XShXOzy9e KADX5Wux2zCVQRlYQm1RxD2Zw/TdVtxsgWqjAc6TF9G15OAz+HEd2jAaex2D6p5aXBU6 H6YsayCTn8+AWqvAufv79BguaUC1/U9ilNs16LgdUeVTrz619gax06upo5HmT9EKzOz5 wIil1s19+w+4apLadu14KPY6uW/KmANkuaANbMbSo/x7jpcdS2QeHB9XhLB3DR1EJhLv qhaA== X-Gm-Message-State: ANoB5pmiSjq4F7QqLZDlZWEs/DWIHMVjBELL6U9GmdxwiCpMULRc/bpc pgvpy1Ozgmqf+Ksyc0HfD20= X-Google-Smtp-Source: AA0mqf77/+b+VHZt2iTNuQJF8SBFQKPCJUFtQbHHRL8xCl1iwGBfNl9qWYmvSkfDDyQ+w91qlTVhiQ== X-Received: by 2002:a05:6402:5412:b0:460:e19c:15a3 with SMTP id ev18-20020a056402541200b00460e19c15a3mr3432932edb.252.1668710456001; Thu, 17 Nov 2022 10:40:56 -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 8-20020a170906310800b007aee7ca1199sm730053ejx.10.2022.11.17.10.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 10:40:55 -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 v3 7/8] drm/simpledrm: Support the XB24/AB24 format Date: Thu, 17 Nov 2022 19:40:38 +0100 Message-Id: <20221117184039.2291937-8-thierry.reding@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221117184039.2291937-1-thierry.reding@gmail.com> References: <20221117184039.2291937-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 --- Changes in v2: - treat AB24 as XB24 and support both at the same time 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 7f39bc58da52..ba1c2057fc65 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -483,6 +483,8 @@ static int simpledrm_device_init_regulators(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 Thu Nov 17 18:40:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1705274 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=aVpjZjUm; 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 4NCpdr16dHz23mL for ; Fri, 18 Nov 2022 05:41:04 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240602AbiKQSlC (ORCPT ); Thu, 17 Nov 2022 13:41:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240575AbiKQSlB (ORCPT ); Thu, 17 Nov 2022 13:41:01 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 219C985175; Thu, 17 Nov 2022 10:40:59 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id f18so7331893ejz.5; Thu, 17 Nov 2022 10:40:59 -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=k1XmyqLWH4AqUOHKKfV1yv3QMSJcaiHXG6zk/U0Icvk=; b=aVpjZjUmugzu/Zf4UlP/gNFrPeVw2QoCsRb8vQyv+jCL2d8y5OsKj0GZ64BylixKY0 NfuzLBkmZe8U4Wk8RmKUxISvrCQxlekxCVlwh1jsS1d3zSbod1iElJrNETfONX6hd34B uTxQxEo8KEASodUrTV8If32PYhb+hH5pppYTuYRmGBsgATHW1APz8U0Z++AVWuzVBvqH JIyPjQ5y4tjj+sWJB5ZdTTgjDNb11EMmdDAw6J0W5teFOHpT3FNKzUsp7OBOR79yctoF fMy/I2WJ3TdIvil4m8cnjwiYPvF6Gu5HIix1clcbsjTLjE6t+iA2JJLXTSmH164iVJJL BpbA== 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=k1XmyqLWH4AqUOHKKfV1yv3QMSJcaiHXG6zk/U0Icvk=; b=btqDlpNFjc21PIgb9uaFW+I1GaYzbog6a8P8tzbyTOEZ1L8vFXEzVvV87sYRvipi6j MVt7nlDfBtHz+VvT/S9ckIw+cjV6W2mO/uBFSwTCmPQA8mmSouX5IXGpZHbmJcQMyyfa OfHvywbxjwTTpZw2ZVt9oTOGs4n6wP3ZVwSCdF0tTXQAx5nwPQX04y+iqe2+D/CEQlho QFEgCrK6nk3kGUQ+pa9mQVqNnUIHTek67Km2OHKwqEc2qRZ3SLASHDZvCA+JYoE+i1w2 P3gMx1ruvt/rYMaAV/aFbsgVTx3JVnX3/HLSQEgtMFdCxR8unjX6EnwhoW4XIceKPhW2 pCng== X-Gm-Message-State: ANoB5pmOQcd4bMgbuhf8wJb1swbhC1OI+lJ5QYQ0s26UZxxOydp6noBL /lmNzR1S3UlR6nTK3nU5ABShFFcK3Uc= X-Google-Smtp-Source: AA0mqf6JIF4Hi+lfPgCjyHzvwjQnYPd8qpC0JNMVn/jTtG1nufCYivUOlHMB4CEB9me5Awc/DBy1CA== X-Received: by 2002:a17:906:3792:b0:7aa:97c7:2bfe with SMTP id n18-20020a170906379200b007aa97c72bfemr3146515ejc.196.1668710457524; Thu, 17 Nov 2022 10:40:57 -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 a13-20020a17090682cd00b0078d424e8c09sm695617ejy.77.2022.11.17.10.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 10:40:56 -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 v3 8/8] arm64: tegra: Add simple framebuffer on Jetson Xavier NX Date: Thu, 17 Nov 2022 19:40:39 +0100 Message-Id: <20221117184039.2291937-9-thierry.reding@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221117184039.2291937-1-thierry.reding@gmail.com> References: <20221117184039.2291937-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 d0dbfafbc930..ec318b9e700c 100644 --- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi @@ -1972,7 +1972,7 @@ display-hub@15200000 { ranges = <0x15200000 0x15200000 0x40000>; - display@15200000 { + dc0: display@15200000 { compatible = "nvidia,tegra194-dc"; reg = <0x15200000 0x10000>; interrupts = ;