All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Arnd Bergmann <arnd@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: "Lukas Bulwahn" <lukas.bulwahn@gmail.com>,
	"Kees Cook" <keescook@chromium.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Jani Nikula" <jani.nikula@intel.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	dri-devel@lists.freedesktop.org,
	"Douglas Anderson" <dianders@chromium.org>,
	"Deepak Rawat" <drawat.floss@gmail.com>,
	"Noralf Trønnes" <noralf@tronnes.org>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@somainline.org>,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Dillon Min" <dillon.minfei@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/panel: add CONFIG_DRM_KMS_HELPER dependencies
Date: Wed, 16 Mar 2022 20:12:41 +0100	[thread overview]
Message-ID: <aaf204b2-e876-d271-3d4e-51cbcc70d690@suse.de> (raw)
In-Reply-To: <20220316183708.1505846-1-arnd@kernel.org>


[-- Attachment #1.1: Type: text/plain, Size: 4335 bytes --]

Hi

Am 16.03.22 um 19:36 schrieb Arnd Bergmann:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The driver fails to build when the KMS helpers are disabled:
> 
> ld.lld: error: undefined symbol: drm_gem_fb_get_obj
>>>> referenced by drm_mipi_dbi.c
>>>>                gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in archive drivers/built-in.a
>>>> referenced by drm_mipi_dbi.c
>>>>                gpu/drm/drm_mipi_dbi.o:(mipi_dbi_fb_dirty) in archive drivers/built-in.a
> 
> ld.lld: error: undefined symbol: drm_gem_fb_begin_cpu_access
>>>> referenced by drm_mipi_dbi.c
>>>>                gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in archive drivers/built-in.a
> 
> ld.lld: error: undefined symbol: drm_fb_swab
>>>> referenced by drm_mipi_dbi.c
>>>>                gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in archive drivers/built-in.a
> 
> ld.lld: error: undefined symbol: drm_fb_xrgb8888_to_rgb565
>>>> referenced by drm_mipi_dbi.c
>>>>                gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in archive drivers/built-in.a
> 
> ld.lld: error: undefined symbol: drm_fb_memcpy
>>>> referenced by drm_mipi_dbi.c
>>>>                gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in archive drivers/built-in.a
> 
> This is fairly hard to hit in randconfig drivers, but it eventually
> did trigger for me in a configuration where all other DRM drivers
> are loadable modules, but DRM_PANEL_WIDECHIPS_WS2401 was built-in.
> 
> Adding a dependency in all drivers that select DRM_MIPI_DBI avoids
> the problem for now, adding the dependency in DRM_MIPI_DBI as well
> should help make it easier to figure out why it breaks if someone
> forgets the dependency the next time.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/gpu/drm/Kconfig       | 2 +-
>   drivers/gpu/drm/panel/Kconfig | 4 ++++
>   2 files changed, 5 insertions(+), 1 deletion(-)
> 
> I see this warning on 5.17-rc8, but did not test it on linux-next,
> which may already have a fix.
> 
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index b1f22e457fd0..d5ec0b77c010 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -30,7 +30,7 @@ menuconfig DRM
>   
>   config DRM_MIPI_DBI
>   	tristate
> -	depends on DRM
> +	depends on DRM_KMS_HELPER

This symbol cannot be selected by users, so it's maybe not a good idea 
to depend on it. In fact, I've had to remove such a statement because it 
created a cyclic dependency. [1]

Making the drivers depend on KMS helpers is the right thing though. If 
there's a better solution, please let me know.

Best regards
Thomas

>   
>   config DRM_MIPI_DSI
>   	bool
> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index 0aec5a10b064..96887d0efb9f 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -425,6 +425,7 @@ config DRM_PANEL_SAMSUNG_DB7430
>   	tristate "Samsung DB7430-based DPI panels"
>   	depends on OF && SPI && GPIOLIB
>   	depends on BACKLIGHT_CLASS_DEVICE
> +	depends on DRM_KMS_HELPER
>   	select DRM_MIPI_DBI
>   	help
>   	  Say Y here if you want to enable support for the Samsung
> @@ -440,6 +441,7 @@ config DRM_PANEL_SAMSUNG_S6D16D0
>   config DRM_PANEL_SAMSUNG_S6D27A1
>   	tristate "Samsung S6D27A1 DPI panel driver"
>   	depends on OF && SPI && GPIOLIB
> +	depends on DRM_KMS_HELPER
>   	select DRM_MIPI_DBI
>   	help
>   	  Say Y here if you want to enable support for the Samsung
> @@ -476,6 +478,7 @@ config DRM_PANEL_SAMSUNG_S6E63M0_SPI
>   	depends on SPI
>   	depends on DRM_PANEL_SAMSUNG_S6E63M0
>   	default DRM_PANEL_SAMSUNG_S6E63M0
> +	depends on DRM_KMS_HELPER
>   	select DRM_MIPI_DBI
>   	help
>   	  Say Y here if you want to be able to access the Samsung
> @@ -677,6 +680,7 @@ config DRM_PANEL_WIDECHIPS_WS2401
>   	tristate "Widechips WS2401 DPI panel driver"
>   	depends on SPI && GPIOLIB
>   	depends on BACKLIGHT_CLASS_DEVICE
> +	depends on DRM_KMS_HELPER
>   	select DRM_MIPI_DBI
>   	help
>   	  Say Y here if you want to enable support for the Widechips WS2401 DPI

-- 
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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Arnd Bergmann <arnd@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: "Kees Cook" <keescook@chromium.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Jani Nikula" <jani.nikula@intel.com>,
	"Dillon Min" <dillon.minfei@gmail.com>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	dri-devel@lists.freedesktop.org,
	"Douglas Anderson" <dianders@chromium.org>,
	"Deepak Rawat" <drawat.floss@gmail.com>,
	"Noralf Trønnes" <noralf@tronnes.org>,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@somainline.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Lukas Bulwahn" <lukas.bulwahn@gmail.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/panel: add CONFIG_DRM_KMS_HELPER dependencies
Date: Wed, 16 Mar 2022 20:12:41 +0100	[thread overview]
Message-ID: <aaf204b2-e876-d271-3d4e-51cbcc70d690@suse.de> (raw)
In-Reply-To: <20220316183708.1505846-1-arnd@kernel.org>


[-- Attachment #1.1: Type: text/plain, Size: 4335 bytes --]

Hi

Am 16.03.22 um 19:36 schrieb Arnd Bergmann:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The driver fails to build when the KMS helpers are disabled:
> 
> ld.lld: error: undefined symbol: drm_gem_fb_get_obj
>>>> referenced by drm_mipi_dbi.c
>>>>                gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in archive drivers/built-in.a
>>>> referenced by drm_mipi_dbi.c
>>>>                gpu/drm/drm_mipi_dbi.o:(mipi_dbi_fb_dirty) in archive drivers/built-in.a
> 
> ld.lld: error: undefined symbol: drm_gem_fb_begin_cpu_access
>>>> referenced by drm_mipi_dbi.c
>>>>                gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in archive drivers/built-in.a
> 
> ld.lld: error: undefined symbol: drm_fb_swab
>>>> referenced by drm_mipi_dbi.c
>>>>                gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in archive drivers/built-in.a
> 
> ld.lld: error: undefined symbol: drm_fb_xrgb8888_to_rgb565
>>>> referenced by drm_mipi_dbi.c
>>>>                gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in archive drivers/built-in.a
> 
> ld.lld: error: undefined symbol: drm_fb_memcpy
>>>> referenced by drm_mipi_dbi.c
>>>>                gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in archive drivers/built-in.a
> 
> This is fairly hard to hit in randconfig drivers, but it eventually
> did trigger for me in a configuration where all other DRM drivers
> are loadable modules, but DRM_PANEL_WIDECHIPS_WS2401 was built-in.
> 
> Adding a dependency in all drivers that select DRM_MIPI_DBI avoids
> the problem for now, adding the dependency in DRM_MIPI_DBI as well
> should help make it easier to figure out why it breaks if someone
> forgets the dependency the next time.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/gpu/drm/Kconfig       | 2 +-
>   drivers/gpu/drm/panel/Kconfig | 4 ++++
>   2 files changed, 5 insertions(+), 1 deletion(-)
> 
> I see this warning on 5.17-rc8, but did not test it on linux-next,
> which may already have a fix.
> 
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index b1f22e457fd0..d5ec0b77c010 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -30,7 +30,7 @@ menuconfig DRM
>   
>   config DRM_MIPI_DBI
>   	tristate
> -	depends on DRM
> +	depends on DRM_KMS_HELPER

This symbol cannot be selected by users, so it's maybe not a good idea 
to depend on it. In fact, I've had to remove such a statement because it 
created a cyclic dependency. [1]

Making the drivers depend on KMS helpers is the right thing though. If 
there's a better solution, please let me know.

Best regards
Thomas

>   
>   config DRM_MIPI_DSI
>   	bool
> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index 0aec5a10b064..96887d0efb9f 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -425,6 +425,7 @@ config DRM_PANEL_SAMSUNG_DB7430
>   	tristate "Samsung DB7430-based DPI panels"
>   	depends on OF && SPI && GPIOLIB
>   	depends on BACKLIGHT_CLASS_DEVICE
> +	depends on DRM_KMS_HELPER
>   	select DRM_MIPI_DBI
>   	help
>   	  Say Y here if you want to enable support for the Samsung
> @@ -440,6 +441,7 @@ config DRM_PANEL_SAMSUNG_S6D16D0
>   config DRM_PANEL_SAMSUNG_S6D27A1
>   	tristate "Samsung S6D27A1 DPI panel driver"
>   	depends on OF && SPI && GPIOLIB
> +	depends on DRM_KMS_HELPER
>   	select DRM_MIPI_DBI
>   	help
>   	  Say Y here if you want to enable support for the Samsung
> @@ -476,6 +478,7 @@ config DRM_PANEL_SAMSUNG_S6E63M0_SPI
>   	depends on SPI
>   	depends on DRM_PANEL_SAMSUNG_S6E63M0
>   	default DRM_PANEL_SAMSUNG_S6E63M0
> +	depends on DRM_KMS_HELPER
>   	select DRM_MIPI_DBI
>   	help
>   	  Say Y here if you want to be able to access the Samsung
> @@ -677,6 +680,7 @@ config DRM_PANEL_WIDECHIPS_WS2401
>   	tristate "Widechips WS2401 DPI panel driver"
>   	depends on SPI && GPIOLIB
>   	depends on BACKLIGHT_CLASS_DEVICE
> +	depends on DRM_KMS_HELPER
>   	select DRM_MIPI_DBI
>   	help
>   	  Say Y here if you want to enable support for the Widechips WS2401 DPI

-- 
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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  parent reply	other threads:[~2022-03-16 19:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 18:36 [PATCH] drm/panel: add CONFIG_DRM_KMS_HELPER dependencies Arnd Bergmann
2022-03-16 18:36 ` Arnd Bergmann
2022-03-16 18:36 ` [PATCH] drm/tegra: vic: fix unused-function warnings Arnd Bergmann
2022-03-16 18:36   ` Arnd Bergmann
2022-04-06 13:21   ` Thierry Reding
2022-04-06 13:21     ` Thierry Reding
2022-04-06 15:51     ` Arnd Bergmann
2022-04-06 15:51       ` Arnd Bergmann
2022-03-16 19:12 ` Thomas Zimmermann [this message]
2022-03-16 19:12   ` [PATCH] drm/panel: add CONFIG_DRM_KMS_HELPER dependencies Thomas Zimmermann
2022-03-16 19:31   ` Thomas Zimmermann
2022-03-16 19:31     ` Thomas Zimmermann
2022-03-16 20:59     ` Arnd Bergmann
2022-03-16 20:59       ` Arnd Bergmann
2022-03-17 19:15       ` Thomas Zimmermann
2022-03-17 19:15         ` Thomas Zimmermann
2022-03-17 20:54         ` Arnd Bergmann
2022-03-17 20:54           ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aaf204b2-e876-d271-3d4e-51cbcc70d690@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=angelogioacchino.delregno@somainline.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dianders@chromium.org \
    --cc=dillon.minfei@gmail.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=drawat.floss@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=javierm@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=noralf@tronnes.org \
    --cc=sam@ravnborg.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.