All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Animesh Manna <animesh.manna@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915/skl: Documentation for CSR firmware.
Date: Tue, 12 May 2015 10:36:00 +0200	[thread overview]
Message-ID: <20150512083600.GA15256@phenom.ffwll.local> (raw)
In-Reply-To: <1431415928-21270-1-git-send-email-animesh.manna@intel.com>

On Tue, May 12, 2015 at 01:02:07PM +0530, Animesh Manna wrote:
> Added docbook info regarding context save and restore (CSR)
> firmware support added from gen9 onwards to drive newly added
> DMC (Display microcontroller) in display engine.
> 
> Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> Signed-off-by: A.Sunil Kamath <sunil.kamath@intel.com>
> ---
>  Documentation/DocBook/drm.tmpl   | 22 +++++++++++++++++++++-
>  drivers/gpu/drm/i915/intel_csr.c | 37 +++++++++++++++++++++++++++++++++++++
>  2 files changed, 58 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
> index 7c68ecc..217b4fc 100644
> --- a/Documentation/DocBook/drm.tmpl
> +++ b/Documentation/DocBook/drm.tmpl
> @@ -4153,6 +4153,27 @@ int num_ioctls;</synopsis>
>  	  </tgroup>
>  	</table>
>        </sect2>
> +
> +      <sect2>
> +       <title>CSR firmware support for DMC</title>
> +       <para>
> +     Display Context Save and Restore (CSR) firmware support added from gen9
> +     onwards to drive newly added DMC (Display microcontroller) in display
> +     engine to save and restore the state of display engine when it enter into
> +     low-power state and comes back to nomral. The above API are used to manage
> +     the firmware loading process.
> +       </para>
> +       <para>
> +     Firmware loading status will be one of the below states: FW_UNINITIALIZED,
> +     FW_LOADED, FW_FAILED.
> +       </para>
> +       <para>
> +     Once the firmware is written into the registers status will be moved from
> +     FW_UNINITIALIZED to FW_LOADED and for any erroneous condition status will
> +     be moved to FW_FAILED.

These kind of overview comments are best put into a DOC: section in the
sourcefiles and then pulled in like the function docs. There's lots of
examples for this in i915 already.
-Daniel

> +       </para>
> +!Idrivers/gpu/drm/i915/intel_csr.c
> +      </sect2>
>      </sect1>
>  
>      <sect1>
> @@ -4204,7 +4225,6 @@ int num_ioctls;</synopsis>
>  !Idrivers/gpu/drm/i915/i915_gem_shrinker.c
>        </sect2>
>      </sect1>
> -
>      <sect1>
>        <title> Tracing </title>
>        <para>
> diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> index 9311cdd..174106f 100644
> --- a/drivers/gpu/drm/i915/intel_csr.c
> +++ b/drivers/gpu/drm/i915/intel_csr.c
> @@ -183,6 +183,14 @@ static char intel_get_substepping(struct drm_device *dev)
>  		return -ENODATA;
>  }
>  
> +/**
> + * intel_csr_load_status_get() - to get firmware loading status.
> + * @dev_priv: i915 device.
> + *
> + * This function helps to get the firmware loading status.
> + *
> + * Return: Firmware loading status.
> + */
>  enum csr_state intel_csr_load_status_get(struct drm_i915_private *dev_priv)
>  {
>  	enum csr_state state;
> @@ -194,6 +202,13 @@ enum csr_state intel_csr_load_status_get(struct drm_i915_private *dev_priv)
>  	return state;
>  }
>  
> +/**
> + * intel_csr_load_status_set() - help to set firmware loading status.
> + * @dev_priv: i915 device.
> + * @state: enumeration of firmware loading status.
> + *
> + * Set the firmware loading status.
> + */
>  void intel_csr_load_status_set(struct drm_i915_private *dev_priv,
>  			enum csr_state state)
>  {
> @@ -202,6 +217,14 @@ void intel_csr_load_status_set(struct drm_i915_private *dev_priv,
>  	mutex_unlock(&dev_priv->csr_lock);
>  }
>  
> +/**
> + * intel_csr_load_program() - write the firmware from memory to register.
> + * @dev: drm device.
> + *
> + * CSR firmware is read from a .bin file and kept in internal memory one time.
> + * Everytime display comes back from low power state this function is called to
> + * copy the firmware from internal memory to registers.
> + */
>  void intel_csr_load_program(struct drm_device *dev)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -359,6 +382,13 @@ out:
>  	release_firmware(fw);
>  }
>  
> +/**
> + * intel_csr_ucode_init() - initialize the firmware loading.
> + * @dev: drm device.
> + *
> + * This function is called at the time of loading the display driver to read
> + * firmware from a .bin file and copied into a internal memory.
> + */
>  void intel_csr_ucode_init(struct drm_device *dev)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -393,6 +423,13 @@ void intel_csr_ucode_init(struct drm_device *dev)
>  	}
>  }
>  
> +/**
> + * intel_csr_ucode_fini() - unload the CSR firmware.
> + * @dev: drm device.
> + *
> + * Firmmware unloading includes freeing the internal momory and reset the
> + * firmware loading status.
> + */
>  void intel_csr_ucode_fini(struct drm_device *dev)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
> -- 
> 2.0.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-05-12  8:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12  7:32 [PATCH 1/2] drm/i915/skl: Documentation for CSR firmware Animesh Manna
2015-05-12  7:32 ` [PATCH 2/2] drm/i915/skl: corrected csr mutex lock declaration Animesh Manna
2015-05-12  8:29   ` Daniel Vetter
2015-05-13 15:40     ` Animesh Manna
2015-05-18  7:12       ` Daniel Vetter
2015-05-15  8:06   ` shuang.he
2015-05-12  8:36 ` Daniel Vetter [this message]
2015-05-13 16:43   ` [PATCH v2 1/2] drm/i915/skl: Documentation for CSR firmware Animesh Manna
2015-05-18  7:14     ` 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=20150512083600.GA15256@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=animesh.manna@intel.com \
    --cc=intel-gfx@lists.freedesktop.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 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.