aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2011-10-04 14:13:33 -0400
committerDave Airlie <airlied@redhat.com>2011-10-05 05:17:31 -0400
commit5bb39e818169783ee17ddbbefbd7bd16a4383fec (patch)
treea4af9f982e0c75e19b7e31bfdbaebc30e25b0bdc /drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
parent90ff18bc3a1ff56e3948ccf7ae4031b8e9662981 (diff)
vmwgfx: Handle device surface memory limit
Make surfaces swappable. Make sure we honor the maximum amount of surface memory the device accepts. This is done by potentially reading back surface contents not used by the current command submission and storing it locally in buffer objects. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
index 98a5d7e90546..5a72ed908232 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
@@ -60,6 +60,11 @@ static uint32_t vram_gmr_placement_flags[] = {
60 VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED 60 VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED
61}; 61};
62 62
63static uint32_t gmr_vram_placement_flags[] = {
64 VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED,
65 TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED
66};
67
63struct ttm_placement vmw_vram_gmr_placement = { 68struct ttm_placement vmw_vram_gmr_placement = {
64 .fpfn = 0, 69 .fpfn = 0,
65 .lpfn = 0, 70 .lpfn = 0,
@@ -125,6 +130,15 @@ struct ttm_placement vmw_evictable_placement = {
125 .busy_placement = &sys_placement_flags 130 .busy_placement = &sys_placement_flags
126}; 131};
127 132
133struct ttm_placement vmw_srf_placement = {
134 .fpfn = 0,
135 .lpfn = 0,
136 .num_placement = 1,
137 .num_busy_placement = 2,
138 .placement = &gmr_placement_flags,
139 .busy_placement = gmr_vram_placement_flags
140};
141
128struct vmw_ttm_backend { 142struct vmw_ttm_backend {
129 struct ttm_backend backend; 143 struct ttm_backend backend;
130 struct page **pages; 144 struct page **pages;