Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165994
b: refs/heads/master
c: e517a5e
h: refs/heads/master
v: v3
  • Loading branch information
Eric Anholt committed Sep 11, 2009
1 parent b90c2cf commit a551c02
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8082400327d8d2ca54254b593644942bed0edd25
refs/heads/master: e517a5e97080bbe52857bd0d7df9b66602d53c4d
1 change: 1 addition & 0 deletions trunk/arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ void clflush_cache_range(void *vaddr, unsigned int size)

mb();
}
EXPORT_SYMBOL_GPL(clflush_cache_range);

static void __cpa_flush_all(void *arg)
{
Expand Down
30 changes: 23 additions & 7 deletions trunk/drivers/char/agp/intel-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,23 +682,39 @@ static void intel_i830_setup_flush(void)
if (!intel_private.i8xx_page)
return;

/* make page uncached */
map_page_into_agp(intel_private.i8xx_page);

intel_private.i8xx_flush_page = kmap(intel_private.i8xx_page);
if (!intel_private.i8xx_flush_page)
intel_i830_fini_flush();
}

static void
do_wbinvd(void *null)
{
wbinvd();
}

/* The chipset_flush interface needs to get data that has already been
* flushed out of the CPU all the way out to main memory, because the GPU
* doesn't snoop those buffers.
*
* The 8xx series doesn't have the same lovely interface for flushing the
* chipset write buffers that the later chips do. According to the 865
* specs, it's 64 octwords, or 1KB. So, to get those previous things in
* that buffer out, we just fill 1KB and clflush it out, on the assumption
* that it'll push whatever was in there out. It appears to work.
*/
static void intel_i830_chipset_flush(struct agp_bridge_data *bridge)
{
unsigned int *pg = intel_private.i8xx_flush_page;
int i;

for (i = 0; i < 256; i += 2)
*(pg + i) = i;
memset(pg, 0, 1024);

wmb();
if (cpu_has_clflush) {
clflush_cache_range(pg, 1024);
} else {
if (on_each_cpu(do_wbinvd, NULL, 1) != 0)
printk(KERN_ERR "Timed out waiting for cache flush.\n");
}
}

/* The intel i830 automatically initializes the agp aperture during POST.
Expand Down
10 changes: 0 additions & 10 deletions trunk/drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2511,16 +2511,6 @@ i915_gem_clflush_object(struct drm_gem_object *obj)
if (obj_priv->pages == NULL)
return;

/* XXX: The 865 in particular appears to be weird in how it handles
* cache flushing. We haven't figured it out, but the
* clflush+agp_chipset_flush doesn't appear to successfully get the
* data visible to the PGU, while wbinvd + agp_chipset_flush does.
*/
if (IS_I865G(obj->dev)) {
wbinvd();
return;
}

drm_clflush_pages(obj_priv->pages, obj->size / PAGE_SIZE);
}

Expand Down

0 comments on commit a551c02

Please sign in to comment.