[Intel-gfx] [PATCH] drm: Only select I2C_ALGOBIT for drivers that actually need it

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Mon Feb 21 10:44:06 UTC 2022


Hello,

On Fri, May 14, 2021 at 12:01:42PM +0200, Uwe Kleine-König wrote:
> While working on a drm driver that doesn't need the i2c algobit stuff I
> noticed that DRM selects this code even tough only 8 drivers actually use
> it. While also only some drivers use i2c, keep the select for I2C for the
> next cleanup patch. Still prepare this already by also selecting I2C for
> the individual drivers.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>

This patch is already old but the issue is still valid and the patch
even still applies to today's Linus' master branch.

I didn't receive any human feedback. If you consider this patch
worthwile I can recheck if it's still correct as is or needs adaption.

Best regards
Uwe

> ---
>  drivers/gpu/drm/Kconfig                 | 5 ++++-
>  drivers/gpu/drm/ast/Kconfig             | 2 ++
>  drivers/gpu/drm/gma500/Kconfig          | 2 ++
>  drivers/gpu/drm/hisilicon/hibmc/Kconfig | 2 ++
>  drivers/gpu/drm/i915/Kconfig            | 2 ++
>  drivers/gpu/drm/mgag200/Kconfig         | 2 ++
>  drivers/gpu/drm/nouveau/Kconfig         | 2 ++
>  7 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 3c16bd1afd87..351ea617c498 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -12,7 +12,6 @@ menuconfig DRM
>  	select HDMI
>  	select FB_CMDLINE
>  	select I2C
> -	select I2C_ALGOBIT
>  	select DMA_SHARED_BUFFER
>  	select SYNC_FILE
>  # gallium uses SYS_kcmp for os_same_file_description() to de-duplicate
> @@ -233,6 +232,8 @@ config DRM_RADEON
>          select DRM_KMS_HELPER
>          select DRM_TTM
>  	select DRM_TTM_HELPER
> +	select I2C
> +	select I2C_ALGOBIT
>  	select POWER_SUPPLY
>  	select HWMON
>  	select BACKLIGHT_CLASS_DEVICE
> @@ -254,6 +255,8 @@ config DRM_AMDGPU
>  	select DRM_SCHED
>  	select DRM_TTM
>  	select DRM_TTM_HELPER
> +	select I2C
> +	select I2C_ALGOBIT
>  	select POWER_SUPPLY
>  	select HWMON
>  	select BACKLIGHT_CLASS_DEVICE
> diff --git a/drivers/gpu/drm/ast/Kconfig b/drivers/gpu/drm/ast/Kconfig
> index fbcf2f45cef5..bcc25decd485 100644
> --- a/drivers/gpu/drm/ast/Kconfig
> +++ b/drivers/gpu/drm/ast/Kconfig
> @@ -6,6 +6,8 @@ config DRM_AST
>  	select DRM_VRAM_HELPER
>  	select DRM_TTM
>  	select DRM_TTM_HELPER
> +	select I2C
> +	select I2C_ALGOBIT
>  	help
>  	 Say yes for experimental AST GPU driver. Do not enable
>  	 this driver without having a working -modesetting,
> diff --git a/drivers/gpu/drm/gma500/Kconfig b/drivers/gpu/drm/gma500/Kconfig
> index 0cff20265f97..e26c3a24955d 100644
> --- a/drivers/gpu/drm/gma500/Kconfig
> +++ b/drivers/gpu/drm/gma500/Kconfig
> @@ -3,6 +3,8 @@ config DRM_GMA500
>  	tristate "Intel GMA500/600/3600/3650 KMS Framebuffer"
>  	depends on DRM && PCI && X86 && MMU
>  	select DRM_KMS_HELPER
> +	select I2C
> +	select I2C_ALGOBIT
>  	# GMA500 depends on ACPI_VIDEO when ACPI is enabled, just like i915
>  	select ACPI_VIDEO if ACPI
>  	select BACKLIGHT_CLASS_DEVICE if ACPI
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/Kconfig b/drivers/gpu/drm/hisilicon/hibmc/Kconfig
> index 43943e980203..ac8c42dc79f6 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/Kconfig
> +++ b/drivers/gpu/drm/hisilicon/hibmc/Kconfig
> @@ -6,6 +6,8 @@ config DRM_HISI_HIBMC
>  	select DRM_VRAM_HELPER
>  	select DRM_TTM
>  	select DRM_TTM_HELPER
> +	select I2C
> +	select I2C_ALGOBIT
>  	help
>  	  Choose this option if you have a Hisilicon Hibmc soc chipset.
>  	  If M is selected the module will be called hibmc-drm.
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index 69f57ca9c68d..b3bb6f7cfbbc 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -13,6 +13,8 @@ config DRM_I915
>  	select DRM_PANEL
>  	select DRM_MIPI_DSI
>  	select RELAY
> +	select I2C
> +	select I2C_ALGOBIT
>  	select IRQ_WORK
>  	# i915 depends on ACPI_VIDEO when ACPI is enabled
>  	# but for select to work, need to select ACPI_VIDEO's dependencies, ick
> diff --git a/drivers/gpu/drm/mgag200/Kconfig b/drivers/gpu/drm/mgag200/Kconfig
> index eec59658a938..b28c5e4828f4 100644
> --- a/drivers/gpu/drm/mgag200/Kconfig
> +++ b/drivers/gpu/drm/mgag200/Kconfig
> @@ -4,6 +4,8 @@ config DRM_MGAG200
>  	depends on DRM && PCI && MMU
>  	select DRM_GEM_SHMEM_HELPER
>  	select DRM_KMS_HELPER
> +	select I2C
> +	select I2C_ALGOBIT
>  	help
>  	 This is a KMS driver for Matrox G200 chips. It supports the original
>  	 MGA G200 desktop chips and the server variants. It requires 0.3.0
> diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
> index 9436310d0854..8823f0b24c73 100644
> --- a/drivers/gpu/drm/nouveau/Kconfig
> +++ b/drivers/gpu/drm/nouveau/Kconfig
> @@ -7,6 +7,8 @@ config DRM_NOUVEAU
>  	select DRM_KMS_HELPER
>  	select DRM_TTM
>  	select DRM_TTM_HELPER
> +	select I2C
> +	select I2C_ALGOBIT
>  	select BACKLIGHT_CLASS_DEVICE if DRM_NOUVEAU_BACKLIGHT
>  	select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && INPUT
>  	select X86_PLATFORM_DEVICES if ACPI && X86
> 
> base-commit: 315d99318179b9cd5077ccc9f7f26a164c9fa998
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20220221/4207d3cb/attachment.sig>


More information about the Intel-gfx mailing list