Re: [PATCH 1/5] drm/i915: implement WaIssueDummyWriteToWakupFromRC6

Daniel Vetter
2012-10-18T11:21:13Z

On Thu, Oct 18, 2012 at 1:17 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, 18 Oct 2012 11:49:50 +0200, Daniel Vetter <daniel.vetter@ffwll.ch> 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