summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/clients
AgeCommit message (Collapse)Author
2025-07-06drm/fbdev-client: Skip DRM clients if modesetting is absentThierry Reding
Recent generations of Tegra have moved the display components outside of host1x, leading to a device that has no CRTCs attached and hence doesn't support any of the modesetting functionality. When this is detected, the driver clears the DRIVER_MODESET and DRIVER_ATOMIC flags for the device. Unfortunately, this causes the following errors during boot: [ 15.418958] ERR KERN drm drm: [drm] *ERROR* Failed to register client: -95 [ 15.425311] WARNING KERN drm drm: [drm] Failed to set up DRM client; error -95 These originate from the fbdev client checking for the presence of the DRIVER_MODESET flag and returning -EOPNOTSUPP. However, if a driver does not support DRIVER_MODESET this is entirely expected and the error isn't helpful. Prevent this misleading error message by setting up the DRM clients only if modesetting is enabled. Changes in v2: - use DRIVER_MODESET check to avoid registering any clients Reported-by: Jonathan Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20250613122838.2082334-1-thierry.reding@gmail.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2025-06-16drm/client: Include <linux/export.h>Thomas Zimmermann
Fixes the compile-time warnings drivers/gpu/drm/clients/drm_client_setup.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing drivers/gpu/drm/drm_client.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing drivers/gpu/drm/drm_client_event.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing drivers/gpu/drm/drm_client_modeset.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing drivers/gpu/drm/drm_fb_helper.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing drivers/gpu/drm/drm_fbdev_dma.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing drivers/gpu/drm/drm_fbdev_shmem.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing drivers/gpu/drm/drm_fbdev_ttm.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: a934a57a42f6 ("scripts/misc-check: check missing #include <linux/export.h> when W=1") Reviewed-by: André Almeida <andrealmeid@igalia.com> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20250612121633.229222-5-tzimmermann@suse.de
2025-03-11printk: Rename console_start to console_resumeMarcos Paulo de Souza
The intent of console_start was to resume a previously suspended console, so rename it accordingly. Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Reviewed-by: John Ogness <john.ogness@linutronix.de> Link: https://lore.kernel.org/r/20250226-printk-renaming-v1-4-0b878577f2e6@suse.com [pmladek@suse.com: Fixed typo in the commit message. Updated also new drm_log.c.] Signed-off-by: Petr Mladek <pmladek@suse.com>
2025-03-11printk: Rename console_stop to console_suspendMarcos Paulo de Souza
The intent of console_stop was in fact to suspend it, so rename the function accordingly. Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Reviewed-by: John Ogness <john.ogness@linutronix.de> Link: https://lore.kernel.org/r/20250226-printk-renaming-v1-3-0b878577f2e6@suse.com [pmladek@suse.com: Fixed typo in the commit message. Updated also new drm_log.c] Signed-off-by: Petr Mladek <pmladek@suse.com>
2024-12-12drm/log: select CONFIG_FONT_SUPPORTArnd Bergmann
Without fonts, this fails to link: drivers/gpu/drm/clients/drm_log.o: in function `drm_log_init_client': drm_log.c:(.text+0x3d4): undefined reference to `get_default_font' Select this, like the other users do. Fixes: f7b42442c4ac ("drm/log: Introduce a new boot logger to draw the kmsg on the screen") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241212154003.1313437-1-arnd@kernel.org
2024-12-12drm/client: Fix drm client endless Kconfig loopJocelyn Falempe
if DRM_CLIENT_SELECTION is enabled, and none of the client is, the "Default DRM Client" choice is empty, and this makes Kconfig goes into an infinite loop of: Default DRM Client choice[1-0?]: 0 Default DRM Client choice[1-0?]: 0 Default DRM Client choice[1-0?]: 0 .... So only allow the choice if at least one of the client is selected. Fixes: f7b42442c4ac ("drm/log: Introduce a new boot logger to draw the kmsg on the screen") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/dri-devel/20241204160014.1171469-1-jfalempe@redhat.com/T/#md78853bba8904fd7614073f280f721d13ab0b432 Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Tested-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Simona Vetter <simona.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20241212091153.1592096-1-jfalempe@redhat.com
2024-12-10drm/log: Add integer scaling supportJocelyn Falempe
Add a module parameter, to increase the font size for HiDPI screen. Even with CONFIG_FONT_TER16x32, it can still be a bit small to read. In this case, adding drm_log.scale=2 to your kernel command line will double the character size. Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20241204160014.1171469-7-jfalempe@redhat.com
2024-12-10drm/log: Implement suspend/resumeJocelyn Falempe
Normally the console is already suspended when the graphic driver suspend callback is called, but if the parameter no_console_suspend is set, it might still be active. So call console_stop()/console_start() in the suspend/resume callbacks, to make sure it won't try to write to the framebuffer while the graphic driver is suspended. Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: John Ogness <john.ogness@linutronix.de> Acked-by: Petr Mladek <pmladek@suse.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20241204160014.1171469-6-jfalempe@redhat.com
2024-12-10drm/log: Color the timestamp, to improve readabilityJocelyn Falempe
Color the timesamp prefix, similar to dmesg. Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20241204160014.1171469-5-jfalempe@redhat.com
2024-12-10drm/log: Do not draw if drm_master is takenJocelyn Falempe
When userspace takes drm_master, the drm_client buffer is no more visible, so drm_log shouldn't waste CPU cycle to draw on it. Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20241204160014.1171469-4-jfalempe@redhat.com
2024-12-10drm/log: Introduce a new boot logger to draw the kmsg on the screenJocelyn Falempe
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. 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. This patch also adds a Kconfig menu to select the drm client to use. It can be overwritten on the kernel command line with: drm_client_lib.active=log or drm_client_lib.active=fbdev Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: John Ogness <john.ogness@linutronix.de> # console API Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20241204160014.1171469-3-jfalempe@redhat.com
2024-11-15drm/fbdev-client: Unexport drm_fbdev_client_setup()Thomas Zimmermann
DRM drivers invoke drm_client_setup() to set up in-kernel clients. No driver should call drm_fbdev_client_setup() directly. Therefore, unexport the symbol and move the declaration to the internal header drm_client_internal.h. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241108154600.126162-4-tzimmermann@suse.de
2024-11-15drm/client: Move public client header to clients/ subdirectoryThomas Zimmermann
Move the public header file drm_client_setup.h to the clients/ subdirectory and update all drivers. No functional changes. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241108154600.126162-3-tzimmermann@suse.de
2024-11-15drm: Move client code to clients/ subdirectoryThomas Zimmermann
Just move some files around to keep source code well organized. Plus fix a type in the help text of CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM. No functional changes. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241108154600.126162-2-tzimmermann@suse.de