Skip to contentSkip to conversation

drm/i915: Guc code reorg

PATCH Superseded Michal Wajdeczko 2 participants 9 messages Oct 4, 2017

Subsystems (2)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v4 cover drm/i915: Guc code reorg

Reviewed patches 1-6 from https://patchwork.freedesktop.org/series/31340/

Michal Wajdeczko (5):
drm/i915: Make intel_uncore.h header self-contained drm/i915/uc: Drop unnecessary forward declaration drm/i915/uc: Move uC fw helper code into dedicated files drm/i915/huc: Move HuC declarations into dedicated header drm/i915/guc: Move Guc early init into own function

Sagar Arun Kamble (1):
drm/i915/uc: Create intel_uc_init_mmio

 drivers/gpu/drm/i915/Makefile       |   1 +
 drivers/gpu/drm/i915/i915_drv.c     |   2 +
 drivers/gpu/drm/i915/intel_huc.h    |  39 ++++++++
 drivers/gpu/drm/i915/intel_uc.c     | 177 ++++-----------------------------
 drivers/gpu/drm/i915/intel_uc.h     |  83 +---------------
 drivers/gpu/drm/i915/intel_uc_fw.c  | 193 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_uc_fw.h  |  98 ++++++++++++++++++
 drivers/gpu/drm/i915/intel_uncore.h |   6 ++
 8 files changed, 362 insertions(+), 237 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_huc.h
 create mode 100644 drivers/gpu/drm/i915/intel_uc_fw.c
 create mode 100644 drivers/gpu/drm/i915/intel_uc_fw.h
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH v4 1/6 drm/i915: Make intel_uncore.h header self-contained

We're trying to resolve inter-header dependencies.

---
 drivers/gpu/drm/i915/intel_uncore.h | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/intel_uncore.h +6 -0
index 03786f9..66eae2c 100644
@@ -25,6 +25,12 @@
 #ifndef __INTEL_UNCORE_H__
 #define __INTEL_UNCORE_H__
 
