[PATCH] drm: cleanup for including
remove duplicated include merge two \#ifdef Signed-off-by: Wang Jinchao --- drivers/gpu/drm/drm_gem_shmem_helper.c | 1 - include/uapi/drm/drm.h | 8 +--- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index e435f986cd13..c510fac3385a 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -10,7 +10,6 @@ #include #include #include -#include #ifdef CONFIG_X86 #include diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index de723566c5ae..c7f5a21e47a2 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h @@ -35,13 +35,7 @@ #ifndef _DRM_H_ #define _DRM_H_ -#if defined(__KERNEL__) - -#include -#include -typedef unsigned int drm_handle_t; - -#elif defined(__linux__) +#if defined(__KERNEL__) || defined(__linux__) #include #include -- 2.40.0
[PATCH] drm/nouveau/fifo: remove duplicated including
rm second including of chid.h Signed-off-by: Wang Jinchao --- drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c index 87a62d4ff4bd..7d4716dcd512 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c @@ -24,7 +24,6 @@ #include "chan.h" #include "chid.h" #include "cgrp.h" -#include "chid.h" #include "runl.h" #include "priv.h" -- 2.40.0
[Intel-gfx] [PATCH v3] drm/i915: Fix Kconfig error for CONFIG_DRM_I915
When CONFIG_DRM_I915 is set to 'y' and CONFIG_BACKLIGHT_CLASS_DEVICE is set to 'm', we encountered an ld.lld error during the build process: ld.lld: error: undefined symbol: backlight_device_get_by_name >>> referenced by intel_backlight.c:955 >>> vmlinux.o:(intel_backlight_device_register) ld.lld: error: undefined symbol: backlight_device_register >>> referenced by intel_backlight.c:971 >>> vmlinux.o:(intel_backlight_device_register) ld.lld: error: undefined symbol: backlight_device_unregister >>> referenced by intel_backlight.c:999 >>> vmlinux.o:(intel_backlight_device_unregister) This issue occurred because intel_backlight_device_register and intel_backlight_device_unregister were enclosed within \#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) and #endif directives. However, according to Kconfig, CONFIG_DRM_I915 will select BACKLIGHT_CLASS_DEVICE only if ACPI is enabled. This led to an error when ACPI is not enabled. Change IS_ENABLED to IS_REACHABLE and use IS_REACHABLE to encompass the implementation of intel_connector_register() to solve this issue. Signed-off-by: Wang Jinchao --- drivers/gpu/drm/i915/display/intel_backlight.c | 2 +- drivers/gpu/drm/i915/display/intel_backlight.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c index 2e8f17c04522..d812cdc74a84 100644 --- a/drivers/gpu/drm/i915/display/intel_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_backlight.c @@ -795,7 +795,7 @@ void intel_backlight_enable(const struct intel_crtc_state *crtc_state, mutex_unlock(>display.backlight.lock); } -#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) +#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE) static u32 intel_panel_get_backlight(struct intel_connector *connector) { struct drm_i915_private *i915 = to_i915(connector->base.dev); diff --git a/drivers/gpu/drm/i915/display/intel_backlight.h b/drivers/gpu/drm/i915/display/intel_backlight.h index 339643f63897..207fe1c613d8 100644 --- a/drivers/gpu/drm/i915/display/intel_backlight.h +++ b/drivers/gpu/drm/i915/display/intel_backlight.h @@ -36,7 +36,7 @@ u32 intel_backlight_invert_pwm_level(struct intel_connector *connector, u32 leve u32 intel_backlight_level_to_pwm(struct intel_connector *connector, u32 level); u32 intel_backlight_level_from_pwm(struct intel_connector *connector, u32 val); -#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) +#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE) int intel_backlight_device_register(struct intel_connector *connector); void intel_backlight_device_unregister(struct intel_connector *connector); #else /* CONFIG_BACKLIGHT_CLASS_DEVICE */ -- 2.40.0
Re: [PATCH] drm/i915: Fix Kconfig error for CONFIG_DRM_I915
On Mon, Aug 14, 2023 at 03:13:32PM +0300, Jani Nikula wrote: > On Mon, 14 Aug 2023, Wang Jinchao wrote: > > On Mon, Aug 14, 2023 at 10:26:45AM +0300, Jani Nikula wrote: > >> On Sat, 12 Aug 2023, Wang Jinchao wrote: > >> > When CONFIG_DRM_I915 is set to 'y' and CONFIG_BACKLIGHT_CLASS_DEVICE > >> > is set to 'm', we encountered an ld.lld error during the build process: > >> > > >> > ld.lld: error: undefined symbol: backlight_device_get_by_name > >> > >>> referenced by intel_backlight.c:955 > >> > >>> vmlinux.o:(intel_backlight_device_register) > >> > > >> > ld.lld: error: undefined symbol: backlight_device_register > >> > >>> referenced by intel_backlight.c:971 > >> > >>> vmlinux.o:(intel_backlight_device_register) > >> > > >> > ld.lld: error: undefined symbol: backlight_device_unregister > >> > >>> referenced by intel_backlight.c:999 > >> > >>> vmlinux.o:(intel_backlight_device_unregister) > >> > > >> > This issue occurred because intel_backlight_device_register and > >> > intel_backlight_device_unregister were enclosed within > >> > However, according to Kconfig, CONFIG_DRM_I915 will select > >> > BACKLIGHT_CLASS_DEVICE only if ACPI is enabled. > >> > This led to an error, which can be resolved by removing the > >> > conditional statements related to ACPI. > >> > >> The real fix is to use > >> > >>depends on BACKLIGHT_CLASS_DEVICE || BACKLIGHT_CLASS_DEVICE=n > > it works. > >> > >> but in order to do that, you need to change a lot of places to depend > > Why, what are the other places? > > Generally when you have a mixture of depends on and select on a kconfig > symbol, you'll eventually end up with dependency problems. > > BR, > Jani. > Now that I understand what you said, I will make an effort to correct it. GEN Makefile drivers/gpu/drm/i915/Kconfig:2:error: recursive dependency detected! drivers/gpu/drm/i915/Kconfig:2: symbol DRM_I915 depends on BACKLIGHT_CLASS_DEVICE drivers/video/backlight/Kconfig:136:symbol BACKLIGHT_CLASS_DEVICE is selected by DRM_FSL_DCU drivers/gpu/drm/fsl-dcu/Kconfig:2: symbol DRM_FSL_DCU depends on COMMON_CLK drivers/clk/Kconfig:21: symbol COMMON_CLK is selected by X86_INTEL_QUARK arch/x86/Kconfig:627: symbol X86_INTEL_QUARK depends on X86_PLATFORM_DEVICES drivers/platform/x86/Kconfig:6: symbol X86_PLATFORM_DEVICES is selected by DRM_I915 For a resolution refer to Documentation/kbuild/kconfig-language.rst subsection "Kconfig recursive dependency limitations" > > >> on, not select BACKLIGHT_CLASS_DEVICE, because otherwise you end up with > > got it. > >> other dependency issues. > >> > >> BR, > >> Jani. > >> > >> > > >> > Signed-off-by: Wang Jinchao > >> > --- > >> > drivers/gpu/drm/i915/Kconfig | 2 +- > >> > 1 file changed, 1 insertion(+), 1 deletion(-) > >> > > >> > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig > >> > index 01b5a8272a27..5003de921bf7 100644 > >> > --- a/drivers/gpu/drm/i915/Kconfig > >> > +++ b/drivers/gpu/drm/i915/Kconfig > >> > @@ -24,7 +24,7 @@ config DRM_I915 > >> > 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 > >> > -select BACKLIGHT_CLASS_DEVICE if ACPI > >> > +select BACKLIGHT_CLASS_DEVICE > >> > select INPUT if ACPI > >> > select X86_PLATFORM_DEVICES if ACPI > >> > select ACPI_WMI if ACPI > >> > >> -- > >> Jani Nikula, Intel Open Source Graphics Center > > -- > Jani Nikula, Intel Open Source Graphics Center
Re: [PATCH] drm/i915: Fix Kconfig error for CONFIG_DRM_I915
On Mon, Aug 14, 2023 at 03:13:32PM +0300, Jani Nikula wrote: > On Mon, 14 Aug 2023, Wang Jinchao wrote: > > On Mon, Aug 14, 2023 at 10:26:45AM +0300, Jani Nikula wrote: > >> On Sat, 12 Aug 2023, Wang Jinchao wrote: > >> > When CONFIG_DRM_I915 is set to 'y' and CONFIG_BACKLIGHT_CLASS_DEVICE > >> > is set to 'm', we encountered an ld.lld error during the build process: > >> > > >> > ld.lld: error: undefined symbol: backlight_device_get_by_name > >> > >>> referenced by intel_backlight.c:955 > >> > >>> vmlinux.o:(intel_backlight_device_register) > >> > > >> > ld.lld: error: undefined symbol: backlight_device_register > >> > >>> referenced by intel_backlight.c:971 > >> > >>> vmlinux.o:(intel_backlight_device_register) > >> > > >> > ld.lld: error: undefined symbol: backlight_device_unregister > >> > >>> referenced by intel_backlight.c:999 > >> > >>> vmlinux.o:(intel_backlight_device_unregister) > >> > > >> > This issue occurred because intel_backlight_device_register and > >> > intel_backlight_device_unregister were enclosed within > >> > However, according to Kconfig, CONFIG_DRM_I915 will select > >> > BACKLIGHT_CLASS_DEVICE only if ACPI is enabled. > >> > This led to an error, which can be resolved by removing the > >> > conditional statements related to ACPI. > >> > >> The real fix is to use > >> > >>depends on BACKLIGHT_CLASS_DEVICE || BACKLIGHT_CLASS_DEVICE=n > > it works. > >> > >> but in order to do that, you need to change a lot of places to depend > > Why, what are the other places? > > Generally when you have a mixture of depends on and select on a kconfig > symbol, you'll eventually end up with dependency problems. > Using A to represent DRM_I915 and B to represent BACKLIGHT_CLASS_DEVICE, as both A and B are tristate options, all the possibilities include: 1. A=n, B=n 2. A=m, B=n 3. A=y, B=n 4. A=n, B=m 5. A=m, B=m 6. A=y, B=m 7. A=n, B=y 8. A=m, B=y 9. A=y, B=y Among them, only the 6th case (A=y, B=m) would lead to a compilation failure. Based on your suggestion, I tested the following configuration: config A tristate "A Option" depends on B || B=n config B tristate "B Option" I tested it using menuconfig, and found that the 6th combination (A=y, B=m) cannot be manually selected. Specifically, if B=m, A can only be selected as either n or m. If A=y and B is set to m, A automatically changes to m as well. I believe there is no issue with the solution you provided. Is there something that I might have overlooked? > BR, > Jani. > > > >> on, not select BACKLIGHT_CLASS_DEVICE, because otherwise you end up with > > got it. > >> other dependency issues. > >> > >> BR, > >> Jani. > >> > >> > > >> > Signed-off-by: Wang Jinchao > >> > --- > >> > drivers/gpu/drm/i915/Kconfig | 2 +- > >> > 1 file changed, 1 insertion(+), 1 deletion(-) > >> > > >> > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig > >> > index 01b5a8272a27..5003de921bf7 100644 > >> > --- a/drivers/gpu/drm/i915/Kconfig > >> > +++ b/drivers/gpu/drm/i915/Kconfig > >> > @@ -24,7 +24,7 @@ config DRM_I915 > >> > 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 > >> > -select BACKLIGHT_CLASS_DEVICE if ACPI > >> > +select BACKLIGHT_CLASS_DEVICE > >> > select INPUT if ACPI > >> > select X86_PLATFORM_DEVICES if ACPI > >> > select ACPI_WMI if ACPI > >> > >> -- > >> Jani Nikula, Intel Open Source Graphics Center > > -- > Jani Nikula, Intel Open Source Graphics Center
Re: [PATCH] drm/i915: Fix Kconfig error for CONFIG_DRM_I915
On Mon, Aug 14, 2023 at 10:26:45AM +0300, Jani Nikula wrote: > On Sat, 12 Aug 2023, Wang Jinchao wrote: > > When CONFIG_DRM_I915 is set to 'y' and CONFIG_BACKLIGHT_CLASS_DEVICE > > is set to 'm', we encountered an ld.lld error during the build process: > > > > ld.lld: error: undefined symbol: backlight_device_get_by_name > > >>> referenced by intel_backlight.c:955 > > >>> vmlinux.o:(intel_backlight_device_register) > > > > ld.lld: error: undefined symbol: backlight_device_register > > >>> referenced by intel_backlight.c:971 > > >>> vmlinux.o:(intel_backlight_device_register) > > > > ld.lld: error: undefined symbol: backlight_device_unregister > > >>> referenced by intel_backlight.c:999 > > >>> vmlinux.o:(intel_backlight_device_unregister) > > > > This issue occurred because intel_backlight_device_register and > > intel_backlight_device_unregister were enclosed within > > However, according to Kconfig, CONFIG_DRM_I915 will select > > BACKLIGHT_CLASS_DEVICE only if ACPI is enabled. > > This led to an error, which can be resolved by removing the > > conditional statements related to ACPI. > > The real fix is to use > > depends on BACKLIGHT_CLASS_DEVICE || BACKLIGHT_CLASS_DEVICE=n it works. > > but in order to do that, you need to change a lot of places to depend Why, what are the other places? > on, not select BACKLIGHT_CLASS_DEVICE, because otherwise you end up with got it. > other dependency issues. > > BR, > Jani. > > > > > Signed-off-by: Wang Jinchao > > --- > > drivers/gpu/drm/i915/Kconfig | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig > > index 01b5a8272a27..5003de921bf7 100644 > > --- a/drivers/gpu/drm/i915/Kconfig > > +++ b/drivers/gpu/drm/i915/Kconfig > > @@ -24,7 +24,7 @@ config DRM_I915 > > 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 > > - select BACKLIGHT_CLASS_DEVICE if ACPI > > + select BACKLIGHT_CLASS_DEVICE > > select INPUT if ACPI > > select X86_PLATFORM_DEVICES if ACPI > > select ACPI_WMI if ACPI > > -- > Jani Nikula, Intel Open Source Graphics Center
[PATCH v2] drm/i915: Fix Kconfig error for CONFIG_DRM_I915
When CONFIG_DRM_I915 is set to 'y' and CONFIG_BACKLIGHT_CLASS_DEVICE is set to 'm', we encountered an ld.lld error during the build process: ld.lld: error: undefined symbol: backlight_device_get_by_name >>> referenced by intel_backlight.c:955 >>> vmlinux.o:(intel_backlight_device_register) ld.lld: error: undefined symbol: backlight_device_register >>> referenced by intel_backlight.c:971 >>> vmlinux.o:(intel_backlight_device_register) ld.lld: error: undefined symbol: backlight_device_unregister >>> referenced by intel_backlight.c:999 >>> vmlinux.o:(intel_backlight_device_unregister) This issue occurred because intel_backlight_device_register and intel_backlight_device_unregister were enclosed within \#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) and #endif directives. However, according to Kconfig, CONFIG_DRM_I915 will select BACKLIGHT_CLASS_DEVICE only if ACPI is enabled. This led to an error, which can be resolved by removing the conditional statements related to ACPI. v2: Add a line starting with # Signed-off-by: Wang Jinchao --- drivers/gpu/drm/i915/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig index 01b5a8272a27..5003de921bf7 100644 --- a/drivers/gpu/drm/i915/Kconfig +++ b/drivers/gpu/drm/i915/Kconfig @@ -24,7 +24,7 @@ config DRM_I915 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 - select BACKLIGHT_CLASS_DEVICE if ACPI + select BACKLIGHT_CLASS_DEVICE select INPUT if ACPI select X86_PLATFORM_DEVICES if ACPI select ACPI_WMI if ACPI -- 2.40.0
[PATCH] drm/i915/gmch: fix build error var set but not used
When CONFIG_PNP is not defined, i915 will fail to compile with error bellow: drivers/gpu/drm/i915/soc/intel_gmch.c:43:13: error: variable ‘mchbar_addr’ set but not used Fix it by surrounding variable declaration and assignment with ifdef Signed-off-by: Wang Jinchao --- drivers/gpu/drm/i915/soc/intel_gmch.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.c b/drivers/gpu/drm/i915/soc/intel_gmch.c index 6d0204942f7a..d2c442b0b4eb 100644 --- a/drivers/gpu/drm/i915/soc/intel_gmch.c +++ b/drivers/gpu/drm/i915/soc/intel_gmch.c @@ -38,16 +38,17 @@ intel_alloc_mchbar_resource(struct drm_i915_private *i915) { int reg = GRAPHICS_VER(i915) >= 4 ? MCHBAR_I965 : MCHBAR_I915; u32 temp_lo, temp_hi = 0; - u64 mchbar_addr; int ret; - +#ifdef CONFIG_PNP + u64 mchbar_addr; +#endif if (GRAPHICS_VER(i915) >= 4) pci_read_config_dword(i915->gmch.pdev, reg + 4, _hi); pci_read_config_dword(i915->gmch.pdev, reg, _lo); - mchbar_addr = ((u64)temp_hi << 32) | temp_lo; /* If ACPI doesn't have it, assume we need to allocate it ourselves */ #ifdef CONFIG_PNP + mchbar_addr = ((u64)temp_hi << 32) | temp_lo; if (mchbar_addr && pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE)) return 0; -- 2.40.0