GuC code reorganization
Subsystems (2)
cover GuC code reorganization
With HuC being imminent we could benefit from some code reorganization. There will be more uC than just GuC so we should name files accordingly.
There is also need to use host2guc_*() family of functions, which are currently limited to submission only.
Arkadiusz Hiler (4):
drm/i915: Rename intel_guc.h to intel_uc.h
drm/i915/guc: Move host2guc_*() to intel_uc.c
drm/i915/guc: Init action_lock in the loader
drm/i915/guc: Remove spurious include
drivers/gpu/drm/i915/Makefile | 3 +-
drivers/gpu/drm/i915/i915_drv.h | 2 +-
drivers/gpu/drm/i915/i915_guc_submission.c | 142 +-------------------
drivers/gpu/drm/i915/intel_guc_loader.c | 3 +-
drivers/gpu/drm/i915/intel_uc.c | 164 +++++++++++++++++++++++
drivers/gpu/drm/i915/{intel_guc.h => intel_uc.h} | 17 ++-
6 files changed, 185 insertions(+), 146 deletions(-)
create mode 100644 drivers/gpu/drm/i915/intel_uc.c
rename drivers/gpu/drm/i915/{intel_guc.h => intel_uc.h} (90%)Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/4 drm/i915: Rename intel_guc.h to intel_uc.h
GuC is not the only one micro controller we have.
There are also HuC and DMC.
Making the file more general will help with code organization.
---
drivers/gpu/drm/i915/i915_drv.h | 2 +-
drivers/gpu/drm/i915/i915_guc_submission.c | 2 +-
drivers/gpu/drm/i915/intel_guc_loader.c | 2 +-
drivers/gpu/drm/i915/{intel_guc.h => intel_uc.h} | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
rename drivers/gpu/drm/i915/{intel_guc.h => intel_uc.h} (99%)drivers/gpu/drm/i915/i915_drv.h +1 -1
@@ -55,7 +55,7 @@#include "intel_bios.h" #include "intel_dpll_mgr.h" -#include "intel_guc.h" +#include "intel_uc.h" #include "intel_lrc.h" #include "intel_ringbuffer.h"
drivers/gpu/drm/i915/i915_guc_submission.c +1 -1
@@ -26,7 +26,7 @@#include <linux/debugfs.h> #include <linux/relay.h> #include "i915_drv.h" -#include "intel_guc.h" +#include "intel_uc.h" /** * DOC: GuC-based command submission
drivers/gpu/drm/i915/intel_guc_loader.c +1 -1
@@ -28,7 +28,7 @@*/ #include <linux/firmware.h> #include "i915_drv.h" -#include "intel_guc.h" +#include "intel_uc.h" /** * DOC: GuC-specific firmware loader
drivers/gpu/drm/i915/intel_uc.h renamed from drivers/gpu/drm/i915/intel_guc.h +2 -2
@@ -21,8 +21,8 @@* IN THE SOFTWARE. * */ -#ifndef _INTEL_GUC_H_ -#define _INTEL_GUC_H_ +#ifndef _INTEL_UC_H_ +#define _INTEL_UC_H_#include "intel_guc_fwif.h" #include "i915_guc_reg.h"
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/4 drm/i915/guc: Move host2guc_*() to intel_uc.c
In reply to Arkadiusz Hilerhost2guc_*() series of functions were introduced in the i915_guc_submission.c and their scope was limited only to that file.
Those are not submission specific though.
--- drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_guc_submission.c | 138 ------------------------ drivers/gpu/drm/i915/intel_uc.c | 164 +++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uc.h | 13 +++ 4 files changed, 179 insertions(+), 139 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_uc.c
drivers/gpu/drm/i915/Makefile +2 -1
@@ -55,7 +55,8 @@ i915-y += i915_cmd_parser.o \ intel_uncore.o # general-purpose microcontroller (GuC) support -i915-y += intel_guc_loader.o \ +i915-y += intel_uc.o \ + intel_guc_loader.o \ i915_guc_submission.o # autogenerated null render state
drivers/gpu/drm/i915/i915_guc_submission.c +0 -138
144 lines not on this page · raw message
drivers/gpu/drm/i915/intel_uc.c new file +164 -0
164 lines not on this page · raw message
drivers/gpu/drm/i915/intel_uc.h +13 -0
@@ -168,6 +168,19 @@ struct intel_guc {struct mutex action_lock; }; +/* intel_uc.c */ +bool host2guc_action_response (struct drm_i915_private *dev_priv,u32 *status); +int host2guc_action (struct intel_guc *guc,u32 *data,u32 len); +int host2guc_allocate_doorbell (struct intel_guc *guc, +struct i915_guc_client *client); +int host2guc_release_doorbell (struct intel_guc *guc, +struct i915_guc_client *client); +int host2guc_sample_forcewake (struct intel_guc *guc, +struct i915_guc_client *client); +int host2guc_logbuffer_flush_complete (struct intel_guc *guc); +int host2guc_force_logbuffer_flush (struct intel_guc *guc); +int host2guc_logging_control (struct intel_guc *guc,u32 control_val); +/* intel_guc_loader.c */ extern void intel_guc_init (struct drm_device *dev);extern int intel_guc_setup (struct drm_device *dev);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/4 drm/i915/guc: Init action_lock in the loader
In reply to Arkadiusz HilerAction_lock is a mutex used to serialise communication with GuC.
Since some functions which utilize the mutex (host2guc_*()) are no longer limited to submission, initialization should be handled as a part of GuC setup.
--- drivers/gpu/drm/i915/i915_guc_submission.c | 1 - drivers/gpu/drm/i915/intel_guc_loader.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_guc_submission.c +0 -1
@@ -1362,7 +1362,6 @@ int i915_guc_submission_init(struct drm_i915_private *dev_priv) guc->ctx_pool_vma = vma;ida_init (&guc->ctx_ids); -mutex_init (&guc->action_lock);guc_log_create (guc);guc_addon_create (guc);
drivers/gpu/drm/i915/intel_guc_loader.c +1 -0
@@ -484,6 +484,7 @@ int intel_guc_setup(struct drm_device *dev) goto fail; } +mutex_init (&dev_priv->guc.action_lock);guc_interrupts_release (dev_priv);gen9_reset_guc_interrupts (dev_priv);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 drm/i915/guc: Remove spurious include
In reply to Arkadiusz Hiler--- drivers/gpu/drm/i915/i915_guc_submission.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/i915_guc_submission.c +0 -1
@@ -21,7 +21,6 @@* IN THE SOFTWARE. * */ -#include <linux/firmware.h> #include <linux/circ_buf.h> #include <linux/debugfs.h> #include <linux/relay.h>
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 8 lines · Arkadiusz Hiler
With HuC being imminent we could benefit from some code reorganization. There will be more uC than just GuC so we should name files accordingly.
There is also need to use host2guc_*() family of functions, which are currently limited to submission only.
Arkadiusz Hiler (4):
drm/i915: Renameintel_guc.htointel_uc.h
Ok.
Quoted 1 line
drm/i915/guc: Move host2guc_*() to
intel_uc.c
host2guc_action() is generic, but host2guc_allocate_doorbell() is not.
host2guc is an unconventional prefix, it should be intel_uc_<verb> to match its new location. (I like intel_uc_send / intel_uc_recv but I'm just an old fuddy-duddy.)
Quoted 1 line
drm/i915/guc: Init
action_lockin the loader
Where's intel_uc_init() ? The lock is for the uc sidechannel, it should only really be used in intel_uc.c for intel_uc_send / intel_uc_recb.
Quoted 1 line
drm/i915/guc: Remove spurious include
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx