Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3472020 authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau: use nvif_mmu_type to determine BAR1 caching



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 658c71f4
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -58,7 +58,6 @@ u64 nvif_device_time(struct nvif_device *);
#define nvxx_bios(a) nvxx_device(a)->bios
#define nvxx_bios(a) nvxx_device(a)->bios
#define nvxx_fb(a) nvxx_device(a)->fb
#define nvxx_fb(a) nvxx_device(a)->fb
#define nvxx_mmu(a) nvxx_device(a)->mmu
#define nvxx_mmu(a) nvxx_device(a)->mmu
#define nvxx_bar(a) nvxx_device(a)->bar
#define nvxx_gpio(a) nvxx_device(a)->gpio
#define nvxx_gpio(a) nvxx_device(a)->gpio
#define nvxx_clk(a) nvxx_device(a)->clk
#define nvxx_clk(a) nvxx_device(a)->clk
#define nvxx_i2c(a) nvxx_device(a)->i2c
#define nvxx_i2c(a) nvxx_device(a)->i2c
+3 −1
Original line number Original line Diff line number Diff line
@@ -589,6 +589,7 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
			 struct ttm_mem_type_manager *man)
			 struct ttm_mem_type_manager *man)
{
{
	struct nouveau_drm *drm = nouveau_bdev(bdev);
	struct nouveau_drm *drm = nouveau_bdev(bdev);
	struct nvif_mmu *mmu = &drm->client.mmu;


	switch (type) {
	switch (type) {
	case TTM_PL_SYSTEM:
	case TTM_PL_SYSTEM:
@@ -605,7 +606,8 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,


		if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
		if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
			/* Some BARs do not support being ioremapped WC */
			/* Some BARs do not support being ioremapped WC */
			if (nvxx_bar(&drm->client.device)->iomap_uncached) {
			const u8 type = mmu->type[drm->ttm.type_vram].type;
			if (type & NVIF_MEM_UNCACHED) {
				man->available_caching = TTM_PL_FLAG_UNCACHED;
				man->available_caching = TTM_PL_FLAG_UNCACHED;
				man->default_caching = TTM_PL_FLAG_UNCACHED;
				man->default_caching = TTM_PL_FLAG_UNCACHED;
			}
			}