All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 04/10] drm/i915/uc: Move intel_uc_fw_fetch() to intel_uc.c
Date: Thu, 2 Mar 2017 16:36:05 +0000	[thread overview]
Message-ID: <20170302163605.GE32004@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <20170302160354.27851-5-arkadiusz.hiler@intel.com>

On Thu, Mar 02, 2017 at 05:03:48PM +0100, Arkadiusz Hiler wrote:
> The file fits better.
> 
> Additionally rename it to intel_uc_prepare_fw(), as the function does
> more than simple fetch.
> 
> v2: remove second declaration, reorder (M. Wajdeczko)
> 
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_guc_loader.c | 137 +-------------------------------
>  drivers/gpu/drm/i915/intel_huc.c        |   2 +-
>  drivers/gpu/drm/i915/intel_uc.c         | 135 +++++++++++++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_uc.h         |   4 +-
>  4 files changed, 139 insertions(+), 139 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
> index 9f09e26..20e3337 100644
> --- a/drivers/gpu/drm/i915/intel_guc_loader.c
> +++ b/drivers/gpu/drm/i915/intel_guc_loader.c
> @@ -26,7 +26,6 @@
>   *    Dave Gordon <david.s.gordon@intel.com>
>   *    Alex Dai <yu.dai@intel.com>
>   */
> -#include <linux/firmware.h>
>  #include "i915_drv.h"
>  #include "intel_uc.h"
>  
> +void intel_uc_prepare_fw(struct drm_i915_private *dev_priv,
> +			 struct intel_uc_fw *uc_fw)
> +{
> +	struct pci_dev *pdev = dev_priv->drm.pdev;
> +	struct drm_i915_gem_object *obj;
> +	const struct firmware *fw = NULL;
> +	struct uc_css_header *css;
> +	size_t size;
> +	int err;

...

> +
> +	mutex_lock(&dev_priv->drm.struct_mutex);
> +	obj = i915_gem_object_create_from_data(dev_priv, fw->data, fw->size);
> +	mutex_unlock(&dev_priv->drm.struct_mutex);
> +	if (IS_ERR_OR_NULL(obj)) {
> +		err = obj ? PTR_ERR(obj) : -ENOMEM;
> +		goto fail;
> +	}
> +
> +	uc_fw->obj = obj;
> +	uc_fw->size = fw->size;
> +
> +	DRM_DEBUG_DRIVER("uC fw fetch status SUCCESS, obj %p\n",
> +			uc_fw->obj);
> +
> +	release_firmware(fw);
> +	uc_fw->fetch_status = INTEL_UC_FIRMWARE_SUCCESS;
> +	return;
> +
> +fail:
> +	DRM_WARN("Failed to fetch valid uC firmware from %s (error %d)\n",
> +		 uc_fw->path, err);
> +	DRM_DEBUG_DRIVER("uC fw fetch status FAIL; err %d, fw %p, obj %p\n",
> +		err, fw, uc_fw->obj);
> +
> +	obj = fetch_and_zero(&uc_fw->obj);
> +	if (obj)
> +		i915_gem_object_put(obj);

I missed whether you fixed this in later patches, but uc_fw->obj can
never be set at this point.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-03-02 16:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02 16:03 [PATCH v6 00/10] GuC Scrub vol. 1 Arkadiusz Hiler
2017-03-02 16:03 ` [PATCH 01/10] drm/i915/uc: Rename intel_?uc_{setup, load}() to _init_hw() Arkadiusz Hiler
2017-03-02 17:03   ` Michal Wajdeczko
2017-03-02 16:03 ` [PATCH 02/10] drm/i915/uc: Drop superfluous externs in intel_uc.h Arkadiusz Hiler
2017-03-02 16:03 ` [PATCH 03/10] drm/i915/huc: Add huc_to_i915 Arkadiusz Hiler
2017-03-02 16:03 ` [PATCH 04/10] drm/i915/uc: Move intel_uc_fw_fetch() to intel_uc.c Arkadiusz Hiler
2017-03-02 16:36   ` Chris Wilson [this message]
2017-03-02 16:38     ` Arkadiusz Hiler
2017-03-03 12:36     ` [PATCH] " Arkadiusz Hiler
2017-03-03 14:13       ` Michal Wajdeczko
2017-03-02 16:03 ` [PATCH 05/10] drm/i915/uc: Introduce intel_uc_init_fw() Arkadiusz Hiler
2017-03-02 16:03 ` [PATCH 06/10] drm/i915/guc: Extract param logic form guc_init_fw() Arkadiusz Hiler
2017-03-02 16:03 ` [PATCH 07/10] drm/i915/guc: Simplify intel_guc_init_hw() Arkadiusz Hiler
2017-03-02 16:03 ` [PATCH 08/10] drm/i915/uc: Simplify firmware path handling Arkadiusz Hiler
2017-03-02 16:03 ` [PATCH 09/10] drm/i915/uc: Separate firmware selection and preparation Arkadiusz Hiler
2017-03-02 16:03 ` [PATCH 10/10] drm/i915/uc: Add params for specifying firmware Arkadiusz Hiler
2017-03-02 18:02 ` ✗ Fi.CI.BAT: failure for GuC Scrub vol. 1 (rev8) Patchwork
2017-03-02 18:47   ` Arkadiusz Hiler
2017-03-03 14:02 ` ✗ Fi.CI.BAT: failure for GuC Scrub vol. 1 (rev9) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2017-03-07 15:24 [PATCH v7 00/10] GuC Scrub vol. 1 Arkadiusz Hiler
2017-03-07 15:24 ` [PATCH 04/10] drm/i915/uc: Move intel_uc_fw_fetch() to intel_uc.c Arkadiusz Hiler
2017-02-24 15:39 [PATCH v5 00/10] GuC Scrub vol. 1 Arkadiusz Hiler
2017-02-24 15:39 ` [PATCH 04/10] drm/i915/uc: Move intel_uc_fw_fetch() to intel_uc.c Arkadiusz Hiler
2017-02-24 16:28   ` Michal Wajdeczko

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=20170302163605.GE32004@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=arkadiusz.hiler@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.