diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2012-02-08 10:49:08 +0100 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2012-02-08 10:50:55 +0100 |
commit | 2cfac57d364d0166ed9472b086c16aea376f495a (patch) | |
tree | ae87e704134c068af013b41573c35215e859a6c1 | |
parent | 230ec7d7bbf1e8a7e263d471b21afb08c28eba0c (diff) | |
download | libdrm-2cfac57d364d0166ed9472b086c16aea376f495a.tar.gz libdrm-2cfac57d364d0166ed9472b086c16aea376f495a.tar.bz2 libdrm-2cfac57d364d0166ed9472b086c16aea376f495a.zip |
radeon_cs_setup_bo: Fix accounting if caller specified write and read domains.
Only account for the write domain in that case.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43893 .
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | radeon/radeon_cs_space.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/radeon/radeon_cs_space.c b/radeon/radeon_cs_space.c index 208e1bbf..be047a7b 100644 --- a/radeon/radeon_cs_space.c +++ b/radeon/radeon_cs_space.c @@ -65,13 +65,16 @@ static inline int radeon_cs_setup_bo(struct radeon_cs_space_check *sc, struct ra } if (bo->space_accounted == 0) { - if (write_domain == RADEON_GEM_DOMAIN_VRAM) - sizes->op_vram_write += bo->size; - else if (write_domain == RADEON_GEM_DOMAIN_GTT) - sizes->op_gart_write += bo->size; - else + if (write_domain) { + if (write_domain == RADEON_GEM_DOMAIN_VRAM) + sizes->op_vram_write += bo->size; + else if (write_domain == RADEON_GEM_DOMAIN_GTT) + sizes->op_gart_write += bo->size; + sc->new_accounted = write_domain; + } else { sizes->op_read += bo->size; - sc->new_accounted = (read_domains << 16) | write_domain; + sc->new_accounted = read_domains << 16; + } } else { uint16_t old_read, old_write; |