From: Jani Nikula <jani.nikula@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Subject: Re: [PATCH] drm: probe_helper: Hide ugly ifdef
Date: Wed, 20 Apr 2016 12:24:16 +0300 [thread overview]
Message-ID: <87k2jsocov.fsf@intel.com> (raw)
In-Reply-To: <1461087638-16959-1-git-send-email-ezequiel@vanguardiasur.com.ar>
On Tue, 19 Apr 2016, Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote:
> Push the ifdef to the drm_edid.h and create a stub, for the
> DRM_LOAD_EDID_FIRMWARE=n case. This removes some clutter in
> the code, making it more readable.
>
> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/drm_probe_helper.c | 2 --
> include/drm/drm_edid.h | 8 ++++++++
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> index e714b5a7955f..0329080d7f7c 100644
> --- a/drivers/gpu/drm/drm_probe_helper.c
> +++ b/drivers/gpu/drm/drm_probe_helper.c
> @@ -264,10 +264,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
> count = drm_add_edid_modes(connector, edid);
> drm_edid_to_eld(connector, edid);
> } else {
> -#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE
> count = drm_load_edid_firmware(connector);
> if (count == 0)
> -#endif
> count = (*connector_funcs->get_modes)(connector);
> }
>
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index 2af97691e878..5996598bc778 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -328,7 +328,15 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb);
> int drm_av_sync_delay(struct drm_connector *connector,
> const struct drm_display_mode *mode);
> struct drm_connector *drm_select_eld(struct drm_encoder *encoder);
> +
> +#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE
> int drm_load_edid_firmware(struct drm_connector *connector);
> +#else
> +static inline int drm_load_edid_firmware(struct drm_connector *connector)
> +{
> + return 0;
> +}
> +#endif
>
> int
> drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-04-20 9:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-19 17:40 [PATCH] drm: probe_helper: Hide ugly ifdef Ezequiel Garcia
2016-04-19 17:40 ` [PATCH] drm: Make drm.debug parameter description more helpful Ezequiel Garcia
2016-04-19 21:00 ` Emil Velikov
2016-04-20 9:21 ` Jani Nikula
2016-04-20 15:48 ` Ezequiel Garcia
2016-04-20 16:45 ` [PATCH v2] " Ezequiel Garcia
2016-04-21 7:32 ` Jani Nikula
2016-04-21 7:50 ` Daniel Vetter
2016-04-20 9:24 ` Jani Nikula [this message]
2016-04-20 11:35 ` [PATCH] drm: probe_helper: Hide ugly ifdef Daniel Vetter
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=87k2jsocov.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ezequiel@vanguardiasur.com.ar \
/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.