Message ID | 20161220115531.76120-1-michal.wajdeczko@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 20/12/2016 11:55, Michal Wajdeczko wrote: > This function is only used by intel_guc_send() and it doesn't > need to be exposed outside of intel_uc.o file. Also when defined > as static, compiler will generate smaller code. Additionally let > it take guc param instead dev_priv to match function name. > > Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> > Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> > --- > drivers/gpu/drm/i915/intel_uc.c | 8 +++++--- > drivers/gpu/drm/i915/intel_uc.h | 1 - > 2 files changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c > index 8ae6795..c6be352 100644 > --- a/drivers/gpu/drm/i915/intel_uc.c > +++ b/drivers/gpu/drm/i915/intel_uc.c > @@ -34,8 +34,10 @@ void intel_uc_init_early(struct drm_i915_private *dev_priv) > * Read GuC command/status register (SOFT_SCRATCH_0) > * Return true if it contains a response rather than a command > */ > -bool intel_guc_recv(struct drm_i915_private *dev_priv, u32 *status) > +static bool intel_guc_recv(struct intel_guc *guc, u32 *status) > { > + struct drm_i915_private *dev_priv = guc_to_i915(guc); > + > u32 val = I915_READ(SOFT_SCRATCH(0)); > *status = val; > return INTEL_GUC_RECV_IS_RESPONSE(val); > @@ -69,9 +71,9 @@ int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len) > * up to that length of time, then switch to a slower sleep-wait loop. > * No inte_guc_send command should ever take longer than 10ms. > */ > - ret = wait_for_us(intel_guc_recv(dev_priv, &status), 10); > + ret = wait_for_us(intel_guc_recv(guc, &status), 10); > if (ret) > - ret = wait_for(intel_guc_recv(dev_priv, &status), 10); > + ret = wait_for(intel_guc_recv(guc, &status), 10); > if (status != INTEL_GUC_STATUS_SUCCESS) { > /* > * Either the GuC explicitly returned an error (which > diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h > index 11f5608..406b06a 100644 > --- a/drivers/gpu/drm/i915/intel_uc.h > +++ b/drivers/gpu/drm/i915/intel_uc.h > @@ -170,7 +170,6 @@ struct intel_guc { > > /* intel_uc.c */ > void intel_uc_init_early(struct drm_i915_private *dev_priv); > -bool intel_guc_recv(struct drm_i915_private *dev_priv, u32 *status); > int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len); > int intel_guc_sample_forcewake(struct intel_guc *guc); > int intel_guc_log_flush_complete(struct intel_guc *guc); > Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Regards, Tvrtko
On 20/12/2016 13:45, Patchwork wrote: > == Series Details == > > Series: drm/i915/guc: Make intel_guc_recv static. > URL : https://patchwork.freedesktop.org/series/17052/ > State : success > > == Summary == > > Series 17052v1 drm/i915/guc: Make intel_guc_recv static. > https://patchwork.freedesktop.org/api/1.0/series/17052/revisions/1/mbox/ > > Test gem_sync: > Subgroup basic-store-all: > fail -> PASS (fi-ivb-3520m) > > fi-bdw-5557u total:247 pass:233 dwarn:0 dfail:0 fail:0 skip:14 > fi-bsw-n3050 total:247 pass:208 dwarn:0 dfail:0 fail:0 skip:39 > fi-bxt-j4205 total:247 pass:225 dwarn:1 dfail:0 fail:0 skip:21 > fi-byt-j1900 total:247 pass:220 dwarn:0 dfail:0 fail:0 skip:27 > fi-byt-n2820 total:247 pass:216 dwarn:0 dfail:0 fail:0 skip:31 > fi-hsw-4770 total:247 pass:228 dwarn:0 dfail:0 fail:0 skip:19 > fi-hsw-4770r total:247 pass:228 dwarn:0 dfail:0 fail:0 skip:19 > fi-ilk-650 total:247 pass:195 dwarn:0 dfail:0 fail:0 skip:52 > fi-ivb-3520m total:247 pass:226 dwarn:0 dfail:0 fail:0 skip:21 > fi-ivb-3770 total:247 pass:226 dwarn:0 dfail:0 fail:0 skip:21 > fi-kbl-7500u total:247 pass:226 dwarn:0 dfail:0 fail:0 skip:21 > fi-skl-6260u total:247 pass:234 dwarn:0 dfail:0 fail:0 skip:13 > fi-skl-6700hq total:247 pass:227 dwarn:0 dfail:0 fail:0 skip:20 > fi-skl-6700k total:247 pass:224 dwarn:3 dfail:0 fail:0 skip:20 > fi-skl-6770hq total:247 pass:234 dwarn:0 dfail:0 fail:0 skip:13 > fi-snb-2520m total:247 pass:216 dwarn:0 dfail:0 fail:0 skip:31 > fi-snb-2600 total:247 pass:215 dwarn:0 dfail:0 fail:0 skip:32 > > b8e68c1d31266b62356d578435246516c39de36b drm-tip: 2016y-12m-20d-12h-47m-27s UTC integration manifest > 3a2f809 drm/i915/guc: Make intel_guc_recv static. Pushed, thanks for the patch! Regards, Tvrtko
diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c index 8ae6795..c6be352 100644 --- a/drivers/gpu/drm/i915/intel_uc.c +++ b/drivers/gpu/drm/i915/intel_uc.c @@ -34,8 +34,10 @@ void intel_uc_init_early(struct drm_i915_private *dev_priv) * Read GuC command/status register (SOFT_SCRATCH_0) * Return true if it contains a response rather than a command */ -bool intel_guc_recv(struct drm_i915_private *dev_priv, u32 *status) +static bool intel_guc_recv(struct intel_guc *guc, u32 *status) { + struct drm_i915_private *dev_priv = guc_to_i915(guc); + u32 val = I915_READ(SOFT_SCRATCH(0)); *status = val; return INTEL_GUC_RECV_IS_RESPONSE(val); @@ -69,9 +71,9 @@ int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len) * up to that length of time, then switch to a slower sleep-wait loop. * No inte_guc_send command should ever take longer than 10ms. */ - ret = wait_for_us(intel_guc_recv(dev_priv, &status), 10); + ret = wait_for_us(intel_guc_recv(guc, &status), 10); if (ret) - ret = wait_for(intel_guc_recv(dev_priv, &status), 10); + ret = wait_for(intel_guc_recv(guc, &status), 10); if (status != INTEL_GUC_STATUS_SUCCESS) { /* * Either the GuC explicitly returned an error (which diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h index 11f5608..406b06a 100644 --- a/drivers/gpu/drm/i915/intel_uc.h +++ b/drivers/gpu/drm/i915/intel_uc.h @@ -170,7 +170,6 @@ struct intel_guc { /* intel_uc.c */ void intel_uc_init_early(struct drm_i915_private *dev_priv); -bool intel_guc_recv(struct drm_i915_private *dev_priv, u32 *status); int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len); int intel_guc_sample_forcewake(struct intel_guc *guc); int intel_guc_log_flush_complete(struct intel_guc *guc);
This function is only used by intel_guc_send() and it doesn't need to be exposed outside of intel_uc.o file. Also when defined as static, compiler will generate smaller code. Additionally let it take guc param instead dev_priv to match function name. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> --- drivers/gpu/drm/i915/intel_uc.c | 8 +++++--- drivers/gpu/drm/i915/intel_uc.h | 1 - 2 files changed, 5 insertions(+), 4 deletions(-)