search for: ttm_pl_flag_wc

Displaying 20 results from an estimated 51 matches for "ttm_pl_flag_wc".

2014 May 19
2
[RFC] drm/nouveau: disable caching for VRAM BOs on ARM
...217232..9cfb8e61f5c4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -552,7 +552,11 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, TTM_MEMTYPE_FLAG_MAPPABLE; man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; +#if defined(__arm__) + man->default_caching = TTM_PL_FLAG_UNCACHED; +#else man->default_caching = TTM_PL_FLAG_WC; +#endif break; case TTM_PL_TT: if (nv_device(drm->device)->card_type >= NV_50) -- 1.9.2
2014 Jun 09
2
[PATCH 4/4] drm/nouveau: introduce CPU cache flushing macro
...it will get flushed on pushbuf kickoff anyways. I tried to go that way, and something interesting happened. What I did: remove this patch and instead set the following caching parameters for the TTM_PL_TT case in nouveau_bo_init_mem_type(): man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; man->default_caching = TTM_PL_FLAG_WC; What happened: no runtime errors as what happened when caching is enabled. However, many of the vertex and texture buffers seem to be partially corrupted. In glmark2 the 3d models had many vertices (but not all) at the wrong position. Note that not al...
2009 Aug 19
1
[PATCH] drm/nouveau: Add a MM for mappable VRAM that isn't usable as scanout.
...caching = man->default_caching = 0; break; + case TTM_PL_PRIV1: /* Mappable but unusable as scanout. */ + { + man->flags = TTM_MEMTYPE_FLAG_FIXED | + TTM_MEMTYPE_FLAG_MAPPABLE | + TTM_MEMTYPE_FLAG_NEEDS_IOREMAP; + man->available_caching = TTM_PL_FLAG_UNCACHED | + TTM_PL_FLAG_WC; + man->default_caching = TTM_PL_FLAG_WC; + + man->io_addr = NULL; + man->io_offset = drm_get_resource_start(dev, 1); + man->io_size = drm_get_resource_len(dev, 1); + man->gpu_offset = dev_priv->vm_vram_base; + break; + } case TTM_PL_TT: switch (dev_priv->gart_info.t...
2014 May 19
0
[RFC] drm/nouveau: disable caching for VRAM BOs on ARM
...t; --- a/drivers/gpu/drm/nouveau/nouveau_bo.c > +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c > @@ -552,7 +552,11 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, > TTM_MEMTYPE_FLAG_MAPPABLE; > man->available_caching = TTM_PL_FLAG_UNCACHED | > TTM_PL_FLAG_WC; > +#if defined(__arm__) > + man->default_caching = TTM_PL_FLAG_UNCACHED; > +#else > man->default_caching = TTM_PL_FLAG_WC; > +#endif > break; > case TTM_PL_TT: > if (nv_device(drm->device)->card_type >= NV_50) -- Pengutronix e.K. | L...
2020 Oct 15
5
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...t here and make sure to cast bo->num_pages before shifting. We have an unit tests of allocating a 8GB BO and that should work on a 32bit machine as well :) > + > + if (mem->bus.addr) > + vaddr_iomem = (void *)(((u8 *)mem->bus.addr)); > + else if (mem->placement & TTM_PL_FLAG_WC) I've just nuked the TTM_PL_FLAG_WC flag in drm-misc-next. There is a new mem->bus.caching enum as replacement. > + vaddr_iomem = ioremap_wc(mem->bus.offset, size); > + else > + vaddr_iomem = ioremap(mem->bus.offset, size); > + > + if (!vaddr_iomem) > + ret...
2014 Jun 27
5
[PATCH 1/2] drm/nouveau/bar: add noncached ioremap property
...+500,25 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, man->default_caching = TTM_PL_FLAG_CACHED; break; case TTM_PL_VRAM: + man->flags = TTM_MEMTYPE_FLAG_FIXED | + TTM_MEMTYPE_FLAG_MAPPABLE; + man->available_caching = TTM_PL_FLAG_UNCACHED | + TTM_PL_FLAG_WC; + man->default_caching = TTM_PL_FLAG_WC; + if (nv_device(drm->device)->card_type >= NV_50) { + /* Some BARs do not support being ioremapped WC */ + if (nouveau_bar(drm->device)->iomap_uncached) { + man->available_caching = TTM_PL_FLAG_UNCACHED; + man->default_...
2020 Oct 19
1
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...ch again, I realized that this is the 'ttm_bo_map_premapped' case and it's missing from _vunmap(). I see two options here: ignore this case in _vunmap(), or do an ioremap() unconditionally. Which one is preferable? Best regards Thomas >> +??????? else if (mem->placement & TTM_PL_FLAG_WC) > > I've just nuked the TTM_PL_FLAG_WC flag in drm-misc-next. There is a new > mem->bus.caching enum as replacement. > >> +??????????? vaddr_iomem = ioremap_wc(mem->bus.offset, size); >> +??????? else >> +??????????? vaddr_iomem = ioremap(mem->bus.offse...
2019 Apr 09
0
[PATCH 13/15] drm/vboxvideo: Convert vboxvideo driver to Simple TTM
...TTM_PL_MASK_CACHING; > - man->default_caching = TTM_PL_FLAG_CACHED; > - break; > - case TTM_PL_VRAM: > - man->func = &ttm_bo_manager_func; > - man->flags = TTM_MEMTYPE_FLAG_FIXED | TTM_MEMTYPE_FLAG_MAPPABLE; > - man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; > - man->default_caching = TTM_PL_FLAG_WC; > - break; > - default: > - DRM_ERROR("Unsupported memory type %u\n", (unsigned int)type); > - return -EINVAL; > - } > - > - return 0; > -} > - > -static int vbox_ttm_io_mem_reserve(struct ttm_bo_device *b...
2014 Jun 12
0
[PATCH 4/4] drm/nouveau: introduce CPU cache flushing macro
...kickoff anyways. > > I tried to go that way, and something interesting happened. > > What I did: remove this patch and instead set the following caching > parameters for the TTM_PL_TT case in nouveau_bo_init_mem_type(): > > man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; > man->default_caching = TTM_PL_FLAG_WC; > > What happened: no runtime errors as what happened when caching is > enabled. However, many of the vertex and texture buffers seem to be > partially corrupted. In glmark2 the 3d models had many vertices (but > not all) at the wro...
2020 Oct 15
1
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...> We have an unit tests of allocating a 8GB BO and that should work on a > > 32bit machine as well :) > > > > > + > > > + if (mem->bus.addr) > > > + vaddr_iomem = (void *)(((u8 *)mem->bus.addr)); > > > + else if (mem->placement & TTM_PL_FLAG_WC) > > > > I've just nuked the TTM_PL_FLAG_WC flag in drm-misc-next. There is a new > > mem->bus.caching enum as replacement. > > > > > + vaddr_iomem = ioremap_wc(mem->bus.offset, > > > size); > > > + else > > > + vaddr_iome...
2020 Oct 19
0
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...two > options here: ignore this case in _vunmap(), or do an ioremap() > unconditionally. Which one is preferable? ioremap would be very very bad, so we should just do nothing. Thanks, Christian. > > Best regards > Thomas > >>> +??????? else if (mem->placement & TTM_PL_FLAG_WC) >> I've just nuked the TTM_PL_FLAG_WC flag in drm-misc-next. There is a new >> mem->bus.caching enum as replacement. >> >>> +??????????? vaddr_iomem = ioremap_wc(mem->bus.offset, size); >>> +??????? else >>> +??????????? vaddr_iomem = ioremap(...
2019 Apr 24
0
[PATCH v2 07/17] drm/ast: Convert AST driver to VRAM MM
...gt;available_caching = TTM_PL_MASK_CACHING; - man->default_caching = TTM_PL_FLAG_CACHED; - break; - case TTM_PL_VRAM: - man->func = &ttm_bo_manager_func; - man->flags = TTM_MEMTYPE_FLAG_FIXED | - TTM_MEMTYPE_FLAG_MAPPABLE; - man->available_caching = TTM_PL_FLAG_UNCACHED | - TTM_PL_FLAG_WC; - man->default_caching = TTM_PL_FLAG_WC; - break; - default: - DRM_ERROR("Unsupported memory type %u\n", (unsigned)type); - return -EINVAL; - } - return 0; -} - -static int ast_ttm_io_mem_reserve(struct ttm_bo_device *bdev, - struct ttm_mem_reg *mem) -{ - struct ttm_mem_type_...
2019 May 06
0
[PATCH v4 12/19] drm/bochs: Convert bochs driver to VRAM MM
...gt;available_caching = TTM_PL_MASK_CACHING; - man->default_caching = TTM_PL_FLAG_CACHED; - break; - case TTM_PL_VRAM: - man->func = &ttm_bo_manager_func; - man->flags = TTM_MEMTYPE_FLAG_FIXED | - TTM_MEMTYPE_FLAG_MAPPABLE; - man->available_caching = TTM_PL_FLAG_UNCACHED | - TTM_PL_FLAG_WC; - man->default_caching = TTM_PL_FLAG_WC; - break; - default: - DRM_ERROR("Unsupported memory type %u\n", (unsigned)type); - return -EINVAL; - } - return 0; -} - -static int bochs_ttm_io_mem_reserve(struct ttm_bo_device *bdev, - struct ttm_mem_reg *mem) -{ - struct ttm_mem_t...
2013 Aug 28
1
[PATCH 4/6] drm/nouveau: introduce NOUVEAU_GEM_TILE_WCUS
...int size, int align, > > nouveau_bo_fixup_align(nvbo, flags, &align, &size); > nvbo->bo.mem.num_pages = size >> PAGE_SHIFT; > + > + if (tile_flags & NOUVEAU_GEM_TILE_WCUS) > + nvbo->valid_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; > + else > + nvbo->valid_caching = TTM_PL_MASK_CACHING; > + > nouveau_bo_placement_set(nvbo, flags, 0); > > acc_size = ttm_bo_dma_acc_size(&drm->ttm.bdev, size, > @@ -292,7 +298,7 @@ void > nouveau_bo_placement_set(struct nouve...
2019 May 22
2
[PATCH] drm/cirrus: remove leftover files
...gt;available_caching = TTM_PL_MASK_CACHING; - man->default_caching = TTM_PL_FLAG_CACHED; - break; - case TTM_PL_VRAM: - man->func = &ttm_bo_manager_func; - man->flags = TTM_MEMTYPE_FLAG_FIXED | - TTM_MEMTYPE_FLAG_MAPPABLE; - man->available_caching = TTM_PL_FLAG_UNCACHED | - TTM_PL_FLAG_WC; - man->default_caching = TTM_PL_FLAG_WC; - break; - default: - DRM_ERROR("Unsupported memory type %u\n", (unsigned)type); - return -EINVAL; - } - return 0; -} - -static void -cirrus_bo_evict_flags(struct ttm_buffer_object *bo, struct ttm_placement *pl) -{ - struct cirrus_bo *cirru...
2019 May 22
2
[PATCH] drm/cirrus: remove leftover files
...gt;available_caching = TTM_PL_MASK_CACHING; - man->default_caching = TTM_PL_FLAG_CACHED; - break; - case TTM_PL_VRAM: - man->func = &ttm_bo_manager_func; - man->flags = TTM_MEMTYPE_FLAG_FIXED | - TTM_MEMTYPE_FLAG_MAPPABLE; - man->available_caching = TTM_PL_FLAG_UNCACHED | - TTM_PL_FLAG_WC; - man->default_caching = TTM_PL_FLAG_WC; - break; - default: - DRM_ERROR("Unsupported memory type %u\n", (unsigned)type); - return -EINVAL; - } - return 0; -} - -static void -cirrus_bo_evict_flags(struct ttm_buffer_object *bo, struct ttm_placement *pl) -{ - struct cirrus_bo *cirru...
2020 Oct 15
0
[PATCH v4 05/10] drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers
...es before > shifting. > > We have an unit tests of allocating a 8GB BO and that should work on a 32bit > machine as well :) > > > + > > + if (mem->bus.addr) > > + vaddr_iomem = (void *)(((u8 *)mem->bus.addr)); > > + else if (mem->placement & TTM_PL_FLAG_WC) > > I've just nuked the TTM_PL_FLAG_WC flag in drm-misc-next. There is a new > mem->bus.caching enum as replacement. > > > + vaddr_iomem = ioremap_wc(mem->bus.offset, size); > > + else > > + vaddr_iomem = ioremap(mem->bus.offset, size); > > +...
2019 Apr 24
0
[PATCH v2 05/17] drm: Add VRAM MM, a simple memory manager for dedicated VRAM
...able_caching = TTM_PL_MASK_CACHING; + man->default_caching = TTM_PL_FLAG_CACHED; + break; + case TTM_PL_VRAM: + man->func = &ttm_bo_manager_func; + man->flags = TTM_MEMTYPE_FLAG_FIXED | + TTM_MEMTYPE_FLAG_MAPPABLE; + man->available_caching = TTM_PL_FLAG_UNCACHED | + TTM_PL_FLAG_WC; + man->default_caching = TTM_PL_FLAG_WC; + break; + default: + return -EINVAL; + } + return 0; +} + +static void bo_driver_evict_flags(struct ttm_buffer_object *bo, + struct ttm_placement *placement) +{ + struct drm_vram_mm *vmm = drm_vram_mm_of_bdev(bo->bdev); + + if (vmm->funcs...
2014 Jun 27
3
[PATCH v3 0/2] drm: nouveau: memory coherency for ARM
v2 was doing some pretty nasty things with the DMA API, so I took a different approach for this v3. As suggested, this version uses ttm_dma_populate() to populate BOs. The reason for doing this was that it would entitle us to using the DMA sync functions, but since the memory returned is already coherent anyway, we do not even need to call these functions anymore. So this series has turned into
2019 Apr 24
21
[PATCH v2 00/17] Share TTM code among DRM framebuffer drivers
Several simple framebuffer drivers copy most of the TTM code from each other. The implementation is always the same; except for the name of some data structures. As recently discussed, this patch set provides generic memory-management code for simple framebuffers with dedicated video memory. It further converts the respective drivers to the generic code. The shared code is basically the same