+#include <linux/spinlock.h>
+#include <linux/notifier.h>
+#include <linux/hrtimer.h>
+
+#include "i915_reg.h"
+
 struct drm_i915_private;
 
 enum forcewake_domain_id {
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH v4 2/6 drm/i915/uc: Drop unnecessary forward declaration

In reply to Michal Wajdeczko

We don't need it here.

---
 drivers/gpu/drm/i915/intel_uc.h | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/intel_uc.h +0 -2
index 6966349..38ec880 100644
@@ -30,8 +30,6 @@
 #include "intel_guc_ct.h"
 #include "i915_vma.h"
 
-struct drm_i915_gem_request;
-
 /*
  * This structure primarily describes the GEM object shared with the GuC.
  * The specs sometimes refer to this object as a "GuC context", but we use
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH v4 3/6 drm/i915/uc: Create intel_uc_init_mmio

In reply to Michal Wajdeczko

From: Sagar Arun Kamble <[email protected]>

This patch adds new function intel_uc_init_mmio which will initialize MMIO access related variables prior to uc load/init.

v2: Removed unnecessary export of guc_send_init_regs. Created intel_uc_init_mmio that currently wraps guc_init_send_regs. (Michal)

v3 (Michal): add kerneldoc (Joonas)

---
 drivers/gpu/drm/i915/i915_drv.c |  2 ++
 drivers/gpu/drm/i915/intel_uc.c | 15 +++++++++++++--
 drivers/gpu/drm/i915/intel_uc.h |  1 +
 3 files changed, 16 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -0
index 5cc2434..74a456f 100644
@@ -1007,6 +1007,8 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)
 
 	intel_uncore_init(dev_priv);
 
+	intel_uc_init_mmio(dev_priv);
+
 	ret = intel_engines_init_mmio(dev_priv);
 	if (ret)
 		goto err_uncore;
drivers/gpu/drm/i915/intel_uc.c +13 -2
index 2774778..8151a9d 100644
@@ -288,6 +288,19 @@ static void guc_init_send_regs(struct intel_guc *guc)
 	guc->send_regs.fw_domains = fw_domains;
 }
 
+/**
+ * intel_uc_init_mmio - setup uC MMIO access
+ *
+ * @dev_priv: device private
+ *
+ * Setup minimal state necessary for MMIO accesses later in the
+ * initialization sequence.
+ */
+void intel_uc_init_mmio(struct drm_i915_private *dev_priv)
+{
+	guc_init_send_regs(&dev_priv->guc);
+}
+
 static void guc_capture_load_err_log(struct intel_guc *guc)
 {
 	if (!guc->log.vma || i915_modparams.guc_log_level < 0)
@@ -309,8 +322,6 @@ static int guc_enable_communication(struct intel_guc *guc)
 {
 	struct drm_i915_private *dev_priv = guc_to_i915(guc);
 
-	guc_init_send_regs(guc);
-
 	if (HAS_GUC_CT(dev_priv))
 		return intel_guc_enable_ct(guc);
 
drivers/gpu/drm/i915/intel_uc.h +1 -0
index 38ec880..388528f 100644
@@ -202,6 +202,7 @@ struct intel_huc {
 /* intel_uc.c */
 void intel_uc_sanitize_options(struct drm_i915_private *dev_priv);
 void intel_uc_init_early(struct drm_i915_private *dev_priv);
+void intel_uc_init_mmio(struct drm_i915_private *dev_priv);
 void intel_uc_init_fw(struct drm_i915_private *dev_priv);
 void intel_uc_fini_fw(struct drm_i915_private *dev_priv);
 int intel_uc_init_hw(struct drm_i915_private *dev_priv);
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

PATCH v4 4/6 drm/i915/uc: Move uC fw helper code into dedicated files

In reply to Michal Wajdeczko

This is a prerequisite to unblock next steps.

v2: correct include order (Joonas)
v3: use common function prefix (Joonas)
add kerneldoc (Michal)

---
 drivers/gpu/drm/i915/Makefile      |   1 +
 drivers/gpu/drm/i915/intel_uc.c    | 159 +-----------------------------
 drivers/gpu/drm/i915/intel_uc.h    |  67 +------------
 drivers/gpu/drm/i915/intel_uc_fw.c | 193 +++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_uc_fw.h |  98 +++++++++++++++++++
 5 files changed, 297 insertions(+), 221 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_uc_fw.c
 create mode 100644 drivers/gpu/drm/i915/intel_uc_fw.h
drivers/gpu/drm/i915/Makefile +1 -0
index 5182e3d..4850f26 100644
@@ -59,6 +59,7 @@ i915-y += i915_cmd_parser.o \
 
 # general-purpose microcontroller (GuC) support
 i915-y += intel_uc.o \
+	  intel_uc_fw.o \
 	  intel_guc_ct.o \
 	  intel_guc_log.o \
 	  intel_guc_loader.o \
drivers/gpu/drm/i915/intel_uc.c +4 -155

177 lines not on this page · raw message

drivers/gpu/drm/i915/intel_uc.h +1 -66

79 lines not on this page · raw message

drivers/gpu/drm/i915/intel_uc_fw.c new file +193 -0

193 lines not on this page · raw message

drivers/gpu/drm/i915/intel_uc_fw.h new file +98 -0

98 lines not on this page · raw message

Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

PATCH v4 5/6 drm/i915/huc: Move HuC declarations into dedicated header

In reply to Michal Wajdeczko

We want to keep each uC specific code in separate files.

---
 drivers/gpu/drm/i915/intel_huc.h | 39 +++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_uc.h  | 13 +------------
 2 files changed, 40 insertions(+), 12 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_huc.h
drivers/gpu/drm/i915/intel_huc.h new file +39 -0
new file mode 100644
index 0000000..d58422b
@@ -0,0 +1,39 @@
+/*
+ * Copyright © 2014-2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _INTEL_HUC_H_
+#define _INTEL_HUC_H_
+
+struct intel_huc {
+	/* Generic uC firmware management */
+	struct intel_uc_fw fw;
+
+	/* HuC-specific additions */
+};
+
+void intel_huc_select_fw(struct intel_huc *huc);
+void intel_huc_init_hw(struct intel_huc *huc);
+void intel_huc_auth(struct intel_huc *huc);
+
+#endif
drivers/gpu/drm/i915/intel_uc.h +1 -12
index f0d5a3f..4fa091e 100644
@@ -30,6 +30,7 @@
 #include "intel_ringbuffer.h"
 #include "intel_guc_ct.h"
 #include "i915_vma.h"
+#include "intel_huc.h"
 
 /*
  * This structure primarily describes the GEM object shared with the GuC.
@@ -127,13 +128,6 @@ struct intel_guc {
 	void (*notify)(struct intel_guc *guc);
 };
 
-struct intel_huc {
-	/* Generic uC firmware management */
-	struct intel_uc_fw fw;
-
-	/* HuC-specific additions */
-};
-
 /* intel_uc.c */
 void intel_uc_sanitize_options(struct drm_i915_private *dev_priv);
 void intel_uc_init_early(struct drm_i915_private *dev_priv);
@@ -186,9 +180,4 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)
 	return offset;
 }
 
-/* intel_huc.c */
-void intel_huc_select_fw(struct intel_huc *huc);
-void intel_huc_init_hw(struct intel_huc *huc);
-void intel_huc_auth(struct intel_huc *huc);
-
 #endif
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

