From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 2/4] drm/i915: add plane enable/disable functions Date: Thu, 30 Dec 2010 13:49:35 -0800 Message-ID: <20101230134935.061d283a@jbarnes-desktop> References: <1293743792-8665-1-git-send-email-jbarnes@virtuousgeek.org> <1293743792-8665-3-git-send-email-jbarnes@virtuousgeek.org> <849307$av583d@azsmga001.ch.intel.com> <20101230134030.786aa6da@jbarnes-desktop> <5b55a1$j45j3q@fmsmga002.fm.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cpoproxy3-pub.bluehost.com (cpoproxy3-pub.bluehost.com [67.222.54.6]) by gabe.freedesktop.org (Postfix) with SMTP id B708A9E732 for ; Thu, 30 Dec 2010 13:49:37 -0800 (PST) In-Reply-To: <5b55a1$j45j3q@fmsmga002.fm.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, 30 Dec 2010 21:45:22 +0000 Chris Wilson wrote: > On Thu, 30 Dec 2010 13:40:30 -0800, Jesse Barnes wrote: > > On Thu, 30 Dec 2010 21:34:46 +0000 > > Chris Wilson wrote: > > > > > Trivial comment, on passing... > > > > > > On Thu, 30 Dec 2010 13:16:30 -0800, Jesse Barnes wrote: > > > > Add plane enable/disable functions to prevent duplicated code and allow > > > > us to easily check for plane enable/disable requirements (such as pipe > > > > enable). > > > > > > > +static void intel_disable_plane(struct drm_i915_private *dev_priv, > > > > + enum plane plane, enum pipe pipe) > > > > +{ > > > > + int reg; > > > > + u32 val; > > > > + > > > > + reg = DSPCNTR(plane); > > > > + val = I915_READ(reg); > > > > + val &= ~DISPLAY_PLANE_ENABLE; > > > > + I915_WRITE(reg, val); > > > > + POSTING_READ(reg); > > > > > > > + reg = DSPADDR(plane); > > > > + I915_WRITE(reg, I915_READ(reg)); /* trigger an update */ > > > > > > Use intel_flush_display_plane(dev_priv, plane); though maybe that function > > > becomes redundant? Unlikely... > > > > It was only used in one place after I added this, so I just stuffed the > > update trigger into this function and deleted flush_display_plane. > > That was in the next function I read. ;-) I'd argue that the > intel_flush_display_plane(), with the requisite whitespacing, remains > clearer than the block of I915_READ/I915_WRITE + comment. Sure, I can put it back. Self-documenting function names ftw. -- Jesse Barnes, Intel Open Source Technology Center