From: Jani Nikula <jani.nikula@linux.intel.com>
To: ZNdOoHvIg7HXh7Gg@fedora,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Cc: stone.xulei@xfusion.com
Subject: Re: [Intel-gfx] [PATCH v3] drm/i915: Fix Kconfig error for CONFIG_DRM_I915
Date: Mon, 21 Aug 2023 10:13:15 +0300 [thread overview]
Message-ID: <87wmxo7tro.fsf@intel.com> (raw)
In-Reply-To: <ZOII3e9nsnmRjTN+@fedora>
On Sun, 20 Aug 2023, Wang Jinchao <wangjinchao@xfusion.com> 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
> \#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.
I told you in [1] what the real fix is.
The IS_REACHABLE() solution has been suggested a number of times, but I
think it's creating an unexpected and silent failure configuration. I
think IS_REACHABLE() is the wrong thing to do in most cases.
BR,
Jani.
[1] https://lore.kernel.org/r/87o7jaythm.fsf@intel.com
>
> Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
> ---
> 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(&i915->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 */
--
Jani Nikula, Intel Open Source Graphics Center
prev parent reply other threads:[~2023-08-21 7:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-20 12:36 [Intel-gfx] [PATCH v3] drm/i915: Fix Kconfig error for CONFIG_DRM_I915 Wang Jinchao
2023-08-21 7:13 ` Jani Nikula [this message]
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=87wmxo7tro.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=ZNdOoHvIg7HXh7Gg@fedora \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=stone.xulei@xfusion.com \
--cc=tvrtko.ursulin@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox