[Intel-gfx] [PATCH 4/5] drm/i915: Pass dev_priv to INTEL_INFO everywhere apart from the gen use
From: Tvrtko Ursulin After this patch only conversion of INTEL_INFO(p)->gen to INTEL_GEN(dev_priv) remains before the __I915__ macro can be removed. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/i915_drv.c | 4 ++-- drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +- drivers/gpu/drm/i915/intel_color.c | 31 ++- drivers/gpu/drm/i915/intel_display.c | 28 +--- drivers/gpu/drm/i915/intel_fbdev.c | 10 +- drivers/gpu/drm/i915/intel_pm.c | 7 --- 6 files changed, 39 insertions(+), 43 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 79cea49183b3..35940192e569 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -150,7 +150,7 @@ static void intel_detect_pch(struct drm_device *dev) /* In all current cases, num_pipes is equivalent to the PCH_NOP setting * (which really amounts to a PCH but no South Display). */ - if (INTEL_INFO(dev)->num_pipes == 0) { + if (INTEL_INFO(dev_priv)->num_pipes == 0) { dev_priv->pch_type = PCH_NOP; return; } @@ -607,7 +607,7 @@ static int i915_load_modeset_init(struct drm_device *dev) intel_modeset_gem_init(dev); - if (INTEL_INFO(dev)->num_pipes == 0) + if (INTEL_INFO(dev_priv)->num_pipes == 0) return 0; ret = intel_fbdev_init(dev); diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index cad6de65947d..b98f11735c5b 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -714,7 +714,7 @@ static int gen8_48b_mm_switch(struct i915_hw_ppgtt *ppgtt, */ static void mark_tlbs_dirty(struct i915_hw_ppgtt *ppgtt) { - ppgtt->pd_dirty_rings = INTEL_INFO(ppgtt->base.dev)->ring_mask; + ppgtt->pd_dirty_rings = INTEL_INFO(to_i915(ppgtt->base.dev))->ring_mask; } /* Removes entries from a single page table, releasing it if it's empty. diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c index 445108855275..3784940a4e7a 100644 --- a/drivers/gpu/drm/i915/intel_color.c +++ b/drivers/gpu/drm/i915/intel_color.c @@ -345,11 +345,10 @@ static void haswell_load_luts(struct drm_crtc_state *crtc_state) static void broadwell_load_luts(struct drm_crtc_state *state) { struct drm_crtc *crtc = state->crtc; - struct drm_device *dev = crtc->dev; - struct drm_i915_private *dev_priv = to_i915(dev); + struct drm_i915_private *dev_priv = to_i915(crtc->dev); struct intel_crtc_state *intel_state = to_intel_crtc_state(state); enum pipe pipe = to_intel_crtc(crtc)->pipe; - uint32_t i, lut_size = INTEL_INFO(dev)->color.degamma_lut_size; + uint32_t i, lut_size = INTEL_INFO(dev_priv)->color.degamma_lut_size; if (crtc_state_is_legacy(state)) { haswell_load_luts(state); @@ -428,8 +427,7 @@ static void broadwell_load_luts(struct drm_crtc_state *state) static void cherryview_load_luts(struct drm_crtc_state *state) { struct drm_crtc *crtc = state->crtc; - struct drm_device *dev = crtc->dev; - struct drm_i915_private *dev_priv = to_i915(dev); + struct drm_i915_private *dev_priv = to_i915(crtc->dev); enum pipe pipe = to_intel_crtc(crtc)->pipe; struct drm_color_lut *lut; uint32_t i, lut_size; @@ -446,7 +444,7 @@ static void cherryview_load_luts(struct drm_crtc_state *state) if (state->degamma_lut) { lut = (struct drm_color_lut *) state->degamma_lut->data; - lut_size = INTEL_INFO(dev)->color.degamma_lut_size; + lut_size = INTEL_INFO(dev_priv)->color.degamma_lut_size; for (i = 0; i < lut_size; i++) { /* Write LUT in U0.14 format. */ word0 = @@ -461,7 +459,7 @@ static void cherryview_load_luts(struct drm_crtc_state *state) if (state->gamma_lut) { lut = (struct drm_color_lut *) state->gamma_lut->data; - lut_size = INTEL_INFO(dev)->color.gamma_lut_size; + lut_size = INTEL_INFO(dev_priv)->color.gamma_lut_size; for (i = 0; i < lut_size; i++) { /* Write LUT in U0.10 format. */ word0 = @@ -497,12 +495,12 @@ void intel_color_load_luts(struct drm_crtc_state *crtc_state) int intel_color_check(struct drm_crtc *crtc, struct drm_crtc_state *crtc_state) { - struct drm_device *dev = crtc->dev; + struct drm_i915_private *dev_priv = to_i915(crtc->dev); size_t gamma_length, degamma_length; - degamma_length = INTEL_INFO(dev)->color.degamma_lut_size * + degamma_length = INTEL_INFO(dev_priv)->color.degamma_lut_size * sizeof(struct drm_color_lut); - gamma_length = INTEL_INFO(dev)->color.gamma_lut_size
Re: [Intel-gfx] [PATCH 4/5] drm/i915: Pass dev_priv to INTEL_INFO everywhere apart from the gen use
On Fri, Nov 04, 2016 at 02:42:47PM +, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > After this patch only conversion of INTEL_INFO(p)->gen to > INTEL_GEN(dev_priv) remains before the __I915__ macro can > be removed. > > Signed-off-by: Tvrtko Ursulin > --- > drivers/gpu/drm/i915/i915_drv.c | 4 ++-- > drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +- > drivers/gpu/drm/i915/intel_color.c | 31 ++- > drivers/gpu/drm/i915/intel_display.c | 28 +--- > drivers/gpu/drm/i915/intel_fbdev.c | 10 +- > drivers/gpu/drm/i915/intel_pm.c | 7 --- > 6 files changed, 39 insertions(+), 43 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c > index 79cea49183b3..35940192e569 100644 > --- a/drivers/gpu/drm/i915/i915_drv.c > +++ b/drivers/gpu/drm/i915/i915_drv.c > @@ -150,7 +150,7 @@ static void intel_detect_pch(struct drm_device *dev) > /* In all current cases, num_pipes is equivalent to the PCH_NOP setting >* (which really amounts to a PCH but no South Display). >*/ > - if (INTEL_INFO(dev)->num_pipes == 0) { > + if (INTEL_INFO(dev_priv)->num_pipes == 0) { > dev_priv->pch_type = PCH_NOP; > return; > } > @@ -607,7 +607,7 @@ static int i915_load_modeset_init(struct drm_device *dev) > > intel_modeset_gem_init(dev); > > - if (INTEL_INFO(dev)->num_pipes == 0) > + if (INTEL_INFO(dev_priv)->num_pipes == 0) > return 0; > > ret = intel_fbdev_init(dev); > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c > b/drivers/gpu/drm/i915/i915_gem_gtt.c > index cad6de65947d..b98f11735c5b 100644 > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c > @@ -714,7 +714,7 @@ static int gen8_48b_mm_switch(struct i915_hw_ppgtt *ppgtt, > */ > static void mark_tlbs_dirty(struct i915_hw_ppgtt *ppgtt) > { > - ppgtt->pd_dirty_rings = INTEL_INFO(ppgtt->base.dev)->ring_mask; > + ppgtt->pd_dirty_rings = INTEL_INFO(to_i915(ppgtt->base.dev))->ring_mask; > } > > /* Removes entries from a single page table, releasing it if it's empty. > diff --git a/drivers/gpu/drm/i915/intel_color.c > b/drivers/gpu/drm/i915/intel_color.c > index 445108855275..3784940a4e7a 100644 > --- a/drivers/gpu/drm/i915/intel_color.c > +++ b/drivers/gpu/drm/i915/intel_color.c > @@ -345,11 +345,10 @@ static void haswell_load_luts(struct drm_crtc_state > *crtc_state) > static void broadwell_load_luts(struct drm_crtc_state *state) > { > struct drm_crtc *crtc = state->crtc; > - struct drm_device *dev = crtc->dev; > - struct drm_i915_private *dev_priv = to_i915(dev); > + struct drm_i915_private *dev_priv = to_i915(crtc->dev); > struct intel_crtc_state *intel_state = to_intel_crtc_state(state); > enum pipe pipe = to_intel_crtc(crtc)->pipe; > - uint32_t i, lut_size = INTEL_INFO(dev)->color.degamma_lut_size; > + uint32_t i, lut_size = INTEL_INFO(dev_priv)->color.degamma_lut_size; > > if (crtc_state_is_legacy(state)) { > haswell_load_luts(state); > @@ -428,8 +427,7 @@ static void broadwell_load_luts(struct drm_crtc_state > *state) > static void cherryview_load_luts(struct drm_crtc_state *state) > { > struct drm_crtc *crtc = state->crtc; > - struct drm_device *dev = crtc->dev; > - struct drm_i915_private *dev_priv = to_i915(dev); > + struct drm_i915_private *dev_priv = to_i915(crtc->dev); > enum pipe pipe = to_intel_crtc(crtc)->pipe; > struct drm_color_lut *lut; > uint32_t i, lut_size; > @@ -446,7 +444,7 @@ static void cherryview_load_luts(struct drm_crtc_state > *state) > > if (state->degamma_lut) { > lut = (struct drm_color_lut *) state->degamma_lut->data; > - lut_size = INTEL_INFO(dev)->color.degamma_lut_size; > + lut_size = INTEL_INFO(dev_priv)->color.degamma_lut_size; > for (i = 0; i < lut_size; i++) { > /* Write LUT in U0.14 format. */ > word0 = > @@ -461,7 +459,7 @@ static void cherryview_load_luts(struct drm_crtc_state > *state) > > if (state->gamma_lut) { > lut = (struct drm_color_lut *) state->gamma_lut->data; > - lut_size = INTEL_INFO(dev)->color.gamma_lut_size; > + lut_size = INTEL_INFO(dev_priv)->color.gamma_lut_size; > for (i = 0; i < lut_size; i++) { > /* Write LUT in U0.10 format. */ > word0 = > @@ -497,12 +495,12 @@ void intel_color_load_luts(struct drm_crtc_state > *crtc_state) > int intel_color_check(struct drm_crtc *crtc, > struct drm_crtc_state *crtc_state) > { > - struct drm_device *dev = crtc->dev; > + struct drm_i915_private *dev_priv = to_i915(crtc->dev); > size_t gamma_length, degamma_length; > > - degamma_length = INTEL_INFO(dev)->color.degamma_l