Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180665
b: refs/heads/master
c: f0e2f38
h: refs/heads/master
i:
  180663: d89c454
v: v3
  • Loading branch information
Francisco Jerez authored and Dave Airlie committed Feb 19, 2010
1 parent a3fdd31 commit d1df85b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 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: 6a660f06e8120977b25d30ace354c8f9dc3aff2a
refs/heads/master: f0e2f38befa787f0267419082b33e8ac72269d77
18 changes: 11 additions & 7 deletions trunk/drivers/gpu/drm/ttm/ttm_tt.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,15 @@ EXPORT_SYMBOL(ttm_tt_populate);

#ifdef CONFIG_X86
static inline int ttm_tt_set_page_caching(struct page *p,
enum ttm_caching_state c_state)
enum ttm_caching_state c_old,
enum ttm_caching_state c_new)
{
int ret = 0;

if (PageHighMem(p))
return 0;

if (get_page_memtype(p) != -1) {
if (c_old != tt_cached) {
/* p isn't in the default caching state, set it to
* writeback first to free its current memtype. */

Expand All @@ -212,16 +213,17 @@ static inline int ttm_tt_set_page_caching(struct page *p,
return ret;
}

if (c_state == tt_wc)
if (c_new == tt_wc)
ret = set_memory_wc((unsigned long) page_address(p), 1);
else if (c_state == tt_uncached)
else if (c_new == tt_uncached)
ret = set_pages_uc(p, 1);

return ret;
}
#else /* CONFIG_X86 */
static inline int ttm_tt_set_page_caching(struct page *p,
enum ttm_caching_state c_state)
enum ttm_caching_state c_old,
enum ttm_caching_state c_new)
{
return 0;
}
Expand Down Expand Up @@ -254,7 +256,9 @@ static int ttm_tt_set_caching(struct ttm_tt *ttm,
for (i = 0; i < ttm->num_pages; ++i) {
cur_page = ttm->pages[i];
if (likely(cur_page != NULL)) {
ret = ttm_tt_set_page_caching(cur_page, c_state);
ret = ttm_tt_set_page_caching(cur_page,
ttm->caching_state,
c_state);
if (unlikely(ret != 0))
goto out_err;
}
Expand All @@ -268,7 +272,7 @@ static int ttm_tt_set_caching(struct ttm_tt *ttm,
for (j = 0; j < i; ++j) {
cur_page = ttm->pages[j];
if (likely(cur_page != NULL)) {
(void)ttm_tt_set_page_caching(cur_page,
(void)ttm_tt_set_page_caching(cur_page, c_state,
ttm->caching_state);
}
}
Expand Down

0 comments on commit d1df85b

Please sign in to comment.