* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
@ 2017-01-13 17:07 Anusha Srivatsa
0 siblings, 0 replies; 39+ messages in thread
From: Anusha Srivatsa @ 2017-01-13 17:07 UTC (permalink / raw)
To: intel-gfx; +Cc: Peter Antoine
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v3: rebased on top of drm-tip. Removed any reference to intel_huc.h
v4: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
Remove intel_is_huc_valid() since it is used only in one place.
Put the case of I915_PARAM_HAS_HUC() in the right place.
v5: rebased. Add a comment to specify that I915_READ(reg)
does not read garbage value. The register HUC_STATUS2 is force
woken and no rpm is needed.
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 7 +++++++
include/uapi/drm/i915_drm.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index d7a0b49..49a927a 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_uc.h"
static struct drm_driver driver;
@@ -315,6 +316,12 @@ static int i915_getparam(struct drm_device *dev, void *data,
case I915_PARAM_MIN_EU_IN_POOL:
value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
break;
+ case I915_PARAM_HUC_STATUS:
+ /* The register is already force-woken. We dont need
+ * any rpm here
+ */
+ value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
+ break;
case I915_PARAM_MMAP_GTT_VERSION:
/* Though we've started our numbering from 1, and so class all
* earlier versions as 0, in effect their value is undefined as
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index da32c2f..57093b4 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
* priorities and the driver will attempt to execute batches in priority order.
*/
#define I915_PARAM_HAS_SCHEDULER 41
+#define I915_PARAM_HUC_STATUS 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 0/8] HuC Loading Patches
@ 2017-01-14 1:17 Anusha Srivatsa
2017-01-14 1:17 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2017-01-14 1:17 UTC (permalink / raw)
To: intel-gfx
The patches add HuC loading support. The driver builds a frame level
workload which is stored in the graphics memory. This workload is presented
to HuC for processing. The driver, therefore should first determine if the
HuC is enabled and also read the huC athentication status bit to determine
if HuC was successfully loaded. The GuC is required to authenticate the HuC.
The userspace patches that check for a fully loaded HuC firmware and use it
can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
More information regarding the HuC, batch commands that configure the
HuC etc can be found at-
https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol02a-commandreference-instructions-huc.pdf
https://www.x.org/docs/intel/CHV/intel-gfx-prm-osrc-chv-bsw-vol10-hevc.pdf
v2: rebased. Changed the code following the review comments.
v3: rebased. Organize code. Move contents of intel_huc.h to intel_uc.h.
Update function intel_huc_load(),intel_huc_init() and intel_uc_fw_fetch()
to accept dev_priv instead of dev.
v4: rebased. Remove intel_is_huc_valid() since it is called onoly once.
Refactor the code to reduce redundency. Remove fiels like uc_dev which
are no longer used.
v5: rebased. Beautify the code- remove comments that no longer hold
good, add newlines etc.
v6: rebased. Remove further redundency. Correct comments. Replace wait_for
with intel_wait_for_register() for optimisation purpose.Make fw_type an enum.
v7: rebased. Rename intel_huc_loader() to intel_huc(). Move intel_guc_auth_huc()
from intel_uc.c to intel_huc.c. Add return values to DRM_ERRORs.
v8: Use DRM_INFO instead of DRM_ERROR in places that are non-erraneous.
Remove invalidates that are no longer required.
Anusha Srivatsa (8):
drm/i915/guc: Make the GuC fw loading helper functions general
drm/i915/huc: Unified css_header struct for GuC and HuC
drm/i915/huc: Add HuC fw loading support
drm/i915/huc: Add BXT HuC Loading Support
drm/i915/HuC: Add KBL huC loading Support
drm/i915/huc: Add debugfs for HuC loading status check
drm/i915/huc: Support HuC authentication
drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_debugfs.c | 43 +++-
drivers/gpu/drm/i915/i915_drv.c | 10 +
drivers/gpu/drm/i915/i915_drv.h | 2 +
drivers/gpu/drm/i915/i915_guc_reg.h | 6 +
drivers/gpu/drm/i915/i915_guc_submission.c | 4 +-
drivers/gpu/drm/i915/intel_guc_fwif.h | 24 +-
drivers/gpu/drm/i915/intel_guc_loader.c | 196 +++++++++--------
drivers/gpu/drm/i915/intel_huc.c | 342 +++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_uc.h | 60 +++--
include/uapi/drm/i915_drm.h | 1 +
11 files changed, 569 insertions(+), 120 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_huc.c
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2017-01-14 1:17 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
@ 2017-01-14 1:17 ` Anusha Srivatsa
0 siblings, 0 replies; 39+ messages in thread
From: Anusha Srivatsa @ 2017-01-14 1:17 UTC (permalink / raw)
To: intel-gfx
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v3: rebased on top of drm-tip. Removed any reference to intel_huc.h
v4: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
Remove intel_is_huc_valid() since it is used only in one place.
Put the case of I915_PARAM_HAS_HUC() in the right place.
v5: rebased. Add a comment to specify that I915_READ(reg)
does not read garbage value. The register HUC_STATUS2 is force
woken and no rpm is needed.
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 7 +++++++
include/uapi/drm/i915_drm.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index d7a0b49..49a927a 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_uc.h"
static struct drm_driver driver;
@@ -315,6 +316,12 @@ static int i915_getparam(struct drm_device *dev, void *data,
case I915_PARAM_MIN_EU_IN_POOL:
value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
break;
+ case I915_PARAM_HUC_STATUS:
+ /* The register is already force-woken. We dont need
+ * any rpm here
+ */
+ value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
+ break;
case I915_PARAM_MMAP_GTT_VERSION:
/* Though we've started our numbering from 1, and so class all
* earlier versions as 0, in effect their value is undefined as
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index da32c2f..57093b4 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
* priorities and the driver will attempt to execute batches in priority order.
*/
#define I915_PARAM_HAS_SCHEDULER 41
+#define I915_PARAM_HUC_STATUS 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 0/8] HuC Loading Patches
@ 2017-01-13 18:08 Anusha Srivatsa
2017-01-13 18:08 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2017-01-13 18:08 UTC (permalink / raw)
To: intel-gfx
The patches add HuC loading support. The driver builds a frame level
workload which is stored in the graphics memory. This workload is presented
to HuC for processing. The driver, therefore should first determine if the
HuC is enabled and also read the huC athentication status bit to determine
if HuC was successfully loaded. The GuC is required to authenticate the HuC.
The userspace patches that check for a fully loaded HuC firmware and use it
can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
More information regarding the HuC, batch commands that configure the
HuC etc can be found at-
https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol02a-commandreference-instructions-huc.pdf
https://www.x.org/docs/intel/CHV/intel-gfx-prm-osrc-chv-bsw-vol10-hevc.pdf
v2: rebased. Changed the code following the review comments.
v3: rebased. Organize code. Move contents of intel_huc.h to intel_uc.h.
Update function intel_huc_load(),intel_huc_init() and intel_uc_fw_fetch()
to accept dev_priv instead of dev.
v4: rebased. Remove intel_is_huc_valid() since it is called onoly once.
Refactor the code to reduce redundency. Remove fiels like uc_dev which
are no longer used.
v5: rebased. Beautify the code- remove comments that no longer hold
good, add newlines etc.
v6: rebased. Remove further redundency. Correct comments. Replace wait_for
with intel_wait_for_register() for optimisation purpose.Make fw_type an enum.
v7: rebased. Rename intel_huc_loader() to intel_huc(). Move intel_guc_auth_huc()
from intel_uc.c to intel_huc.c. Add return values to DRM_ERRORs.
v8: Use DRM_INFO instead of DRM_ERROR in places that are non-erraneous.
Remove invalidates that are no longer required.
Anusha Srivatsa (8):
drm/i915/guc: Make the GuC fw loading helper functions general
drm/i915/huc: Unified css_header struct for GuC and HuC
drm/i915/huc: Add HuC fw loading support
drm/i915/huc: Add BXT HuC Loading Support
drm/i915/HuC: Add KBL huC loading Support
drm/i915/huc: Add debugfs for HuC loading status check
drm/i915/huc: Support HuC authentication
drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_debugfs.c | 43 +++-
drivers/gpu/drm/i915/i915_drv.c | 10 +
drivers/gpu/drm/i915/i915_drv.h | 2 +
drivers/gpu/drm/i915/i915_guc_reg.h | 6 +
drivers/gpu/drm/i915/i915_guc_submission.c | 4 +-
drivers/gpu/drm/i915/intel_guc_fwif.h | 24 +-
drivers/gpu/drm/i915/intel_guc_loader.c | 196 +++++++++--------
drivers/gpu/drm/i915/intel_huc.c | 342 +++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_uc.h | 60 +++--
include/uapi/drm/i915_drm.h | 1 +
11 files changed, 569 insertions(+), 120 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_huc.c
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2017-01-13 18:08 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
@ 2017-01-13 18:08 ` Anusha Srivatsa
0 siblings, 0 replies; 39+ messages in thread
From: Anusha Srivatsa @ 2017-01-13 18:08 UTC (permalink / raw)
To: intel-gfx; +Cc: Peter Antoine
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v3: rebased on top of drm-tip. Removed any reference to intel_huc.h
v4: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
Remove intel_is_huc_valid() since it is used only in one place.
Put the case of I915_PARAM_HAS_HUC() in the right place.
v5: rebased. Add a comment to specify that I915_READ(reg)
does not read garbage value. The register HUC_STATUS2 is force
woken and no rpm is needed.
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 7 +++++++
include/uapi/drm/i915_drm.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index d7a0b49..49a927a 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_uc.h"
static struct drm_driver driver;
@@ -315,6 +316,12 @@ static int i915_getparam(struct drm_device *dev, void *data,
case I915_PARAM_MIN_EU_IN_POOL:
value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
break;
+ case I915_PARAM_HUC_STATUS:
+ /* The register is already force-woken. We dont need
+ * any rpm here
+ */
+ value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
+ break;
case I915_PARAM_MMAP_GTT_VERSION:
/* Though we've started our numbering from 1, and so class all
* earlier versions as 0, in effect their value is undefined as
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index da32c2f..57093b4 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
* priorities and the driver will attempt to execute batches in priority order.
*/
#define I915_PARAM_HAS_SCHEDULER 41
+#define I915_PARAM_HUC_STATUS 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 0/8] HuC Loading Patches
@ 2017-01-04 14:55 Anusha Srivatsa
2017-01-04 14:55 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2017-01-04 14:55 UTC (permalink / raw)
To: intel-gfx
These patches add HuC loading support. The driver builds a frame level
workload which is stored in the graphics memory. This workload is presented
to HuC for processing. The driver, therefore should first determine if the
HuC is enabled and also read the huC athentication status bit to determine
if HuC was successfully loaded. The GuC is required to authenticate the HuC.
The userspace patches that check for a fully loaded HuC firmware and use it
can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
More information regarding the HuC, batch commands that configure the
HuC etc can be found at-
https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol02a-commandreference-instructions-huc.pdf
https://www.x.org/docs/intel/CHV/intel-gfx-prm-osrc-chv-bsw-vol10-hevc.pdf
v2: rebased.
v3: rebased. Changed the code following the review comments.
v4: Added action_lock initialization fix provided by Arek
(Hiler Arkadiusz) to the first patch in the series- Make the
GuC fw loading helper functions general.
v5: rebased on top of drm-tip. The patch series is now in sync with GuC
code reorganization efforts by Arek-
https://patchwork.freedesktop.org/series/15896/
v6:rebased. Organize code. Move contents of intel_huc.h to intel_uc.h.
Update function intel_huc_load(),intel_huc_init() and intel_uc_fw_fetch()
to accept dev_priv instead of dev.
v7: rebased. Remove intel_is_huc_valid() since it is called onoly once.
Refactor the code to reduce redundency. Remove fiels like uc_dev which
are no longer used.
v8: rebased. Beautify the code- remove comments that no longer hold
good, add newlines etc.
v9: rebased. Remove further redundency. Correct comments. Replace wait_for
with intel_wait_for_register() for optimisation purpose.Make fw_type an enum.
Anusha Srivatsa (3):
drm/i915/huc: Add HuC fw loading support
drm/i915/huc: Add BXT HuC Loading Support
drm/i915/HuC: Add KBL huC loading Support
Peter Antoine (5):
drm/i915/guc: Make the GuC fw loading helper functions general
drm/i915/huc: Unified css_header struct for GuC and HuC
drm/i915/huc: Add debugfs for HuC loading status check
drm/i915/huc: Support HuC authentication
drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_debugfs.c | 43 ++++-
drivers/gpu/drm/i915/i915_drv.c | 11 +-
drivers/gpu/drm/i915/i915_drv.h | 3 +-
drivers/gpu/drm/i915/i915_guc_reg.h | 3 +
drivers/gpu/drm/i915/i915_guc_submission.c | 4 +-
drivers/gpu/drm/i915/intel_guc_fwif.h | 24 ++-
drivers/gpu/drm/i915/intel_guc_loader.c | 200 ++++++++++----------
drivers/gpu/drm/i915/intel_huc_loader.c | 283 +++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_uc.c | 68 ++++++-
drivers/gpu/drm/i915/intel_uc.h | 64 +++++--
include/uapi/drm/i915_drm.h | 1 +
12 files changed, 579 insertions(+), 126 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_huc_loader.c
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2017-01-04 14:55 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
@ 2017-01-04 14:55 ` Anusha Srivatsa
0 siblings, 0 replies; 39+ messages in thread
From: Anusha Srivatsa @ 2017-01-04 14:55 UTC (permalink / raw)
To: intel-gfx; +Cc: Peter Antoine
From: Peter Antoine <peter.antoine@intel.com>
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v4: rebased.
v5: rebased on top of drm-tip.
v6: rebased. Removed any reference to intel_huc.h
v7: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
Remove intel_is_huc_valid() since it is used only in one place.
Put the case of I915_PARAM_HAS_HUC() in the right place.
v8: rebased. Add a comment to specify that I915_READ(reg)
does not read garbage value. The register HUC_STATUS2 is force
woken and no rpm is needed.
v9: rebased.
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 7 +++++++
drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
include/uapi/drm/i915_drm.h | 1 +
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index c9f71e0..723442c 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_uc.h"
static struct drm_driver driver;
@@ -315,6 +316,12 @@ static int i915_getparam(struct drm_device *dev, void *data,
case I915_PARAM_MIN_EU_IN_POOL:
value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
break;
+ case I915_PARAM_HUC_STATUS:
+ /* The register is already force-woken. We dont need
+ * any rpm here
+ */
+ value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
+ break;
case I915_PARAM_MMAP_GTT_VERSION:
/* Though we've started our numbering from 1, and so class all
* earlier versions as 0, in effect their value is undefined as
diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
index 57fc48b..af75d1d 100644
--- a/drivers/gpu/drm/i915/intel_huc_loader.c
+++ b/drivers/gpu/drm/i915/intel_huc_loader.c
@@ -281,4 +281,3 @@ void intel_huc_fini(struct drm_device *dev)
huc_fw->fetch_status = INTEL_UC_FIRMWARE_NONE;
}
-
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index da32c2f..57093b4 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
* priorities and the driver will attempt to execute batches in priority order.
*/
#define I915_PARAM_HAS_SCHEDULER 41
+#define I915_PARAM_HUC_STATUS 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 0/8] HuC Loading Patches
@ 2017-01-04 13:27 Anusha Srivatsa
2017-01-04 13:27 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2017-01-04 13:27 UTC (permalink / raw)
To: intel-gfx
These patches add HuC loading support. The driver builds a frame level
workload which is stored in the graphics memory. This workload is presented
to HuC for processing. The driver, therefore should first determine if the
HuC is enabled and also read the huC athentication status bit to determine
if HuC was successfully loaded. The GuC is required to authenticate the HuC.
The userspace patches that check for a fully loaded HuC firmware and use it
can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
More information regarding the HuC, batch commands that configure the
HuC etc can be found at-
https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol02a-commandreference-instructions-huc.pdf
https://www.x.org/docs/intel/CHV/intel-gfx-prm-osrc-chv-bsw-vol10-hevc.pdf
v2: rebased.
v3: rebased. Changed the code following the review comments.
v4: Added action_lock initialization fix provided by Arek
(Hiler Arkadiusz) to the first patch in the series- Make the
GuC fw loading helper functions general.
v5: rebased on top of drm-tip. The patch series is now in sync with GuC
code reorganization efforts by Arek-
https://patchwork.freedesktop.org/series/15896/
v6:rebased. Organize code. Move contents of intel_huc.h to intel_uc.h.
Update function intel_huc_load(),intel_huc_init() and intel_uc_fw_fetch()
to accept dev_priv instead of dev.
v7: rebased. Remove intel_is_huc_valid() since it is called onoly once.
Refactor the code to reduce redundency. Remove fiels like uc_dev which
are no longer used.
v8: rebased. Beautify the code- remove comments that no longer hold
good, add newlines etc.
v9: rebased. Remove further redundency. Correct comments. Replace wait_for
with intel_wait_for_register() for optimisation purpose.Make fw_type an enum.
Anusha Srivatsa (3):
drm/i915/huc: Add HuC fw loading support
drm/i915/huc: Add BXT HuC Loading Support
drm/i915/HuC: Add KBL huC loading Support
Peter Antoine (5):
drm/i915/guc: Make the GuC fw loading helper functions general
drm/i915/huc: Unified css_header struct for GuC and HuC
drm/i915/huc: Add debugfs for HuC loading status check
drm/i915/huc: Support HuC authentication
drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_debugfs.c | 43 ++++-
drivers/gpu/drm/i915/i915_drv.c | 11 +-
drivers/gpu/drm/i915/i915_drv.h | 3 +-
drivers/gpu/drm/i915/i915_guc_reg.h | 3 +
drivers/gpu/drm/i915/i915_guc_submission.c | 4 +-
drivers/gpu/drm/i915/intel_guc_fwif.h | 24 ++-
drivers/gpu/drm/i915/intel_guc_loader.c | 200 ++++++++++----------
drivers/gpu/drm/i915/intel_huc_loader.c | 283 +++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_uc.c | 68 ++++++-
drivers/gpu/drm/i915/intel_uc.h | 64 +++++--
include/uapi/drm/i915_drm.h | 1 +
12 files changed, 579 insertions(+), 126 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_huc_loader.c
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2017-01-04 13:27 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
@ 2017-01-04 13:27 ` Anusha Srivatsa
0 siblings, 0 replies; 39+ messages in thread
From: Anusha Srivatsa @ 2017-01-04 13:27 UTC (permalink / raw)
To: intel-gfx; +Cc: Peter Antoine
From: Peter Antoine <peter.antoine@intel.com>
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v4: rebased.
v5: rebased on top of drm-tip.
v6: rebased. Removed any reference to intel_huc.h
v7: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
Remove intel_is_huc_valid() since it is used only in one place.
Put the case of I915_PARAM_HAS_HUC() in the right place.
v8: rebased. Add a comment to specify that I915_READ(reg)
does not read garbage value. The register HUC_STATUS2 is force
woken and no rpm is needed.
v9: rebased.
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 7 +++++++
drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
include/uapi/drm/i915_drm.h | 1 +
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index c9f71e0..723442c 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_uc.h"
static struct drm_driver driver;
@@ -315,6 +316,12 @@ static int i915_getparam(struct drm_device *dev, void *data,
case I915_PARAM_MIN_EU_IN_POOL:
value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
break;
+ case I915_PARAM_HUC_STATUS:
+ /* The register is already force-woken. We dont need
+ * any rpm here
+ */
+ value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
+ break;
case I915_PARAM_MMAP_GTT_VERSION:
/* Though we've started our numbering from 1, and so class all
* earlier versions as 0, in effect their value is undefined as
diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
index 051e7ba..d0a7547 100644
--- a/drivers/gpu/drm/i915/intel_huc_loader.c
+++ b/drivers/gpu/drm/i915/intel_huc_loader.c
@@ -281,4 +281,3 @@ void intel_huc_fini(struct drm_device *dev)
huc_fw->fetch_status = INTEL_UC_FIRMWARE_NONE;
}
-
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index da32c2f..57093b4 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
* priorities and the driver will attempt to execute batches in priority order.
*/
#define I915_PARAM_HAS_SCHEDULER 41
+#define I915_PARAM_HUC_STATUS 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 0/8] HuC Loading Patches
@ 2016-12-22 23:12 Anusha Srivatsa
2016-12-22 23:12 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2016-12-22 23:12 UTC (permalink / raw)
To: intel-gfx
These patches add HuC loading support. The driver builds a frame level
workload which is stored in the graphics memory. This workload is presented
to HuC for processing. The driver, therefore should first determine if the
HuC is enabled and also read the huC athentication status bit to determine
if HuC was successfully loaded. The GuC is required to authenticate the HuC.
The userspace patches that check for a fully loaded HuC firmware and use it
can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
More information regarding the HuC, batch commands that configure the
HuC etc can be found at-
https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol02a-commandreference-instructions-huc.pdf
https://www.x.org/docs/intel/CHV/intel-gfx-prm-osrc-chv-bsw-vol10-hevc.pdf
v2: rebased.
v3: rebased. Changed the code following the review comments.
v4: Added action_lock initialization fix provided by Arek
(Hiler Arkadiusz) to the first patch in the series- Make the
GuC fw loading helper functions general.
v5: rebased on top of drm-tip. The patch series is now in sync with GuC
code reorganization efforts by Arek-
https://patchwork.freedesktop.org/series/15896/
v6:rebased. Organize code. Move contents of intel_huc.h to intel_uc.h.
Update function intel_huc_load(),intel_huc_init() and intel_uc_fw_fetch()
to accept dev_priv instead of dev.
v7: rebased. Remove intel_is_huc_valid() since it is called onoly once.
Refactor the code to reduce redundency. Remove fiels like uc_dev which
are no longer used.
v8: rebased. Beautify the code- remove comments that no longer hold
good, add newlines etc.
Anusha Srivatsa (3):
drm/i915/huc: Add HuC fw loading support
drm/i915/huc: Add BXT HuC Loading Support
drm/i915/HuC: Add KBL huC loading Support
Peter Antoine (5):
drm/i915/guc: Make the GuC fw loading helper functions general
drm/i915/huc: Unified css_header struct for GuC and HuC
drm/i915/huc: Add debugfs for HuC loading status check
drm/i915/huc: Support HuC authentication
drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_debugfs.c | 43 ++++-
drivers/gpu/drm/i915/i915_drv.c | 11 +-
drivers/gpu/drm/i915/i915_drv.h | 3 +-
drivers/gpu/drm/i915/i915_guc_reg.h | 3 +
drivers/gpu/drm/i915/i915_guc_submission.c | 4 +-
drivers/gpu/drm/i915/intel_guc_fwif.h | 24 ++-
drivers/gpu/drm/i915/intel_guc_loader.c | 200 +++++++++++---------
drivers/gpu/drm/i915/intel_huc_loader.c | 286 +++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_uc.c | 62 +++++++
drivers/gpu/drm/i915/intel_uc.h | 63 +++++--
include/uapi/drm/i915_drm.h | 1 +
12 files changed, 577 insertions(+), 124 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_huc_loader.c
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-22 23:12 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
@ 2016-12-22 23:12 ` Anusha Srivatsa
2016-12-23 14:33 ` Arkadiusz Hiler
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2016-12-22 23:12 UTC (permalink / raw)
To: intel-gfx; +Cc: Peter Antoine
From: Peter Antoine <peter.antoine@intel.com>
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v4: rebased.
v5: rebased on top of drm-tip.
v6: rebased. Removed any reference to intel_huc.h
v7: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
Remove intel_is_huc_valid() since it is used only in one place.
Put the case of I915_PARAM_HAS_HUC() in the right place.
v8: rebased. Add a comment to specify that I915_READ(reg)
does not read garbage value. The register HUC_STATUS2 is force
woken and no rpm is needed.
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 7 +++++++
drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
include/uapi/drm/i915_drm.h | 1 +
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 85a47c2..c4f0620 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_uc.h"
static struct drm_driver driver;
@@ -315,6 +316,12 @@ static int i915_getparam(struct drm_device *dev, void *data,
case I915_PARAM_MIN_EU_IN_POOL:
value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
break;
+ case I915_PARAM_HUC_STATUS:
+ /* The register is already force-woken. We dont need
+ * any rpm here
+ */
+ value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
+ break;
case I915_PARAM_MMAP_GTT_VERSION:
/* Though we've started our numbering from 1, and so class all
* earlier versions as 0, in effect their value is undefined as
diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
index 75f3dc5..dd42676 100644
--- a/drivers/gpu/drm/i915/intel_huc_loader.c
+++ b/drivers/gpu/drm/i915/intel_huc_loader.c
@@ -284,4 +284,3 @@ void intel_huc_fini(struct drm_device *dev)
huc_fw->fetch_status = INTEL_UC_FIRMWARE_NONE;
}
-
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index da32c2f..57093b4 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
* priorities and the driver will attempt to execute batches in priority order.
*/
#define I915_PARAM_HAS_SCHEDULER 41
+#define I915_PARAM_HUC_STATUS 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-22 23:12 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
@ 2016-12-23 14:33 ` Arkadiusz Hiler
0 siblings, 0 replies; 39+ messages in thread
From: Arkadiusz Hiler @ 2016-12-23 14:33 UTC (permalink / raw)
To: Anusha Srivatsa; +Cc: intel-gfx, Peter Antoine
On Thu, Dec 22, 2016 at 03:12:24PM -0800, Anusha Srivatsa wrote:
> From: Peter Antoine <peter.antoine@intel.com>
>
> This patch will allow for getparams to return the status of the HuC.
> As the HuC has to be validated by the GuC this patch uses the validated
> status to show when the HuC is loaded and ready for use. You cannot use
> the loaded status as with the GuC as the HuC is verified after it is
> loaded and is not usable until it is verified.
>
> v2: removed the forewakes as the registers are already force-woken.
> (T.Ursulin)
> v4: rebased.
> v5: rebased on top of drm-tip.
> v6: rebased. Removed any reference to intel_huc.h
> v7: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
> Remove intel_is_huc_valid() since it is used only in one place.
> Put the case of I915_PARAM_HAS_HUC() in the right place.
> v8: rebased. Add a comment to specify that I915_READ(reg)
> does not read garbage value. The register HUC_STATUS2 is force
> woken and no rpm is needed.
>
> Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Where is your s-o-b?
other than that:
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
--
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 0/8] HuC Loading Patches
@ 2016-12-15 22:29 anushasr
2016-12-15 22:29 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams anushasr
0 siblings, 1 reply; 39+ messages in thread
From: anushasr @ 2016-12-15 22:29 UTC (permalink / raw)
To: intel-gfx
These patches add HuC loading support. The driver builds a frame level
workload which is stored in the graphics memory. This workload is presented
to HuC for processing. The driver, therefore should first determine if the
HuC is enabled and also read the huC athentication status bit to determine
if HuC was successfully loaded. The GuC is required to authenticate the HuC.
The userspace patches that check for a fully loaded HuC firmware and use it
can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
More information regarding the HuC, batch commands that configure the
HuC etc can be found at-
https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol02a-commandreference-instructions-huc.pdf
https://www.x.org/docs/intel/CHV/intel-gfx-prm-osrc-chv-bsw-vol10-hevc.pdf
v2: rebased.
v3: rebased. Changed the code following the review comments.
v4: Added action_lock initialization fix provided by Arek
(Hiler Arkadiusz) to the first patch in the series- Make the
GuC fw loading helper functions general.
v5: rebased on top of drm-tip. The patch series is now in sync with GuC
code reorganization efforts by Arek-
https://patchwork.freedesktop.org/series/15896/
v6:rebased. Organize code. Move contents of intel_huc.h to intel_uc.h.
Update function intel_huc_load(),intel_huc_init() and intel_uc_fw_fetch()
to accept dev_priv instead of dev.
v7: rebased. Remove intel_is_huc_valid() since it is called onoly once.
Refactor the code to reduce redundency. Remove fiels like uc_dev which
are no longer used.
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Cc: Arek <arkadiusz.hiler@intel.com>
Cc: Jeff Mcgee <jeff.mcgee@intel.com> BLURB HERE ***
Cc: Chris Wilson <Chris@chris-wilson.co.uk>
Anusha Srivatsa (3):
drm/i915/huc: Add HuC fw loading support
drm/i915/huc: Add BXT HuC Loading Support
drm/i915/HuC: Add KBL huC loading Support
Peter Antoine (5):
drm/i915/guc: Make the GuC fw loading helper functions general
drm/i915/huc: Unified css_header struct for GuC and HuC
drm/i915/huc: Add debugfs for HuC loading status check
drm/i915/huc: Support HuC authentication
drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_debugfs.c | 43 ++++-
drivers/gpu/drm/i915/i915_drv.c | 8 +-
drivers/gpu/drm/i915/i915_drv.h | 3 +-
drivers/gpu/drm/i915/i915_guc_reg.h | 3 +
drivers/gpu/drm/i915/i915_guc_submission.c | 4 +-
drivers/gpu/drm/i915/intel_guc_fwif.h | 24 ++-
drivers/gpu/drm/i915/intel_guc_loader.c | 201 +++++++++++---------
drivers/gpu/drm/i915/intel_huc_loader.c | 290 +++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_uc.c | 62 ++++++
drivers/gpu/drm/i915/intel_uc.h | 63 +++++--
include/uapi/drm/i915_drm.h | 1 +
12 files changed, 579 insertions(+), 124 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_huc_loader.c
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-15 22:29 [PATCH 0/8] HuC Loading Patches anushasr
@ 2016-12-15 22:29 ` anushasr
2016-12-15 22:42 ` Chris Wilson
2016-12-16 16:00 ` Arkadiusz Hiler
0 siblings, 2 replies; 39+ messages in thread
From: anushasr @ 2016-12-15 22:29 UTC (permalink / raw)
To: intel-gfx; +Cc: Peter Antoine
From: Peter Antoine <peter.antoine@intel.com>
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v4: rebased.
v5: rebased on top of drm-tip.
v6: rebased. Removed any reference to intel_huc.h
v7: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
Remove intel_is_huc_valid() since it is used only in one place.
Put the case of I915_PARAM_HAS_HUC() in the right place.
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 4 ++++
drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
include/uapi/drm/i915_drm.h | 1 +
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 85a47c2..0bc016d 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_uc.h"
static struct drm_driver driver;
@@ -315,6 +316,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
case I915_PARAM_MIN_EU_IN_POOL:
value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
break;
+ case I915_PARAM_HUC_STATUS:
+ value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
+ break;
case I915_PARAM_MMAP_GTT_VERSION:
/* Though we've started our numbering from 1, and so class all
* earlier versions as 0, in effect their value is undefined as
diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
index d8c5266..b06a613 100644
--- a/drivers/gpu/drm/i915/intel_huc_loader.c
+++ b/drivers/gpu/drm/i915/intel_huc_loader.c
@@ -288,4 +288,3 @@ void intel_huc_fini(struct drm_device *dev)
huc_fw->fetch_status = INTEL_UC_FIRMWARE_NONE;
}
-
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index da32c2f..57093b4 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
* priorities and the driver will attempt to execute batches in priority order.
*/
#define I915_PARAM_HAS_SCHEDULER 41
+#define I915_PARAM_HUC_STATUS 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-15 22:29 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams anushasr
@ 2016-12-15 22:42 ` Chris Wilson
2016-12-16 14:43 ` Arkadiusz Hiler
2016-12-16 16:00 ` Arkadiusz Hiler
1 sibling, 1 reply; 39+ messages in thread
From: Chris Wilson @ 2016-12-15 22:42 UTC (permalink / raw)
To: anushasr; +Cc: intel-gfx, Peter Antoine
On Thu, Dec 15, 2016 at 02:29:50PM -0800, anushasr wrote:
> From: Peter Antoine <peter.antoine@intel.com>
>
> This patch will allow for getparams to return the status of the HuC.
> As the HuC has to be validated by the GuC this patch uses the validated
> status to show when the HuC is loaded and ready for use. You cannot use
> the loaded status as with the GuC as the HuC is verified after it is
> loaded and is not usable until it is verified.
>
> v2: removed the forewakes as the registers are already force-woken.
> (T.Ursulin)
> v4: rebased.
> v5: rebased on top of drm-tip.
> v6: rebased. Removed any reference to intel_huc.h
> v7: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
> Remove intel_is_huc_valid() since it is used only in one place.
> Put the case of I915_PARAM_HAS_HUC() in the right place.
>
> Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
> include/uapi/drm/i915_drm.h | 1 +
> 3 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 85a47c2..0bc016d 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_uc.h"
>
> static struct drm_driver driver;
>
> @@ -315,6 +316,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> case I915_PARAM_MIN_EU_IN_POOL:
> value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
> break;
> + case I915_PARAM_HUC_STATUS:
> + value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
Same question as last time: does the device need to be awake? We know is
one of the GT power wells, so presumably we need an rpm_get/rpm_put as
well to access the register.
-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
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-15 22:42 ` Chris Wilson
@ 2016-12-16 14:43 ` Arkadiusz Hiler
2016-12-16 16:12 ` Chris Wilson
0 siblings, 1 reply; 39+ messages in thread
From: Arkadiusz Hiler @ 2016-12-16 14:43 UTC (permalink / raw)
To: Chris Wilson, anushasr, intel-gfx, Peter Antoine
On Thu, Dec 15, 2016 at 10:42:53PM +0000, Chris Wilson wrote:
> On Thu, Dec 15, 2016 at 02:29:50PM -0800, anushasr wrote:
> > From: Peter Antoine <peter.antoine@intel.com>
> >
> > This patch will allow for getparams to return the status of the HuC.
> > As the HuC has to be validated by the GuC this patch uses the validated
> > status to show when the HuC is loaded and ready for use. You cannot use
> > the loaded status as with the GuC as the HuC is verified after it is
> > loaded and is not usable until it is verified.
> >
> > v2: removed the forewakes as the registers are already force-woken.
> > (T.Ursulin)
> > v4: rebased.
> > v5: rebased on top of drm-tip.
> > v6: rebased. Removed any reference to intel_huc.h
> > v7: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
> > Remove intel_is_huc_valid() since it is used only in one place.
> > Put the case of I915_PARAM_HAS_HUC() in the right place.
> >
> > Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> > drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
> > include/uapi/drm/i915_drm.h | 1 +
> > 3 files changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 85a47c2..0bc016d 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_uc.h"
> >
> > static struct drm_driver driver;
> >
> > @@ -315,6 +316,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> > case I915_PARAM_MIN_EU_IN_POOL:
> > value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
> > break;
> > + case I915_PARAM_HUC_STATUS:
> > + value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
>
> Same question as last time: does the device need to be awake? We know is
> one of the GT power wells, so presumably we need an rpm_get/rpm_put as
> well to access the register.
> -Chris
I get:
[ 1588.570174] [drm:i915_huc_load_status_info [i915]] HUC_STATUS2 PRE 24704
[ 1588.571285] [drm:intel_runtime_suspend [i915]] Suspending device
[ 1588.575768] [drm:intel_runtime_suspend [i915]] Device suspended
[ 1588.577156] [drm:i915_huc_load_status_info [i915]] HUC_STATUS2 POST 24704
[ 1588.578259] [drm:intel_runtime_resume [i915]] Resuming device
consistently from:
value = I915_READ(HUC_STATUS2);
DRM_DEBUG_DRIVER("HUC_STATUS2 PRE %d\n", value);
i915_pm_ops.runtime_suspend(dev_priv->drm.dev);
value = I915_READ(HUC_STATUS2);
DRM_DEBUG_DRIVER("HUC_STATUS2 POST %d\n", value);
i915_pm_ops.runtime_resume(dev_priv->drm.dev);
> --
> Chris Wilson, Intel Open Source Technology Centre
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-16 14:43 ` Arkadiusz Hiler
@ 2016-12-16 16:12 ` Chris Wilson
2016-12-16 16:21 ` Arkadiusz Hiler
0 siblings, 1 reply; 39+ messages in thread
From: Chris Wilson @ 2016-12-16 16:12 UTC (permalink / raw)
To: Arkadiusz Hiler; +Cc: intel-gfx, Peter Antoine
On Fri, Dec 16, 2016 at 03:43:46PM +0100, Arkadiusz Hiler wrote:
> On Thu, Dec 15, 2016 at 10:42:53PM +0000, Chris Wilson wrote:
> > On Thu, Dec 15, 2016 at 02:29:50PM -0800, anushasr wrote:
> > > From: Peter Antoine <peter.antoine@intel.com>
> > >
> > > This patch will allow for getparams to return the status of the HuC.
> > > As the HuC has to be validated by the GuC this patch uses the validated
> > > status to show when the HuC is loaded and ready for use. You cannot use
> > > the loaded status as with the GuC as the HuC is verified after it is
> > > loaded and is not usable until it is verified.
> > >
> > > v2: removed the forewakes as the registers are already force-woken.
> > > (T.Ursulin)
> > > v4: rebased.
> > > v5: rebased on top of drm-tip.
> > > v6: rebased. Removed any reference to intel_huc.h
> > > v7: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
> > > Remove intel_is_huc_valid() since it is used only in one place.
> > > Put the case of I915_PARAM_HAS_HUC() in the right place.
> > >
> > > Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> > > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > > ---
> > > drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> > > drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
> > > include/uapi/drm/i915_drm.h | 1 +
> > > 3 files changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > > index 85a47c2..0bc016d 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_uc.h"
> > >
> > > static struct drm_driver driver;
> > >
> > > @@ -315,6 +316,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> > > case I915_PARAM_MIN_EU_IN_POOL:
> > > value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
> > > break;
> > > + case I915_PARAM_HUC_STATUS:
> > > + value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
> >
> > Same question as last time: does the device need to be awake? We know is
> > one of the GT power wells, so presumably we need an rpm_get/rpm_put as
> > well to access the register.
> > -Chris
>
> I get:
>
> [ 1588.570174] [drm:i915_huc_load_status_info [i915]] HUC_STATUS2 PRE 24704
> [ 1588.571285] [drm:intel_runtime_suspend [i915]] Suspending device
> [ 1588.575768] [drm:intel_runtime_suspend [i915]] Device suspended
> [ 1588.577156] [drm:i915_huc_load_status_info [i915]] HUC_STATUS2 POST 24704
> [ 1588.578259] [drm:intel_runtime_resume [i915]] Resuming device
>
> consistently from:
>
> value = I915_READ(HUC_STATUS2);
> DRM_DEBUG_DRIVER("HUC_STATUS2 PRE %d\n", value);
> i915_pm_ops.runtime_suspend(dev_priv->drm.dev);
>
> value = I915_READ(HUC_STATUS2);
> DRM_DEBUG_DRIVER("HUC_STATUS2 POST %d\n", value);
> i915_pm_ops.runtime_resume(dev_priv->drm.dev);
Also do the test with i915.mmio_debug=9999
-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
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-16 16:12 ` Chris Wilson
@ 2016-12-16 16:21 ` Arkadiusz Hiler
2016-12-16 16:30 ` Chris Wilson
0 siblings, 1 reply; 39+ messages in thread
From: Arkadiusz Hiler @ 2016-12-16 16:21 UTC (permalink / raw)
To: Chris Wilson, anushasr, intel-gfx
On Fri, Dec 16, 2016 at 04:12:36PM +0000, Chris Wilson wrote:
> On Fri, Dec 16, 2016 at 03:43:46PM +0100, Arkadiusz Hiler wrote:
> > On Thu, Dec 15, 2016 at 10:42:53PM +0000, Chris Wilson wrote:
> > > On Thu, Dec 15, 2016 at 02:29:50PM -0800, anushasr wrote:
> > > > From: Peter Antoine <peter.antoine@intel.com>
> > > >
> > > > This patch will allow for getparams to return the status of the HuC.
> > > > As the HuC has to be validated by the GuC this patch uses the validated
> > > > status to show when the HuC is loaded and ready for use. You cannot use
> > > > the loaded status as with the GuC as the HuC is verified after it is
> > > > loaded and is not usable until it is verified.
> > > >
> > > > v2: removed the forewakes as the registers are already force-woken.
> > > > (T.Ursulin)
> > > > v4: rebased.
> > > > v5: rebased on top of drm-tip.
> > > > v6: rebased. Removed any reference to intel_huc.h
> > > > v7: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
> > > > Remove intel_is_huc_valid() since it is used only in one place.
> > > > Put the case of I915_PARAM_HAS_HUC() in the right place.
> > > >
> > > > Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> > > > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > > > ---
> > > > drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> > > > drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
> > > > include/uapi/drm/i915_drm.h | 1 +
> > > > 3 files changed, 5 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > > > index 85a47c2..0bc016d 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_uc.h"
> > > >
> > > > static struct drm_driver driver;
> > > >
> > > > @@ -315,6 +316,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> > > > case I915_PARAM_MIN_EU_IN_POOL:
> > > > value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
> > > > break;
> > > > + case I915_PARAM_HUC_STATUS:
> > > > + value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
> > >
> > > Same question as last time: does the device need to be awake? We know is
> > > one of the GT power wells, so presumably we need an rpm_get/rpm_put as
> > > well to access the register.
> > > -Chris
> >
> > I get:
> >
> > [ 1588.570174] [drm:i915_huc_load_status_info [i915]] HUC_STATUS2 PRE 24704
> > [ 1588.571285] [drm:intel_runtime_suspend [i915]] Suspending device
> > [ 1588.575768] [drm:intel_runtime_suspend [i915]] Device suspended
> > [ 1588.577156] [drm:i915_huc_load_status_info [i915]] HUC_STATUS2 POST 24704
> > [ 1588.578259] [drm:intel_runtime_resume [i915]] Resuming device
> >
> > consistently from:
> >
> > value = I915_READ(HUC_STATUS2);
> > DRM_DEBUG_DRIVER("HUC_STATUS2 PRE %d\n", value);
> > i915_pm_ops.runtime_suspend(dev_priv->drm.dev);
> >
> > value = I915_READ(HUC_STATUS2);
> > DRM_DEBUG_DRIVER("HUC_STATUS2 POST %d\n", value);
> > i915_pm_ops.runtime_resume(dev_priv->drm.dev);
>
> Also do the test with i915.mmio_debug=9999
> -Chris
Same effect. Works.
--
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-16 16:21 ` Arkadiusz Hiler
@ 2016-12-16 16:30 ` Chris Wilson
2016-12-16 18:31 ` Srivatsa, Anusha
0 siblings, 1 reply; 39+ messages in thread
From: Chris Wilson @ 2016-12-16 16:30 UTC (permalink / raw)
To: Arkadiusz Hiler; +Cc: intel-gfx
On Fri, Dec 16, 2016 at 05:21:38PM +0100, Arkadiusz Hiler wrote:
> On Fri, Dec 16, 2016 at 04:12:36PM +0000, Chris Wilson wrote:
> > On Fri, Dec 16, 2016 at 03:43:46PM +0100, Arkadiusz Hiler wrote:
> > > On Thu, Dec 15, 2016 at 10:42:53PM +0000, Chris Wilson wrote:
> > > > On Thu, Dec 15, 2016 at 02:29:50PM -0800, anushasr wrote:
> > > > > From: Peter Antoine <peter.antoine@intel.com>
> > > > >
> > > > > This patch will allow for getparams to return the status of the HuC.
> > > > > As the HuC has to be validated by the GuC this patch uses the validated
> > > > > status to show when the HuC is loaded and ready for use. You cannot use
> > > > > the loaded status as with the GuC as the HuC is verified after it is
> > > > > loaded and is not usable until it is verified.
> > > > >
> > > > > v2: removed the forewakes as the registers are already force-woken.
> > > > > (T.Ursulin)
> > > > > v4: rebased.
> > > > > v5: rebased on top of drm-tip.
> > > > > v6: rebased. Removed any reference to intel_huc.h
> > > > > v7: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
> > > > > Remove intel_is_huc_valid() since it is used only in one place.
> > > > > Put the case of I915_PARAM_HAS_HUC() in the right place.
> > > > >
> > > > > Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> > > > > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > > > > ---
> > > > > drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> > > > > drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
> > > > > include/uapi/drm/i915_drm.h | 1 +
> > > > > 3 files changed, 5 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > > > > index 85a47c2..0bc016d 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_uc.h"
> > > > >
> > > > > static struct drm_driver driver;
> > > > >
> > > > > @@ -315,6 +316,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> > > > > case I915_PARAM_MIN_EU_IN_POOL:
> > > > > value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
> > > > > break;
> > > > > + case I915_PARAM_HUC_STATUS:
> > > > > + value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
> > > >
> > > > Same question as last time: does the device need to be awake? We know is
> > > > one of the GT power wells, so presumably we need an rpm_get/rpm_put as
> > > > well to access the register.
> > > > -Chris
> > >
> > > I get:
> > >
> > > [ 1588.570174] [drm:i915_huc_load_status_info [i915]] HUC_STATUS2 PRE 24704
> > > [ 1588.571285] [drm:intel_runtime_suspend [i915]] Suspending device
> > > [ 1588.575768] [drm:intel_runtime_suspend [i915]] Device suspended
> > > [ 1588.577156] [drm:i915_huc_load_status_info [i915]] HUC_STATUS2 POST 24704
> > > [ 1588.578259] [drm:intel_runtime_resume [i915]] Resuming device
> > >
> > > consistently from:
> > >
> > > value = I915_READ(HUC_STATUS2);
> > > DRM_DEBUG_DRIVER("HUC_STATUS2 PRE %d\n", value);
> > > i915_pm_ops.runtime_suspend(dev_priv->drm.dev);
> > >
> > > value = I915_READ(HUC_STATUS2);
> > > DRM_DEBUG_DRIVER("HUC_STATUS2 POST %d\n", value);
> > > i915_pm_ops.runtime_resume(dev_priv->drm.dev);
> >
> > Also do the test with i915.mmio_debug=9999
> > -Chris
>
> Same effect. Works.
Ok, then just mark up that we don't need rpm here so that we don't freak
out in future scans for mmio access outside of rpm.
-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
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-16 16:30 ` Chris Wilson
@ 2016-12-16 18:31 ` Srivatsa, Anusha
2016-12-16 18:46 ` Chris Wilson
0 siblings, 1 reply; 39+ messages in thread
From: Srivatsa, Anusha @ 2016-12-16 18:31 UTC (permalink / raw)
To: Chris Wilson, Hiler, Arkadiusz; +Cc: intel-gfx@lists.freedesktop.org
>-----Original Message-----
>From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
>Sent: Friday, December 16, 2016 8:31 AM
>To: Hiler, Arkadiusz <arkadiusz.hiler@intel.com>
>Cc: Srivatsa, Anusha <anusha.srivatsa@intel.com>; intel-
>gfx@lists.freedesktop.org
>Subject: Re: [Intel-gfx] [PATCH 8/8] drm/i915/get_params: Add HuC status to
>getparams
>
>On Fri, Dec 16, 2016 at 05:21:38PM +0100, Arkadiusz Hiler wrote:
>> On Fri, Dec 16, 2016 at 04:12:36PM +0000, Chris Wilson wrote:
>> > On Fri, Dec 16, 2016 at 03:43:46PM +0100, Arkadiusz Hiler wrote:
>> > > On Thu, Dec 15, 2016 at 10:42:53PM +0000, Chris Wilson wrote:
>> > > > On Thu, Dec 15, 2016 at 02:29:50PM -0800, anushasr wrote:
>> > > > > From: Peter Antoine <peter.antoine@intel.com>
>> > > > >
>> > > > > This patch will allow for getparams to return the status of the HuC.
>> > > > > As the HuC has to be validated by the GuC this patch uses the
>> > > > > validated status to show when the HuC is loaded and ready for
>> > > > > use. You cannot use the loaded status as with the GuC as the
>> > > > > HuC is verified after it is loaded and is not usable until it is verified.
>> > > > >
>> > > > > v2: removed the forewakes as the registers are already force-woken.
>> > > > > (T.Ursulin)
>> > > > > v4: rebased.
>> > > > > v5: rebased on top of drm-tip.
>> > > > > v6: rebased. Removed any reference to intel_huc.h
>> > > > > v7: rebased. Rename I915_PARAM_HAS_HUC to
>I915_PARAM_HUC_STATUS.
>> > > > > Remove intel_is_huc_valid() since it is used only in one place.
>> > > > > Put the case of I915_PARAM_HAS_HUC() in the right place.
>> > > > >
>> > > > > Signed-off-by: Peter Antoine <peter.antoine@intel.com>
>> > > > > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
>> > > > > ---
>> > > > > drivers/gpu/drm/i915/i915_drv.c | 4 ++++
>> > > > > drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
>> > > > > include/uapi/drm/i915_drm.h | 1 +
>> > > > > 3 files changed, 5 insertions(+), 1 deletion(-)
>> > > > >
>> > > > > diff --git a/drivers/gpu/drm/i915/i915_drv.c
>> > > > > b/drivers/gpu/drm/i915/i915_drv.c index 85a47c2..0bc016d
>> > > > > 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_uc.h"
>> > > > >
>> > > > > static struct drm_driver driver;
>> > > > >
>> > > > > @@ -315,6 +316,9 @@ static int i915_getparam(struct drm_device
>*dev, void *data,
>> > > > > case I915_PARAM_MIN_EU_IN_POOL:
>> > > > > value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
>> > > > > break;
>> > > > > + case I915_PARAM_HUC_STATUS:
>> > > > > + value = I915_READ(HUC_STATUS2) &
>HUC_FW_VERIFIED;
>> > > >
>> > > > Same question as last time: does the device need to be awake? We
>> > > > know is one of the GT power wells, so presumably we need an
>> > > > rpm_get/rpm_put as well to access the register.
>> > > > -Chris
>> > >
>> > > I get:
>> > >
>> > > [ 1588.570174] [drm:i915_huc_load_status_info [i915]] HUC_STATUS2
>> > > PRE 24704 [ 1588.571285] [drm:intel_runtime_suspend [i915]]
>> > > Suspending device [ 1588.575768] [drm:intel_runtime_suspend
>> > > [i915]] Device suspended [ 1588.577156]
>> > > [drm:i915_huc_load_status_info [i915]] HUC_STATUS2 POST 24704 [
>> > > 1588.578259] [drm:intel_runtime_resume [i915]] Resuming device
>> > >
>> > > consistently from:
>> > >
>> > > value = I915_READ(HUC_STATUS2);
>> > > DRM_DEBUG_DRIVER("HUC_STATUS2 PRE %d\n", value);
>> > > i915_pm_ops.runtime_suspend(dev_priv->drm.dev);
>> > >
>> > > value = I915_READ(HUC_STATUS2);
>> > > DRM_DEBUG_DRIVER("HUC_STATUS2 POST %d\n", value);
>> > > i915_pm_ops.runtime_resume(dev_priv->drm.dev);
>> >
>> > Also do the test with i915.mmio_debug=9999 -Chris
>>
>> Same effect. Works.
Thanks Arek for confirming.
>Ok, then just mark up that we don't need rpm here so that we don't freak out in
>future scans for mmio access outside of rpm.
>-Chris
Chris, v2 as changed by Tvrtko suggests that forcewakes are removed since the register is force waken. Are you suggesting that adding that rpm not being required in the commit message will make things much more clearer?
Anusha
>
>--
>Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-16 18:31 ` Srivatsa, Anusha
@ 2016-12-16 18:46 ` Chris Wilson
2016-12-16 18:55 ` Srivatsa, Anusha
0 siblings, 1 reply; 39+ messages in thread
From: Chris Wilson @ 2016-12-16 18:46 UTC (permalink / raw)
To: Srivatsa, Anusha; +Cc: intel-gfx@lists.freedesktop.org
On Fri, Dec 16, 2016 at 06:31:46PM +0000, Srivatsa, Anusha wrote:
>
>
> >-----Original Message-----
> >From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
> >Sent: Friday, December 16, 2016 8:31 AM
> >To: Hiler, Arkadiusz <arkadiusz.hiler@intel.com>
> >Cc: Srivatsa, Anusha <anusha.srivatsa@intel.com>; intel-
> >gfx@lists.freedesktop.org
> >Subject: Re: [Intel-gfx] [PATCH 8/8] drm/i915/get_params: Add HuC status to
> >getparams
> >
> >On Fri, Dec 16, 2016 at 05:21:38PM +0100, Arkadiusz Hiler wrote:
> >> On Fri, Dec 16, 2016 at 04:12:36PM +0000, Chris Wilson wrote:
> >> > On Fri, Dec 16, 2016 at 03:43:46PM +0100, Arkadiusz Hiler wrote:
> >> > > On Thu, Dec 15, 2016 at 10:42:53PM +0000, Chris Wilson wrote:
> >> > > > On Thu, Dec 15, 2016 at 02:29:50PM -0800, anushasr wrote:
> >> > > > > From: Peter Antoine <peter.antoine@intel.com>
> >> > > > >
> >> > > > > This patch will allow for getparams to return the status of the HuC.
> >> > > > > As the HuC has to be validated by the GuC this patch uses the
> >> > > > > validated status to show when the HuC is loaded and ready for
> >> > > > > use. You cannot use the loaded status as with the GuC as the
> >> > > > > HuC is verified after it is loaded and is not usable until it is verified.
> >> > > > >
> >> > > > > v2: removed the forewakes as the registers are already force-woken.
> >> > > > > (T.Ursulin)
> >> > > > > v4: rebased.
> >> > > > > v5: rebased on top of drm-tip.
> >> > > > > v6: rebased. Removed any reference to intel_huc.h
> >> > > > > v7: rebased. Rename I915_PARAM_HAS_HUC to
> >I915_PARAM_HUC_STATUS.
> >> > > > > Remove intel_is_huc_valid() since it is used only in one place.
> >> > > > > Put the case of I915_PARAM_HAS_HUC() in the right place.
> >> > > > >
> >> > > > > Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> >> > > > > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> >> > > > > ---
> >> > > > > drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> >> > > > > drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
> >> > > > > include/uapi/drm/i915_drm.h | 1 +
> >> > > > > 3 files changed, 5 insertions(+), 1 deletion(-)
> >> > > > >
> >> > > > > diff --git a/drivers/gpu/drm/i915/i915_drv.c
> >> > > > > b/drivers/gpu/drm/i915/i915_drv.c index 85a47c2..0bc016d
> >> > > > > 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_uc.h"
> >> > > > >
> >> > > > > static struct drm_driver driver;
> >> > > > >
> >> > > > > @@ -315,6 +316,9 @@ static int i915_getparam(struct drm_device
> >*dev, void *data,
> >> > > > > case I915_PARAM_MIN_EU_IN_POOL:
> >> > > > > value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
> >> > > > > break;
> >> > > > > + case I915_PARAM_HUC_STATUS:
> >> > > > > + value = I915_READ(HUC_STATUS2) &
> >HUC_FW_VERIFIED;
> >> > > >
> >> > > > Same question as last time: does the device need to be awake? We
> >> > > > know is one of the GT power wells, so presumably we need an
> >> > > > rpm_get/rpm_put as well to access the register.
> >> > > > -Chris
> >> > >
> >> > > I get:
> >> > >
> >> > > [ 1588.570174] [drm:i915_huc_load_status_info [i915]] HUC_STATUS2
> >> > > PRE 24704 [ 1588.571285] [drm:intel_runtime_suspend [i915]]
> >> > > Suspending device [ 1588.575768] [drm:intel_runtime_suspend
> >> > > [i915]] Device suspended [ 1588.577156]
> >> > > [drm:i915_huc_load_status_info [i915]] HUC_STATUS2 POST 24704 [
> >> > > 1588.578259] [drm:intel_runtime_resume [i915]] Resuming device
> >> > >
> >> > > consistently from:
> >> > >
> >> > > value = I915_READ(HUC_STATUS2);
> >> > > DRM_DEBUG_DRIVER("HUC_STATUS2 PRE %d\n", value);
> >> > > i915_pm_ops.runtime_suspend(dev_priv->drm.dev);
> >> > >
> >> > > value = I915_READ(HUC_STATUS2);
> >> > > DRM_DEBUG_DRIVER("HUC_STATUS2 POST %d\n", value);
> >> > > i915_pm_ops.runtime_resume(dev_priv->drm.dev);
> >> >
> >> > Also do the test with i915.mmio_debug=9999 -Chris
> >>
> >> Same effect. Works.
> Thanks Arek for confirming.
>
> >Ok, then just mark up that we don't need rpm here so that we don't freak out in
> >future scans for mmio access outside of rpm.
> >-Chris
> Chris, v2 as changed by Tvrtko suggests that forcewakes are removed since the register is force waken. Are you suggesting that adding that rpm not being required in the commit message will make things much more clearer?
No, if you are eschewing taking rpm around mmio access, I want that
commented upon in the code so that it is visible the next time we do an
audit for rpm abuse/misuse.
-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
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-16 18:46 ` Chris Wilson
@ 2016-12-16 18:55 ` Srivatsa, Anusha
0 siblings, 0 replies; 39+ messages in thread
From: Srivatsa, Anusha @ 2016-12-16 18:55 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx@lists.freedesktop.org
>-----Original Message-----
>From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
>Sent: Friday, December 16, 2016 10:47 AM
>To: Srivatsa, Anusha <anusha.srivatsa@intel.com>
>Cc: Hiler, Arkadiusz <arkadiusz.hiler@intel.com>; intel-gfx@lists.freedesktop.org
>Subject: Re: [Intel-gfx] [PATCH 8/8] drm/i915/get_params: Add HuC status to
>getparams
>
>On Fri, Dec 16, 2016 at 06:31:46PM +0000, Srivatsa, Anusha wrote:
>>
>>
>> >-----Original Message-----
>> >From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
>> >Sent: Friday, December 16, 2016 8:31 AM
>> >To: Hiler, Arkadiusz <arkadiusz.hiler@intel.com>
>> >Cc: Srivatsa, Anusha <anusha.srivatsa@intel.com>; intel-
>> >gfx@lists.freedesktop.org
>> >Subject: Re: [Intel-gfx] [PATCH 8/8] drm/i915/get_params: Add HuC
>> >status to getparams
>> >
>> >On Fri, Dec 16, 2016 at 05:21:38PM +0100, Arkadiusz Hiler wrote:
>> >> On Fri, Dec 16, 2016 at 04:12:36PM +0000, Chris Wilson wrote:
>> >> > On Fri, Dec 16, 2016 at 03:43:46PM +0100, Arkadiusz Hiler wrote:
>> >> > > On Thu, Dec 15, 2016 at 10:42:53PM +0000, Chris Wilson wrote:
>> >> > > > On Thu, Dec 15, 2016 at 02:29:50PM -0800, anushasr wrote:
>> >> > > > > From: Peter Antoine <peter.antoine@intel.com>
>> >> > > > >
>> >> > > > > This patch will allow for getparams to return the status of the HuC.
>> >> > > > > As the HuC has to be validated by the GuC this patch uses
>> >> > > > > the validated status to show when the HuC is loaded and
>> >> > > > > ready for use. You cannot use the loaded status as with the
>> >> > > > > GuC as the HuC is verified after it is loaded and is not usable until it is
>verified.
>> >> > > > >
>> >> > > > > v2: removed the forewakes as the registers are already force-woken.
>> >> > > > > (T.Ursulin)
>> >> > > > > v4: rebased.
>> >> > > > > v5: rebased on top of drm-tip.
>> >> > > > > v6: rebased. Removed any reference to intel_huc.h
>> >> > > > > v7: rebased. Rename I915_PARAM_HAS_HUC to
>> >I915_PARAM_HUC_STATUS.
>> >> > > > > Remove intel_is_huc_valid() since it is used only in one place.
>> >> > > > > Put the case of I915_PARAM_HAS_HUC() in the right place.
>> >> > > > >
>> >> > > > > Signed-off-by: Peter Antoine <peter.antoine@intel.com>
>> >> > > > > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
>> >> > > > > ---
>> >> > > > > drivers/gpu/drm/i915/i915_drv.c | 4 ++++
>> >> > > > > drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
>> >> > > > > include/uapi/drm/i915_drm.h | 1 +
>> >> > > > > 3 files changed, 5 insertions(+), 1 deletion(-)
>> >> > > > >
>> >> > > > > diff --git a/drivers/gpu/drm/i915/i915_drv.c
>> >> > > > > b/drivers/gpu/drm/i915/i915_drv.c index 85a47c2..0bc016d
>> >> > > > > 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_uc.h"
>> >> > > > >
>> >> > > > > static struct drm_driver driver;
>> >> > > > >
>> >> > > > > @@ -315,6 +316,9 @@ static int i915_getparam(struct
>> >> > > > > drm_device
>> >*dev, void *data,
>> >> > > > > case I915_PARAM_MIN_EU_IN_POOL:
>> >> > > > > value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
>> >> > > > > break;
>> >> > > > > + case I915_PARAM_HUC_STATUS:
>> >> > > > > + value = I915_READ(HUC_STATUS2) &
>> >HUC_FW_VERIFIED;
>> >> > > >
>> >> > > > Same question as last time: does the device need to be awake?
>> >> > > > We know is one of the GT power wells, so presumably we need
>> >> > > > an rpm_get/rpm_put as well to access the register.
>> >> > > > -Chris
>> >> > >
>> >> > > I get:
>> >> > >
>> >> > > [ 1588.570174] [drm:i915_huc_load_status_info [i915]]
>> >> > > HUC_STATUS2 PRE 24704 [ 1588.571285]
>> >> > > [drm:intel_runtime_suspend [i915]] Suspending device [
>> >> > > 1588.575768] [drm:intel_runtime_suspend [i915]] Device
>> >> > > suspended [ 1588.577156] [drm:i915_huc_load_status_info [i915]]
>> >> > > HUC_STATUS2 POST 24704 [ 1588.578259] [drm:intel_runtime_resume
>> >> > > [i915]] Resuming device
>> >> > >
>> >> > > consistently from:
>> >> > >
>> >> > > value = I915_READ(HUC_STATUS2);
>> >> > > DRM_DEBUG_DRIVER("HUC_STATUS2 PRE %d\n", value);
>> >> > > i915_pm_ops.runtime_suspend(dev_priv->drm.dev);
>> >> > >
>> >> > > value = I915_READ(HUC_STATUS2);
>> >> > > DRM_DEBUG_DRIVER("HUC_STATUS2 POST %d\n", value);
>> >> > > i915_pm_ops.runtime_resume(dev_priv->drm.dev);
>> >> >
>> >> > Also do the test with i915.mmio_debug=9999 -Chris
>> >>
>> >> Same effect. Works.
>> Thanks Arek for confirming.
>>
>> >Ok, then just mark up that we don't need rpm here so that we don't
>> >freak out in future scans for mmio access outside of rpm.
>> >-Chris
>> Chris, v2 as changed by Tvrtko suggests that forcewakes are removed since the
>register is force waken. Are you suggesting that adding that rpm not being
>required in the commit message will make things much more clearer?
>
>No, if you are eschewing taking rpm around mmio access, I want that
>commented upon in the code so that it is visible the next time we do an audit for
>rpm abuse/misuse.
Ah! Got it. Thanks.
Cheers,
Anusha
>-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
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-15 22:29 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams anushasr
2016-12-15 22:42 ` Chris Wilson
@ 2016-12-16 16:00 ` Arkadiusz Hiler
1 sibling, 0 replies; 39+ messages in thread
From: Arkadiusz Hiler @ 2016-12-16 16:00 UTC (permalink / raw)
To: anushasr; +Cc: intel-gfx, Peter Antoine
On Thu, Dec 15, 2016 at 02:29:50PM -0800, anushasr wrote:
> From: Peter Antoine <peter.antoine@intel.com>
>
> This patch will allow for getparams to return the status of the HuC.
> As the HuC has to be validated by the GuC this patch uses the validated
> status to show when the HuC is loaded and ready for use. You cannot use
> the loaded status as with the GuC as the HuC is verified after it is
> loaded and is not usable until it is verified.
>
> v2: removed the forewakes as the registers are already force-woken.
> (T.Ursulin)
> v4: rebased.
> v5: rebased on top of drm-tip.
> v6: rebased. Removed any reference to intel_huc.h
> v7: rebased. Rename I915_PARAM_HAS_HUC to I915_PARAM_HUC_STATUS.
> Remove intel_is_huc_valid() since it is used only in one place.
> Put the case of I915_PARAM_HAS_HUC() in the right place.
>
> Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
You've retained my rb without asking me.
With the changes you've made and confirmation that MEDIA FW that
I915_READ() assumes:
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> drivers/gpu/drm/i915/intel_huc_loader.c | 1 -
> include/uapi/drm/i915_drm.h | 1 +
> 3 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 85a47c2..0bc016d 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_uc.h"
>
> static struct drm_driver driver;
>
> @@ -315,6 +316,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> case I915_PARAM_MIN_EU_IN_POOL:
> value = INTEL_INFO(dev_priv)->sseu.min_eu_in_pool;
> break;
> + case I915_PARAM_HUC_STATUS:
> + value = I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED;
> + break;
> case I915_PARAM_MMAP_GTT_VERSION:
> /* Though we've started our numbering from 1, and so class all
> * earlier versions as 0, in effect their value is undefined as
> diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
> index d8c5266..b06a613 100644
> --- a/drivers/gpu/drm/i915/intel_huc_loader.c
> +++ b/drivers/gpu/drm/i915/intel_huc_loader.c
> @@ -288,4 +288,3 @@ void intel_huc_fini(struct drm_device *dev)
>
> huc_fw->fetch_status = INTEL_UC_FIRMWARE_NONE;
> }
> -
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index da32c2f..57093b4 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
> * priorities and the driver will attempt to execute batches in priority order.
> */
> #define I915_PARAM_HAS_SCHEDULER 41
> +#define I915_PARAM_HUC_STATUS 42
>
> 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
--
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 0/8]HuC Loading Patches
@ 2016-12-08 23:02 anushasr
2016-12-08 23:02 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams anushasr
0 siblings, 1 reply; 39+ messages in thread
From: anushasr @ 2016-12-08 23:02 UTC (permalink / raw)
To: intel-gfx
These patches add HuC loading support. The GuC is required to
authenticate the HuC. The userspace patches that check for a
fully loaded HuC firmware and use it can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
More information regarding the HuC, batch commands that configure the
HuC etc can be found at-
https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol02a-commandreference-instructions-huc.pdf
https://www.x.org/docs/intel/CHV/intel-gfx-prm-osrc-chv-bsw-vol10-hevc.pdf
v2: rebased.
v3: rebased. Changed the code following the review comments.
v4: Added action_lock initialization fix provided by Arek
(Hiler Arkadiusz) to the first patch in the series- Make the
GuC fw loading helper functions general.
v5: rebased on top of drm-tip. The patch series is now in sync with GuC
code reorganization efforts by Arek-
https://patchwork.freedesktop.org/series/15896/
v6: rebased. Organize the code-move contents of intel_huc.h to intel_uc.h. Update functions
intel_huc_load(),intel_huc_init() and intel_uc_fw_fetch() to accept dev_priv instead of dev.
Anusha Srivatsa (3):
drm/i915/huc: Add HuC fw loading support
drm/i915/huc: Add BXT HuC Loading Support
drm/i915/HuC: Add KBL huC loading Support
Peter Antoine (5):
drm/i915/guc: Make the GuC fw loading helper functions general
drm/i915/huc: Unified css_header struct for GuC and HuC
drm/i915/huc: Add debugfs for HuC loading status check
drm/i915/huc: Support HuC authentication
drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_debugfs.c | 43 +++-
drivers/gpu/drm/i915/i915_drv.c | 8 +-
drivers/gpu/drm/i915/i915_drv.h | 3 +-
drivers/gpu/drm/i915/i915_guc_reg.h | 3 +
drivers/gpu/drm/i915/i915_guc_submission.c | 4 +-
drivers/gpu/drm/i915/intel_guc_fwif.h | 22 ++-
drivers/gpu/drm/i915/intel_guc_loader.c | 199 ++++++++++---------
drivers/gpu/drm/i915/intel_huc_loader.c | 303 +++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_uc.c | 61 ++++++
drivers/gpu/drm/i915/intel_uc.h | 68 +++++--
include/uapi/drm/i915_drm.h | 1 +
12 files changed, 593 insertions(+), 123 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_huc_loader.c
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-08 23:02 [PATCH 0/8]HuC Loading Patches anushasr
@ 2016-12-08 23:02 ` anushasr
2016-12-08 23:55 ` Chris Wilson
2016-12-09 12:59 ` Michal Wajdeczko
0 siblings, 2 replies; 39+ messages in thread
From: anushasr @ 2016-12-08 23:02 UTC (permalink / raw)
To: intel-gfx; +Cc: Peter Antoine
From: Peter Antoine <peter.antoine@intel.com>
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v4: rebased.
v5: rebased on top of drm-tip.
v6: rebased. Removed any reference to intel_huc.h
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 4 ++++
drivers/gpu/drm/i915/intel_huc_loader.c | 12 ++++++++++++
drivers/gpu/drm/i915/intel_uc.h | 1 +
include/uapi/drm/i915_drm.h | 1 +
4 files changed, 18 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 85a47c2..6be06a27 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_uc.h"
static struct drm_driver driver;
@@ -349,6 +350,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
*/
value = 1;
break;
+ case I915_PARAM_HAS_HUC:
+ value = intel_is_huc_valid(dev_priv);
+ break;
default:
DRM_DEBUG("Unknown parameter %d\n", param->param);
return -EINVAL;
diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
index 96fc727..6704cc8 100644
--- a/drivers/gpu/drm/i915/intel_huc_loader.c
+++ b/drivers/gpu/drm/i915/intel_huc_loader.c
@@ -289,3 +289,15 @@ void intel_huc_fini(struct drm_device *dev)
huc_fw->fetch_status = UC_FIRMWARE_NONE;
}
+/**
+ * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
+ * @dev_priv: drm device to check.
+ *
+ * This function will return true if the guc has been loaded and
+ * has valid firmware. The simplest way of doing this is to check
+ * if the HuC has been validated, if so it must have been loaded.
+ */
+int intel_is_huc_valid(struct drm_i915_private *dev_priv)
+{
+ return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
+}
diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
index 1db8bc2..ccd3f69 100644
--- a/drivers/gpu/drm/i915/intel_uc.h
+++ b/drivers/gpu/drm/i915/intel_uc.h
@@ -226,6 +226,7 @@ int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val);
void intel_huc_init(struct drm_i915_private *dev_priv);
void intel_huc_fini(struct drm_device *dev);
int intel_huc_load(struct drm_i915_private *dev_priv);
+int intel_is_huc_valid(struct drm_i915_private *dev_priv);
#endif
#endif
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index da32c2f..3e1964c 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
* priorities and the driver will attempt to execute batches in priority order.
*/
#define I915_PARAM_HAS_SCHEDULER 41
+#define I915_PARAM_HAS_HUC 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-08 23:02 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams anushasr
@ 2016-12-08 23:55 ` Chris Wilson
2016-12-13 9:40 ` Arkadiusz Hiler
2016-12-09 12:59 ` Michal Wajdeczko
1 sibling, 1 reply; 39+ messages in thread
From: Chris Wilson @ 2016-12-08 23:55 UTC (permalink / raw)
To: anushasr; +Cc: intel-gfx, Peter Antoine
On Thu, Dec 08, 2016 at 03:02:19PM -0800, anushasr wrote:
> From: Peter Antoine <peter.antoine@intel.com>
>
> This patch will allow for getparams to return the status of the HuC.
> As the HuC has to be validated by the GuC this patch uses the validated
> status to show when the HuC is loaded and ready for use. You cannot use
> the loaded status as with the GuC as the HuC is verified after it is
> loaded and is not usable until it is verified.
>
> v2: removed the forewakes as the registers are already force-woken.
> (T.Ursulin)
> v4: rebased.
> v5: rebased on top of drm-tip.
> v6: rebased. Removed any reference to intel_huc.h
>
> Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> drivers/gpu/drm/i915/intel_huc_loader.c | 12 ++++++++++++
> drivers/gpu/drm/i915/intel_uc.h | 1 +
> include/uapi/drm/i915_drm.h | 1 +
> 4 files changed, 18 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 85a47c2..6be06a27 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_uc.h"
>
> static struct drm_driver driver;
>
> @@ -349,6 +350,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> */
> value = 1;
> break;
> + case I915_PARAM_HAS_HUC:
> + value = intel_is_huc_valid(dev_priv);
> + break;
Why did you put it here? It breaks the pattern of case statements.
> default:
> DRM_DEBUG("Unknown parameter %d\n", param->param);
> return -EINVAL;
> diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
> index 96fc727..6704cc8 100644
> --- a/drivers/gpu/drm/i915/intel_huc_loader.c
> +++ b/drivers/gpu/drm/i915/intel_huc_loader.c
> @@ -289,3 +289,15 @@ void intel_huc_fini(struct drm_device *dev)
> huc_fw->fetch_status = UC_FIRMWARE_NONE;
> }
>
> +/**
> + * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
> + * @dev_priv: drm device to check.
> + *
> + * This function will return true if the guc has been loaded and
> + * has valid firmware. The simplest way of doing this is to check
> + * if the HuC has been validated, if so it must have been loaded.
> + */
> +int intel_is_huc_valid(struct drm_i915_private *dev_priv)
bool
> +{
> + return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
(brackets (because (brackets)))
But what I really wanted to ask... Does this register access require the
device to be awake and powered?
-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
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-08 23:55 ` Chris Wilson
@ 2016-12-13 9:40 ` Arkadiusz Hiler
2016-12-14 1:02 ` Srivatsa, Anusha
0 siblings, 1 reply; 39+ messages in thread
From: Arkadiusz Hiler @ 2016-12-13 9:40 UTC (permalink / raw)
To: Chris Wilson, anushasr, intel-gfx, Peter Antoine
On Thu, Dec 08, 2016 at 11:55:34PM +0000, Chris Wilson wrote:
> On Thu, Dec 08, 2016 at 03:02:19PM -0800, anushasr wrote:
> > From: Peter Antoine <peter.antoine@intel.com>
> >
> > This patch will allow for getparams to return the status of the HuC.
> > As the HuC has to be validated by the GuC this patch uses the validated
> > status to show when the HuC is loaded and ready for use. You cannot use
> > the loaded status as with the GuC as the HuC is verified after it is
> > loaded and is not usable until it is verified.
> >
> > v2: removed the forewakes as the registers are already force-woken.
> > (T.Ursulin)
> > v4: rebased.
> > v5: rebased on top of drm-tip.
> > v6: rebased. Removed any reference to intel_huc.h
> >
> > Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> > drivers/gpu/drm/i915/intel_huc_loader.c | 12 ++++++++++++
> > drivers/gpu/drm/i915/intel_uc.h | 1 +
> > include/uapi/drm/i915_drm.h | 1 +
> > 4 files changed, 18 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 85a47c2..6be06a27 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_uc.h"
> >
> > static struct drm_driver driver;
> >
> > @@ -349,6 +350,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> > */
> > value = 1;
> > break;
> > + case I915_PARAM_HAS_HUC:
> > + value = intel_is_huc_valid(dev_priv);
> > + break;
>
> Why did you put it here? It breaks the pattern of case statements.
>
> > default:
> > DRM_DEBUG("Unknown parameter %d\n", param->param);
> > return -EINVAL;
> > diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
> > index 96fc727..6704cc8 100644
> > --- a/drivers/gpu/drm/i915/intel_huc_loader.c
> > +++ b/drivers/gpu/drm/i915/intel_huc_loader.c
> > @@ -289,3 +289,15 @@ void intel_huc_fini(struct drm_device *dev)
> > huc_fw->fetch_status = UC_FIRMWARE_NONE;
> > }
> >
> > +/**
> > + * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
> > + * @dev_priv: drm device to check.
> > + *
> > + * This function will return true if the guc has been loaded and
> > + * has valid firmware. The simplest way of doing this is to check
> > + * if the HuC has been validated, if so it must have been loaded.
> > + */
> > +int intel_is_huc_valid(struct drm_i915_private *dev_priv)
>
> bool
>
> > +{
> > + return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
>
> (brackets (because (brackets)))
>
> But what I really wanted to ask... Does this register access require the
> device to be awake and powered?
Just confirmed that this register indeed requires MEDIA FW.
> -Chris
--
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-13 9:40 ` Arkadiusz Hiler
@ 2016-12-14 1:02 ` Srivatsa, Anusha
0 siblings, 0 replies; 39+ messages in thread
From: Srivatsa, Anusha @ 2016-12-14 1:02 UTC (permalink / raw)
To: Hiler, Arkadiusz, Chris Wilson, intel-gfx@lists.freedesktop.org,
Peter Antoine
>-----Original Message-----
>From: Hiler, Arkadiusz
>Sent: Tuesday, December 13, 2016 1:41 AM
>To: Chris Wilson <chris@chris-wilson.co.uk>; Srivatsa, Anusha
><anusha.srivatsa@intel.com>; intel-gfx@lists.freedesktop.org; Peter Antoine
><peter.antoine@intel.com>
>Subject: Re: [Intel-gfx] [PATCH 8/8] drm/i915/get_params: Add HuC status to
>getparams
>
>On Thu, Dec 08, 2016 at 11:55:34PM +0000, Chris Wilson wrote:
>> On Thu, Dec 08, 2016 at 03:02:19PM -0800, anushasr wrote:
>> > From: Peter Antoine <peter.antoine@intel.com>
>> >
>> > This patch will allow for getparams to return the status of the HuC.
>> > As the HuC has to be validated by the GuC this patch uses the
>> > validated status to show when the HuC is loaded and ready for use.
>> > You cannot use the loaded status as with the GuC as the HuC is
>> > verified after it is loaded and is not usable until it is verified.
>> >
>> > v2: removed the forewakes as the registers are already force-woken.
>> > (T.Ursulin)
>> > v4: rebased.
>> > v5: rebased on top of drm-tip.
>> > v6: rebased. Removed any reference to intel_huc.h
>> >
>> > Signed-off-by: Peter Antoine <peter.antoine@intel.com>
>> > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
>> > ---
>> > drivers/gpu/drm/i915/i915_drv.c | 4 ++++
>> > drivers/gpu/drm/i915/intel_huc_loader.c | 12 ++++++++++++
>> > drivers/gpu/drm/i915/intel_uc.h | 1 +
>> > include/uapi/drm/i915_drm.h | 1 +
>> > 4 files changed, 18 insertions(+)
>> >
>> > diff --git a/drivers/gpu/drm/i915/i915_drv.c
>> > b/drivers/gpu/drm/i915/i915_drv.c index 85a47c2..6be06a27 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_uc.h"
>> >
>> > static struct drm_driver driver;
>> >
>> > @@ -349,6 +350,9 @@ static int i915_getparam(struct drm_device *dev, void
>*data,
>> > */
>> > value = 1;
>> > break;
>> > + case I915_PARAM_HAS_HUC:
>> > + value = intel_is_huc_valid(dev_priv);
>> > + break;
>>
>> Why did you put it here? It breaks the pattern of case statements.
>>
>> > default:
>> > DRM_DEBUG("Unknown parameter %d\n", param->param);
>> > return -EINVAL;
>> > diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c
>> > b/drivers/gpu/drm/i915/intel_huc_loader.c
>> > index 96fc727..6704cc8 100644
>> > --- a/drivers/gpu/drm/i915/intel_huc_loader.c
>> > +++ b/drivers/gpu/drm/i915/intel_huc_loader.c
>> > @@ -289,3 +289,15 @@ void intel_huc_fini(struct drm_device *dev)
>> > huc_fw->fetch_status = UC_FIRMWARE_NONE; }
>> >
>> > +/**
>> > + * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
>> > + * @dev_priv: drm device to check.
>> > + *
>> > + * This function will return true if the guc has been loaded and
>> > + * has valid firmware. The simplest way of doing this is to check
>> > + * if the HuC has been validated, if so it must have been loaded.
>> > + */
>> > +int intel_is_huc_valid(struct drm_i915_private *dev_priv)
>>
>> bool
>>
>> > +{
>> > + return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
>>
>> (brackets (because (brackets)))
>>
>> But what I really wanted to ask... Does this register access require
>> the device to be awake and powered?
>
>Just confirmed that this register indeed requires MEDIA FW.
Thanks Arek.
>> -Chris
>
>--
>Cheers,
>Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-08 23:02 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams anushasr
2016-12-08 23:55 ` Chris Wilson
@ 2016-12-09 12:59 ` Michal Wajdeczko
2016-12-12 14:13 ` Arkadiusz Hiler
1 sibling, 1 reply; 39+ messages in thread
From: Michal Wajdeczko @ 2016-12-09 12:59 UTC (permalink / raw)
To: anushasr; +Cc: intel-gfx, Peter Antoine
On Thu, Dec 08, 2016 at 03:02:19PM -0800, anushasr wrote:
> From: Peter Antoine <peter.antoine@intel.com>
>
> This patch will allow for getparams to return the status of the HuC.
> As the HuC has to be validated by the GuC this patch uses the validated
> status to show when the HuC is loaded and ready for use. You cannot use
> the loaded status as with the GuC as the HuC is verified after it is
> loaded and is not usable until it is verified.
>
> v2: removed the forewakes as the registers are already force-woken.
> (T.Ursulin)
> v4: rebased.
> v5: rebased on top of drm-tip.
> v6: rebased. Removed any reference to intel_huc.h
>
> Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> drivers/gpu/drm/i915/intel_huc_loader.c | 12 ++++++++++++
> drivers/gpu/drm/i915/intel_uc.h | 1 +
> include/uapi/drm/i915_drm.h | 1 +
> 4 files changed, 18 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 85a47c2..6be06a27 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_uc.h"
>
> static struct drm_driver driver;
>
> @@ -349,6 +350,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> */
> value = 1;
> break;
> + case I915_PARAM_HAS_HUC:
For me this param name does not match returned result which maybe misleading.
Note that other HAS params return static driver/hw capability, not runtime.
I guess PARAM_HUC_STATUS would be better (0=no huc, 1=pending, 2=ok, -1=failed)
And you can cache huc status in intel_huc struct and make final modification in
intel_huc_auth() function to avoid registry read (unless we want to detect later
crash of the huc using this reg read)
> + value = intel_is_huc_valid(dev_priv);
> + break;
> default:
> DRM_DEBUG("Unknown parameter %d\n", param->param);
> return -EINVAL;
> diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
> index 96fc727..6704cc8 100644
> --- a/drivers/gpu/drm/i915/intel_huc_loader.c
> +++ b/drivers/gpu/drm/i915/intel_huc_loader.c
> @@ -289,3 +289,15 @@ void intel_huc_fini(struct drm_device *dev)
> huc_fw->fetch_status = UC_FIRMWARE_NONE;
> }
>
> +/**
> + * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
> + * @dev_priv: drm device to check.
> + *
> + * This function will return true if the guc has been loaded and
Please change function return type to bool to match this description.
> + * has valid firmware. The simplest way of doing this is to check
> + * if the HuC has been validated, if so it must have been loaded.
> + */
> +int intel_is_huc_valid(struct drm_i915_private *dev_priv)
> +{
> + return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
> +}
> diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
> index 1db8bc2..ccd3f69 100644
> --- a/drivers/gpu/drm/i915/intel_uc.h
> +++ b/drivers/gpu/drm/i915/intel_uc.h
> @@ -226,6 +226,7 @@ int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val);
> void intel_huc_init(struct drm_i915_private *dev_priv);
> void intel_huc_fini(struct drm_device *dev);
> int intel_huc_load(struct drm_i915_private *dev_priv);
> +int intel_is_huc_valid(struct drm_i915_private *dev_priv);
>
> #endif
> #endif
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index da32c2f..3e1964c 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
> * priorities and the driver will attempt to execute batches in priority order.
> */
> #define I915_PARAM_HAS_SCHEDULER 41
> +#define I915_PARAM_HAS_HUC 42
>
> 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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-09 12:59 ` Michal Wajdeczko
@ 2016-12-12 14:13 ` Arkadiusz Hiler
2016-12-12 14:21 ` Chris Wilson
0 siblings, 1 reply; 39+ messages in thread
From: Arkadiusz Hiler @ 2016-12-12 14:13 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-gfx
On Fri, Dec 09, 2016 at 01:59:45PM +0100, Michal Wajdeczko wrote:
> On Thu, Dec 08, 2016 at 03:02:19PM -0800, anushasr wrote:
> > From: Peter Antoine <peter.antoine@intel.com>
> >
> > This patch will allow for getparams to return the status of the HuC.
> > As the HuC has to be validated by the GuC this patch uses the validated
> > status to show when the HuC is loaded and ready for use. You cannot use
> > the loaded status as with the GuC as the HuC is verified after it is
> > loaded and is not usable until it is verified.
> >
> > v2: removed the forewakes as the registers are already force-woken.
> > (T.Ursulin)
> > v4: rebased.
> > v5: rebased on top of drm-tip.
> > v6: rebased. Removed any reference to intel_huc.h
> >
> > Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> > drivers/gpu/drm/i915/intel_huc_loader.c | 12 ++++++++++++
> > drivers/gpu/drm/i915/intel_uc.h | 1 +
> > include/uapi/drm/i915_drm.h | 1 +
> > 4 files changed, 18 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 85a47c2..6be06a27 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_uc.h"
> >
> > static struct drm_driver driver;
> >
> > @@ -349,6 +350,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> > */
> > value = 1;
> > break;
> > + case I915_PARAM_HAS_HUC:
>
> For me this param name does not match returned result which maybe misleading.
> Note that other HAS params return static driver/hw capability, not runtime.
>
> I guess PARAM_HUC_STATUS would be better (0=no huc, 1=pending, 2=ok, -1=failed)
> And you can cache huc status in intel_huc struct and make final modification in
> intel_huc_auth() function to avoid registry read (unless we want to detect later
> crash of the huc using this reg read)
Why should userspace care for those intermediary states? From what I
know (docs and patches from the cover letter) userspace is interested
only in being able to use HuC. If something is not working you have
DebugFS for that exact purpose.
As of cacheing - seems like a good idea to limit reg reads.
> > + value = intel_is_huc_valid(dev_priv);
> > + break;
> > default:
> > DRM_DEBUG("Unknown parameter %d\n", param->param);
> > return -EINVAL;
> > diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
> > index 96fc727..6704cc8 100644
> > --- a/drivers/gpu/drm/i915/intel_huc_loader.c
> > +++ b/drivers/gpu/drm/i915/intel_huc_loader.c
> > @@ -289,3 +289,15 @@ void intel_huc_fini(struct drm_device *dev)
> > huc_fw->fetch_status = UC_FIRMWARE_NONE;
> > }
> >
> > +/**
> > + * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
> > + * @dev_priv: drm device to check.
> > + *
> > + * This function will return true if the guc has been loaded and
>
> Please change function return type to bool to match this description.
>
> > + * has valid firmware. The simplest way of doing this is to check
> > + * if the HuC has been validated, if so it must have been loaded.
> > + */
> > +int intel_is_huc_valid(struct drm_i915_private *dev_priv)
> > +{
> > + return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
> > +}
> > diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
> > index 1db8bc2..ccd3f69 100644
> > --- a/drivers/gpu/drm/i915/intel_uc.h
> > +++ b/drivers/gpu/drm/i915/intel_uc.h
> > @@ -226,6 +226,7 @@ int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val);
> > void intel_huc_init(struct drm_i915_private *dev_priv);
> > void intel_huc_fini(struct drm_device *dev);
> > int intel_huc_load(struct drm_i915_private *dev_priv);
> > +int intel_is_huc_valid(struct drm_i915_private *dev_priv);
> >
> > #endif
> > #endif
> > diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> > index da32c2f..3e1964c 100644
> > --- a/include/uapi/drm/i915_drm.h
> > +++ b/include/uapi/drm/i915_drm.h
> > @@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
> > * priorities and the driver will attempt to execute batches in priority order.
> > */
> > #define I915_PARAM_HAS_SCHEDULER 41
> > +#define I915_PARAM_HAS_HUC 42
> >
> > 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
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-12 14:13 ` Arkadiusz Hiler
@ 2016-12-12 14:21 ` Chris Wilson
2016-12-12 14:52 ` Arkadiusz Hiler
0 siblings, 1 reply; 39+ messages in thread
From: Chris Wilson @ 2016-12-12 14:21 UTC (permalink / raw)
To: Arkadiusz Hiler; +Cc: intel-gfx, Michal Wajdeczko
On Mon, Dec 12, 2016 at 03:13:17PM +0100, Arkadiusz Hiler wrote:
> On Fri, Dec 09, 2016 at 01:59:45PM +0100, Michal Wajdeczko wrote:
> > On Thu, Dec 08, 2016 at 03:02:19PM -0800, anushasr wrote:
> > > From: Peter Antoine <peter.antoine@intel.com>
> > >
> > > This patch will allow for getparams to return the status of the HuC.
> > > As the HuC has to be validated by the GuC this patch uses the validated
> > > status to show when the HuC is loaded and ready for use. You cannot use
> > > the loaded status as with the GuC as the HuC is verified after it is
> > > loaded and is not usable until it is verified.
> > >
> > > v2: removed the forewakes as the registers are already force-woken.
> > > (T.Ursulin)
> > > v4: rebased.
> > > v5: rebased on top of drm-tip.
> > > v6: rebased. Removed any reference to intel_huc.h
> > >
> > > Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> > > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > > ---
> > > drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> > > drivers/gpu/drm/i915/intel_huc_loader.c | 12 ++++++++++++
> > > drivers/gpu/drm/i915/intel_uc.h | 1 +
> > > include/uapi/drm/i915_drm.h | 1 +
> > > 4 files changed, 18 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > > index 85a47c2..6be06a27 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_uc.h"
> > >
> > > static struct drm_driver driver;
> > >
> > > @@ -349,6 +350,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> > > */
> > > value = 1;
> > > break;
> > > + case I915_PARAM_HAS_HUC:
> >
> > For me this param name does not match returned result which maybe misleading.
> > Note that other HAS params return static driver/hw capability, not runtime.
> >
> > I guess PARAM_HUC_STATUS would be better (0=no huc, 1=pending, 2=ok, -1=failed)
> > And you can cache huc status in intel_huc struct and make final modification in
> > intel_huc_auth() function to avoid registry read (unless we want to detect later
> > crash of the huc using this reg read)
>
> Why should userspace care for those intermediary states? From what I
> know (docs and patches from the cover letter) userspace is interested
> only in being able to use HuC. If something is not working you have
> DebugFS for that exact purpose.
>
> As of cacheing - seems like a good idea to limit reg reads.
Is GETPARAM(HAS_HUC) a hot path? Should we even encourage it?
Are there any other users of intel_huc_is_valid()?
As for userspace simply asking where huc is enabled, we already have
that in the ABI via the module parameter, so you need to justify why
this is preferred (in addition to the available information).
-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
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-12 14:21 ` Chris Wilson
@ 2016-12-12 14:52 ` Arkadiusz Hiler
2016-12-12 15:17 ` Chris Wilson
0 siblings, 1 reply; 39+ messages in thread
From: Arkadiusz Hiler @ 2016-12-12 14:52 UTC (permalink / raw)
To: Chris Wilson, Michal Wajdeczko, intel-gfx
On Mon, Dec 12, 2016 at 02:21:41PM +0000, Chris Wilson wrote:
> On Mon, Dec 12, 2016 at 03:13:17PM +0100, Arkadiusz Hiler wrote:
> > On Fri, Dec 09, 2016 at 01:59:45PM +0100, Michal Wajdeczko wrote:
> > > On Thu, Dec 08, 2016 at 03:02:19PM -0800, anushasr wrote:
> > > > From: Peter Antoine <peter.antoine@intel.com>
> > > >
> > > > This patch will allow for getparams to return the status of the HuC.
> > > > As the HuC has to be validated by the GuC this patch uses the validated
> > > > status to show when the HuC is loaded and ready for use. You cannot use
> > > > the loaded status as with the GuC as the HuC is verified after it is
> > > > loaded and is not usable until it is verified.
> > > >
> > > > v2: removed the forewakes as the registers are already force-woken.
> > > > (T.Ursulin)
> > > > v4: rebased.
> > > > v5: rebased on top of drm-tip.
> > > > v6: rebased. Removed any reference to intel_huc.h
> > > >
> > > > Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> > > > Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > > > ---
> > > > drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> > > > drivers/gpu/drm/i915/intel_huc_loader.c | 12 ++++++++++++
> > > > drivers/gpu/drm/i915/intel_uc.h | 1 +
> > > > include/uapi/drm/i915_drm.h | 1 +
> > > > 4 files changed, 18 insertions(+)
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > > > index 85a47c2..6be06a27 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_uc.h"
> > > >
> > > > static struct drm_driver driver;
> > > >
> > > > @@ -349,6 +350,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> > > > */
> > > > value = 1;
> > > > break;
> > > > + case I915_PARAM_HAS_HUC:
> > >
> > > For me this param name does not match returned result which maybe misleading.
> > > Note that other HAS params return static driver/hw capability, not runtime.
> > >
> > > I guess PARAM_HUC_STATUS would be better (0=no huc, 1=pending, 2=ok, -1=failed)
> > > And you can cache huc status in intel_huc struct and make final modification in
> > > intel_huc_auth() function to avoid registry read (unless we want to detect later
> > > crash of the huc using this reg read)
> >
> > Why should userspace care for those intermediary states? From what I
> > know (docs and patches from the cover letter) userspace is interested
> > only in being able to use HuC. If something is not working you have
> > DebugFS for that exact purpose.
> >
> > As of cacheing - seems like a good idea to limit reg reads.
>
> Is GETPARAM(HAS_HUC) a hot path? Should we even encourage it?
Actually... Good point. HAS_HUC is used once each time you initialise
libva client.
> Are there any other users of intel_huc_is_valid()?
intel_guc_auth_huc() uses
ret = wait_for((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) > 0, 50);
So it can be reused there.
> As for userspace simply asking where huc is enabled, we already have
> that in the ABI via the module parameter, so you need to justify why
> this is preferred (in addition to the available information).
Yeah, we do change the values of module parameters. But a lot of them
are uid 0 only and we have PARAMS for those.
Do anything userspace use those actually? Do we plan to use them instead
of the getparams since now on?
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
--
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-12 14:52 ` Arkadiusz Hiler
@ 2016-12-12 15:17 ` Chris Wilson
2016-12-12 15:27 ` Arkadiusz Hiler
2016-12-12 19:20 ` Srivatsa, Anusha
0 siblings, 2 replies; 39+ messages in thread
From: Chris Wilson @ 2016-12-12 15:17 UTC (permalink / raw)
To: Arkadiusz Hiler; +Cc: intel-gfx, Michal Wajdeczko
On Mon, Dec 12, 2016 at 03:52:05PM +0100, Arkadiusz Hiler wrote:
> On Mon, Dec 12, 2016 at 02:21:41PM +0000, Chris Wilson wrote:
> > As for userspace simply asking where huc is enabled, we already have
> > that in the ABI via the module parameter, so you need to justify why
> > this is preferred (in addition to the available information).
>
> Yeah, we do change the values of module parameters. But a lot of them
> are uid 0 only and we have PARAMS for those.
>
> Do anything userspace use those actually? Do we plan to use them instead
> of the getparams since now on?
I've done both from userspace... I don't really have a preference, once
you have an fd, an ioctl/GETPARAM is trivial. But for quick querying and
reporting of driver state, reading the module parameter is easier. So I
have a tendency to use an ioctl in production code and module parameter
in igt. (And I would say that for one-off validation purposes, i.e. did
hte module actually enable huc?, just check the module parameter. If
userspace is expected to interact and respond to the setting during its
early probe, make it an ioctl so it fits in with the similar code also
being run at that time.)
It is just worth explaining the intended usecase in the cover note, so
that the use can be sanity checked and reflected upon later if need be.
-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
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-12 15:17 ` Chris Wilson
@ 2016-12-12 15:27 ` Arkadiusz Hiler
2016-12-12 19:20 ` Srivatsa, Anusha
1 sibling, 0 replies; 39+ messages in thread
From: Arkadiusz Hiler @ 2016-12-12 15:27 UTC (permalink / raw)
To: Chris Wilson, Michal Wajdeczko, intel-gfx
On Mon, Dec 12, 2016 at 03:17:16PM +0000, Chris Wilson wrote:
> On Mon, Dec 12, 2016 at 03:52:05PM +0100, Arkadiusz Hiler wrote:
> > On Mon, Dec 12, 2016 at 02:21:41PM +0000, Chris Wilson wrote:
> > > As for userspace simply asking where huc is enabled, we already have
> > > that in the ABI via the module parameter, so you need to justify why
> > > this is preferred (in addition to the available information).
> >
> > Yeah, we do change the values of module parameters. But a lot of them
> > are uid 0 only and we have PARAMS for those.
> >
> > Do anything userspace use those actually? Do we plan to use them instead
> > of the getparams since now on?
>
> I've done both from userspace... I don't really have a preference, once
> you have an fd, an ioctl/GETPARAM is trivial. But for quick querying and
> reporting of driver state, reading the module parameter is easier. So I
> have a tendency to use an ioctl in production code and module parameter
> in igt. (And I would say that for one-off validation purposes, i.e. did
> hte module actually enable huc?, just check the module parameter.
Thank you for explaining it :)
> If userspace is expected to interact and respond to the setting
> during its early probe, make it an ioctl so it fits in with the
> similar code also being run at that time.)
Okay. Seems like the scenario Anusha's got.
> It is just worth explaining the intended usecase in the cover note, so
> that the use can be sanity checked and reflected upon later if need be.
> -Chris
The cover letter links patches from the libva which is pretty much a
template usecase, but I agree, it wold be nice if it used
words/pseudocode instead of portions of code from some other project.
> --
> Chris Wilson, Intel Open Source Technology Centre
--
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-12-12 15:17 ` Chris Wilson
2016-12-12 15:27 ` Arkadiusz Hiler
@ 2016-12-12 19:20 ` Srivatsa, Anusha
1 sibling, 0 replies; 39+ messages in thread
From: Srivatsa, Anusha @ 2016-12-12 19:20 UTC (permalink / raw)
To: Chris Wilson, Hiler, Arkadiusz
Cc: intel-gfx@lists.freedesktop.org, Michal Wajdeczko
>-----Original Message-----
>From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of
>Chris Wilson
>Sent: Monday, December 12, 2016 7:17 AM
>To: Hiler, Arkadiusz <arkadiusz.hiler@intel.com>
>Cc: intel-gfx@lists.freedesktop.org; Michal Wajdeczko
><michal.wajdeczko@linux.intel.com>
>Subject: Re: [Intel-gfx] [PATCH 8/8] drm/i915/get_params: Add HuC status to
>getparams
>
>On Mon, Dec 12, 2016 at 03:52:05PM +0100, Arkadiusz Hiler wrote:
>> On Mon, Dec 12, 2016 at 02:21:41PM +0000, Chris Wilson wrote:
>> > As for userspace simply asking where huc is enabled, we already have
>> > that in the ABI via the module parameter, so you need to justify why
>> > this is preferred (in addition to the available information).
>>
>> Yeah, we do change the values of module parameters. But a lot of them
>> are uid 0 only and we have PARAMS for those.
>>
>> Do anything userspace use those actually? Do we plan to use them
>> instead of the getparams since now on?
>
>I've done both from userspace... I don't really have a preference, once you have
>an fd, an ioctl/GETPARAM is trivial. But for quick querying and reporting of driver
>state, reading the module parameter is easier. So I have a tendency to use an
>ioctl in production code and module parameter in igt. (And I would say that for
>one-off validation purposes, i.e. did hte module actually enable huc?, just check
>the module parameter. If userspace is expected to interact and respond to the
>setting during its early probe, make it an ioctl so it fits in with the similar code
>also being run at that time.)
>
>It is just worth explaining the intended usecase in the cover note, so that the use
>can be sanity checked and reflected upon later if need be.
>-Chris
>
Thanks for explaining Chris....
Anusha
>Chris Wilson, Intel Open Source Technology Centre
>_______________________________________________
>Intel-gfx mailing list
>Intel-gfx@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 0/8] HuC Loading Patches
@ 2016-11-30 23:31 Anusha Srivatsa
2016-11-30 23:31 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2016-11-30 23:31 UTC (permalink / raw)
To: intel-gfx
These patches add HuC loading support. The GuC is required to
authenticate the HuC. The userspace patches that check for a
fully loaded HuC firmware and use it can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
More information regarding the HuC, batch commands that configure the
HuC etc can be found at-
https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol02a-commandreference-instructions-huc.pdf
https://www.x.org/docs/intel/CHV/intel-gfx-prm-osrc-chv-bsw-vol10-hevc.pdf
v2: rebased.
v3: rebased. Changed the code following the review comments.
v4: Added action_lock initialization fix provided by Arek
(Hiler Arkadiusz) to the first patch in the series- Make the
GuC fw loading helper functions general.
v5: rebased on top of drm-tip. The patch series is now in sync with GuC
code reorganization efforts by Arek-
https://patchwork.freedesktop.org/series/15896/
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Cc: Arek <arkadiusz.hiler@intel.com>
Cc: Jeff Mcgee <jeff.mcgee@intel.com>
Anusha Srivatsa (2):
drm/i915/huc: Add BXT HuC Loading Support
drm/i915/HuC: Add KBL huC loading Support
Peter Antoine (6):
drm/i915/guc: Make the GuC fw loading helper functions general
drm/i915/huc: Unified css_header struct for GuC and HuC
drm/i914/huc: Add HuC fw loading support
drm/i915/huc: Add debugfs for HuC loading status check
drm/i915/huc: Support HuC authentication
drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_debugfs.c | 43 +++-
drivers/gpu/drm/i915/i915_drv.c | 9 +-
drivers/gpu/drm/i915/i915_drv.h | 4 +-
drivers/gpu/drm/i915/i915_guc_reg.h | 3 +
drivers/gpu/drm/i915/i915_guc_submission.c | 67 ++++++-
drivers/gpu/drm/i915/intel_guc_fwif.h | 22 ++-
drivers/gpu/drm/i915/intel_guc_loader.c | 196 +++++++++---------
drivers/gpu/drm/i915/intel_huc.h | 43 ++++
drivers/gpu/drm/i915/intel_huc_loader.c | 306 +++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_uc.h | 47 +++--
include/uapi/drm/i915_drm.h | 1 +
12 files changed, 620 insertions(+), 122 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_huc.h
create mode 100644 drivers/gpu/drm/i915/intel_huc_loader.c
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-11-30 23:31 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
@ 2016-11-30 23:31 ` Anusha Srivatsa
2016-12-01 13:07 ` Arkadiusz Hiler
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2016-11-30 23:31 UTC (permalink / raw)
To: intel-gfx; +Cc: Peter Antoine
From: Peter Antoine <peter.antoine@intel.com>
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v4: rebased.
v5: rebased on top of drm-tip.
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 5 +++++
drivers/gpu/drm/i915/intel_huc.h | 1 +
drivers/gpu/drm/i915/intel_huc_loader.c | 12 ++++++++++++
include/uapi/drm/i915_drm.h | 1 +
4 files changed, 19 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 075d9ce..75a3e24 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -49,6 +49,8 @@
#include "i915_trace.h"
#include "i915_vgpu.h"
#include "intel_drv.h"
+#include "intel_uc.h"
+#include "intel_huc.h"
static struct drm_driver driver;
@@ -350,6 +352,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
*/
value = 1;
break;
+ case I915_PARAM_HAS_HUC:
+ value = intel_is_huc_valid(dev_priv);
+ break;
default:
DRM_DEBUG("Unknown parameter %d\n", param->param);
return -EINVAL;
diff --git a/drivers/gpu/drm/i915/intel_huc.h b/drivers/gpu/drm/i915/intel_huc.h
index 1dd18c5..1b67311 100644
--- a/drivers/gpu/drm/i915/intel_huc.h
+++ b/drivers/gpu/drm/i915/intel_huc.h
@@ -39,4 +39,5 @@ struct intel_huc {
void intel_huc_init(struct drm_device *dev);
void intel_huc_fini(struct drm_device *dev);
int intel_huc_load(struct drm_device *dev);
+int intel_is_huc_valid(struct drm_i915_private *dev_priv);
#endif
diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
index 20526a4..e18de0f6 100644
--- a/drivers/gpu/drm/i915/intel_huc_loader.c
+++ b/drivers/gpu/drm/i915/intel_huc_loader.c
@@ -292,3 +292,15 @@ void intel_huc_fini(struct drm_device *dev)
huc_fw->fetch_status = UC_FIRMWARE_NONE;
}
+/**
+ * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
+ * @dev_priv: drm device to check.
+ *
+ * This function will return true if the guc has been loaded and
+ * has valid firmware. The simplest way of doing this is to check
+ * if the HuC has been validated, if so it must have been loaded.
+ */
+int intel_is_huc_valid(struct drm_i915_private *dev_priv)
+{
+ return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
+}
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index bdfc688..397b47d 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
* priorities and the driver will attempt to execute batches in priority order.
*/
#define I915_PARAM_HAS_SCHEDULER 41
+#define I915_PARAM_HAS_HUC 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-11-30 23:31 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
@ 2016-12-01 13:07 ` Arkadiusz Hiler
0 siblings, 0 replies; 39+ messages in thread
From: Arkadiusz Hiler @ 2016-12-01 13:07 UTC (permalink / raw)
To: Anusha Srivatsa; +Cc: intel-gfx
On Wed, Nov 30, 2016 at 03:31:34PM -0800, Anusha Srivatsa wrote:
> From: Peter Antoine <peter.antoine@intel.com>
>
> This patch will allow for getparams to return the status of the HuC.
> As the HuC has to be validated by the GuC this patch uses the validated
> status to show when the HuC is loaded and ready for use. You cannot use
> the loaded status as with the GuC as the HuC is verified after it is
> loaded and is not usable until it is verified.
>
> v2: removed the forewakes as the registers are already force-woken.
> (T.Ursulin)
> v4: rebased.
> v5: rebased on top of drm-tip.
>
> Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 5 +++++
> drivers/gpu/drm/i915/intel_huc.h | 1 +
> drivers/gpu/drm/i915/intel_huc_loader.c | 12 ++++++++++++
> include/uapi/drm/i915_drm.h | 1 +
> 4 files changed, 19 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 075d9ce..75a3e24 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -49,6 +49,8 @@
> #include "i915_trace.h"
> #include "i915_vgpu.h"
> #include "intel_drv.h"
> +#include "intel_uc.h"
> +#include "intel_huc.h"
>
> static struct drm_driver driver;
>
> @@ -350,6 +352,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> */
> value = 1;
> break;
> + case I915_PARAM_HAS_HUC:
> + value = intel_is_huc_valid(dev_priv);
> + break;
> default:
> DRM_DEBUG("Unknown parameter %d\n", param->param);
> return -EINVAL;
> diff --git a/drivers/gpu/drm/i915/intel_huc.h b/drivers/gpu/drm/i915/intel_huc.h
> index 1dd18c5..1b67311 100644
> --- a/drivers/gpu/drm/i915/intel_huc.h
> +++ b/drivers/gpu/drm/i915/intel_huc.h
> @@ -39,4 +39,5 @@ struct intel_huc {
> void intel_huc_init(struct drm_device *dev);
> void intel_huc_fini(struct drm_device *dev);
> int intel_huc_load(struct drm_device *dev);
> +int intel_is_huc_valid(struct drm_i915_private *dev_priv);
> #endif
> diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
> index 20526a4..e18de0f6 100644
> --- a/drivers/gpu/drm/i915/intel_huc_loader.c
> +++ b/drivers/gpu/drm/i915/intel_huc_loader.c
> @@ -292,3 +292,15 @@ void intel_huc_fini(struct drm_device *dev)
> huc_fw->fetch_status = UC_FIRMWARE_NONE;
> }
>
> +/**
> + * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
> + * @dev_priv: drm device to check.
> + *
> + * This function will return true if the guc has been loaded and
> + * has valid firmware. The simplest way of doing this is to check
> + * if the HuC has been validated, if so it must have been loaded.
> + */
> +int intel_is_huc_valid(struct drm_i915_private *dev_priv)
> +{
> + return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
> +}
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index bdfc688..397b47d 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -395,6 +395,7 @@ typedef struct drm_i915_irq_wait {
> * priorities and the driver will attempt to execute batches in priority order.
> */
> #define I915_PARAM_HAS_SCHEDULER 41
> +#define I915_PARAM_HAS_HUC 42
>
> 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
--
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 0/8] HuC Loading Patches
@ 2016-11-23 22:27 Anusha Srivatsa
2016-11-23 22:27 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2016-11-23 22:27 UTC (permalink / raw)
To: intel-gfx
These patches add HuC loading support. The userspace
patches that check for a fully loaded HuC firmware and use
it can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
v2: rebased.
v3: rebased. Changed the code following the review comments.
v4: Added action_lock initialization fix provided by Arick
(Hiler Arkadiusz) to the first patch in the series- Make the
GuC fw loading helper functions general.
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Anusha Srivatsa (2):
drm/i915/huc: Add BXT HuC Loading Support
drm/i915/HuC: Add KBL huC loading Support
Peter Antoine (6):
drm/i915/guc: Make the GuC fw loading helper functions general. Always
initialize action_lock
drm/i915/huc: Unified css_header struct for GuC and HuC
drm/i915/huc: Add HuC fw loading support
drm/i915/huc: Add debugfs for HuC loading status check
drm/i915/huc: Support HuC authentication
drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_debugfs.c | 43 +++-
drivers/gpu/drm/i915/i915_drv.c | 8 +
drivers/gpu/drm/i915/i915_drv.h | 3 +
drivers/gpu/drm/i915/i915_guc_reg.h | 3 +
drivers/gpu/drm/i915/i915_guc_submission.c | 70 ++++++-
drivers/gpu/drm/i915/intel_guc.h | 49 +++--
drivers/gpu/drm/i915/intel_guc_fwif.h | 22 ++-
drivers/gpu/drm/i915/intel_guc_loader.c | 196 +++++++++---------
drivers/gpu/drm/i915/intel_huc.h | 43 ++++
drivers/gpu/drm/i915/intel_huc_loader.c | 306 +++++++++++++++++++++++++++++
include/uapi/drm/i915_drm.h | 1 +
12 files changed, 624 insertions(+), 121 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_huc.h
create mode 100644 drivers/gpu/drm/i915/intel_huc_loader.c
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-11-23 22:27 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
@ 2016-11-23 22:27 ` Anusha Srivatsa
2016-11-24 1:35 ` Jeff McGee
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2016-11-23 22:27 UTC (permalink / raw)
To: intel-gfx; +Cc: Peter Antoine
From: Peter Antoine <peter.antoine@intel.com>
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v4: rebased.
v5: rebased.
v6: rebased.
v7: rebased.
v8: rebased.
Tested-by: Xiang Haihao <haihao.xiang@intel.com>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Jeff McGee <jeff.mcgee@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 8 ++++++++
drivers/gpu/drm/i915/intel_huc.h | 1 +
drivers/gpu/drm/i915/intel_huc_loader.c | 13 +++++++++++++
include/uapi/drm/i915_drm.h | 1 +
4 files changed, 23 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index b893e67..f2d5b0f 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -49,6 +49,8 @@
#include "i915_trace.h"
#include "i915_vgpu.h"
#include "intel_drv.h"
+#include "intel_guc.h"
+#include "intel_huc.h"
static struct drm_driver driver;
@@ -350,6 +352,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
*/
value = 1;
break;
+ case I915_PARAM_HAS_HUC:
+ value = intel_is_huc_valid(dev_priv);
+ break;
default:
DRM_DEBUG("Unknown parameter %d\n", param->param);
return -EINVAL;
@@ -603,6 +608,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
if (ret)
goto cleanup_irq;
+ intel_huc_init(dev);
intel_guc_init(dev);
ret = i915_gem_init(dev);
@@ -630,6 +636,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
DRM_ERROR("failed to idle hardware; continuing to unload!\n");
i915_gem_fini(dev_priv);
cleanup_irq:
+ intel_huc_fini(dev);
intel_guc_fini(dev);
drm_irq_uninstall(dev);
intel_teardown_gmbus(dev);
@@ -1325,6 +1332,7 @@ void i915_driver_unload(struct drm_device *dev)
/* Flush any outstanding unpin_work. */
drain_workqueue(dev_priv->wq);
+ intel_huc_fini(dev);
intel_guc_fini(dev);
i915_gem_fini(dev_priv);
intel_fbc_cleanup_cfb(dev_priv);
diff --git a/drivers/gpu/drm/i915/intel_huc.h b/drivers/gpu/drm/i915/intel_huc.h
index 3ce0299..2e150be 100644
--- a/drivers/gpu/drm/i915/intel_huc.h
+++ b/drivers/gpu/drm/i915/intel_huc.h
@@ -39,4 +39,5 @@ struct intel_huc {
void intel_huc_init(struct drm_device *dev);
void intel_huc_fini(struct drm_device *dev);
int intel_huc_load(struct drm_device *dev);
+extern int intel_is_huc_valid(struct drm_i915_private *dev_priv);
#endif
diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
index 3a2555e..8c3993b 100644
--- a/drivers/gpu/drm/i915/intel_huc_loader.c
+++ b/drivers/gpu/drm/i915/intel_huc_loader.c
@@ -291,3 +291,16 @@ void intel_huc_fini(struct drm_device *dev)
huc_fw->fetch_status = UC_FIRMWARE_NONE;
}
+
+/**
+ * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
+ * @dev_priv: drm device to check.
+ *
+ * This function will return true if the guc has been loaded and
+ * has valid firmware. The simplest way of doing this is to check
+ * if the HuC has been validated, if so it must have been loaded.
+ */
+int intel_is_huc_valid(struct drm_i915_private *dev_priv)
+{
+ return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
+}
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index bdfc688..0a9dac4 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -390,6 +390,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_HUC 42
/* Query whether DRM_I915_GEM_EXECBUFFER2 supports user defined execution
* priorities and the driver will attempt to execute batches in priority order.
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-11-23 22:27 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
@ 2016-11-24 1:35 ` Jeff McGee
0 siblings, 0 replies; 39+ messages in thread
From: Jeff McGee @ 2016-11-24 1:35 UTC (permalink / raw)
To: Anusha Srivatsa; +Cc: intel-gfx, Peter Antoine
On Wed, Nov 23, 2016 at 02:27:43PM -0800, Anusha Srivatsa wrote:
> From: Peter Antoine <peter.antoine@intel.com>
>
> This patch will allow for getparams to return the status of the HuC.
> As the HuC has to be validated by the GuC this patch uses the validated
> status to show when the HuC is loaded and ready for use. You cannot use
> the loaded status as with the GuC as the HuC is verified after it is
> loaded and is not usable until it is verified.
>
> v2: removed the forewakes as the registers are already force-woken.
> (T.Ursulin)
> v4: rebased.
> v5: rebased.
> v6: rebased.
> v7: rebased.
> v8: rebased.
>
> Tested-by: Xiang Haihao <haihao.xiang@intel.com>
> Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
> Signed-off-by: Peter Antoine <peter.antoine@intel.com>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Reviewed-by: Jeff McGee <jeff.mcgee@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 8 ++++++++
> drivers/gpu/drm/i915/intel_huc.h | 1 +
> drivers/gpu/drm/i915/intel_huc_loader.c | 13 +++++++++++++
> include/uapi/drm/i915_drm.h | 1 +
> 4 files changed, 23 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index b893e67..f2d5b0f 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -49,6 +49,8 @@
> #include "i915_trace.h"
> #include "i915_vgpu.h"
> #include "intel_drv.h"
> +#include "intel_guc.h"
> +#include "intel_huc.h"
>
> static struct drm_driver driver;
>
> @@ -350,6 +352,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> */
> value = 1;
> break;
> + case I915_PARAM_HAS_HUC:
> + value = intel_is_huc_valid(dev_priv);
> + break;
> default:
> DRM_DEBUG("Unknown parameter %d\n", param->param);
> return -EINVAL;
> @@ -603,6 +608,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
> if (ret)
> goto cleanup_irq;
>
> + intel_huc_init(dev);
As we discussed, this needs to be in patch 3.
> intel_guc_init(dev);
>
> ret = i915_gem_init(dev);
> @@ -630,6 +636,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
> DRM_ERROR("failed to idle hardware; continuing to unload!\n");
> i915_gem_fini(dev_priv);
> cleanup_irq:
> + intel_huc_fini(dev);
> intel_guc_fini(dev);
> drm_irq_uninstall(dev);
> intel_teardown_gmbus(dev);
> @@ -1325,6 +1332,7 @@ void i915_driver_unload(struct drm_device *dev)
> /* Flush any outstanding unpin_work. */
> drain_workqueue(dev_priv->wq);
>
> + intel_huc_fini(dev);
> intel_guc_fini(dev);
> i915_gem_fini(dev_priv);
> intel_fbc_cleanup_cfb(dev_priv);
> diff --git a/drivers/gpu/drm/i915/intel_huc.h b/drivers/gpu/drm/i915/intel_huc.h
> index 3ce0299..2e150be 100644
> --- a/drivers/gpu/drm/i915/intel_huc.h
> +++ b/drivers/gpu/drm/i915/intel_huc.h
> @@ -39,4 +39,5 @@ struct intel_huc {
> void intel_huc_init(struct drm_device *dev);
> void intel_huc_fini(struct drm_device *dev);
> int intel_huc_load(struct drm_device *dev);
> +extern int intel_is_huc_valid(struct drm_i915_private *dev_priv);
> #endif
> diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
> index 3a2555e..8c3993b 100644
> --- a/drivers/gpu/drm/i915/intel_huc_loader.c
> +++ b/drivers/gpu/drm/i915/intel_huc_loader.c
> @@ -291,3 +291,16 @@ void intel_huc_fini(struct drm_device *dev)
>
> huc_fw->fetch_status = UC_FIRMWARE_NONE;
> }
> +
> +/**
> + * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
> + * @dev_priv: drm device to check.
> + *
> + * This function will return true if the guc has been loaded and
> + * has valid firmware. The simplest way of doing this is to check
> + * if the HuC has been validated, if so it must have been loaded.
> + */
> +int intel_is_huc_valid(struct drm_i915_private *dev_priv)
> +{
> + return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
> +}
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index bdfc688..0a9dac4 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -390,6 +390,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_HUC 42
>
> /* Query whether DRM_I915_GEM_EXECBUFFER2 supports user defined execution
> * priorities and the driver will attempt to execute batches in priority order.
> --
> 2.7.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH v4 0/8] HuC Loading Patches
@ 2016-11-11 0:15 Anusha Srivatsa
2016-11-11 0:15 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2016-11-11 0:15 UTC (permalink / raw)
To: intel-gfx
These patches add HuC loading support. The userspace
patches that check for a fully loaded HuC firmware and use
it can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
v2: rebased.
v3: rebased. Changed the code following the review comments.
Changed mainly include renaming certain functions, correcting comments
and changing the yesr in the copyright message. Removed one patch
from original series: Add guC status to getparams.
v4: Added the file construction method which the HuC follows. This is on similar
lines to that of GuC. Rewrote the BXT HuC loading patch and wrote a new
patch for HuC loading on KBL.
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Anusha Srivatsa (2):
drm/i915/huc: Add BXT HuC Loading Support
drm/i915/HuC: Add KBL huC loading Support
Peter Antoine (6):
drm/i915/guc: Make the GuC fw loading helper functions general
drm/i915/huc: Unified css_header struct for GuC and HuC
drm/i915/huc: Add HuC fw loading support
drm/i915/huc: Add debugfs for HuC loading status check
drm/i915/huc: Support HuC authentication
drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_debugfs.c | 43 +++-
drivers/gpu/drm/i915/i915_drv.c | 8 +
drivers/gpu/drm/i915/i915_drv.h | 3 +
drivers/gpu/drm/i915/i915_guc_reg.h | 3 +
drivers/gpu/drm/i915/i915_guc_submission.c | 67 ++++++-
drivers/gpu/drm/i915/intel_guc.h | 50 +++--
drivers/gpu/drm/i915/intel_guc_fwif.h | 22 ++-
drivers/gpu/drm/i915/intel_guc_loader.c | 197 +++++++++---------
drivers/gpu/drm/i915/intel_huc.h | 43 ++++
drivers/gpu/drm/i915/intel_huc_loader.c | 308 +++++++++++++++++++++++++++++
include/uapi/drm/i915_drm.h | 1 +
12 files changed, 624 insertions(+), 122 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_huc.h
create mode 100644 drivers/gpu/drm/i915/intel_huc_loader.c
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-11-11 0:15 [PATCH v4 0/8] HuC Loading Patches Anusha Srivatsa
@ 2016-11-11 0:15 ` Anusha Srivatsa
0 siblings, 0 replies; 39+ messages in thread
From: Anusha Srivatsa @ 2016-11-11 0:15 UTC (permalink / raw)
To: intel-gfx; +Cc: Peter Antoine
From: Peter Antoine <peter.antoine@intel.com>
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v4: rebased.
v5: rebased.
v6: rebased.
v7: rebased.
Tested-by: Xiang Haihao <haihao.xiang@intel.com>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Jeff McGee <jeff.mcgee@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 8 ++++++++
drivers/gpu/drm/i915/intel_huc.h | 1 +
drivers/gpu/drm/i915/intel_huc_loader.c | 14 ++++++++++++++
include/uapi/drm/i915_drm.h | 1 +
4 files changed, 24 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 0213a30..52a1941 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -49,6 +49,8 @@
#include "i915_trace.h"
#include "i915_vgpu.h"
#include "intel_drv.h"
+#include "intel_guc.h"
+#include "intel_huc.h"
static struct drm_driver driver;
@@ -346,6 +348,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
*/
value = 1;
break;
+ case I915_PARAM_HAS_HUC:
+ value = intel_is_huc_valid(dev_priv);
+ break;
default:
DRM_DEBUG("Unknown parameter %d\n", param->param);
return -EINVAL;
@@ -599,6 +604,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
if (ret)
goto cleanup_irq;
+ intel_huc_init(dev);
intel_guc_init(dev);
ret = i915_gem_init(dev);
@@ -626,6 +632,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
DRM_ERROR("failed to idle hardware; continuing to unload!\n");
i915_gem_fini(dev_priv);
cleanup_irq:
+ intel_huc_fini(dev);
intel_guc_fini(dev);
drm_irq_uninstall(dev);
intel_teardown_gmbus(dev);
@@ -1313,6 +1320,7 @@ void i915_driver_unload(struct drm_device *dev)
/* Flush any outstanding unpin_work. */
drain_workqueue(dev_priv->wq);
+ intel_huc_fini(dev);
intel_guc_fini(dev);
i915_gem_fini(dev_priv);
intel_fbc_cleanup_cfb(dev_priv);
diff --git a/drivers/gpu/drm/i915/intel_huc.h b/drivers/gpu/drm/i915/intel_huc.h
index 3ce0299..2e150be 100644
--- a/drivers/gpu/drm/i915/intel_huc.h
+++ b/drivers/gpu/drm/i915/intel_huc.h
@@ -39,4 +39,5 @@ struct intel_huc {
void intel_huc_init(struct drm_device *dev);
void intel_huc_fini(struct drm_device *dev);
int intel_huc_load(struct drm_device *dev);
+extern int intel_is_huc_valid(struct drm_i915_private *dev_priv);
#endif
diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
index dab64ba..c6eec5b 100644
--- a/drivers/gpu/drm/i915/intel_huc_loader.c
+++ b/drivers/gpu/drm/i915/intel_huc_loader.c
@@ -292,3 +292,17 @@ void intel_huc_fini(struct drm_device *dev)
huc_fw->fetch_status = UC_FIRMWARE_NONE;
}
+
+/**
+ * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
+ * @dev_priv: drm device to check.
+ *
+ * This function will return true if the guc has been loaded and
+ * has valid firmware. The simplest way of doing this is to check
+ * if the HuC has been validated, if so it must have been loaded.
+ */
+int intel_is_huc_valid(struct drm_i915_private *dev_priv)
+{
+ return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
+}
+
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 03725fe..aa7667e 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_HUC 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 1/8] drm/i915/guc: Make the GuC fw loading helper functions general
@ 2016-11-09 18:51 Anusha Srivatsa
2016-11-09 18:51 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2016-11-09 18:51 UTC (permalink / raw)
To: intel-gfx; +Cc: Alex Dai, Peter Antoine
From: Peter Antoine <peter.antoine@intel.com>
Rename some of the GuC fw loading code to make them more general. We
will utilise them for HuC loading as well.
s/intel_guc_fw/intel_uc_fw/g
s/GUC_FIRMWARE/UC_FIRMWARE/g
Struct intel_guc_fw is renamed to intel_uc_fw. Prefix of tts members,
such as 'guc' or 'guc_fw' either is renamed to 'uc' or removed for
same purpose.
v2: rebased on top of nightly.
reapplied the search/replace as upstream code as changed.
v3: rebased again on drm-nightly.
v4: removed G from messages in shared fw fetch function.
v5: rebased.
v7: rebased.
v8: rebased.
v9: rebased.
v10: rebased.
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Alex Dai <yu.dai@intel.com>
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Dave Gordon <david.s.gordon@intel.com>
Reviewed-by: Jeff McGee <jeff.mcgee@intel.com>
Reviewed-by: Carlos Santa <carlos.santa@intel.com>
Tested-by: Carlos Santa <carlos.santa@intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 12 +--
drivers/gpu/drm/i915/i915_guc_submission.c | 4 +-
drivers/gpu/drm/i915/intel_guc.h | 39 ++++----
drivers/gpu/drm/i915/intel_guc_loader.c | 156 ++++++++++++++---------------
4 files changed, 106 insertions(+), 105 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index b681d42..7e206dd 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2353,7 +2353,7 @@ static int i915_llc(struct seq_file *m, void *data)
static int i915_guc_load_status_info(struct seq_file *m, void *data)
{
struct drm_i915_private *dev_priv = node_to_i915(m->private);
- struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
+ struct intel_uc_fw *guc_fw = &dev_priv->guc.guc_fw;
u32 tmp, i;
if (!HAS_GUC_UCODE(dev_priv))
@@ -2361,15 +2361,15 @@ static int i915_guc_load_status_info(struct seq_file *m, void *data)
seq_printf(m, "GuC firmware status:\n");
seq_printf(m, "\tpath: %s\n",
- guc_fw->guc_fw_path);
+ guc_fw->uc_fw_path);
seq_printf(m, "\tfetch: %s\n",
- intel_guc_fw_status_repr(guc_fw->guc_fw_fetch_status));
+ intel_uc_fw_status_repr(guc_fw->fetch_status));
seq_printf(m, "\tload: %s\n",
- intel_guc_fw_status_repr(guc_fw->guc_fw_load_status));
+ intel_uc_fw_status_repr(guc_fw->load_status));
seq_printf(m, "\tversion wanted: %d.%d\n",
- guc_fw->guc_fw_major_wanted, guc_fw->guc_fw_minor_wanted);
+ guc_fw->major_ver_wanted, guc_fw->minor_ver_wanted);
seq_printf(m, "\tversion found: %d.%d\n",
- guc_fw->guc_fw_major_found, guc_fw->guc_fw_minor_found);
+ guc_fw->major_ver_found, guc_fw->minor_ver_found);
seq_printf(m, "\theader: offset is %d; size = %d\n",
guc_fw->header_offset, guc_fw->header_size);
seq_printf(m, "\tuCode: offset is %d; size = %d\n",
diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
index 666dab7..fb59e44 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -1570,7 +1570,7 @@ int intel_guc_suspend(struct drm_device *dev)
struct i915_gem_context *ctx;
u32 data[3];
- if (guc->guc_fw.guc_fw_load_status != GUC_FIRMWARE_SUCCESS)
+ if (guc->guc_fw.load_status != UC_FIRMWARE_SUCCESS)
return 0;
gen9_disable_guc_interrupts(dev_priv);
@@ -1598,7 +1598,7 @@ int intel_guc_resume(struct drm_device *dev)
struct i915_gem_context *ctx;
u32 data[3];
- if (guc->guc_fw.guc_fw_load_status != GUC_FIRMWARE_SUCCESS)
+ if (guc->guc_fw.load_status != UC_FIRMWARE_SUCCESS)
return 0;
if (i915.guc_log_level >= 0)
diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h
index 0053258..6dc328f 100644
--- a/drivers/gpu/drm/i915/intel_guc.h
+++ b/drivers/gpu/drm/i915/intel_guc.h
@@ -91,29 +91,29 @@ struct i915_guc_client {
uint64_t submissions[I915_NUM_ENGINES];
};
-enum intel_guc_fw_status {
- GUC_FIRMWARE_FAIL = -1,
- GUC_FIRMWARE_NONE = 0,
- GUC_FIRMWARE_PENDING,
- GUC_FIRMWARE_SUCCESS
+enum intel_uc_fw_status {
+ UC_FIRMWARE_FAIL = -1,
+ UC_FIRMWARE_NONE = 0,
+ UC_FIRMWARE_PENDING,
+ UC_FIRMWARE_SUCCESS
};
/*
* This structure encapsulates all the data needed during the process
* of fetching, caching, and loading the firmware image into the GuC.
*/
-struct intel_guc_fw {
- struct drm_device * guc_dev;
- const char * guc_fw_path;
- size_t guc_fw_size;
- struct drm_i915_gem_object * guc_fw_obj;
- enum intel_guc_fw_status guc_fw_fetch_status;
- enum intel_guc_fw_status guc_fw_load_status;
-
- uint16_t guc_fw_major_wanted;
- uint16_t guc_fw_minor_wanted;
- uint16_t guc_fw_major_found;
- uint16_t guc_fw_minor_found;
+struct intel_uc_fw {
+ struct drm_device *uc_dev;
+ const char *uc_fw_path;
+ size_t uc_fw_size;
+ struct drm_i915_gem_object *uc_fw_obj;
+ enum intel_uc_fw_status fetch_status;
+ enum intel_uc_fw_status load_status;
+
+ uint16_t major_ver_wanted;
+ uint16_t minor_ver_wanted;
+ uint16_t major_ver_found;
+ uint16_t minor_ver_found;
uint32_t header_size;
uint32_t header_offset;
@@ -140,7 +140,7 @@ struct intel_guc_log {
};
struct intel_guc {
- struct intel_guc_fw guc_fw;
+ struct intel_uc_fw guc_fw;
struct intel_guc_log log;
/* GuC2Host interrupt related state */
@@ -173,9 +173,10 @@ struct intel_guc {
extern void intel_guc_init(struct drm_device *dev);
extern int intel_guc_setup(struct drm_device *dev);
extern void intel_guc_fini(struct drm_device *dev);
-extern const char *intel_guc_fw_status_repr(enum intel_guc_fw_status status);
+extern const char *intel_uc_fw_status_repr(enum intel_uc_fw_status status);
extern int intel_guc_suspend(struct drm_device *dev);
extern int intel_guc_resume(struct drm_device *dev);
+void intel_uc_fw_fetch(struct drm_device *dev, struct intel_uc_fw *uc_fw);
/* i915_guc_submission.c */
int i915_guc_submission_init(struct drm_i915_private *dev_priv);
diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index 1aa8523..6683a88 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -81,16 +81,16 @@ MODULE_FIRMWARE(I915_BXT_GUC_UCODE);
MODULE_FIRMWARE(I915_KBL_GUC_UCODE);
/* User-friendly representation of an enum */
-const char *intel_guc_fw_status_repr(enum intel_guc_fw_status status)
+const char *intel_uc_fw_status_repr(enum intel_uc_fw_status status)
{
switch (status) {
- case GUC_FIRMWARE_FAIL:
+ case UC_FIRMWARE_FAIL:
return "FAIL";
- case GUC_FIRMWARE_NONE:
+ case UC_FIRMWARE_NONE:
return "NONE";
- case GUC_FIRMWARE_PENDING:
+ case UC_FIRMWARE_PENDING:
return "PENDING";
- case GUC_FIRMWARE_SUCCESS:
+ case UC_FIRMWARE_SUCCESS:
return "SUCCESS";
default:
return "UNKNOWN!";
@@ -278,7 +278,7 @@ static inline bool guc_ucode_response(struct drm_i915_private *dev_priv,
static int guc_ucode_xfer_dma(struct drm_i915_private *dev_priv,
struct i915_vma *vma)
{
- struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
+ struct intel_uc_fw *guc_fw = &dev_priv->guc.guc_fw;
unsigned long offset;
struct sg_table *sg = vma->pages;
u32 status, rsa[UOS_RSA_SCRATCH_MAX_COUNT];
@@ -350,17 +350,17 @@ static u32 guc_wopcm_size(struct drm_i915_private *dev_priv)
*/
static int guc_ucode_xfer(struct drm_i915_private *dev_priv)
{
- struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
+ struct intel_uc_fw *guc_fw = &dev_priv->guc.guc_fw;
struct i915_vma *vma;
int ret;
- ret = i915_gem_object_set_to_gtt_domain(guc_fw->guc_fw_obj, false);
+ ret = i915_gem_object_set_to_gtt_domain(guc_fw->uc_fw_obj, false);
if (ret) {
DRM_DEBUG_DRIVER("set-domain failed %d\n", ret);
return ret;
}
- vma = i915_gem_object_ggtt_pin(guc_fw->guc_fw_obj, NULL, 0, 0, 0);
+ vma = i915_gem_object_ggtt_pin(guc_fw->uc_fw_obj, NULL, 0, 0, 0);
if (IS_ERR(vma)) {
DRM_DEBUG_DRIVER("pin failed %d\n", (int)PTR_ERR(vma));
return PTR_ERR(vma);
@@ -451,14 +451,14 @@ static int guc_hw_reset(struct drm_i915_private *dev_priv)
int intel_guc_setup(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = to_i915(dev);
- struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
- const char *fw_path = guc_fw->guc_fw_path;
+ struct intel_uc_fw *guc_fw = &dev_priv->guc.guc_fw;
+ const char *fw_path = guc_fw->uc_fw_path;
int retries, ret, err;
DRM_DEBUG_DRIVER("GuC fw status: path %s, fetch %s, load %s\n",
fw_path,
- intel_guc_fw_status_repr(guc_fw->guc_fw_fetch_status),
- intel_guc_fw_status_repr(guc_fw->guc_fw_load_status));
+ intel_uc_fw_status_repr(guc_fw->fetch_status),
+ intel_uc_fw_status_repr(guc_fw->load_status));
/* Loading forbidden, or no firmware to load? */
if (!i915.enable_guc_loading) {
@@ -476,10 +476,10 @@ int intel_guc_setup(struct drm_device *dev)
}
/* Fetch failed, or already fetched but failed to load? */
- if (guc_fw->guc_fw_fetch_status != GUC_FIRMWARE_SUCCESS) {
+ if (guc_fw->fetch_status != UC_FIRMWARE_SUCCESS) {
err = -EIO;
goto fail;
- } else if (guc_fw->guc_fw_load_status == GUC_FIRMWARE_FAIL) {
+ } else if (guc_fw->load_status == UC_FIRMWARE_FAIL) {
err = -ENOEXEC;
goto fail;
}
@@ -487,11 +487,11 @@ int intel_guc_setup(struct drm_device *dev)
guc_interrupts_release(dev_priv);
gen9_reset_guc_interrupts(dev_priv);
- guc_fw->guc_fw_load_status = GUC_FIRMWARE_PENDING;
+ guc_fw->load_status = UC_FIRMWARE_PENDING;
DRM_DEBUG_DRIVER("GuC fw status: fetch %s, load %s\n",
- intel_guc_fw_status_repr(guc_fw->guc_fw_fetch_status),
- intel_guc_fw_status_repr(guc_fw->guc_fw_load_status));
+ intel_uc_fw_status_repr(guc_fw->fetch_status),
+ intel_uc_fw_status_repr(guc_fw->load_status));
err = i915_guc_submission_init(dev_priv);
if (err)
@@ -523,11 +523,11 @@ int intel_guc_setup(struct drm_device *dev)
"retry %d more time(s)\n", err, retries);
}
- guc_fw->guc_fw_load_status = GUC_FIRMWARE_SUCCESS;
+ guc_fw->load_status = UC_FIRMWARE_SUCCESS;
DRM_DEBUG_DRIVER("GuC fw status: fetch %s, load %s\n",
- intel_guc_fw_status_repr(guc_fw->guc_fw_fetch_status),
- intel_guc_fw_status_repr(guc_fw->guc_fw_load_status));
+ intel_uc_fw_status_repr(guc_fw->fetch_status),
+ intel_uc_fw_status_repr(guc_fw->load_status));
if (i915.enable_guc_submission) {
if (i915.guc_log_level >= 0)
@@ -542,8 +542,8 @@ int intel_guc_setup(struct drm_device *dev)
return 0;
fail:
- if (guc_fw->guc_fw_load_status == GUC_FIRMWARE_PENDING)
- guc_fw->guc_fw_load_status = GUC_FIRMWARE_FAIL;
+ if (guc_fw->load_status == UC_FIRMWARE_PENDING)
+ guc_fw->load_status = UC_FIRMWARE_FAIL;
guc_interrupts_release(dev_priv);
i915_guc_submission_disable(dev_priv);
@@ -588,7 +588,7 @@ int intel_guc_setup(struct drm_device *dev)
return ret;
}
-static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
+void intel_uc_fw_fetch(struct drm_device *dev, struct intel_uc_fw *uc_fw)
{
struct pci_dev *pdev = dev->pdev;
struct drm_i915_gem_object *obj;
@@ -597,17 +597,17 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
size_t size;
int err;
- DRM_DEBUG_DRIVER("before requesting firmware: GuC fw fetch status %s\n",
- intel_guc_fw_status_repr(guc_fw->guc_fw_fetch_status));
+ DRM_DEBUG_DRIVER("before requesting firmware: uC fw fetch status %s\n",
+ intel_uc_fw_status_repr(uc_fw->fetch_status));
- err = request_firmware(&fw, guc_fw->guc_fw_path, &pdev->dev);
+ err = request_firmware(&fw, uc_fw->uc_fw_path, &pdev->dev);
if (err)
goto fail;
if (!fw)
goto fail;
- DRM_DEBUG_DRIVER("fetch GuC fw from %s succeeded, fw %p\n",
- guc_fw->guc_fw_path, fw);
+ DRM_DEBUG_DRIVER("fetch uC fw from %s succeeded, fw %p\n",
+ uc_fw->uc_fw_path, fw);
/* Check the size of the blob before examining buffer contents */
if (fw->size < sizeof(struct guc_css_header)) {
@@ -618,36 +618,36 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
css = (struct guc_css_header *)fw->data;
/* Firmware bits always start from header */
- guc_fw->header_offset = 0;
- guc_fw->header_size = (css->header_size_dw - css->modulus_size_dw -
+ uc_fw->header_offset = 0;
+ uc_fw->header_size = (css->header_size_dw - css->modulus_size_dw -
css->key_size_dw - css->exponent_size_dw) * sizeof(u32);
- if (guc_fw->header_size != sizeof(struct guc_css_header)) {
+ if (uc_fw->header_size != sizeof(struct guc_css_header)) {
DRM_NOTE("CSS header definition mismatch\n");
goto fail;
}
/* then, uCode */
- guc_fw->ucode_offset = guc_fw->header_offset + guc_fw->header_size;
- guc_fw->ucode_size = (css->size_dw - css->header_size_dw) * sizeof(u32);
+ uc_fw->ucode_offset = uc_fw->header_offset + uc_fw->header_size;
+ uc_fw->ucode_size = (css->size_dw - css->header_size_dw) * sizeof(u32);
/* now RSA */
if (css->key_size_dw != UOS_RSA_SCRATCH_MAX_COUNT) {
DRM_NOTE("RSA key size is bad\n");
goto fail;
}
- guc_fw->rsa_offset = guc_fw->ucode_offset + guc_fw->ucode_size;
- guc_fw->rsa_size = css->key_size_dw * sizeof(u32);
+ uc_fw->rsa_offset = uc_fw->ucode_offset + uc_fw->ucode_size;
+ uc_fw->rsa_size = css->key_size_dw * sizeof(u32);
/* At least, it should have header, uCode and RSA. Size of all three. */
- size = guc_fw->header_size + guc_fw->ucode_size + guc_fw->rsa_size;
+ size = uc_fw->header_size + uc_fw->ucode_size + uc_fw->rsa_size;
if (fw->size < size) {
DRM_NOTE("Missing firmware components\n");
goto fail;
}
/* Header and uCode will be loaded to WOPCM. Size of the two. */
- size = guc_fw->header_size + guc_fw->ucode_size;
+ size = uc_fw->header_size + uc_fw->ucode_size;
if (size > guc_wopcm_size(to_i915(dev))) {
DRM_NOTE("Firmware is too large to fit in WOPCM\n");
goto fail;
@@ -659,21 +659,21 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
* TWO bytes each (i.e. u16), although all pointers and offsets are defined
* in terms of bytes (u8).
*/
- guc_fw->guc_fw_major_found = css->guc_sw_version >> 16;
- guc_fw->guc_fw_minor_found = css->guc_sw_version & 0xFFFF;
-
- if (guc_fw->guc_fw_major_found != guc_fw->guc_fw_major_wanted ||
- guc_fw->guc_fw_minor_found < guc_fw->guc_fw_minor_wanted) {
- DRM_NOTE("GuC firmware version %d.%d, required %d.%d\n",
- guc_fw->guc_fw_major_found, guc_fw->guc_fw_minor_found,
- guc_fw->guc_fw_major_wanted, guc_fw->guc_fw_minor_wanted);
+ uc_fw->major_ver_found = css->guc_sw_version >> 16;
+ uc_fw->minor_ver_found = css->guc_sw_version & 0xFFFF;
+
+ if (uc_fw->major_ver_found != uc_fw->major_ver_wanted ||
+ uc_fw->minor_ver_found < uc_fw->minor_ver_wanted) {
+ DRM_NOTE("uC firmware version %d.%d, required %d.%d\n",
+ uc_fw->major_ver_found, uc_fw->minor_ver_found,
+ uc_fw->major_ver_wanted, uc_fw->minor_ver_wanted);
err = -ENOEXEC;
goto fail;
}
DRM_DEBUG_DRIVER("firmware version %d.%d OK (minimum %d.%d)\n",
- guc_fw->guc_fw_major_found, guc_fw->guc_fw_minor_found,
- guc_fw->guc_fw_major_wanted, guc_fw->guc_fw_minor_wanted);
+ uc_fw->major_ver_found, uc_fw->minor_ver_found,
+ uc_fw->major_ver_wanted, uc_fw->minor_ver_wanted);
mutex_lock(&dev->struct_mutex);
obj = i915_gem_object_create_from_data(dev, fw->data, fw->size);
@@ -683,31 +683,31 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
goto fail;
}
- guc_fw->guc_fw_obj = obj;
- guc_fw->guc_fw_size = fw->size;
+ uc_fw->uc_fw_obj = obj;
+ uc_fw->uc_fw_size = fw->size;
- DRM_DEBUG_DRIVER("GuC fw fetch status SUCCESS, obj %p\n",
- guc_fw->guc_fw_obj);
+ DRM_DEBUG_DRIVER("uC fw fetch status SUCCESS, obj %p\n",
+ uc_fw->uc_fw_obj);
release_firmware(fw);
- guc_fw->guc_fw_fetch_status = GUC_FIRMWARE_SUCCESS;
+ uc_fw->fetch_status = UC_FIRMWARE_SUCCESS;
return;
fail:
- DRM_WARN("Failed to fetch valid GuC firmware from %s (error %d)\n",
- guc_fw->guc_fw_path, err);
- DRM_DEBUG_DRIVER("GuC fw fetch status FAIL; err %d, fw %p, obj %p\n",
- err, fw, guc_fw->guc_fw_obj);
+ DRM_WARN("Failed to fetch valid uC firmware from %s (error %d)\n",
+ uc_fw->uc_fw_path, err);
+ DRM_DEBUG_DRIVER("uC fw fetch status FAIL; err %d, fw %p, obj %p\n",
+ err, fw, uc_fw->uc_fw_obj);
mutex_lock(&dev->struct_mutex);
- obj = guc_fw->guc_fw_obj;
+ obj = uc_fw->uc_fw_obj;
if (obj)
i915_gem_object_put(obj);
- guc_fw->guc_fw_obj = NULL;
+ uc_fw->uc_fw_obj = NULL;
mutex_unlock(&dev->struct_mutex);
release_firmware(fw); /* OK even if fw is NULL */
- guc_fw->guc_fw_fetch_status = GUC_FIRMWARE_FAIL;
+ uc_fw->fetch_status = UC_FIRMWARE_FAIL;
}
/**
@@ -722,7 +722,7 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
void intel_guc_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = to_i915(dev);
- struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
+ struct intel_uc_fw *guc_fw = &dev_priv->guc.guc_fw;
const char *fw_path;
if (!HAS_GUC(dev)) {
@@ -740,24 +740,24 @@ void intel_guc_init(struct drm_device *dev)
fw_path = NULL;
} else if (IS_SKYLAKE(dev_priv)) {
fw_path = I915_SKL_GUC_UCODE;
- guc_fw->guc_fw_major_wanted = SKL_FW_MAJOR;
- guc_fw->guc_fw_minor_wanted = SKL_FW_MINOR;
+ guc_fw->major_ver_wanted = SKL_FW_MAJOR;
+ guc_fw->minor_ver_wanted = SKL_FW_MINOR;
} else if (IS_BROXTON(dev_priv)) {
fw_path = I915_BXT_GUC_UCODE;
- guc_fw->guc_fw_major_wanted = BXT_FW_MAJOR;
- guc_fw->guc_fw_minor_wanted = BXT_FW_MINOR;
+ guc_fw->major_ver_wanted = BXT_FW_MAJOR;
+ guc_fw->minor_ver_wanted = BXT_FW_MINOR;
} else if (IS_KABYLAKE(dev_priv)) {
fw_path = I915_KBL_GUC_UCODE;
- guc_fw->guc_fw_major_wanted = KBL_FW_MAJOR;
- guc_fw->guc_fw_minor_wanted = KBL_FW_MINOR;
+ guc_fw->major_ver_wanted = KBL_FW_MAJOR;
+ guc_fw->minor_ver_wanted = KBL_FW_MINOR;
} else {
fw_path = ""; /* unknown device */
}
- guc_fw->guc_dev = dev;
- guc_fw->guc_fw_path = fw_path;
- guc_fw->guc_fw_fetch_status = GUC_FIRMWARE_NONE;
- guc_fw->guc_fw_load_status = GUC_FIRMWARE_NONE;
+ guc_fw->uc_dev = dev;
+ guc_fw->uc_fw_path = fw_path;
+ guc_fw->fetch_status = UC_FIRMWARE_NONE;
+ guc_fw->load_status = UC_FIRMWARE_NONE;
/* Early (and silent) return if GuC loading is disabled */
if (!i915.enable_guc_loading)
@@ -767,9 +767,9 @@ void intel_guc_init(struct drm_device *dev)
if (*fw_path == '\0')
return;
- guc_fw->guc_fw_fetch_status = GUC_FIRMWARE_PENDING;
+ guc_fw->fetch_status = UC_FIRMWARE_PENDING;
DRM_DEBUG_DRIVER("GuC firmware pending, path %s\n", fw_path);
- guc_fw_fetch(dev, guc_fw);
+ intel_uc_fw_fetch(dev, guc_fw);
/* status must now be FAIL or SUCCESS */
}
@@ -780,17 +780,17 @@ void intel_guc_init(struct drm_device *dev)
void intel_guc_fini(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = to_i915(dev);
- struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
+ struct intel_uc_fw *guc_fw = &dev_priv->guc.guc_fw;
mutex_lock(&dev->struct_mutex);
guc_interrupts_release(dev_priv);
i915_guc_submission_disable(dev_priv);
i915_guc_submission_fini(dev_priv);
- if (guc_fw->guc_fw_obj)
- i915_gem_object_put(guc_fw->guc_fw_obj);
- guc_fw->guc_fw_obj = NULL;
+ if (guc_fw->uc_fw_obj)
+ i915_gem_object_put(guc_fw->uc_fw_obj);
+ guc_fw->uc_fw_obj = NULL;
mutex_unlock(&dev->struct_mutex);
- guc_fw->guc_fw_fetch_status = GUC_FIRMWARE_NONE;
+ guc_fw->fetch_status = UC_FIRMWARE_NONE;
}
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-11-09 18:51 [PATCH 1/8] drm/i915/guc: Make the GuC fw loading helper functions general Anusha Srivatsa
@ 2016-11-09 18:51 ` Anusha Srivatsa
0 siblings, 0 replies; 39+ messages in thread
From: Anusha Srivatsa @ 2016-11-09 18:51 UTC (permalink / raw)
To: intel-gfx; +Cc: Peter Antoine
From: Peter Antoine <peter.antoine@intel.com>
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v4: rebased.
v5: rebased.
v6: rebased.
v7: rebased.
Tested-by: Xiang Haihao <haihao.xiang@intel.com>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Jeff McGee <jeff.mcgee@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 5 +++++
drivers/gpu/drm/i915/intel_huc.h | 1 +
drivers/gpu/drm/i915/intel_huc_loader.c | 14 ++++++++++++++
include/uapi/drm/i915_drm.h | 1 +
4 files changed, 21 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index aa44d8d..52a1941 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -49,6 +49,8 @@
#include "i915_trace.h"
#include "i915_vgpu.h"
#include "intel_drv.h"
+#include "intel_guc.h"
+#include "intel_huc.h"
static struct drm_driver driver;
@@ -346,6 +348,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
*/
value = 1;
break;
+ case I915_PARAM_HAS_HUC:
+ value = intel_is_huc_valid(dev_priv);
+ break;
default:
DRM_DEBUG("Unknown parameter %d\n", param->param);
return -EINVAL;
diff --git a/drivers/gpu/drm/i915/intel_huc.h b/drivers/gpu/drm/i915/intel_huc.h
index 3ce0299..2e150be 100644
--- a/drivers/gpu/drm/i915/intel_huc.h
+++ b/drivers/gpu/drm/i915/intel_huc.h
@@ -39,4 +39,5 @@ struct intel_huc {
void intel_huc_init(struct drm_device *dev);
void intel_huc_fini(struct drm_device *dev);
int intel_huc_load(struct drm_device *dev);
+extern int intel_is_huc_valid(struct drm_i915_private *dev_priv);
#endif
diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
index a388437..df149b7 100644
--- a/drivers/gpu/drm/i915/intel_huc_loader.c
+++ b/drivers/gpu/drm/i915/intel_huc_loader.c
@@ -290,3 +290,17 @@ void intel_huc_fini(struct drm_device *dev)
huc_fw->fetch_status = UC_FIRMWARE_NONE;
}
+
+/**
+ * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
+ * @dev_priv: drm device to check.
+ *
+ * This function will return true if the guc has been loaded and
+ * has valid firmware. The simplest way of doing this is to check
+ * if the HuC has been validated, if so it must have been loaded.
+ */
+int intel_is_huc_valid(struct drm_i915_private *dev_priv)
+{
+ return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
+}
+
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 03725fe..aa7667e 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_HUC 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 0/8] HuC Loading Patches
@ 2016-10-03 18:42 Anusha Srivatsa
2016-10-03 18:43 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2016-10-03 18:42 UTC (permalink / raw)
To: intel-gfx
These patches add HuC loading support. The userspace
patches that check for a fully loaded HuC firmware and use
it can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
v2: rebased.
Peter Antoine (8):
drm/i915/guc: Make the GuC fw loading helper functions general
drm/i915/huc: Unified css_header struct for GuC and HuC
drm/i915/huc: Add HuC fw loading support
drm/i915/huc: Add debugfs for HuC loading status check
drm/i915/huc: Support HuC authentication
drm/i915/huc: Add BXT HuC Loading Support
drm/i915/get_params: Add GuC status to getparams
drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_debugfs.c | 43 ++++-
drivers/gpu/drm/i915/i915_drv.c | 11 ++
drivers/gpu/drm/i915/i915_drv.h | 3 +
drivers/gpu/drm/i915/i915_guc_reg.h | 3 +
drivers/gpu/drm/i915/i915_guc_submission.c | 69 ++++++-
drivers/gpu/drm/i915/intel_guc.h | 48 ++---
drivers/gpu/drm/i915/intel_guc_fwif.h | 17 +-
drivers/gpu/drm/i915/intel_guc_loader.c | 215 ++++++++++++---------
drivers/gpu/drm/i915/intel_huc.h | 44 +++++
drivers/gpu/drm/i915/intel_huc_loader.c | 289 +++++++++++++++++++++++++++++
include/uapi/drm/i915_drm.h | 2 +
12 files changed, 624 insertions(+), 121 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_huc.h
create mode 100644 drivers/gpu/drm/i915/intel_huc_loader.c
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-10-03 18:42 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
@ 2016-10-03 18:43 ` Anusha Srivatsa
2016-10-05 20:51 ` Rodrigo Vivi
2016-10-13 21:47 ` Jeff McGee
0 siblings, 2 replies; 39+ messages in thread
From: Anusha Srivatsa @ 2016-10-03 18:43 UTC (permalink / raw)
To: intel-gfx
From: Peter Antoine <peter.antoine@intel.com>
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v4: rebased.
v5: rebased.
Tested-by: Xiang Haihao <haihao.xiang@intel.com>
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_huc.h | 2 +-
drivers/gpu/drm/i915/intel_huc_loader.c | 14 ++++++++++++++
include/uapi/drm/i915_drm.h | 1 +
4 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index ff1c18d..0d7b290 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_huc.h"
#include "intel_guc.h"
static struct drm_driver driver;
@@ -343,6 +344,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
case I915_PARAM_HAS_GUC:
value = intel_is_guc_valid(dev_priv);
break;
+ case I915_PARAM_HAS_HUC:
+ value = intel_is_huc_valid(dev_priv);
+ break;
default:
DRM_DEBUG("Unknown parameter %d\n", param->param);
return -EINVAL;
diff --git a/drivers/gpu/drm/i915/intel_huc.h b/drivers/gpu/drm/i915/intel_huc.h
index 946caa7..5eac625 100644
--- a/drivers/gpu/drm/i915/intel_huc.h
+++ b/drivers/gpu/drm/i915/intel_huc.h
@@ -40,5 +40,5 @@ extern void intel_huc_init(struct drm_device *dev);
extern int intel_huc_load(struct drm_device *dev);
extern void intel_huc_auth(struct drm_device *dev);
extern void intel_huc_fini(struct drm_device *dev);
-
+extern int intel_is_huc_valid(struct drm_i915_private *dev_priv);
#endif
diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
index 87a6948..d574183 100644
--- a/drivers/gpu/drm/i915/intel_huc_loader.c
+++ b/drivers/gpu/drm/i915/intel_huc_loader.c
@@ -273,3 +273,17 @@ void intel_huc_fini(struct drm_device *dev)
huc_fw->fetch_status = UC_FIRMWARE_NONE;
}
+
+/**
+ * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
+ * @dev_priv: drm device to check.
+ *
+ * This function will return true if the guc has been loaded and
+ * has valid firmware. The simplest way of doing this is to check
+ * if the HuC has been validated, if so it must have been loaded.
+ */
+int intel_is_huc_valid(struct drm_i915_private *dev_priv)
+{
+ return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
+}
+
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 629fb5e..d236520 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -389,6 +389,7 @@ typedef struct drm_i915_irq_wait {
#define I915_PARAM_MIN_EU_IN_POOL 39
#define I915_PARAM_MMAP_GTT_VERSION 40
#define I915_PARAM_HAS_GUC 41
+#define I915_PARAM_HAS_HUC 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-10-03 18:43 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
@ 2016-10-05 20:51 ` Rodrigo Vivi
2016-10-13 21:47 ` Jeff McGee
1 sibling, 0 replies; 39+ messages in thread
From: Rodrigo Vivi @ 2016-10-05 20:51 UTC (permalink / raw)
To: Anusha Srivatsa; +Cc: intel-gfx
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
On Mon, Oct 03, 2016 at 11:43:02AM -0700, Anusha Srivatsa wrote:
> From: Peter Antoine <peter.antoine@intel.com>
>
> This patch will allow for getparams to return the status of the HuC.
> As the HuC has to be validated by the GuC this patch uses the validated
> status to show when the HuC is loaded and ready for use. You cannot use
> the loaded status as with the GuC as the HuC is verified after it is
> loaded and is not usable until it is verified.
>
> v2: removed the forewakes as the registers are already force-woken.
> (T.Ursulin)
> v4: rebased.
> v5: rebased.
>
> Tested-by: Xiang Haihao <haihao.xiang@intel.com>
> 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_huc.h | 2 +-
> drivers/gpu/drm/i915/intel_huc_loader.c | 14 ++++++++++++++
> include/uapi/drm/i915_drm.h | 1 +
> 4 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index ff1c18d..0d7b290 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_huc.h"
> #include "intel_guc.h"
>
> static struct drm_driver driver;
> @@ -343,6 +344,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> case I915_PARAM_HAS_GUC:
> value = intel_is_guc_valid(dev_priv);
> break;
> + case I915_PARAM_HAS_HUC:
> + value = intel_is_huc_valid(dev_priv);
> + break;
> default:
> DRM_DEBUG("Unknown parameter %d\n", param->param);
> return -EINVAL;
> diff --git a/drivers/gpu/drm/i915/intel_huc.h b/drivers/gpu/drm/i915/intel_huc.h
> index 946caa7..5eac625 100644
> --- a/drivers/gpu/drm/i915/intel_huc.h
> +++ b/drivers/gpu/drm/i915/intel_huc.h
> @@ -40,5 +40,5 @@ extern void intel_huc_init(struct drm_device *dev);
> extern int intel_huc_load(struct drm_device *dev);
> extern void intel_huc_auth(struct drm_device *dev);
> extern void intel_huc_fini(struct drm_device *dev);
> -
> +extern int intel_is_huc_valid(struct drm_i915_private *dev_priv);
> #endif
> diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
> index 87a6948..d574183 100644
> --- a/drivers/gpu/drm/i915/intel_huc_loader.c
> +++ b/drivers/gpu/drm/i915/intel_huc_loader.c
> @@ -273,3 +273,17 @@ void intel_huc_fini(struct drm_device *dev)
>
> huc_fw->fetch_status = UC_FIRMWARE_NONE;
> }
> +
> +/**
> + * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
> + * @dev_priv: drm device to check.
> + *
> + * This function will return true if the guc has been loaded and
> + * has valid firmware. The simplest way of doing this is to check
> + * if the HuC has been validated, if so it must have been loaded.
> + */
> +int intel_is_huc_valid(struct drm_i915_private *dev_priv)
> +{
> + return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
> +}
> +
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index 629fb5e..d236520 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -389,6 +389,7 @@ typedef struct drm_i915_irq_wait {
> #define I915_PARAM_MIN_EU_IN_POOL 39
> #define I915_PARAM_MMAP_GTT_VERSION 40
> #define I915_PARAM_HAS_GUC 41
> +#define I915_PARAM_HAS_HUC 42
>
> 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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-10-03 18:43 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2016-10-05 20:51 ` Rodrigo Vivi
@ 2016-10-13 21:47 ` Jeff McGee
2016-10-17 6:48 ` Daniel Vetter
1 sibling, 1 reply; 39+ messages in thread
From: Jeff McGee @ 2016-10-13 21:47 UTC (permalink / raw)
To: Anusha Srivatsa; +Cc: intel-gfx
On Mon, Oct 03, 2016 at 11:43:02AM -0700, Anusha Srivatsa wrote:
> From: Peter Antoine <peter.antoine@intel.com>
>
> This patch will allow for getparams to return the status of the HuC.
> As the HuC has to be validated by the GuC this patch uses the validated
> status to show when the HuC is loaded and ready for use. You cannot use
> the loaded status as with the GuC as the HuC is verified after it is
> loaded and is not usable until it is verified.
>
> v2: removed the forewakes as the registers are already force-woken.
> (T.Ursulin)
> v4: rebased.
> v5: rebased.
>
> Tested-by: Xiang Haihao <haihao.xiang@intel.com>
> 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_huc.h | 2 +-
> drivers/gpu/drm/i915/intel_huc_loader.c | 14 ++++++++++++++
> include/uapi/drm/i915_drm.h | 1 +
> 4 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index ff1c18d..0d7b290 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_huc.h"
> #include "intel_guc.h"
>
> static struct drm_driver driver;
> @@ -343,6 +344,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> case I915_PARAM_HAS_GUC:
> value = intel_is_guc_valid(dev_priv);
> break;
> + case I915_PARAM_HAS_HUC:
> + value = intel_is_huc_valid(dev_priv);
> + break;
> default:
> DRM_DEBUG("Unknown parameter %d\n", param->param);
> return -EINVAL;
> diff --git a/drivers/gpu/drm/i915/intel_huc.h b/drivers/gpu/drm/i915/intel_huc.h
> index 946caa7..5eac625 100644
> --- a/drivers/gpu/drm/i915/intel_huc.h
> +++ b/drivers/gpu/drm/i915/intel_huc.h
> @@ -40,5 +40,5 @@ extern void intel_huc_init(struct drm_device *dev);
> extern int intel_huc_load(struct drm_device *dev);
> extern void intel_huc_auth(struct drm_device *dev);
> extern void intel_huc_fini(struct drm_device *dev);
> -
> +extern int intel_is_huc_valid(struct drm_i915_private *dev_priv);
> #endif
> diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
> index 87a6948..d574183 100644
> --- a/drivers/gpu/drm/i915/intel_huc_loader.c
> +++ b/drivers/gpu/drm/i915/intel_huc_loader.c
> @@ -273,3 +273,17 @@ void intel_huc_fini(struct drm_device *dev)
>
> huc_fw->fetch_status = UC_FIRMWARE_NONE;
> }
> +
> +/**
> + * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
> + * @dev_priv: drm device to check.
> + *
> + * This function will return true if the guc has been loaded and
> + * has valid firmware. The simplest way of doing this is to check
> + * if the HuC has been validated, if so it must have been loaded.
> + */
> +int intel_is_huc_valid(struct drm_i915_private *dev_priv)
I'm still unclear on the 'intel' vs. 'i915' prefix usage. But it seems
that intel prefixed functions accept drm_device instead of drm_i915_private.
Also, need to see the userspace usage of this new GETPARAM.
> +{
> + return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
> +}
> +
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index 629fb5e..d236520 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -389,6 +389,7 @@ typedef struct drm_i915_irq_wait {
> #define I915_PARAM_MIN_EU_IN_POOL 39
> #define I915_PARAM_MMAP_GTT_VERSION 40
> #define I915_PARAM_HAS_GUC 41
> +#define I915_PARAM_HAS_HUC 42
>
> 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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-10-13 21:47 ` Jeff McGee
@ 2016-10-17 6:48 ` Daniel Vetter
0 siblings, 0 replies; 39+ messages in thread
From: Daniel Vetter @ 2016-10-17 6:48 UTC (permalink / raw)
To: Jeff McGee; +Cc: intel-gfx
On Thu, Oct 13, 2016 at 02:47:32PM -0700, Jeff McGee wrote:
> On Mon, Oct 03, 2016 at 11:43:02AM -0700, Anusha Srivatsa wrote:
> > From: Peter Antoine <peter.antoine@intel.com>
> >
> > This patch will allow for getparams to return the status of the HuC.
> > As the HuC has to be validated by the GuC this patch uses the validated
> > status to show when the HuC is loaded and ready for use. You cannot use
> > the loaded status as with the GuC as the HuC is verified after it is
> > loaded and is not usable until it is verified.
> >
> > v2: removed the forewakes as the registers are already force-woken.
> > (T.Ursulin)
> > v4: rebased.
> > v5: rebased.
> >
> > Tested-by: Xiang Haihao <haihao.xiang@intel.com>
> > 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_huc.h | 2 +-
> > drivers/gpu/drm/i915/intel_huc_loader.c | 14 ++++++++++++++
> > include/uapi/drm/i915_drm.h | 1 +
> > 4 files changed, 20 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index ff1c18d..0d7b290 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_huc.h"
> > #include "intel_guc.h"
> >
> > static struct drm_driver driver;
> > @@ -343,6 +344,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> > case I915_PARAM_HAS_GUC:
> > value = intel_is_guc_valid(dev_priv);
> > break;
> > + case I915_PARAM_HAS_HUC:
> > + value = intel_is_huc_valid(dev_priv);
> > + break;
> > default:
> > DRM_DEBUG("Unknown parameter %d\n", param->param);
> > return -EINVAL;
> > diff --git a/drivers/gpu/drm/i915/intel_huc.h b/drivers/gpu/drm/i915/intel_huc.h
> > index 946caa7..5eac625 100644
> > --- a/drivers/gpu/drm/i915/intel_huc.h
> > +++ b/drivers/gpu/drm/i915/intel_huc.h
> > @@ -40,5 +40,5 @@ extern void intel_huc_init(struct drm_device *dev);
> > extern int intel_huc_load(struct drm_device *dev);
> > extern void intel_huc_auth(struct drm_device *dev);
> > extern void intel_huc_fini(struct drm_device *dev);
> > -
> > +extern int intel_is_huc_valid(struct drm_i915_private *dev_priv);
> > #endif
> > diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
> > index 87a6948..d574183 100644
> > --- a/drivers/gpu/drm/i915/intel_huc_loader.c
> > +++ b/drivers/gpu/drm/i915/intel_huc_loader.c
> > @@ -273,3 +273,17 @@ void intel_huc_fini(struct drm_device *dev)
> >
> > huc_fw->fetch_status = UC_FIRMWARE_NONE;
> > }
> > +
> > +/**
> > + * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
> > + * @dev_priv: drm device to check.
> > + *
> > + * This function will return true if the guc has been loaded and
> > + * has valid firmware. The simplest way of doing this is to check
> > + * if the HuC has been validated, if so it must have been loaded.
> > + */
> > +int intel_is_huc_valid(struct drm_i915_private *dev_priv)
> I'm still unclear on the 'intel' vs. 'i915' prefix usage. But it seems
> that intel prefixed functions accept drm_device instead of drm_i915_private.
intel_ is core and modeset, i915_ is gem stuff. mostly. Absolutely nothing
to do with drm_device vs. drm_i915_private, that should only be a question
of whether it's a drm vfunc or an internal one (we're transitioning to
that pattern, so atm it's a bit a mess).
> Also, need to see the userspace usage of this new GETPARAM.
+1 ;-)
Cheers, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 0/8] HuC Loading Patches
@ 2016-09-29 18:03 Anusha Srivatsa
2016-09-29 18:04 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
0 siblings, 1 reply; 39+ messages in thread
From: Anusha Srivatsa @ 2016-09-29 18:03 UTC (permalink / raw)
To: intel-gfx
These patches add HuC loading support. The userspace
patches that check for a fully loaded HuC firmware and use
it can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
Peter Antoine (8):
drm/i915/guc: Make the GuC fw loading helper functions general
drm/i915/huc: Unified css_header struct for GuC and HuC
drm/i915/huc: Add HuC fw loading support
drm/i915/huc: Add debugfs for HuC loading status check
drm/i915/huc: Support HuC authentication
drm/i915/huc: Add BXT HuC Loading Support
drm/i915/get_params: Add GuC status to getparams
drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 +
drivers/gpu/drm/i915/i915_debugfs.c | 43 ++++-
drivers/gpu/drm/i915/i915_drv.c | 11 ++
drivers/gpu/drm/i915/i915_drv.h | 3 +
drivers/gpu/drm/i915/i915_guc_reg.h | 3 +
drivers/gpu/drm/i915/i915_guc_submission.c | 69 ++++++-
drivers/gpu/drm/i915/intel_guc.h | 46 +++--
drivers/gpu/drm/i915/intel_guc_fwif.h | 17 +-
drivers/gpu/drm/i915/intel_guc_loader.c | 215 ++++++++++++---------
drivers/gpu/drm/i915/intel_huc.h | 44 +++++
drivers/gpu/drm/i915/intel_huc_loader.c | 289 +++++++++++++++++++++++++++++
include/uapi/drm/i915_drm.h | 2 +
12 files changed, 623 insertions(+), 120 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_huc.h
create mode 100644 drivers/gpu/drm/i915/intel_huc_loader.c
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams
2016-09-29 18:03 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
@ 2016-09-29 18:04 ` Anusha Srivatsa
0 siblings, 0 replies; 39+ messages in thread
From: Anusha Srivatsa @ 2016-09-29 18:04 UTC (permalink / raw)
To: intel-gfx
From: Peter Antoine <peter.antoine@intel.com>
This patch will allow for getparams to return the status of the HuC.
As the HuC has to be validated by the GuC this patch uses the validated
status to show when the HuC is loaded and ready for use. You cannot use
the loaded status as with the GuC as the HuC is verified after it is
loaded and is not usable until it is verified.
v2: removed the forewakes as the registers are already force-woken.
(T.Ursulin)
v4: rebased.
v5:rebased.
Tested-by: Xiang Haihao <haihao.xiang@intel.com>
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_huc.h | 2 +-
drivers/gpu/drm/i915/intel_huc_loader.c | 14 ++++++++++++++
include/uapi/drm/i915_drm.h | 1 +
4 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index ff1c18d..0d7b290 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_huc.h"
#include "intel_guc.h"
static struct drm_driver driver;
@@ -343,6 +344,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
case I915_PARAM_HAS_GUC:
value = intel_is_guc_valid(dev_priv);
break;
+ case I915_PARAM_HAS_HUC:
+ value = intel_is_huc_valid(dev_priv);
+ break;
default:
DRM_DEBUG("Unknown parameter %d\n", param->param);
return -EINVAL;
diff --git a/drivers/gpu/drm/i915/intel_huc.h b/drivers/gpu/drm/i915/intel_huc.h
index 946caa7..5eac625 100644
--- a/drivers/gpu/drm/i915/intel_huc.h
+++ b/drivers/gpu/drm/i915/intel_huc.h
@@ -40,5 +40,5 @@ extern void intel_huc_init(struct drm_device *dev);
extern int intel_huc_load(struct drm_device *dev);
extern void intel_huc_auth(struct drm_device *dev);
extern void intel_huc_fini(struct drm_device *dev);
-
+extern int intel_is_huc_valid(struct drm_i915_private *dev_priv);
#endif
diff --git a/drivers/gpu/drm/i915/intel_huc_loader.c b/drivers/gpu/drm/i915/intel_huc_loader.c
index 87a6948..d574183 100644
--- a/drivers/gpu/drm/i915/intel_huc_loader.c
+++ b/drivers/gpu/drm/i915/intel_huc_loader.c
@@ -273,3 +273,17 @@ void intel_huc_fini(struct drm_device *dev)
huc_fw->fetch_status = UC_FIRMWARE_NONE;
}
+
+/**
+ * intel_is_huc_valid() - Check to see if the HuC is fully loaded.
+ * @dev_priv: drm device to check.
+ *
+ * This function will return true if the guc has been loaded and
+ * has valid firmware. The simplest way of doing this is to check
+ * if the HuC has been validated, if so it must have been loaded.
+ */
+int intel_is_huc_valid(struct drm_i915_private *dev_priv)
+{
+ return ((I915_READ(HUC_STATUS2) & HUC_FW_VERIFIED) != 0);
+}
+
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 629fb5e..d236520 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -389,6 +389,7 @@ typedef struct drm_i915_irq_wait {
#define I915_PARAM_MIN_EU_IN_POOL 39
#define I915_PARAM_MMAP_GTT_VERSION 40
#define I915_PARAM_HAS_GUC 41
+#define I915_PARAM_HAS_HUC 42
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
^ permalink raw reply related [flat|nested] 39+ messages in thread
end of thread, other threads:[~2017-01-14 1:20 UTC | newest]
Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-13 17:07 [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
-- strict thread matches above, loose matches on Subject: below --
2017-01-14 1:17 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2017-01-14 1:17 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2017-01-13 18:08 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2017-01-13 18:08 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2017-01-04 14:55 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2017-01-04 14:55 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2017-01-04 13:27 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2017-01-04 13:27 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2016-12-22 23:12 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2016-12-22 23:12 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2016-12-23 14:33 ` Arkadiusz Hiler
2016-12-15 22:29 [PATCH 0/8] HuC Loading Patches anushasr
2016-12-15 22:29 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams anushasr
2016-12-15 22:42 ` Chris Wilson
2016-12-16 14:43 ` Arkadiusz Hiler
2016-12-16 16:12 ` Chris Wilson
2016-12-16 16:21 ` Arkadiusz Hiler
2016-12-16 16:30 ` Chris Wilson
2016-12-16 18:31 ` Srivatsa, Anusha
2016-12-16 18:46 ` Chris Wilson
2016-12-16 18:55 ` Srivatsa, Anusha
2016-12-16 16:00 ` Arkadiusz Hiler
2016-12-08 23:02 [PATCH 0/8]HuC Loading Patches anushasr
2016-12-08 23:02 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams anushasr
2016-12-08 23:55 ` Chris Wilson
2016-12-13 9:40 ` Arkadiusz Hiler
2016-12-14 1:02 ` Srivatsa, Anusha
2016-12-09 12:59 ` Michal Wajdeczko
2016-12-12 14:13 ` Arkadiusz Hiler
2016-12-12 14:21 ` Chris Wilson
2016-12-12 14:52 ` Arkadiusz Hiler
2016-12-12 15:17 ` Chris Wilson
2016-12-12 15:27 ` Arkadiusz Hiler
2016-12-12 19:20 ` Srivatsa, Anusha
2016-11-30 23:31 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2016-11-30 23:31 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2016-12-01 13:07 ` Arkadiusz Hiler
2016-11-23 22:27 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2016-11-23 22:27 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2016-11-24 1:35 ` Jeff McGee
2016-11-11 0:15 [PATCH v4 0/8] HuC Loading Patches Anusha Srivatsa
2016-11-11 0:15 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2016-11-09 18:51 [PATCH 1/8] drm/i915/guc: Make the GuC fw loading helper functions general Anusha Srivatsa
2016-11-09 18:51 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2016-10-03 18:42 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2016-10-03 18:43 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
2016-10-05 20:51 ` Rodrigo Vivi
2016-10-13 21:47 ` Jeff McGee
2016-10-17 6:48 ` Daniel Vetter
2016-09-29 18:03 [PATCH 0/8] HuC Loading Patches Anusha Srivatsa
2016-09-29 18:04 ` [PATCH 8/8] drm/i915/get_params: Add HuC status to getparams Anusha Srivatsa
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).