dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Philipp Zabel <p.zabel@pengutronix.de>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/modes: add non-OF stub for of_get_drm_display_mode
Date: Fri, 8 Jan 2021 10:24:03 -0800	[thread overview]
Message-ID: <6bed2949-bf2d-d10c-0dec-58c4f86fae16@infradead.org> (raw)
In-Reply-To: <20210108101343.23695-1-p.zabel@pengutronix.de>

On 1/8/21 2:13 AM, Philipp Zabel wrote:
> If CONFIG_OF is disabled, of_get_drm_display_mode is not compiled in,
> and drivers using it fail to build:
> 
>   ld: drivers/gpu/drm/imx/parallel-display.o: in function `imx_pd_connector_get_modes':
>   parallel-display.c:(.text+0x8d): undefined reference to `of_get_drm_display_mode'
> 
> Add an inline stub so they can be build-tested with non-OF
> configurations.
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

Acked-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
>  include/drm/drm_modes.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
> index a0d79d1c51e2..29ba4adf0c53 100644
> --- a/include/drm/drm_modes.h
> +++ b/include/drm/drm_modes.h
> @@ -461,9 +461,19 @@ void drm_display_mode_from_videomode(const struct videomode *vm,
>  void drm_display_mode_to_videomode(const struct drm_display_mode *dmode,
>  				   struct videomode *vm);
>  void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags);
> +
> +#if defined(CONFIG_OF)
>  int of_get_drm_display_mode(struct device_node *np,
>  			    struct drm_display_mode *dmode, u32 *bus_flags,
>  			    int index);
> +#else
> +static inline int of_get_drm_display_mode(struct device_node *np,
> +					  struct drm_display_mode *dmode,
> +					  u32 *bus_flags, int index)
> +{
> +	return -EINVAL;
> +}
> +#endif
>  
>  void drm_mode_set_name(struct drm_display_mode *mode);
>  int drm_mode_vrefresh(const struct drm_display_mode *mode);
> 


-- 
~Randy

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2021-01-09 11:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 10:13 [PATCH] drm/modes: add non-OF stub for of_get_drm_display_mode Philipp Zabel
2021-01-08 14:45 ` Daniel Vetter
2021-01-08 18:24 ` Randy Dunlap [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=6bed2949-bf2d-d10c-0dec-58c4f86fae16@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=p.zabel@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).