From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DBE718E2A for ; Wed, 18 Dec 2024 14:18:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734531498; cv=none; b=HjUrq0FpwfDLLhHAjZce8yT5kYBFY0U5uah0p5kYVgRSV4YmZGvgBaEUNlXE6DU3o2xH7qNvVHZecXCHBeGz0YWm6MyQJDYtCZdUu5HrBb5R1VMLx37FIMuixfNZ8SiAcjIoI0b7Qq2lr2cFm/9DlUpRQm42Nu6gJDpmHfndRK0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734531498; c=relaxed/simple; bh=Tkf/BVb24bFBTtDjSZB49w3vxUtxzwA6In6ijd5QrMQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KeiCUOGha00BwOwfnNOMVUSAEASGwXAqOWapibUq6QGDS0PkyiC0xbByq7kc3U+LqnyV1dAXAQRa8yLV2Fca7gB1EcNGpc0m2ltLOKc6fzJ/4X8Me82OMIlljVHnJJ+2PyfUNJL+fis+9MTh02/5T1ZQ143RaYeIUAWpV6ivsC4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=gXoHjLHl; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="gXoHjLHl" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-43621d27adeso45574445e9.2 for ; Wed, 18 Dec 2024 06:18:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1734531495; x=1735136295; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=cOSusqsktfDuxu16rk7M+LG/oRYwLBrKmcYhe7v+/9Q=; b=gXoHjLHlLZf9U8PqwIq4sUzN4XRae+910ry+BOxZsJDrOYtOBZfd6g+WsOoA39SOSQ 090vgM7nL2kKas9cy/y/vWWakLa9t7rZti28i8cznPZ4gN1nBHe/zhnqDMVyRvEflOYx uMq4U5Tt4hkkhPe2S2F6YrNjSaUEpUA06MAFaVkfoBz72NQ/aKVs/IoII/F+isEzXwE/ F2YqMuBozBX93/hBRwaMx0QwVspbAvNoLwTRrPzav1OJuTWsJsnCTDwxZnBXnYO/Umcw ILh9sRdGaIYRLoqjN7pHUniHMyAlZ5nTcq/ETtshOylpJKGrTFqwf3W7AUhykc7kxGG9 mP3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734531495; x=1735136295; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cOSusqsktfDuxu16rk7M+LG/oRYwLBrKmcYhe7v+/9Q=; b=Dx12boBdNr6kkePhHPOBmrjsK7Bn5ce3VmyY+GYXzBY14CW+3wqxPZ2EVyTObOajhR BL39RKKSAmb3u29ap8wd3jSCY2igGEmSv/rzI5vfsPdn12yGwXWGABN63J7hMDMMByg0 9H6hSlUOUC65FBCeGlCaYCwVAIYwaR5oqckFK6ym76uva1B3K0eveX1evxVPc7IYhVUh KTiabXoCrcBF8R6Q0SJrcyrtfKzRmEk6fIaZonIVr7Ni+fHGNSqyqd/3RJJtbSa/EOJf 24QQNfpCCQeDgpvQq243wdI86LatSNUpIyUN/UQz3EgCHM1ENpSEAn/pPJXH8oUtBRmf Jluw== X-Forwarded-Encrypted: i=1; AJvYcCWbPmJH6MDNj227NQOv5lZEsuPu1WWHQf9Q5Nq2g4OP5hdy48Tjt5U9Z3r90NuXeel/ZXJTwzDeD/8Zotg=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3En0WZJOzlNrnXkJ+fvgOyt0AErC2tsHh8K5Bx+McacVbbnO+ AKYD89kf+7UZeQ6d0mkwm+Hyn3wto8d4RMNd5PrjPAxnQ5azlA89CvhDLFJ9vvA= X-Gm-Gg: ASbGncu1+97Tm+H/AVngxF2SZqXakdGANOpG5KxQBOOF+s9nWTW4G1Vg0jIIGYEXTDz nrCPITSuLZbcA/14HSsi1szX1Dv1AD12vSE0ZOw7TnlOITE0jSeP8BgYcMroQuPBayBVSuoBamo rCRtEZ/WE2vYXXLxGXWbt/o7GI/ArsTSVbVVlKdJph1OtI+kcynXuTbJ12GHCFH/oUcU2bwcciv q03C9M0PEK7bWNVbwTzcBmiupmI6/A88xLUyKXgquXBqPlGNeeeeq704Q== X-Google-Smtp-Source: AGHT+IEaISJLNAKw87VA5njzUdMOysTz70EmeTh0tRvEzKJXALSuN6Rh9dx9COPILxnSQjSbHjZIBw== X-Received: by 2002:a05:600c:1c99:b0:431:5aea:95f with SMTP id 5b1f17b1804b1-4365536e479mr28298645e9.16.1734531494753; Wed, 18 Dec 2024 06:18:14 -0800 (PST) Received: from pathway.suse.cz ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43656b013ecsm21888165e9.16.2024.12.18.06.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 06:18:14 -0800 (PST) Date: Wed, 18 Dec 2024 15:18:11 +0100 From: Petr Mladek To: Jocelyn Falempe Cc: Geert Uytterhoeven , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , John Ogness , Javier Martinez Canillas , "Guilherme G . Piccoli" , bluescreen_avenger@verizon.net, Caleb Connolly , Jani Nikula , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Linux-Renesas Subject: Re: [PATCH v9 0/6] drm/log: Introduce a new boot logger to draw the kmsg on the screen Message-ID: References: <20241204160014.1171469-1-jfalempe@redhat.com> <301714d8-0723-4881-83e8-24523c121bfe@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed 2024-12-18 12:41:39, Jocelyn Falempe wrote: > On 18/12/2024 12:00, Geert Uytterhoeven wrote: > > Hi Jocelyn, > > > > On Wed, Dec 18, 2024 at 11:14 AM Jocelyn Falempe wrote: > > > On 17/12/2024 15:54, Geert Uytterhoeven wrote: > > > > On Tue, Dec 17, 2024 at 3:46 PM Jocelyn Falempe wrote: > > > > > On 17/12/2024 15:19, Geert Uytterhoeven wrote: > > > > > > On Wed, Dec 4, 2024 at 6:41 PM Jocelyn Falempe wrote: > > > > > > > drm_log is a simple logger that uses the drm_client API to print the kmsg boot log on the screen. > > > > > > > This is not a full replacement to fbcon, as it will only print the kmsg. > > > > > > > It will never handle user input, or a terminal because this is better done in userspace. > > > > > > > > > > > > > > If you're curious on how it looks like, I've put a small demo here: > > > > > > > https://people.redhat.com/jfalempe/drm_log/drm_log_draft_boot_v2.mp4 > > > > > > > > > > > > > > Design decisions: > > > > > > > * It uses the drm_client API, so it should work on all drm drivers from the start. > > > > > > > * It doesn't scroll the message, that way it doesn't need to redraw the whole screen for each new message. > > > > > > > It also means it doesn't have to keep drawn messages in memory, to redraw them when scrolling. > > > > > > > * It uses the new non-blocking console API, so it should work well with PREEMPT_RT > > > > > > > > > > > > I gave this a try on Koelsch (R-Car M2-W), using rcar-du. > > > > > > Unfortunately I don't see any kernel messages, and my monitor complains > > > > > > about no signal. Does this require special support from the driver? > > > > > > > > > > It doesn't require a special support from the driver. But as it is the > > > > > first drm client other than fbdev emulation, I'm not surprised it's > > > > > broken on some driver. > > > > > I know it works on virtio-gpu, nouveau, amdgpu, and even on a OnePlus 6 > > > > > (Qualcomm SDM845/freedreno), without requiring driver changes. > > > > > > > > > > Do you have a serial console on this device, to check if there is > > > > > something in kmsg? > > > > > > > > Nothing interesting to see. Compared to the fbdev client: > > > > > > > > rcar-du feb00000.display: [drm] Registered 2 planes with drm panic > > > > [drm] Initialized rcar-du 1.0.0 for feb00000.display on minor 0 > > > > rcar-du feb00000.display: [drm] Device feb00000.display probed > > > > -Console: switching to colour frame buffer device 240x67 > > > > -rcar-du feb00000.display: [drm] fb0: rcar-dudrmfb frame buffer device > > > > > > > > I did verify (by adding my own debug prints) that the code does > > > > get to the success case in drm_log_register(). > > > > Thanks! > > > > > > Maybe you need to add console=drm_log to your kernel command line, so > > > the kernel will actually use this console. > > > > Thanks, that does the trick! > > > > Note that I do not need to specify any console= kernel command line > > parameter for the fbdev console. > > Yes, the fbcon console is tty0, which is hardcoded for historical reason. > Some architectures use add_preferred_console() to enable specific consoles, > I'm not sure it's allowed to use that from the drm_log_register() code. add_preferred_console() is used when the console should get enabled intentionally. I would split the intentions into two categories: + requested by the end-user on the command line, see __add_preferred_console(..., true) in console_setup() + enabled by default by a hardware definition (manufacture), see add_preferred_console() in: + of_console_check(): generic solution via device tree + acpi_parse_spcr(): generic solution via SPCR table + *: hardcoded in few more HW-specific drivers add_preferred_console() causes the console will always get enabled when it is successfully initialized. So, should the "drm_log" console get always enabled? > I will still send a patch to add update the Kconfig help for drm_log, as > this command line argument is required to have it working. I guess that the drm_log consoles should get enabled only when requested by the user => documenting the command line parameter is the right solution here. Best Regards, Petr