TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC;
man->default_caching = TTM_PL_FLAG_WC;
break;
- case TTM_PL_CI:
- man->func = &ttm_bo_manager_func;
- man->flags = TTM_MEMTYPE_FLAG_MAPPABLE |
- TTM_MEMTYPE_FLAG_FIXED;
- man->gpu_offset = pg->mmu_gatt_start + (pg->ci_start);
- man->available_caching = TTM_PL_FLAG_UNCACHED;
- man->default_caching = TTM_PL_FLAG_UNCACHED;
- break;
case TTM_PL_TT: /* Mappable GATT memory */
man->func = &ttm_bo_manager_func;
#ifdef PSB_WORKING_HOST_MMU_ACCESS
mem->bus.offset = mm_node->start << PAGE_SHIFT;
mem->bus.base = 0x00000000;
break;
- case TTM_PL_CI:
- mem->bus.offset = mm_node->start << PAGE_SHIFT;
- mem->bus.base = dev_priv->ci_region_start;;
- mem->bus.is_iomem = true;
- break;
default:
return -EINVAL;
}
ttm_bo_clean_mm(bdev, TTM_PL_TT);
dev_priv->have_tt = 0;
}
-
- if (dev_priv->have_camera) {
- ttm_bo_clean_mm(bdev, TTM_PL_CI);
- dev_priv->have_camera = 0;
- }
}
void mrst_get_fuse_settings(struct drm_device *dev)
PSB_WSGX32(pg->mmu_gatt_start, PSB_CR_BIF_TWOD_REQ_BASE);
/* TT region managed by TTM. */
- if (!ttm_bo_init_mm(bdev, TTM_PL_TT,
- pg->gatt_pages -
- (pg->ci_start >> PAGE_SHIFT) -
- ((dev_priv->ci_region_size)
- >> PAGE_SHIFT))) {
-
+ if (!ttm_bo_init_mm(bdev, TTM_PL_TT, pg->gatt_pages)) {
dev_priv->have_tt = 1;
dev_priv->sizes.tt_size =
(tt_pages << PAGE_SHIFT) / (1024 * 1024) / 2;
(dev_priv->mmu),
pg->mmu_gatt_start,
pg->vram_stolen_size >> PAGE_SHIFT);
- if (pg->ci_stolen_size != 0)
- psb_mmu_remove_pfn_sequence(
- psb_mmu_get_default_pd
- (dev_priv->mmu),
- pg->ci_start,
- pg->ci_stolen_size >> PAGE_SHIFT);
up_read(&pg->sem);
psb_mmu_driver_takedown(dev_priv->mmu);
dev_priv->mmu = NULL;
tt_pages = (pg->gatt_pages < PSB_TT_PRIV0_PLIMIT) ?
(pg->gatt_pages) : PSB_TT_PRIV0_PLIMIT;
- /* CI/RAR use the lower half of TT. */
- pg->ci_start = (tt_pages / 2) << PAGE_SHIFT;
-
-
- /*
- * Make MSVDX/TOPAZ MMU aware of the CI stolen memory area.
- */
- if (dev_priv->pg->ci_stolen_size != 0) {
- down_read(&pg->sem);
- ret = psb_mmu_insert_pfn_sequence(psb_mmu_get_default_pd
- (dev_priv->mmu),
- dev_priv->ci_region_start >> PAGE_SHIFT,
- pg->mmu_gatt_start + pg->ci_start,
- pg->ci_stolen_size >> PAGE_SHIFT, 0);
- up_read(&pg->sem);
- if (ret)
- goto out_err;
- }
dev_priv->pf_pd = psb_mmu_alloc_pd(dev_priv->mmu, 1, 0);
if (!dev_priv->pf_pd)
struct drm_crtc *pipe_to_crtc_mapping[PSB_NUM_PIPE];
uint32_t num_pipe;
- /*
- * CI share buffer
- */
- unsigned int ci_region_start;
- unsigned int ci_region_size;
-
/*
*Memory managers
*/
- int have_camera;
- int have_rar;
int have_tt;
int have_mem_mmu;
struct mutex temp_mem;
struct drm_device *dev = pg->dev;
struct drm_psb_private *dev_priv = dev->dev_private;
unsigned gtt_pages;
- unsigned long stolen_size, vram_stolen_size, ci_stolen_size;
+ unsigned long stolen_size, vram_stolen_size;
unsigned i, num_pages;
unsigned pfn_base;
- uint32_t ci_pages, vram_pages;
+ uint32_t vram_pages;
uint32_t tt_pages;
uint32_t *ttm_gtt_map;
uint32_t dvmt_mode = 0;
pci_read_config_dword(dev->pdev, PSB_BSM, &pg->stolen_base);
vram_stolen_size = pg->gtt_phys_start - pg->stolen_base - PAGE_SIZE;
- /* CI is not included in the stolen size since the TOPAZ MMU bug */
- ci_stolen_size = dev_priv->ci_region_size;
- /* Don't add CI & RAR share buffer space
- * managed by TTM to stolen_size */
stolen_size = vram_stolen_size;
printk(KERN_INFO"GMMADR(region 0) start: 0x%08x (%dM).\n",
printk(KERN_INFO " the correct size should be: %dM(dvmt mode=%d)\n",
(dvmt_mode == 1) ? 1 : (2 << (dvmt_mode - 1)), dvmt_mode);
- if (ci_stolen_size > 0)
- printk(KERN_INFO"CI Stole memory: RAM base = 0x%08x, size = %lu M\n",
- dev_priv->ci_region_start,
- ci_stolen_size / 1024 / 1024);
-
if (resume && (gtt_pages != pg->gtt_pages) &&
(stolen_size != pg->stolen_size)) {
DRM_ERROR("GTT resume error.\n");
pg->gtt_pages = gtt_pages;
pg->stolen_size = stolen_size;
pg->vram_stolen_size = vram_stolen_size;
- pg->ci_stolen_size = ci_stolen_size;
pg->gtt_map =
ioremap_nocache(pg->gtt_phys_start, gtt_pages << PAGE_SHIFT);
if (!pg->gtt_map) {
for (; i < tt_pages / 2 - 1; ++i)
iowrite32(pte, pg->gtt_map + i);
- /*
- * insert CI stolen pages
- */
-
- pfn_base = dev_priv->ci_region_start >> PAGE_SHIFT;
- ci_pages = num_pages = ci_stolen_size >> PAGE_SHIFT;
- printk(KERN_INFO"Set up %d CI stolen pages starting at 0x%08x, GTT offset %dK\n",
- num_pages, pfn_base, (ttm_gtt_map - pg->gtt_map) * 4);
- for (i = 0; i < num_pages; ++i) {
- pte = psb_gtt_mask_pte(pfn_base + i, 0);
- iowrite32(pte, ttm_gtt_map + i);
- }
-
/*
* Init rest of gtt managed by TTM.
*/
int initialized;
uint32_t gatt_start;
uint32_t mmu_gatt_start;
- uint32_t ci_start;
- uint32_t rar_start;
uint32_t gtt_start;
uint32_t gtt_phys_start;
unsigned gtt_pages;
u16 gmch_ctrl;
unsigned long stolen_size;
unsigned long vram_stolen_size;
- unsigned long ci_stolen_size;
- unsigned long rar_stolen_size;
uint32_t *gtt_map;
struct rw_semaphore sem;
};