From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 1/5] drm/i915: implement WaIssueDummyWriteToWakupFromRC6 Date: Thu, 18 Oct 2012 13:21:12 +0200 Message-ID: References: <1350553794-5534-1-git-send-email-daniel.vetter@ffwll.ch> <1350553794-5534-2-git-send-email-daniel.vetter@ffwll.ch> <6c3329$6qi2hv@orsmga002.jf.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id DBDA29E943 for ; Thu, 18 Oct 2012 04:21:13 -0700 (PDT) Received: by mail-wi0-f177.google.com with SMTP id hj13so1407876wib.12 for ; Thu, 18 Oct 2012 04:21:13 -0700 (PDT) In-Reply-To: <6c3329$6qi2hv@orsmga002.jf.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 Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Thu, Oct 18, 2012 at 1:17 PM, Chris Wilson wrote: > On Thu, 18 Oct 2012 11:49:50 +0200, Daniel Vetter wrote: >> #define __i915_read(x, y) \ >> u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg) { \ >> u##x val = 0; \ >> + if (IS_GEN5(dev_priv->dev)) \ >> + ilk_dummy_write(dev_priv); \ > > IS_GEN5(dev_priv->dev) just makes me want to puke. At some point we must > go through and add an __INTEL_INFO(dev_priv) and so > #define __IS_GEN5(dev_priv__) ((dev_priv__)->info->->gen == 5) > #define IS_GEN5(dev) __IS_GEN5(to_drm_i915_private(dev)) We could also teach the drm setup and teardown code manners and embed struct drm_device into our own device struct and call it a day. Would kill all that pointless circular pointer chasing. Been on my todo since ages, will probably stay there for a while ... -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch