Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/8] drm/i915: VBT Parsing for the PSR Feature Block for HSW
Date: Fri, 11 Jan 2013 21:46:01 +0100	[thread overview]
Message-ID: <20130111204601.GM5737@phenom.ffwll.local> (raw)
In-Reply-To: <1357934277-3300-6-git-send-email-rodrigo.vivi@gmail.com>

On Fri, Jan 11, 2013 at 05:57:54PM -0200, Rodrigo Vivi wrote:
> From: Shobhit Kumar <shobhit.kumar@intel.com>
> 
> Parse and store useful information in i915_dev_private
> 
> Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h   |  8 ++++++++
>  drivers/gpu/drm/i915/intel_bios.c | 30 ++++++++++++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_bios.h | 20 +++++++++++++++++++-
>  3 files changed, 57 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index d2b93a4..6cb3439 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -751,6 +751,14 @@ typedef struct drm_i915_private {
>  	} edp;
>  	bool no_aux_handshake;
>  
> +
> +	/* PSR related info from VBT */
> +	u8 full_link_state;
> +	u8 wait_lines;
> +	u8 idle_frames;
> +	u16 wakeup_tp1;
> +	u16 wakeup_tp2_tp3;

Recently started holy war of mine: Can we pls now shovel random piles of
things into dev_priv? Preferred would be if only intel_dp.c would need to
care about this, otherwise a meaningful substruct (with the struct
definition out of line) is the 2nd best option ...
-Daniel

> +
>  	int crt_ddc_pin;
>  	struct drm_i915_fence_reg fence_regs[I915_MAX_NUM_FENCES]; /* assume 965 */
>  	int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index 87e9b92..a5fa3c4 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -381,6 +381,35 @@ parse_general_definitions(struct drm_i915_private *dev_priv,
>  	}
>  }
>  
> +
> +static void
> +parse_edp_psr(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
> +{
> +	struct bdb_psr_features *psr;
> +	struct bdb_lvds_options *lvds_opts;
> +	int index = 0;
> +	lvds_opts = find_section(bdb, BDB_LVDS_OPTIONS);
> +	if (!lvds_opts) {
> +		DRM_DEBUG_KMS("No LVDS Options block found.\n");
> +		return;
> +	}
> +
> +	index = lvds_opts->panel_type;
> +
> +	psr = find_section(bdb, BDB_PSR_FEATURES);
> +	if (!psr) {
> +		DRM_DEBUG_KMS("No PSR feature block found.\n");
> +		return;
> +	}
> +
> +	dev_priv->full_link_state = psr[index].link_disable;
> +	dev_priv->wait_lines = psr[index].wait_lines;
> +	dev_priv->idle_frames = psr[index].idle_frames;
> +	dev_priv->wakeup_tp1 = psr[index].wakeup_tp1;
> +	dev_priv->wakeup_tp2_tp3 = psr[index].wakeup_tp2;
> +}
> +
> +
>  static void
>  parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
>  			  struct bdb_header *bdb)
> @@ -747,6 +776,7 @@ intel_parse_bios(struct drm_device *dev)
>  	parse_device_mapping(dev_priv, bdb);
>  	parse_driver_features(dev_priv, bdb);
>  	parse_edp(dev_priv, bdb);
> +	parse_edp_psr(dev_priv, bdb);
>  
>  	if (bios)
>  		pci_unmap_rom(pdev, bios);
> diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
> index 36e57f9..c1d39de 100644
> --- a/drivers/gpu/drm/i915/intel_bios.h
> +++ b/drivers/gpu/drm/i915/intel_bios.h
> @@ -80,7 +80,7 @@ struct vbios_data {
>  #define BDB_EXT_MMIO_REGS	  6
>  #define BDB_SWF_IO		  7
>  #define BDB_SWF_MMIO		  8
> -#define BDB_DOT_CLOCK_TABLE	  9
> +#define BDB_PSR_FEATURES	  9
>  #define BDB_MODE_REMOVAL_TABLE	 10
>  #define BDB_CHILD_DEVICE_TABLE	 11
>  #define BDB_DRIVER_FEATURES	 12
> @@ -263,6 +263,24 @@ struct bdb_lvds_options {
>  	u8 rsvd4;
>  } __attribute__((packed));
>  
> +struct bdb_psr_features {
> +	/* psr_enable byte */
> +	u8 link_disable:1;
> +	u8 require_aux:1;
> +	u8 rsvd1:6;
> +
> +	/* panel wait times */
> +	u8 idle_frames:4;
> +	u8 wait_lines:3;
> +	u8 rsvd2:1;
> +
> +	/* TP1 wakeup time */
> +	u16 wakeup_tp1;
> +
> +	/* TP2 wakeup time */
> +	u16 wakeup_tp2;
> +} __attribute__((packed));
> +
>  /* LFP pointer table contains entries to the struct below */
>  struct bdb_lvds_lfp_data_ptr {
>  	u16 fp_timing_offset; /* offsets are from start of bdb */
> -- 
> 1.7.11.7
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2013-01-11 20:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 19:57 [PATCH 0/8] Enable eDP PSR funcionality at HSW Rodrigo Vivi
2013-01-11 19:57 ` [PATCH 1/8] drm/i915: Added eDP PSR registers Rodrigo Vivi
2013-01-15 13:36   ` Paulo Zanoni
2013-01-11 19:57 ` [PATCH 2/8] drm/i915: Added SDP and VSC structures for handling PSR for eDP Rodrigo Vivi
2013-01-11 20:15   ` Daniel Vetter
2013-01-14 11:22     ` Ville Syrjälä
2013-01-14 11:42       ` Philipp Klaus Krause
2013-01-11 19:57 ` [PATCH 3/8] drm/i915: Read the EDP DPCD and PSR Capability Rodrigo Vivi
2013-01-23 15:22   ` Paulo Zanoni
2013-01-11 19:57 ` [PATCH 4/8] drm/i915: Setup EDP PSR AUX Registers Rodrigo Vivi
2013-01-23 15:36   ` Paulo Zanoni
2013-01-11 19:57 ` [PATCH 5/8] drm/i915: VBT Parsing for the PSR Feature Block for HSW Rodrigo Vivi
2013-01-11 20:46   ` Daniel Vetter [this message]
2013-01-15 13:23     ` Rodrigo Vivi
2013-01-15 13:32       ` Daniel Vetter
2013-01-11 19:57 ` [PATCH 6/8] drm/i915: Enable/Disable PSR on HSW Rodrigo Vivi
2013-01-11 19:57 ` [PATCH 7/8] drm/i915: Added debugfs support for PSR Status Rodrigo Vivi
2013-01-11 19:57 ` [PATCH 8/8] drm/i915: Hook PSR functionality Rodrigo Vivi
2013-01-11 20:49   ` Daniel Vetter
2013-01-15 13:25     ` Rodrigo Vivi
2013-01-15 13:31       ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2013-02-25 22:55 [PATCH 0/8] Enable eDP PSR functionality at HSW - v3 Rodrigo Vivi
2013-02-25 22:55 ` [PATCH 5/8] drm/i915: VBT Parsing for the PSR Feature Block for HSW Rodrigo Vivi

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=20130111204601.GM5737@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@gmail.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