Skip to content

Commit

Permalink
drm/i915/guc: Rename intel_guc_loader.c to intel_guc_fw.c
Browse files Browse the repository at this point in the history
Remaining functions in intel_guc_loader.c were focused around
GuC firmware. Rename them to match object-verb pattern and
rename file itself.

Suggested-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171016144724.17244-6-michal.wajdeczko@intel.com
  • Loading branch information
Michal Wajdeczko authored and Joonas Lahtinen committed Oct 16, 2017
1 parent d9e2e01 commit e8668bb
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ i915-y += intel_uc.o \
intel_guc.o \
intel_guc_ct.o \
intel_guc_log.o \
intel_guc_loader.o \
intel_guc_fw.o \
intel_huc.o \
i915_guc_submission.o

Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/i915/intel_guc.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define _INTEL_GUC_H_

#include "intel_uncore.h"
#include "intel_guc_fw.h"
#include "intel_guc_fwif.h"
#include "intel_guc_ct.h"
#include "intel_guc_log.h"
Expand Down Expand Up @@ -114,9 +115,6 @@ int intel_guc_auth_huc(struct intel_guc *guc, u32 rsa_offset);
int intel_guc_suspend(struct drm_i915_private *dev_priv);
int intel_guc_resume(struct drm_i915_private *dev_priv);
struct i915_vma *intel_guc_allocate_vma(struct intel_guc *guc, u32 size);

int intel_guc_select_fw(struct intel_guc *guc);
int intel_guc_init_hw(struct intel_guc *guc);
u32 intel_guc_wopcm_size(struct drm_i915_private *dev_priv);

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
* Dave Gordon <david.s.gordon@intel.com>
* Alex Dai <yu.dai@intel.com>
*/

#include "intel_guc_fw.h"
#include "i915_drv.h"
#include "intel_uc.h"

#define SKL_FW_MAJOR 6
#define SKL_FW_MINOR 1
Expand Down Expand Up @@ -55,7 +56,6 @@ MODULE_FIRMWARE(I915_KBL_GUC_UCODE);

#define I915_GLK_GUC_UCODE GUC_FW_PATH(glk, GLK_FW_MAJOR, GLK_FW_MINOR)


/*
* Read the GuC status register (GUC_STATUS) and store it in the
* specified location; then return a boolean indicating whether
Expand Down Expand Up @@ -209,7 +209,7 @@ static int guc_ucode_xfer(struct drm_i915_private *dev_priv)
}

/**
* intel_guc_init_hw() - finish preparing the GuC for activity
* intel_guc_fw_upload() - finish preparing the GuC for activity
* @guc: intel_guc structure
*
* Called during driver loading and also after a GPU reset.
Expand All @@ -221,7 +221,7 @@ static int guc_ucode_xfer(struct drm_i915_private *dev_priv)
*
* Return: non-zero code on error
*/
int intel_guc_init_hw(struct intel_guc *guc)
int intel_guc_fw_upload(struct intel_guc *guc)
{
struct drm_i915_private *dev_priv = guc_to_i915(guc);
const char *fw_path = guc->fw.path;
Expand Down Expand Up @@ -258,12 +258,12 @@ int intel_guc_init_hw(struct intel_guc *guc)
}

/**
* intel_guc_select_fw() - selects GuC firmware for loading
* intel_guc_fw_select() - selects GuC firmware for loading
* @guc: intel_guc struct
*
* Return: zero when we know firmware, non-zero in other case
*/
int intel_guc_select_fw(struct intel_guc *guc)
int intel_guc_fw_select(struct intel_guc *guc)
{
struct drm_i915_private *dev_priv = guc_to_i915(guc);

Expand Down
33 changes: 33 additions & 0 deletions drivers/gpu/drm/i915/intel_guc_fw.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright © 2017 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
*/

#ifndef _INTEL_GUC_FW_H_
#define _INTEL_GUC_FW_H_

struct intel_guc;

int intel_guc_fw_select(struct intel_guc *guc);
int intel_guc_fw_upload(struct intel_guc *guc);

#endif
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/intel_uc.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void intel_uc_sanitize_options(struct drm_i915_private *dev_priv)
if (HAS_HUC_UCODE(dev_priv))
intel_huc_select_fw(&dev_priv->huc);

if (intel_guc_select_fw(&dev_priv->guc))
if (intel_guc_fw_select(&dev_priv->guc))
i915_modparams.enable_guc_loading = 0;
}

Expand Down Expand Up @@ -196,7 +196,7 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)

intel_huc_init_hw(&dev_priv->huc);
intel_guc_init_params(guc);
ret = intel_guc_init_hw(&dev_priv->guc);
ret = intel_guc_fw_upload(guc);
if (ret == 0 || ret != -EAGAIN)
break;

Expand Down

0 comments on commit e8668bb

Please sign in to comment.