[Intel-gfx] [PATCH 02/12] drm/i915: Use the new rq->i915 field where appropriate

Daniel Vetter daniel at ffwll.ch
Tue Nov 24 06:41:49 PST 2015


On Tue, Nov 24, 2015 at 02:23:03PM +0000, Chris Wilson wrote:
> On Tue, Nov 24, 2015 at 02:57:04PM +0100, Daniel Vetter wrote:
> > On Fri, Nov 20, 2015 at 12:43:42PM +0000, Chris Wilson wrote:
> > > In a few frequent cases, having a direct pointer to the drm_i915_private
> > > from the request is very useful.
> > > 
> > > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > 
> > req->i915 is a bit inconsistent imo, i915_dev would be better. Anyway, not
> > something you started, just makes the code a bit harder to speed-read ;-)
> 
> How does it strike you as inconsistent? rq->i915 was nicer :-p
> 
> The idea I have been trying to sell is i915->drm->dev for the struct
> drm_i915_private / struct drm_device / struct device triplet.

Hm, we should do an overview section in i915 docs about best practices in
variable naming. I'm serious about this, since we have similar fun with
modeset stuff:

- Preferred: crtc for struct intel_crtc, drm_crtc for struct drm_crtc.
- Transitinoal: crtc for struct drm_crtc, intel_crtc for struct
  intel_crtc. But if you have only one, then don't use that.

Maybe we should mention intel_ vs. i915_ vs. platform prefixes too?
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list