diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 3620a1b0a73c..d3c3b5b15824 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
@@ -57,7 +57,9 @@ typedef gen8_gtt_pte_t gen8_ppgtt_pde_t; | |||
57 | #define HSW_WB_LLC_AGE3 HSW_CACHEABILITY_CONTROL(0x2) | 57 | #define HSW_WB_LLC_AGE3 HSW_CACHEABILITY_CONTROL(0x2) |
58 | #define HSW_WB_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0x3) | 58 | #define HSW_WB_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0x3) |
59 | #define HSW_WB_ELLC_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0xb) | 59 | #define HSW_WB_ELLC_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0xb) |
60 | #define HSW_WB_ELLC_LLC_AGE3 HSW_CACHEABILITY_CONTROL(0x8) | ||
60 | #define HSW_WT_ELLC_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0x6) | 61 | #define HSW_WT_ELLC_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0x6) |
62 | #define HSW_WT_ELLC_LLC_AGE3 HSW_CACHEABILITY_CONTROL(0x7) | ||
61 | 63 | ||
62 | #define GEN8_PTES_PER_PAGE (PAGE_SIZE / sizeof(gen8_gtt_pte_t)) | 64 | #define GEN8_PTES_PER_PAGE (PAGE_SIZE / sizeof(gen8_gtt_pte_t)) |
63 | #define GEN8_PDES_PER_PAGE (PAGE_SIZE / sizeof(gen8_ppgtt_pde_t)) | 65 | #define GEN8_PDES_PER_PAGE (PAGE_SIZE / sizeof(gen8_ppgtt_pde_t)) |
@@ -185,10 +187,10 @@ static gen6_gtt_pte_t iris_pte_encode(dma_addr_t addr, | |||
185 | case I915_CACHE_NONE: | 187 | case I915_CACHE_NONE: |
186 | break; | 188 | break; |
187 | case I915_CACHE_WT: | 189 | case I915_CACHE_WT: |
188 | pte |= HSW_WT_ELLC_LLC_AGE0; | 190 | pte |= HSW_WT_ELLC_LLC_AGE3; |
189 | break; | 191 | break; |
190 | default: | 192 | default: |
191 | pte |= HSW_WB_ELLC_LLC_AGE0; | 193 | pte |= HSW_WB_ELLC_LLC_AGE3; |
192 | break; | 194 | break; |
193 | } | 195 | } |
194 | 196 | ||
@@ -335,8 +337,8 @@ static void gen8_ppgtt_cleanup(struct i915_address_space *vm) | |||
335 | kfree(ppgtt->gen8_pt_dma_addr[i]); | 337 | kfree(ppgtt->gen8_pt_dma_addr[i]); |
336 | } | 338 | } |
337 | 339 | ||
338 | __free_pages(ppgtt->gen8_pt_pages, ppgtt->num_pt_pages << PAGE_SHIFT); | 340 | __free_pages(ppgtt->gen8_pt_pages, get_order(ppgtt->num_pt_pages << PAGE_SHIFT)); |
339 | __free_pages(ppgtt->pd_pages, ppgtt->num_pd_pages << PAGE_SHIFT); | 341 | __free_pages(ppgtt->pd_pages, get_order(ppgtt->num_pd_pages << PAGE_SHIFT)); |
340 | } | 342 | } |
341 | 343 | ||
342 | /** | 344 | /** |
@@ -904,14 +906,12 @@ static void gen8_ggtt_insert_entries(struct i915_address_space *vm, | |||
904 | WARN_ON(readq(>t_entries[i-1]) | 906 | WARN_ON(readq(>t_entries[i-1]) |
905 | != gen8_pte_encode(addr, level, true)); | 907 | != gen8_pte_encode(addr, level, true)); |
906 | 908 | ||
907 | #if 0 /* TODO: Still needed on GEN8? */ | ||
908 | /* This next bit makes the above posting read even more important. We | 909 | /* This next bit makes the above posting read even more important. We |
909 | * want to flush the TLBs only after we're certain all the PTE updates | 910 | * want to flush the TLBs only after we're certain all the PTE updates |
910 | * have finished. | 911 | * have finished. |
911 | */ | 912 | */ |
912 | I915_WRITE(GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN); | 913 | I915_WRITE(GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN); |
913 | POSTING_READ(GFX_FLSH_CNTL_GEN6); | 914 | POSTING_READ(GFX_FLSH_CNTL_GEN6); |
914 | #endif | ||
915 | } | 915 | } |
916 | 916 | ||
917 | /* | 917 | /* |
@@ -1239,6 +1239,11 @@ static inline unsigned int gen8_get_total_gtt_size(u16 bdw_gmch_ctl) | |||
1239 | bdw_gmch_ctl &= BDW_GMCH_GGMS_MASK; | 1239 | bdw_gmch_ctl &= BDW_GMCH_GGMS_MASK; |
1240 | if (bdw_gmch_ctl) | 1240 | if (bdw_gmch_ctl) |
1241 | bdw_gmch_ctl = 1 << bdw_gmch_ctl; | 1241 | bdw_gmch_ctl = 1 << bdw_gmch_ctl; |
1242 | if (bdw_gmch_ctl > 4) { | ||
1243 | WARN_ON(!i915_preliminary_hw_support); | ||
1244 | return 4<<20; | ||
1245 | } | ||
1246 | |||
1242 | return bdw_gmch_ctl << 20; | 1247 | return bdw_gmch_ctl << 20; |
1243 | } | 1248 | } |
1244 | 1249 | ||