From: Anusha Srivatsa <anusha.srivatsa@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 7/8] drm/i915/get_params: Add GuC status to getparams
Date: Thu, 29 Sep 2016 11:04:04 -0700 [thread overview]
Message-ID: <1475172245-10939-8-git-send-email-anusha.srivatsa@intel.com> (raw)
In-Reply-To: <1475172245-10939-1-git-send-email-anusha.srivatsa@intel.com>
From: Peter Antoine <peter.antoine@intel.com>
This patch returns the GuC status to the caller. It is used so
that the userspace knows if the GuC has been loaded.
v4: rebase.
v5: rebased.
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 4 ++++
drivers/gpu/drm/i915/intel_guc_loader.c | 18 ++++++++++++++++++
include/uapi/drm/i915_drm.h | 1 +
3 files changed, 23 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 7af7bd6..ff1c18d 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -49,6 +49,7 @@
#include "i915_trace.h"
#include "i915_vgpu.h"
#include "intel_drv.h"
+#include "intel_guc.h"
static struct drm_driver driver;
@@ -339,6 +340,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
*/
value = 1;
break;
+ case I915_PARAM_HAS_GUC:
+ value = intel_is_guc_valid(dev_priv);
+ break;
default:
DRM_DEBUG("Unknown parameter %d\n", param->param);
return -EINVAL;
diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index 31a2b0a..5d2a703 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -801,3 +801,21 @@ void intel_guc_fini(struct drm_device *dev)
guc_fw->fetch_status = UC_FIRMWARE_NONE;
}
+
+/**
+ * intel_is_guc_valid() - Check to see if the GuC is fully loaded.
+ * @dev: drm dedvice to check.
+ *
+ * This function will return true if the guc has been loaded and
+ * has valid firmware.
+ */
+int intel_is_guc_valid(struct drm_i915_private *dev_priv)
+{
+ struct intel_uc_fw *guc_fw = &dev_priv->guc.guc_fw;
+
+ if (guc_fw->load_status == UC_FIRMWARE_SUCCESS)
+ return 1;
+ else
+ return 0;
+}
+
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 03725fe..629fb5e 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -388,6 +388,7 @@ typedef struct drm_i915_irq_wait {
#define I915_PARAM_HAS_POOLED_EU 38
#define I915_PARAM_MIN_EU_IN_POOL 39
#define I915_PARAM_MMAP_GTT_VERSION 40
+#define I915_PARAM_HAS_GUC 41
typedef struct drm_i915_getparam {
__s32 param;
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-09-29 18:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 18:03 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2016-09-29 18:03 ` [PATCH 1/8] drm/i915/guc: Make the GuC fw loading helper functions general Anusha Srivatsa
2016-09-29 18:03 ` [PATCH 2/8] drm/i915/huc: Unified css_header struct for GuC and HuC Anusha Srivatsa
2016-09-29 18:04 ` [PATCH 3/8] drm/i915/huc: Add HuC fw loading support Anusha Srivatsa
2016-09-29 18:04 ` [PATCH 4/8] drm/i915/huc: Add debugfs for HuC loading status check Anusha Srivatsa
2016-09-29 18:04 ` [PATCH 5/8] drm/i915/huc: Support HuC authentication Anusha Srivatsa
2016-09-29 18:04 ` [PATCH 6/8] drm/i915/huc: Add BXT HuC Loading Support Anusha Srivatsa
2016-09-29 18:04 ` Anusha Srivatsa [this message]
2016-09-29 18:04 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2016-09-29 18:31 ` ✗ Fi.CI.BAT: failure for HuC Loading Patches Patchwork
2016-10-13 13:10 ` [PATCH 0/8] " Daniel Vetter
-- strict thread matches above, loose matches on Subject: below --
2016-10-03 18:42 Anusha Srivatsa
2016-10-03 18:43 ` [PATCH 7/8] drm/i915/get_params: Add GuC status to getparams Anusha Srivatsa
2016-10-05 20:51 ` Rodrigo Vivi
2016-10-07 7:11 ` Daniel Vetter
2016-10-13 21:42 ` Jeff McGee
2016-10-17 6:49 ` 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=1475172245-10939-8-git-send-email-anusha.srivatsa@intel.com \
--to=anusha.srivatsa@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).