Re: [PATCH] drm/i915,agp/intel: Do not clear stolen entries

From: Jiri Olsa
Date: Fri Jan 21 2011 - 11:27:18 EST


this patch fixed the issue for me

Tested-by: Jiri Olsa <jolsa@xxxxxxxxxx>
if needed :)

thanks,
jirka


On Fri, Jan 21, 2011 at 10:58:57AM +0000, Chris Wilson wrote:
> We can only utilize the stolen portion of the GTT if we are in sole
> charge of the hardware. This is only true if using GEM and KMS,
> otherwise VESA continues to access stolen memory.
>
> Reported-by: Arnd Bergmann <arnd@xxxxxxxx>
> Reported-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>
> Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> ---
> drivers/char/agp/intel-gtt.c | 18 ++++++++----------
> drivers/gpu/drm/i915/i915_gem.c | 6 ++++--
> 2 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
> index 826ab09..cbbcaba 100644
> --- a/drivers/char/agp/intel-gtt.c
> +++ b/drivers/char/agp/intel-gtt.c
> @@ -68,6 +68,7 @@ static struct _intel_private {
> phys_addr_t gma_bus_addr;
> u32 PGETBL_save;
> u32 __iomem *gtt; /* I915G */
> + bool clear_fake_agp; /* on first access via agp, fill with scratch */
> int num_dcache_entries;
> union {
> void __iomem *i9xx_flush_page;
> @@ -869,21 +870,12 @@ static int intel_fake_agp_free_gatt_table(struct agp_bridge_data *bridge)
>
> static int intel_fake_agp_configure(void)
> {
> - int i;
> -
> if (!intel_enable_gtt())
> return -EIO;
>
> + intel_private.clear_fake_agp = true;
> agp_bridge->gart_bus_addr = intel_private.gma_bus_addr;
>
> - for (i = 0; i < intel_private.base.gtt_total_entries; i++) {
> - intel_private.driver->write_entry(intel_private.scratch_page_dma,
> - i, 0);
> - }
> - readl(intel_private.gtt+i-1); /* PCI Posting. */
> -
> - global_cache_flush();
> -
> return 0;
> }
>
> @@ -945,6 +937,12 @@ static int intel_fake_agp_insert_entries(struct agp_memory *mem,
> {
> int ret = -EINVAL;
>
> + if (intel_private.clear_fake_agp) {
> + intel_gtt_clear_range(intel_private.base.stolen_size / PAGE_SIZE,
> + intel_private.base.gtt_total_entries);
> + intel_private.clear_fake_agp = false;
> + }
> +
> if (INTEL_GTT_GEN == 1 && type == AGP_DCACHE_MEMORY)
> return i810_insert_dcache_entries(mem, pg_start, type);
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 812b97b..6542e7d 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -140,12 +140,14 @@ void i915_gem_do_init(struct drm_device *dev,
> {
> drm_i915_private_t *dev_priv = dev->dev_private;
>
> - drm_mm_init(&dev_priv->mm.gtt_space, start,
> - end - start);
> + drm_mm_init(&dev_priv->mm.gtt_space, start, end - start);
>
> dev_priv->mm.gtt_total = end - start;
> dev_priv->mm.mappable_gtt_total = min(end, mappable_end) - start;
> dev_priv->mm.gtt_mappable_end = mappable_end;
> +
> + /* Take over this portion of the GTT */
> + intel_gtt_clear_range(start / PAGE_SIZE, end / PAGE_SIZE);
> }
>
> int
> --
> 1.7.2.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/