Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757087AbcJMUsI (ORCPT ); Thu, 13 Oct 2016 16:48:08 -0400 Received: from mga03.intel.com ([134.134.136.65]:51651 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755503AbcJMUr6 (ORCPT ); Thu, 13 Oct 2016 16:47:58 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,489,1473145200"; d="scan'208";a="19423788" Message-ID: <1476391230.2478.44.camel@intel.com> Subject: Re: [PATCH 08/10] drm/i915/gen9: Add skl_wm_level_equals() From: Paulo Zanoni To: Lyude , intel-gfx@lists.freedesktop.org Cc: Maarten Lankhorst , Ville =?ISO-8859-1?Q?Syrj=E4l=E4?= , Daniel Vetter , Jani Nikula , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Thu, 13 Oct 2016 17:40:30 -0300 In-Reply-To: <1475885497-6094-9-git-send-email-cpaul@redhat.com> References: <1475885497-6094-1-git-send-email-cpaul@redhat.com> <1475885497-6094-9-git-send-email-cpaul@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2164 Lines: 62 Em Sex, 2016-10-07 às 20:11 -0400, Lyude escreveu: > Helper we're going to be using for implementing verification of the > wm > levels in skl_verify_wm_level(). > > Signed-off-by: Lyude Reviewed-by: Paulo Zanoni > Cc: Maarten Lankhorst > Cc: Ville Syrjälä > Cc: Paulo Zanoni > --- >  drivers/gpu/drm/i915/intel_drv.h |  2 ++ >  drivers/gpu/drm/i915/intel_pm.c  | 14 ++++++++++++++ >  2 files changed, 16 insertions(+) > > diff --git a/drivers/gpu/drm/i915/intel_drv.h > b/drivers/gpu/drm/i915/intel_drv.h > index 73a2d16d..3e6e9af 100644 > --- a/drivers/gpu/drm/i915/intel_drv.h > +++ b/drivers/gpu/drm/i915/intel_drv.h > @@ -1761,6 +1761,8 @@ void skl_pipe_wm_get_hw_state(struct drm_crtc > *crtc, >  bool intel_can_enable_sagv(struct drm_atomic_state *state); >  int intel_enable_sagv(struct drm_i915_private *dev_priv); >  int intel_disable_sagv(struct drm_i915_private *dev_priv); > +bool skl_wm_level_equals(const struct skl_wm_level *l1, > +  const struct skl_wm_level *l2); >  bool skl_ddb_allocation_equals(const struct skl_ddb_allocation *old, >          const struct skl_ddb_allocation *new, >          enum pipe pipe); > diff --git a/drivers/gpu/drm/i915/intel_pm.c > b/drivers/gpu/drm/i915/intel_pm.c > index 27a520ce..6af1587 100644 > --- a/drivers/gpu/drm/i915/intel_pm.c > +++ b/drivers/gpu/drm/i915/intel_pm.c > @@ -3853,6 +3853,20 @@ void skl_write_cursor_wm(struct intel_crtc > *intel_crtc, >       &ddb->plane[pipe][PLANE_CURSOR]); >  } >   > +bool skl_wm_level_equals(const struct skl_wm_level *l1, > +  const struct skl_wm_level *l2) > +{ > + if (l1->plane_en != l2->plane_en) > + return false; > + > + /* If both planes aren't enabled, the rest shouldn't matter > */ > + if (!l1->plane_en) > + return true; > + > + return (l1->plane_res_l == l2->plane_res_l && > + l1->plane_res_b == l2->plane_res_b); > +} > + >  static inline bool skl_ddb_entries_overlap(const struct > skl_ddb_entry *a, >      const struct > skl_ddb_entry *b) >  {