Re: [Intel-gfx] [PATCH] drm/i915: Use dev_priv as first argument of for_each_pipe()
On Mon, Aug 18, 2014 at 02:13:06PM +0100, Chris Wilson wrote: On Mon, Aug 18, 2014 at 02:07:40PM +0100, Damien Lespiau wrote: On Mon, Aug 18, 2014 at 01:58:06PM +0100, Chris Wilson wrote: On Mon, Aug 18, 2014 at 01:49:10PM +0100, Damien Lespiau wrote: Chris has decided that enough is enough. It's time to fixup dev Vs dev_priv. This is a modest contribution to the crusade. v2: Still use INTEL_INFO(), for the (mythical!) case we want to hardcode the info struct with defines (Chris) Rename the macro argument from 'dev' to 'dev_priv' (Jani) v3: Use names unlikely to be used as macro arguments (Chris) I can be annoying! These macros typically take the iter as the first argument... How typical is your typical? list_for_each and everything derived from them that paid attention... #define for_each_pipe(__dev_priv, __p) #define for_each_crtc(dev, crtc) #define for_each_intel_crtc(dev, intel_crtc) #define for_each_intel_encoder(dev, intel_encoder) #define for_each_encoder_on_crtc(dev, __crtc, intel_encoder) #define for_each_connector_on_encoder(dev, __encoder, intel_connector) Sounds like a lot of churn for no good reason this time. Or that I forgot to tell you about this detail last time. I think a lot of those are on me ;-) Patch merged to dinq, thanks. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH] drm/i915: Use dev_priv as first argument of for_each_pipe()
On Fri, 15 Aug 2014, Damien Lespiau damien.lesp...@intel.com wrote: Chris has decided that enough is enough. It's time to fixup dev Vs dev_priv and the, oh so awful, INTEL_INFO(). This is a modest contribution to the crusade. -#define for_each_pipe(p) for ((p) = 0; (p) INTEL_INFO(dev)-num_pipes; (p)++) +#define for_each_pipe(dev, p) for ((p) = 0; (p) (dev)-info.num_pipes; (p)++) Naming the first argument dev disagrees with the subject. BR, Jani. -- Jani Nikula, Intel Open Source Technology Center ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH] drm/i915: Use dev_priv as first argument of for_each_pipe()
Chris has decided that enough is enough. It's time to fixup dev Vs dev_priv. This is a modest contribution to the crusade. v2: Still use INTEL_INFO(), for the (mythical!) case we want to hardcode the info struct with defines (Chris) Rename the macro argument from 'dev' to 'dev_priv' (Jani) Suggested-by: Chris Wilson ch...@chris-wilson.co.uk Signed-off-by: Damien Lespiau damien.lesp...@intel.com --- drivers/gpu/drm/i915/i915_debugfs.c | 10 +++--- drivers/gpu/drm/i915/i915_dma.c | 4 +-- drivers/gpu/drm/i915/i915_drv.h | 3 +- drivers/gpu/drm/i915/i915_irq.c | 65 ++-- drivers/gpu/drm/i915/intel_display.c | 16 + drivers/gpu/drm/i915/intel_dp.c | 2 +- drivers/gpu/drm/i915/intel_panel.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 17 +- 8 files changed, 60 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 6c82bda..637143c 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -662,7 +662,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) I915_READ(VLV_IIR_RW)); seq_printf(m, Display IMR:\t%08x\n, I915_READ(VLV_IMR)); - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) seq_printf(m, Pipe %c stat:\t%08x\n, pipe_name(pipe), I915_READ(PIPESTAT(pipe))); @@ -702,7 +702,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) i, I915_READ(GEN8_GT_IER(i))); } - for_each_pipe(pipe) { + for_each_pipe(dev_priv, pipe) { if (!intel_display_power_enabled(dev_priv, POWER_DOMAIN_PIPE(pipe))) { seq_printf(m, Pipe %c power disabled\n, @@ -749,7 +749,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) I915_READ(VLV_IIR_RW)); seq_printf(m, Display IMR:\t%08x\n, I915_READ(VLV_IMR)); - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) seq_printf(m, Pipe %c stat:\t%08x\n, pipe_name(pipe), I915_READ(PIPESTAT(pipe))); @@ -785,7 +785,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) I915_READ(IIR)); seq_printf(m, Interrupt mask: %08x\n, I915_READ(IMR)); - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) seq_printf(m, Pipe %c stat: %08x\n, pipe_name(pipe), I915_READ(PIPESTAT(pipe))); @@ -4178,7 +4178,7 @@ void intel_display_crc_init(struct drm_device *dev) struct drm_i915_private *dev_priv = dev-dev_private; enum pipe pipe; - for_each_pipe(pipe) { + for_each_pipe(dev_priv, pipe) { struct intel_pipe_crc *pipe_crc = dev_priv-pipe_crc[pipe]; pipe_crc-opened = false; diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 3f676f9..f19dbff 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1528,10 +1528,10 @@ static void intel_device_info_runtime_init(struct drm_device *dev) info = (struct intel_device_info *)dev_priv-info; if (IS_VALLEYVIEW(dev)) - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) info-num_sprites[pipe] = 2; else - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) info-num_sprites[pipe] = 1; if (i915.disable_display) { diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 4754328..719c7c7 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -163,7 +163,8 @@ enum hpd_pin { I915_GEM_DOMAIN_INSTRUCTION | \ I915_GEM_DOMAIN_VERTEX) -#define for_each_pipe(p) for ((p) = 0; (p) INTEL_INFO(dev)-num_pipes; (p)++) +#define for_each_pipe(dev_priv, p) \ + for ((p) = 0; (p) INTEL_INFO(dev_priv)-num_pipes; (p)++) #define for_each_sprite(p, s) for ((s) = 0; (s) INTEL_INFO(dev)-num_sprites[(p)]; (s)++) #define for_each_crtc(dev, crtc) \ diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 6b6fff1..06bb8cd 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -238,7 +238,7 @@ static bool ivb_can_enable_err_int(struct drm_device *dev)
Re: [Intel-gfx] [PATCH] drm/i915: Use dev_priv as first argument of for_each_pipe()
On Mon, Aug 18, 2014 at 11:00:42AM +0100, Damien Lespiau wrote: Chris has decided that enough is enough. It's time to fixup dev Vs dev_priv. This is a modest contribution to the crusade. v2: Still use INTEL_INFO(), for the (mythical!) case we want to hardcode the info struct with defines (Chris) Rename the macro argument from 'dev' to 'dev_priv' (Jani) If you want to be pedantic, don't use a macro name that is often a variable name. -Chris -- Chris Wilson, Intel Open Source Technology Centre ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH] drm/i915: Use dev_priv as first argument of for_each_pipe()
Chris has decided that enough is enough. It's time to fixup dev Vs dev_priv. This is a modest contribution to the crusade. v2: Still use INTEL_INFO(), for the (mythical!) case we want to hardcode the info struct with defines (Chris) Rename the macro argument from 'dev' to 'dev_priv' (Jani) v3: Use names unlikely to be used as macro arguments (Chris) Suggested-by: Chris Wilson ch...@chris-wilson.co.uk Signed-off-by: Damien Lespiau damien.lesp...@intel.com --- drivers/gpu/drm/i915/i915_debugfs.c | 10 +++--- drivers/gpu/drm/i915/i915_dma.c | 4 +-- drivers/gpu/drm/i915/i915_drv.h | 3 +- drivers/gpu/drm/i915/i915_irq.c | 65 ++-- drivers/gpu/drm/i915/intel_display.c | 16 + drivers/gpu/drm/i915/intel_dp.c | 2 +- drivers/gpu/drm/i915/intel_panel.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 17 +- 8 files changed, 60 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 6c82bda..637143c 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -662,7 +662,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) I915_READ(VLV_IIR_RW)); seq_printf(m, Display IMR:\t%08x\n, I915_READ(VLV_IMR)); - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) seq_printf(m, Pipe %c stat:\t%08x\n, pipe_name(pipe), I915_READ(PIPESTAT(pipe))); @@ -702,7 +702,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) i, I915_READ(GEN8_GT_IER(i))); } - for_each_pipe(pipe) { + for_each_pipe(dev_priv, pipe) { if (!intel_display_power_enabled(dev_priv, POWER_DOMAIN_PIPE(pipe))) { seq_printf(m, Pipe %c power disabled\n, @@ -749,7 +749,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) I915_READ(VLV_IIR_RW)); seq_printf(m, Display IMR:\t%08x\n, I915_READ(VLV_IMR)); - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) seq_printf(m, Pipe %c stat:\t%08x\n, pipe_name(pipe), I915_READ(PIPESTAT(pipe))); @@ -785,7 +785,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) I915_READ(IIR)); seq_printf(m, Interrupt mask: %08x\n, I915_READ(IMR)); - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) seq_printf(m, Pipe %c stat: %08x\n, pipe_name(pipe), I915_READ(PIPESTAT(pipe))); @@ -4178,7 +4178,7 @@ void intel_display_crc_init(struct drm_device *dev) struct drm_i915_private *dev_priv = dev-dev_private; enum pipe pipe; - for_each_pipe(pipe) { + for_each_pipe(dev_priv, pipe) { struct intel_pipe_crc *pipe_crc = dev_priv-pipe_crc[pipe]; pipe_crc-opened = false; diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 3f676f9..f19dbff 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1528,10 +1528,10 @@ static void intel_device_info_runtime_init(struct drm_device *dev) info = (struct intel_device_info *)dev_priv-info; if (IS_VALLEYVIEW(dev)) - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) info-num_sprites[pipe] = 2; else - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) info-num_sprites[pipe] = 1; if (i915.disable_display) { diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 4754328..dcfc63c 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -163,7 +163,8 @@ enum hpd_pin { I915_GEM_DOMAIN_INSTRUCTION | \ I915_GEM_DOMAIN_VERTEX) -#define for_each_pipe(p) for ((p) = 0; (p) INTEL_INFO(dev)-num_pipes; (p)++) +#define for_each_pipe(__dev_priv, __p) \ + for ((__p) = 0; (__p) INTEL_INFO(__dev_priv)-num_pipes; (__p)++) #define for_each_sprite(p, s) for ((s) = 0; (s) INTEL_INFO(dev)-num_sprites[(p)]; (s)++) #define for_each_crtc(dev, crtc) \ diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 6b6fff1..06bb8cd 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -238,7 +238,7 @@ static bool
Re: [Intel-gfx] [PATCH] drm/i915: Use dev_priv as first argument of for_each_pipe()
On Mon, Aug 18, 2014 at 01:49:10PM +0100, Damien Lespiau wrote: Chris has decided that enough is enough. It's time to fixup dev Vs dev_priv. This is a modest contribution to the crusade. v2: Still use INTEL_INFO(), for the (mythical!) case we want to hardcode the info struct with defines (Chris) Rename the macro argument from 'dev' to 'dev_priv' (Jani) v3: Use names unlikely to be used as macro arguments (Chris) I can be annoying! These macros typically take the iter as the first argument... -Chris -- Chris Wilson, Intel Open Source Technology Centre ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH] drm/i915: Use dev_priv as first argument of for_each_pipe()
On Mon, Aug 18, 2014 at 01:58:06PM +0100, Chris Wilson wrote: On Mon, Aug 18, 2014 at 01:49:10PM +0100, Damien Lespiau wrote: Chris has decided that enough is enough. It's time to fixup dev Vs dev_priv. This is a modest contribution to the crusade. v2: Still use INTEL_INFO(), for the (mythical!) case we want to hardcode the info struct with defines (Chris) Rename the macro argument from 'dev' to 'dev_priv' (Jani) v3: Use names unlikely to be used as macro arguments (Chris) I can be annoying! These macros typically take the iter as the first argument... How typical is your typical? #define for_each_pipe(__dev_priv, __p) #define for_each_crtc(dev, crtc) #define for_each_intel_crtc(dev, intel_crtc) #define for_each_intel_encoder(dev, intel_encoder) #define for_each_encoder_on_crtc(dev, __crtc, intel_encoder) #define for_each_connector_on_encoder(dev, __encoder, intel_connector) Sounds like a lot of churn for no good reason this time. -- Damien ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH] drm/i915: Use dev_priv as first argument of for_each_pipe()
On Mon, Aug 18, 2014 at 02:07:40PM +0100, Damien Lespiau wrote: On Mon, Aug 18, 2014 at 01:58:06PM +0100, Chris Wilson wrote: On Mon, Aug 18, 2014 at 01:49:10PM +0100, Damien Lespiau wrote: Chris has decided that enough is enough. It's time to fixup dev Vs dev_priv. This is a modest contribution to the crusade. v2: Still use INTEL_INFO(), for the (mythical!) case we want to hardcode the info struct with defines (Chris) Rename the macro argument from 'dev' to 'dev_priv' (Jani) v3: Use names unlikely to be used as macro arguments (Chris) I can be annoying! These macros typically take the iter as the first argument... How typical is your typical? list_for_each and everything derived from them that paid attention... #define for_each_pipe(__dev_priv, __p) #define for_each_crtc(dev, crtc) #define for_each_intel_crtc(dev, intel_crtc) #define for_each_intel_encoder(dev, intel_encoder) #define for_each_encoder_on_crtc(dev, __crtc, intel_encoder) #define for_each_connector_on_encoder(dev, __encoder, intel_connector) Sounds like a lot of churn for no good reason this time. Or that I forgot to tell you about this detail last time. -Chris -- Chris Wilson, Intel Open Source Technology Centre ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH] drm/i915: Use dev_priv as first argument of for_each_pipe()
Chris has decided that enough is enough. It's time to fixup dev Vs dev_priv and the, oh so awful, INTEL_INFO(). This is a modest contribution to the crusade. Suggested-by: Chris Wilson ch...@chris-wilson.co.uk Signed-off-by: Damien Lespiau damien.lesp...@intel.com --- drivers/gpu/drm/i915/i915_debugfs.c | 10 +++--- drivers/gpu/drm/i915/i915_dma.c | 4 +-- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/i915_irq.c | 65 ++-- drivers/gpu/drm/i915/intel_display.c | 16 + drivers/gpu/drm/i915/intel_dp.c | 2 +- drivers/gpu/drm/i915/intel_panel.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 17 +- 8 files changed, 59 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 6c82bda..637143c 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -662,7 +662,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) I915_READ(VLV_IIR_RW)); seq_printf(m, Display IMR:\t%08x\n, I915_READ(VLV_IMR)); - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) seq_printf(m, Pipe %c stat:\t%08x\n, pipe_name(pipe), I915_READ(PIPESTAT(pipe))); @@ -702,7 +702,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) i, I915_READ(GEN8_GT_IER(i))); } - for_each_pipe(pipe) { + for_each_pipe(dev_priv, pipe) { if (!intel_display_power_enabled(dev_priv, POWER_DOMAIN_PIPE(pipe))) { seq_printf(m, Pipe %c power disabled\n, @@ -749,7 +749,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) I915_READ(VLV_IIR_RW)); seq_printf(m, Display IMR:\t%08x\n, I915_READ(VLV_IMR)); - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) seq_printf(m, Pipe %c stat:\t%08x\n, pipe_name(pipe), I915_READ(PIPESTAT(pipe))); @@ -785,7 +785,7 @@ static int i915_interrupt_info(struct seq_file *m, void *data) I915_READ(IIR)); seq_printf(m, Interrupt mask: %08x\n, I915_READ(IMR)); - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) seq_printf(m, Pipe %c stat: %08x\n, pipe_name(pipe), I915_READ(PIPESTAT(pipe))); @@ -4178,7 +4178,7 @@ void intel_display_crc_init(struct drm_device *dev) struct drm_i915_private *dev_priv = dev-dev_private; enum pipe pipe; - for_each_pipe(pipe) { + for_each_pipe(dev_priv, pipe) { struct intel_pipe_crc *pipe_crc = dev_priv-pipe_crc[pipe]; pipe_crc-opened = false; diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 3f676f9..f19dbff 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1528,10 +1528,10 @@ static void intel_device_info_runtime_init(struct drm_device *dev) info = (struct intel_device_info *)dev_priv-info; if (IS_VALLEYVIEW(dev)) - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) info-num_sprites[pipe] = 2; else - for_each_pipe(pipe) + for_each_pipe(dev_priv, pipe) info-num_sprites[pipe] = 1; if (i915.disable_display) { diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 4754328..e07419d 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -163,7 +163,7 @@ enum hpd_pin { I915_GEM_DOMAIN_INSTRUCTION | \ I915_GEM_DOMAIN_VERTEX) -#define for_each_pipe(p) for ((p) = 0; (p) INTEL_INFO(dev)-num_pipes; (p)++) +#define for_each_pipe(dev, p) for ((p) = 0; (p) (dev)-info.num_pipes; (p)++) #define for_each_sprite(p, s) for ((s) = 0; (s) INTEL_INFO(dev)-num_sprites[(p)]; (s)++) #define for_each_crtc(dev, crtc) \ diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 6b6fff1..06bb8cd 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -238,7 +238,7 @@ static bool ivb_can_enable_err_int(struct drm_device *dev) assert_spin_locked(dev_priv-irq_lock); - for_each_pipe(pipe) { + for_each_pipe(dev_priv, pipe) { crtc = to_intel_crtc(dev_priv-pipe_to_crtc_mapping[pipe]);
Re: [Intel-gfx] [PATCH] drm/i915: Use dev_priv as first argument of for_each_pipe()
On Fri, Aug 15, 2014 at 06:34:06PM +0100, Damien Lespiau wrote: -#define for_each_pipe(p) for ((p) = 0; (p) INTEL_INFO(dev)-num_pipes; (p)++) +#define for_each_pipe(dev, p) for ((p) = 0; (p) (dev)-info.num_pipes; (p)++) #define for_each_sprite(p, s) for ((s) = 0; (s) INTEL_INFO(dev)-num_sprites[(p)]; (s)++) I think we still want to keep the INTEL_INFO() as that seems to be the favourite for eliminating deadcode when compiling for a subset of generation. It doesn't hurt to keep it around for a little longer. -Chris -- Chris Wilson, Intel Open Source Technology Centre ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx