Message ID | 20221116-s905x_spi_ili9486-v3-3-59c6b58cbfe3@baylibre.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2701508wrr; Tue, 6 Dec 2022 00:39:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf4lFDKwxODjvJ2dK1+Cjq6JNHHfXrMLn8B5oeGyXuVGhjCyDcETa7PMxSIzEv77j7BIOgdP X-Received: by 2002:a63:f542:0:b0:478:ba54:6ad with SMTP id e2-20020a63f542000000b00478ba5406admr8036228pgk.214.1670315973301; Tue, 06 Dec 2022 00:39:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670315973; cv=none; d=google.com; s=arc-20160816; b=MrMkirz9O/GYSmMg4mfIHM+FUZ1FjSz4tI+Hj0sqnYD+D7bHqN0pPLmiOSJExh7VLi MHmP6D2wX2m3FYFtykjVYJiswHmJPGqv6OBjplgoD0jYwQXYpuXz7zbpCjKngBtPKgj/ Ptj8pwMSxjb2A+U7CVXDduYvSjuj4lonaISjKlvCpSRrDafBqswJ8ltRD1iqhYLMeaxI ZZBtBOjbyraRg3VwrPIx165MCPgcwRaByTE7YmZa/Vbve2yT/R+q1/bjmrc5r4IrOn75 R/1MngN+UpsqRlxzNa1CkCt0toV+xoweRz2AXl+0VTQrjci5v1sG51uXTahnFKSOonI5 W/GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=dcRZDjg3O3q6T3Sk5c09WrJuoI7e4rWvSzYj/Z5H43A=; b=aT20QHrWi8xgwgzKhbajMEKLfA3P5f/mp7Edqf8Ls3VRxYRxZCWEa3cfVwuXSaSemK 7PDJH/7HJ3KChbOFz4fLJeMkSe4hujDJeq4gMa5SSk0VKfe+2yQoEtCPHShR4WOj70mB /+uXGpLzOsXX+IsvIVGq84PoP1K8e4SXdADwGWaijOEyr2vhmV7tbWo/MFa7VVqNnwcM Ef+Voe1R3kLT2cT36HBp7rsKSj4Jni+0DfLe5zTdCoVuSDvB/CRfpjsbfdbj3LOsiUE8 uW7UHcFp0Lr9HhWLt0bnWFdSCODZF0sb2k4RnX9rqYx7/XBjiGFIbik/ssT5EsLkCxri DkbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=4WirXC4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f185-20020a636ac2000000b004780e6f20adsi16655609pgc.522.2022.12.06.00.39.19; Tue, 06 Dec 2022 00:39:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=4WirXC4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234000AbiLFIeY (ORCPT <rfc822;jaysivo@gmail.com> + 99 others); Tue, 6 Dec 2022 03:34:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233929AbiLFIeO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 6 Dec 2022 03:34:14 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DA30F6E for <linux-kernel@vger.kernel.org>; Tue, 6 Dec 2022 00:34:12 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id qk9so4427391ejc.3 for <linux-kernel@vger.kernel.org>; Tue, 06 Dec 2022 00:34:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=dcRZDjg3O3q6T3Sk5c09WrJuoI7e4rWvSzYj/Z5H43A=; b=4WirXC4jMxNwlMz6xJ0Jso5tI43SM73m6Z9nAG5UcC6cra+AVeRVqQ34JVt6DgZKgV c9hIcYbA/AvXNIM6RMGCohkjPKGrjCTBPl9oU3bNjAjQ/umGlKZLpggA155FB0vJk6Ct rVcHJ0ILj6BY4HBabqfD7FJVizZkw3Ldgd5e3xJbSInv7XpX/wYG6HZCmV7RsRmxhpIu XkwElGUBdmrQGgZBpaz/Yd6JEAvU7fw8grj8BxnZf8UlHql26r0u8WY4z+Mv4oLZ0koR xQtcD4jBbiBlgU3ycjVbJlgfX5rdOKY5JE6tHR1X8QYJktlo5P4BCCoaT1FmCpd7wM9l 2tgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dcRZDjg3O3q6T3Sk5c09WrJuoI7e4rWvSzYj/Z5H43A=; b=fiTVEqDoF7wevulIc3WFQYnvNe8kewfTrTH/u/lT+PzNmQOqeucpNSdKdhECfKz6wr NHqFaQGsPdP9fUml8C+wiVkVv0ld6GYHWxa9eC/LyHKVtgnPU0DI40+7xou6p12ZGHaG 5/cUUrZh9H0d94xRzKMDoA/zZbL1HoEb4LeBPxk6XubOBT8u2sVC4vCrR2okPyMtwgoo FmnhfnbS2YyaaXqO3Q3WOWeG/B69S3d3UC/K4RWDeyMrCwHppiskvmI7SM5BQi4WWgIb kG3zZXsf8yDR9kFVLetAZXxqGe27hlRl4cbf1ZS+gnCBrZOsFLm7FcU6Mb3VLPOYsFHT N9wQ== X-Gm-Message-State: ANoB5plvbDA59JjYVx2R2+1vc4a5MGLOmhgdumnlLK3+Tnmx3hwyiK+T 3p064xxAipwS1DhAs5j7spqqjw== X-Received: by 2002:a17:906:164d:b0:7c0:b602:f9a1 with SMTP id n13-20020a170906164d00b007c0b602f9a1mr17569290ejd.88.1670315651166; Tue, 06 Dec 2022 00:34:11 -0800 (PST) Received: from [127.0.1.1] ([2a0e:41a:894f:0:2017:359e:18ef:1c49]) by smtp.gmail.com with ESMTPSA id g18-20020a17090604d200b0078d9b967962sm7019390eja.65.2022.12.06.00.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 00:34:10 -0800 (PST) From: Carlo Caione <ccaione@baylibre.com> Date: Tue, 06 Dec 2022 09:34:03 +0100 Subject: [PATCH v3 3/3] drm/tiny: ili9486: remove conflicting framebuffers MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20221116-s905x_spi_ili9486-v3-3-59c6b58cbfe3@baylibre.com> References: <20221116-s905x_spi_ili9486-v3-0-59c6b58cbfe3@baylibre.com> In-Reply-To: <20221116-s905x_spi_ili9486-v3-0-59c6b58cbfe3@baylibre.com> To: Daniel Vetter <daniel@ffwll.ch>, Jerome Brunet <jbrunet@baylibre.com>, David Airlie <airlied@gmail.com>, Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>, Mark Brown <broonie@kernel.org>, Martin Blumenstingl <martin.blumenstingl@googlemail.com>, Kevin Hilman <khilman@baylibre.com>, Neil Armstrong <neil.armstrong@linaro.org> Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, Carlo Caione <ccaione@baylibre.com>, linux-kernel@vger.kernel.org X-Mailer: b4 0.10.1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751453242355377651?= X-GMAIL-MSGID: =?utf-8?q?1751453242355377651?= |
Series |
Make ILI9486 driver working with 16-bits SPI controllers
|
|
Commit Message
Carlo Caione
Dec. 6, 2022, 8:34 a.m. UTC
For platforms using simplefb / efifb, call
drm_aperture_remove_framebuffers() to remove the conflicting
framebuffer.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
drivers/gpu/drm/tiny/ili9486.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
Hi Carlo, On 06/12/2022 09:34, Carlo Caione wrote: > For platforms using simplefb / efifb, call > drm_aperture_remove_framebuffers() to remove the conflicting > framebuffer. Conflicting framebuffer on the SPI display ? How is that possible ? The meson_drm should already do this, no ? Neil > > Signed-off-by: Carlo Caione <ccaione@baylibre.com> > --- > drivers/gpu/drm/tiny/ili9486.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/gpu/drm/tiny/ili9486.c b/drivers/gpu/drm/tiny/ili9486.c > index 14a9e6ad2d15..6fd4d42437fd 100644 > --- a/drivers/gpu/drm/tiny/ili9486.c > +++ b/drivers/gpu/drm/tiny/ili9486.c > @@ -14,6 +14,7 @@ > > #include <video/mipi_display.h> > > +#include <drm/drm_aperture.h> > #include <drm/drm_atomic_helper.h> > #include <drm/drm_drv.h> > #include <drm/drm_fb_helper.h> > @@ -238,6 +239,10 @@ static int ili9486_probe(struct spi_device *spi) > if (ret) > return ret; > > + ret = drm_aperture_remove_framebuffers(false, &ili9486_driver); > + if (ret) > + return ret; > + > drm_mode_config_reset(drm); > > ret = drm_dev_register(drm, 0); >
Hi Am 06.12.22 um 10:41 schrieb Neil Armstrong: > Hi Carlo, > > On 06/12/2022 09:34, Carlo Caione wrote: >> For platforms using simplefb / efifb, call >> drm_aperture_remove_framebuffers() to remove the conflicting >> framebuffer. > > Conflicting framebuffer on the SPI display ? How is that possible ? Calling drm_aperture_remove_framebuffers() is only required if the graphics card may have been pre-initialized by the system, such as a VGA-compatible card on a PC. Could the SPI display have been initialized by the firmware? If not, the call should be left out. Best regards Thomas > > The meson_drm should already do this, no ? > > Neil > >> >> Signed-off-by: Carlo Caione <ccaione@baylibre.com> >> --- >> drivers/gpu/drm/tiny/ili9486.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/drivers/gpu/drm/tiny/ili9486.c >> b/drivers/gpu/drm/tiny/ili9486.c >> index 14a9e6ad2d15..6fd4d42437fd 100644 >> --- a/drivers/gpu/drm/tiny/ili9486.c >> +++ b/drivers/gpu/drm/tiny/ili9486.c >> @@ -14,6 +14,7 @@ >> #include <video/mipi_display.h> >> +#include <drm/drm_aperture.h> >> #include <drm/drm_atomic_helper.h> >> #include <drm/drm_drv.h> >> #include <drm/drm_fb_helper.h> >> @@ -238,6 +239,10 @@ static int ili9486_probe(struct spi_device *spi) >> if (ret) >> return ret; >> + ret = drm_aperture_remove_framebuffers(false, &ili9486_driver); >> + if (ret) >> + return ret; >> + >> drm_mode_config_reset(drm); >> ret = drm_dev_register(drm, 0); >> > -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev
On 06/12/2022 10:52, Thomas Zimmermann wrote: >> Conflicting framebuffer on the SPI display ? How is that possible ? > > Calling drm_aperture_remove_framebuffers() is only required if the > graphics card may have been pre-initialized by the system, such as a > VGA-compatible card on a PC. > > Could the SPI display have been initialized by the firmware? If not, the > call should be left out. What's happening on this board is that the builtin simpledrm driver is creating fb0 backed by the framebuffer prepared by u-boot / grub, and this the framebuffer being used by fbcon at early boot. When the ILI9486 DRM driver is probed later during boot a second framebuffer is created (fb1) and when fb0 is destroyed, fbcon still remains attached to a non-existent framebuffer, so the user is left in the dark. What this patch is doing is that when the ILI driver is probed, fb0 is destroyed and a new DRM-backed fb0 is created by the ILI DRM driver that can be used by fbcon, so the user can correctly see the console on the SPI display. Cheers,
On 12/6/22 10:52, Thomas Zimmermann wrote: > Hi > > Am 06.12.22 um 10:41 schrieb Neil Armstrong: >> Hi Carlo, >> >> On 06/12/2022 09:34, Carlo Caione wrote: >>> For platforms using simplefb / efifb, call >>> drm_aperture_remove_framebuffers() to remove the conflicting >>> framebuffer. >> >> Conflicting framebuffer on the SPI display ? How is that possible ? > > Calling drm_aperture_remove_framebuffers() is only required if the > graphics card may have been pre-initialized by the system, such as a > VGA-compatible card on a PC. > > Could the SPI display have been initialized by the firmware? If not, the > call should be left out. > Agree.
diff --git a/drivers/gpu/drm/tiny/ili9486.c b/drivers/gpu/drm/tiny/ili9486.c index 14a9e6ad2d15..6fd4d42437fd 100644 --- a/drivers/gpu/drm/tiny/ili9486.c +++ b/drivers/gpu/drm/tiny/ili9486.c @@ -14,6 +14,7 @@ #include <video/mipi_display.h> +#include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_drv.h> #include <drm/drm_fb_helper.h> @@ -238,6 +239,10 @@ static int ili9486_probe(struct spi_device *spi) if (ret) return ret; + ret = drm_aperture_remove_framebuffers(false, &ili9486_driver); + if (ret) + return ret; + drm_mode_config_reset(drm); ret = drm_dev_register(drm, 0);