PATCH v4 6/6 drm/i915/guc: Move Guc early init into own function

In reply to Michal Wajdeczko

We don't want to make aggregate uc functions to be too detailed. This will also make future patch easier.

---
 drivers/gpu/drm/i915/intel_uc.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_uc.c +6 -3
index 25694dd..e787527 100644
@@ -88,10 +88,8 @@ static void gen8_guc_raise_irq(struct intel_guc *guc)
 	I915_WRITE(GUC_SEND_INTERRUPT, GUC_SEND_TRIGGER);
 }
 
-void intel_uc_init_early(struct drm_i915_private *dev_priv)
+static void guc_init_early(struct intel_guc *guc)
 {
-	struct intel_guc *guc = &dev_priv->guc;
-
 	intel_guc_ct_init_early(&guc->ct);
 
 	mutex_init(&guc->send_mutex);
@@ -99,6 +97,11 @@ void intel_uc_init_early(struct drm_i915_private *dev_priv)
 	guc->notify = gen8_guc_raise_irq;
 }
 
+void intel_uc_init_early(struct drm_i915_private *dev_priv)
+{
+	guc_init_early(&dev_priv->guc);
+}
+
 void intel_uc_init_fw(struct drm_i915_private *dev_priv)
 {
 	intel_uc_fw_fetch(dev_priv, &dev_priv->huc.fw);
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

✓ Fi.CI.BAT: success for drm/i915: Guc code reorg

In reply to Michal Wajdeczko
== Series Details ==

== Series Details ==

Series: drm/i915: Guc code reorg
URL : https://patchwork.freedesktop.org/series/31391/
State : success

== Summary ==

Series 31391v1 drm/i915: Guc code reorg
https://patchwork.freedesktop.org/api/1.0/series/31391/revisions/1/mbox/

Test chamelium:

        Subgroup dp-hpd-fast:
                none       -> INCOMPLETE (fi-hsw-4770)
        Subgroup dp-crc-fast:
                pass       -> FAIL       (fi-kbl-7500u) fdo#102514
Test drv_module_reload:
        Subgroup basic-reload-inject:
                dmesg-warn -> PASS       (fi-cfl-s) k.org#196765

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
k.org#196765 https://bugzilla.kernel.org/show_bug.cgi?id=196765

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:457s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:474s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:398s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:569s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:288s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:526s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:538s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:540s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:523s
fi-cfl-s         total:289  pass:256  dwarn:1   dfail:0   fail:0   skip:32  time:552s
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:628s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:436s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:591s
fi-hsw-4770      total:289  pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:421s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:508s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:472s
fi-kbl-7500u     total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  time:493s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:574s
fi-kbl-7567u     total:289  pass:265  dwarn:4   dfail:0   fail:0   skip:20  time:491s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:587s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:654s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:475s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:612s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:534s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:522s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:477s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:580s
fi-snb-2600      total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:430s

fi-ilk-650 failed to connect after reboot

f7f890956c4796b5b6993c33b378d45beeca6a05 drm-tip: 2017y-10m-04d-14h-20m-47s UTC integration manifest 5e0752efec00 drm/i915/guc: Move Guc early init into own function
07af12b03cbb drm/i915/huc: Move HuC declarations into dedicated header
d6e2b925f9f4 drm/i915/uc: Move uC fw helper code into dedicated files
0ead4cd7e7ab drm/i915/uc: Create intel_uc_init_mmio
db3956e1b270 drm/i915/uc: Drop unnecessary forward declaration
9acbaf2e8178 drm/i915: Make intel_uncore.h header self-contained

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5898/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

✗ Fi.CI.IGT: warning for drm/i915: Guc code reorg

In reply to Michal Wajdeczko
== Series Details ==

== Series Details ==

Series: drm/i915: Guc code reorg
URL : https://patchwork.freedesktop.org/series/31391/
State : warning

== Summary ==

Test kms_flip:

        Subgroup blt-wf_vblank-vs-modeset:
                pass       -> DMESG-WARN (shard-hsw)
        Subgroup flip-vs-rmfb-interruptible:
                pass       -> DMESG-WARN (shard-hsw)
Test kms_plane:
        Subgroup plane-panning-bottom-right-suspend-pipe-A-planes:
                pass       -> SKIP       (shard-hsw)
        Subgroup plane-position-hole-pipe-B-planes:
                pass       -> SKIP       (shard-hsw)
Test pm_lpsp:
        Subgroup non-edp:
                pass       -> SKIP       (shard-hsw)

shard-hsw total:2430 pass:1326 dwarn:9 dfail:0 fail:8 skip:1087 time:10164s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5898/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx