[Intel-gfx] [PATCH 05/13 v2] drm/i915: Remove use on gma_bus_addr on gen6+

Rodrigo Vivi rodrigo.vivi at gmail.com
Thu Jan 17 14:22:59 CET 2013


Reviewed-by: Rodrigo Vivi <rodrigo.vivi at gmail.com>

On Wed, Jan 16, 2013 at 4:20 PM, Ben Widawsky <ben at bwidawsk.net> wrote:
> We have enough info to not use the intel_gtt bridge stuff.
>
> v2: Move setup of mappable_base above the legacy init stuff because we
> still need that on older platforms. (Daniel)
>
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
> ---
>  drivers/gpu/drm/i915/i915_dma.c         | 3 +--
>  drivers/gpu/drm/i915/i915_gem_gtt.c     | 3 ++-
>  drivers/gpu/drm/i915/intel_ringbuffer.c | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index bb4382f..b8f42e0 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1417,7 +1417,7 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>         if (!ap)
>                 return;
>
> -       ap->ranges[0].base = dev_priv->mm.gtt->gma_bus_addr;
> +       ap->ranges[0].base = dev_priv->gtt.mappable_base;
>         ap->ranges[0].size =
>                 dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;
>         primary =
> @@ -1534,7 +1534,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
>         }
>
>         aperture_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;
> -       dev_priv->gtt.mappable_base = dev_priv->mm.gtt->gma_bus_addr;
>
>         dev_priv->gtt.mappable =
>                 io_mapping_create_wc(dev_priv->gtt.mappable_base,
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index e044f58..c5fd35b 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -691,6 +691,8 @@ int i915_gem_gtt_init(struct drm_device *dev)
>         u16 snb_gmch_ctl;
>         int ret;
>
> +       dev_priv->gtt.mappable_base = pci_resource_start(dev->pdev, 2);
> +
>         /* On modern platforms we need not worry ourself with the legacy
>          * hostbridge query stuff. Skip it entirely
>          */
> @@ -719,7 +721,6 @@ int i915_gem_gtt_init(struct drm_device *dev)
>
>         /* For GEN6+ the PTEs for the ggtt live at 2MB + BAR0 */
>         gtt_bus_addr = pci_resource_start(dev->pdev, 0) + (2<<20);
> -       dev_priv->mm.gtt->gma_bus_addr = pci_resource_start(dev->pdev, 2);
>
>         /* i9xx_setup */
>         pci_read_config_word(dev->pdev, SNB_GMCH_CTRL, &snb_gmch_ctl);
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 2bd074a..9765055 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -1164,7 +1164,7 @@ static int intel_init_ring_buffer(struct drm_device *dev,
>                 goto err_unpin;
>
>         ring->virtual_start =
> -               ioremap_wc(dev_priv->mm.gtt->gma_bus_addr + obj->gtt_offset,
> +               ioremap_wc(dev_priv->gtt.mappable_base + obj->gtt_offset,
>                            ring->size);
>         if (ring->virtual_start == NULL) {
>                 DRM_ERROR("Failed to map ringbuffer.\n");
> --
> 1.8.1.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



--
Rodrigo Vivi
Blog: http://blog.vivi.eng.br



More information about the Intel-gfx mailing list