diff options
author | Francisco Jerez <currojerez@riseup.net> | 2010-10-10 00:01:08 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-11-17 23:38:29 -0500 |
commit | f13b32630dda7e583a84a8c535880cff7e4a9bdd (patch) | |
tree | a527aa3fd21cb58aaa95e0d70566acb14ea0586f /drivers/gpu/drm/nouveau/nouveau_bo.c | |
parent | 1397b42b5a2e5b3b982078c89f3594c123e3c2b3 (diff) |
drm/nouveau: Expose some BO usage flags to userspace.
This will be needed for Z compression and to take smarter placement
decisions.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 80353e2b8409..f55dd9145b7c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
@@ -144,7 +144,8 @@ nouveau_bo_new(struct drm_device *dev, struct nouveau_channel *chan, | |||
144 | nvbo->tile_mode = tile_mode; | 144 | nvbo->tile_mode = tile_mode; |
145 | nvbo->tile_flags = tile_flags; | 145 | nvbo->tile_flags = tile_flags; |
146 | 146 | ||
147 | nouveau_bo_fixup_align(dev, tile_mode, tile_flags, &align, &size); | 147 | nouveau_bo_fixup_align(dev, tile_mode, nouveau_bo_tile_layout(nvbo), |
148 | &align, &size); | ||
148 | align >>= PAGE_SHIFT; | 149 | align >>= PAGE_SHIFT; |
149 | 150 | ||
150 | nouveau_bo_placement_set(nvbo, flags, 0); | 151 | nouveau_bo_placement_set(nvbo, flags, 0); |
@@ -525,7 +526,8 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, | |||
525 | stride = 16 * 4; | 526 | stride = 16 * 4; |
526 | height = amount / stride; | 527 | height = amount / stride; |
527 | 528 | ||
528 | if (new_mem->mem_type == TTM_PL_VRAM && nvbo->tile_flags) { | 529 | if (new_mem->mem_type == TTM_PL_VRAM && |
530 | nouveau_bo_tile_layout(nvbo)) { | ||
529 | ret = RING_SPACE(chan, 8); | 531 | ret = RING_SPACE(chan, 8); |
530 | if (ret) | 532 | if (ret) |
531 | return ret; | 533 | return ret; |
@@ -546,7 +548,8 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, | |||
546 | BEGIN_RING(chan, NvSubM2MF, 0x0200, 1); | 548 | BEGIN_RING(chan, NvSubM2MF, 0x0200, 1); |
547 | OUT_RING (chan, 1); | 549 | OUT_RING (chan, 1); |
548 | } | 550 | } |
549 | if (old_mem->mem_type == TTM_PL_VRAM && nvbo->tile_flags) { | 551 | if (old_mem->mem_type == TTM_PL_VRAM && |
552 | nouveau_bo_tile_layout(nvbo)) { | ||
550 | ret = RING_SPACE(chan, 8); | 553 | ret = RING_SPACE(chan, 8); |
551 | if (ret) | 554 | if (ret) |
552 | return ret; | 555 | return ret; |
@@ -753,7 +756,8 @@ nouveau_bo_vm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem, | |||
753 | if (dev_priv->card_type == NV_50) { | 756 | if (dev_priv->card_type == NV_50) { |
754 | ret = nv50_mem_vm_bind_linear(dev, | 757 | ret = nv50_mem_vm_bind_linear(dev, |
755 | offset + dev_priv->vm_vram_base, | 758 | offset + dev_priv->vm_vram_base, |
756 | new_mem->size, nvbo->tile_flags, | 759 | new_mem->size, |
760 | nouveau_bo_tile_layout(nvbo), | ||
757 | offset); | 761 | offset); |
758 | if (ret) | 762 | if (ret) |
759 | return ret; | 763 | return ret; |
@@ -894,7 +898,8 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo) | |||
894 | * nothing to do here. | 898 | * nothing to do here. |
895 | */ | 899 | */ |
896 | if (bo->mem.mem_type != TTM_PL_VRAM) { | 900 | if (bo->mem.mem_type != TTM_PL_VRAM) { |
897 | if (dev_priv->card_type < NV_50 || !nvbo->tile_flags) | 901 | if (dev_priv->card_type < NV_50 || |
902 | !nouveau_bo_tile_layout(nvbo)) | ||
898 | return 0; | 903 | return 0; |
899 | } | 904 | } |
900 | 905 | ||