From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, aaron.lu@intel.com,
EGriffith92@gmail.com, stable@vger.kernel.org,
kent.baxley@canonical.com
Subject: Re: [Intel-gfx] [PATCH 1/2] drm/i915: check VBT for supported backlight type
Date: Wed, 9 Apr 2014 14:44:59 +0300 [thread overview]
Message-ID: <20140409114459.GI18465@intel.com> (raw)
In-Reply-To: <1397039735-2561-1-git-send-email-jani.nikula@intel.com>
On Wed, Apr 09, 2014 at 01:35:34PM +0300, Jani Nikula wrote:
> The only supported types are none and PWM. Other values are obsolete or
> reserved, don't add them.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 1 +
> drivers/gpu/drm/i915/intel_bios.c | 10 ++++++++++
> drivers/gpu/drm/i915/intel_bios.h | 3 +++
> 3 files changed, 14 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 55addaaa8222..03f4c866bf3e 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1154,6 +1154,7 @@ struct intel_vbt_data {
> struct edp_power_seq edp_pps;
>
> struct {
> + bool present;
> u16 pwm_freq_hz;
> bool active_low_pwm;
Could pack the bools next to each other.
Otherwise the series looks good. Obviously I can't tell whether the VBT
can be trusted on this, but at least the code matches the spec I have.
So for the series:
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> } backlight;
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index 9b986775c4b0..862ca04f7a44 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -309,6 +309,9 @@ parse_lfp_backlight(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
> const struct bdb_lfp_backlight_data *backlight_data;
> const struct bdb_lfp_backlight_data_entry *entry;
>
> + /* Err to enabling backlight if no backlight block. */
> + dev_priv->vbt.backlight.present = true;
> +
> backlight_data = find_section(bdb, BDB_LVDS_BACKLIGHT);
> if (!backlight_data)
> return;
> @@ -321,6 +324,13 @@ parse_lfp_backlight(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
>
> entry = &backlight_data->data[panel_type];
>
> + dev_priv->vbt.backlight.present = entry->type == BDB_BACKLIGHT_TYPE_PWM;
> + if (!dev_priv->vbt.backlight.present) {
> + DRM_DEBUG_KMS("PWM backlight not present in VBT (type %u)\n",
> + entry->type);
> + return;
> + }
> +
> dev_priv->vbt.backlight.pwm_freq_hz = entry->pwm_freq_hz;
> dev_priv->vbt.backlight.active_low_pwm = entry->active_low_pwm;
> DRM_DEBUG_KMS("VBT backlight PWM modulation frequency %u Hz, "
> diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
> index d02e5f93c362..036a79922391 100644
> --- a/drivers/gpu/drm/i915/intel_bios.h
> +++ b/drivers/gpu/drm/i915/intel_bios.h
> @@ -389,6 +389,9 @@ struct bdb_lvds_lfp_data {
> struct bdb_lvds_lfp_data_entry data[16];
> } __packed;
>
> +#define BDB_BACKLIGHT_TYPE_NONE 0
> +#define BDB_BACKLIGHT_TYPE_PWM 2
> +
> struct bdb_lfp_backlight_data_entry {
> u8 type:2;
> u8 active_low_pwm:1;
> --
> 1.7.9.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
prev parent reply other threads:[~2014-04-09 11:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-09 10:35 [PATCH 1/2] drm/i915: check VBT for supported backlight type Jani Nikula
2014-04-09 10:35 ` [PATCH 2/2] drm/i915: do not setup backlight if not available according to VBT Jani Nikula
2014-04-09 13:45 ` Daniel Vetter
2014-04-10 8:09 ` Jani Nikula
2014-04-09 17:01 ` Kamal Mostafa
2014-04-09 11:44 ` Ville Syrjälä [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=20140409114459.GI18465@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=EGriffith92@gmail.com \
--cc=aaron.lu@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=kent.baxley@canonical.com \
--cc=stable@vger.kernel.org \
/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