diff mbox series

[v6,2/6] drm/i915/guc: Do not partition WOPCM if GuC is not used.

Message ID 20180727085350.321-2-jakub.bartminski@intel.com (mailing list archive)
State New, archived
Headers show
Series [v6,1/6] drm/i915/guc: Avoid wasting memory on incorrect GuC pin bias | expand

Commit Message

Bartminski, Jakub July 27, 2018, 8:53 a.m. UTC
There seems to be no reason for doing extra work on WOPCM partitioning
in the case GuC is not used, as the partitioning will not be used by the
intel_wopcm_init_hw function anyway.

Signed-off-by: Jakub Bartmiński <jakub.bartminski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/i915/intel_wopcm.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Chris Wilson July 27, 2018, 10:20 a.m. UTC | #1
Quoting Jakub Bartmiński (2018-07-27 09:53:46)
> There seems to be no reason for doing extra work on WOPCM partitioning
> in the case GuC is not used, as the partitioning will not be used by the
> intel_wopcm_init_hw function anyway.
> 
> Signed-off-by: Jakub Bartmiński <jakub.bartminski@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_wopcm.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_wopcm.c b/drivers/gpu/drm/i915/intel_wopcm.c
> index 74bf76f3fddc..09cc62b0d7ca 100644
> --- a/drivers/gpu/drm/i915/intel_wopcm.c
> +++ b/drivers/gpu/drm/i915/intel_wopcm.c
> @@ -163,6 +163,9 @@ int intel_wopcm_init(struct intel_wopcm *wopcm)
>         u32 guc_wopcm_rsvd;
>         int err;
>  
> +       if (!USES_GUC(dev_priv))
> +               return 0;
> +
>         GEM_BUG_ON(!wopcm->size);

My personal preference would be that wopcm->size = 0 if !USES_GUC, but
hey ho.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Michal Wajdeczko July 27, 2018, 12:04 p.m. UTC | #2
On Fri, 27 Jul 2018 10:53:46 +0200, Jakub Bartmiński  
<jakub.bartminski@intel.com> wrote:

> There seems to be no reason for doing extra work on WOPCM partitioning
> in the case GuC is not used, as the partitioning will not be used by the
> intel_wopcm_init_hw function anyway.
>
> Signed-off-by: Jakub Bartmiński <jakub.bartminski@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_wopcm.c b/drivers/gpu/drm/i915/intel_wopcm.c
index 74bf76f3fddc..09cc62b0d7ca 100644
--- a/drivers/gpu/drm/i915/intel_wopcm.c
+++ b/drivers/gpu/drm/i915/intel_wopcm.c
@@ -163,6 +163,9 @@  int intel_wopcm_init(struct intel_wopcm *wopcm)
 	u32 guc_wopcm_rsvd;
 	int err;
 
+	if (!USES_GUC(dev_priv))
+		return 0;
+
 	GEM_BUG_ON(!wopcm->size);
 
 	if (guc_fw_size >= wopcm->size) {