public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 2/2] drm: add backwards compatibility support for drm_kms_helper.edid_firmware
Date: Fri, 15 Sep 2017 15:15:21 +0300	[thread overview]
Message-ID: <20170915121521.GQ4914@intel.com> (raw)
In-Reply-To: <4968bb2bdd416e8dd84b3059b7c9843732dcef0e.1505203831.git.jani.nikula@intel.com>

On Tue, Sep 12, 2017 at 11:19:27AM +0300, Jani Nikula wrote:
> If drm_kms_helper.edid_firmware module parameter is set at
> drm_kms_helper probe time, update the new drm.edid_firmware parameter
> for backwards compatibility.
> 
> The drm_kms_helper.edid_firmware is now read-only in sysfs to prevent
> runtime updates.
> 
> This is a sort of easy middle ground; adding a full runtime support via
> /sys/module/drm_kms_helper/parameters/edid_firmware would be possible,
> but considerably more and uglier code.

Hmm. Wouldn't you just have to have custom kernel_param_ops and
that's about it? Seems like that could be a bit cleaner.

> 
> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> 
> ---
> 
> I'm wondering if the change from drm_kms_helper.edid_firmware to
> drm.edid_firmware is enough of an ABI breakage to warrant something like
> this patch.
> ---
>  drivers/gpu/drm/drm_edid_load.c         |  7 +++++++
>  drivers/gpu/drm/drm_kms_helper_common.c | 19 +++++++++++++++++++
>  include/drm/drm_edid.h                  |  2 ++
>  3 files changed, 28 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c
> index 1c0495acf341..a94005529cd4 100644
> --- a/drivers/gpu/drm/drm_edid_load.c
> +++ b/drivers/gpu/drm/drm_edid_load.c
> @@ -31,6 +31,13 @@ module_param_string(edid_firmware, edid_firmware, sizeof(edid_firmware), 0644);
>  MODULE_PARM_DESC(edid_firmware, "Do not probe monitor, use specified EDID blob "
>  	"from built-in data or /lib/firmware instead. ");
>  
> +/* Use only for backward compatibility with drm_kms_helper.edid_firmware */
> +void __drm_set_edid_firmware_path(const char *path)
> +{
> +	strlcpy(edid_firmware, path, sizeof(edid_firmware));
> +}
> +EXPORT_SYMBOL(__drm_set_edid_firmware_path);
> +
>  #define GENERIC_EDIDS 6
>  static const char * const generic_edid_name[GENERIC_EDIDS] = {
>  	"edid/800x600.bin",
> diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c
> index 6e35a56a6102..6130199a83b6 100644
> --- a/drivers/gpu/drm/drm_kms_helper_common.c
> +++ b/drivers/gpu/drm/drm_kms_helper_common.c
> @@ -26,6 +26,7 @@
>   */
>  
>  #include <linux/module.h>
> +#include <drm/drmP.h>
>  
>  #include "drm_crtc_helper_internal.h"
>  
> @@ -33,10 +34,28 @@ MODULE_AUTHOR("David Airlie, Jesse Barnes");
>  MODULE_DESCRIPTION("DRM KMS helper");
>  MODULE_LICENSE("GPL and additional rights");
>  
> +#if IS_ENABLED(CONFIG_DRM_LOAD_EDID_FIRMWARE)
> +static char edid_firmware[PATH_MAX];
> +module_param_string(edid_firmware, edid_firmware, sizeof(edid_firmware), 0444);
> +MODULE_PARM_DESC(edid_firmware, "DEPRECATED. Use drm.edid_firmware instead.");
> +static inline void legacy_set_edid_firmare_path(void)
> +{
> +	if (edid_firmware[0]) {
> +		DRM_NOTE("drm_kms_firmware.edid_firmware is deprecated, "
> +			 "please use drm.edid_firmware intead.\n");
> +		__drm_set_edid_firmware_path(edid_firmware);
> +	}
> +}
> +#else
> +static inline void legacy_set_edid_firmare_path(void) {}
> +#endif
> +
>  static int __init drm_kms_helper_init(void)
>  {
>  	int ret;
>  
> +	legacy_set_edid_firmare_path();
> +
>  	/* Call init functions from specific kms helpers here */
>  	ret = drm_fb_helper_modinit();
>  	if (ret < 0)
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index 1e1908a6b1d6..cdfb793255f0 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -341,12 +341,14 @@ int drm_av_sync_delay(struct drm_connector *connector,
>  
>  #ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE
>  struct edid *drm_load_edid_firmware(struct drm_connector *connector);
> +void __drm_set_edid_firmware_path(const char *path);
>  #else
>  static inline struct edid *
>  drm_load_edid_firmware(struct drm_connector *connector)
>  {
>  	return ERR_PTR(-ENOENT);
>  }
> +static inline void __drm_set_edid_firmware_path(const char *path) {}
>  #endif
>  
>  int
> -- 
> 2.11.0

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-09-15 12:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-12  8:19 [PATCH v3 0/2] drm/edid: transparent low-level override/firmware EDIDs Jani Nikula
2017-09-12  8:19 ` [PATCH v3 1/2] drm: handle override and firmware EDID at drm_do_get_edid() level Jani Nikula
2017-09-15 12:08   ` Ville Syrjälä
2017-09-12  8:19 ` [PATCH v3 2/2] drm: add backwards compatibility support for drm_kms_helper.edid_firmware Jani Nikula
2017-09-15 12:15   ` Ville Syrjälä [this message]
2017-09-18 18:20     ` Jani Nikula
2017-09-18 18:20       ` [PATCH] " Jani Nikula
2017-09-18 19:29         ` Ville Syrjälä
2017-09-19  8:03           ` Jani Nikula
2017-09-12  8:38 ` ✓ Fi.CI.BAT: success for drm/edid: transparent low-level override/firmware EDIDs Patchwork
2017-09-12  9:05 ` [PATCH v3 0/2] " Abdiel Janulgue
2017-09-12  9:55 ` ✓ Fi.CI.IGT: success for " Patchwork
2017-09-18 19:02 ` ✓ Fi.CI.BAT: success for drm/edid: transparent low-level override/firmware EDIDs (rev2) Patchwork
2017-09-19 10:40 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-09-19 15:47 ` [PATCH v3 0/2] drm/edid: transparent low-level override/firmware EDIDs Jani Nikula

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=20170915121521.GQ4914@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=abdiel.janulgue@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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