sna: Tweak usage of kgem_bo_can_map vs kgem_bo_mapped

More often than not we only want to consider whether we can map the bo
and decide whether doing so is the better option. Whether the bo is
already mapped is not such an issue any more with the throttling.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-05-13 19:29:44 +01:00
parent 37aa1e1291
commit effb0b9ec5
2 changed files with 4 additions and 3 deletions

View File

@ -445,7 +445,8 @@ static inline bool kgem_bo_is_mappable(struct kgem *kgem,
static inline bool kgem_bo_mapped(struct kgem_bo *bo)
{
DBG_HDR(("%s: map=%p, tiling=%d\n", __FUNCTION__, bo->map, bo->tiling));
DBG_HDR(("%s: map=%p, tiling=%d, domain=%d\n",
__FUNCTION__, bo->map, bo->tiling, bo->domain));
if (bo->map == NULL)
return bo->tiling == I915_TILING_NONE && bo->domain == DOMAIN_CPU;

View File

@ -531,7 +531,7 @@ static bool upload_inplace(struct kgem *kgem,
* able to almagamate a series of small writes into a single
* operation.
*/
if (!kgem_bo_mapped(bo) || kgem_bo_is_busy(bo)) {
if (kgem_bo_is_busy(bo)) {
unsigned int bytes = 0;
while (n--) {
bytes += (box->x2 - box->x1) * (box->y2 - box->y1);
@ -1148,7 +1148,7 @@ bool sna_replace(struct sna *sna,
pixmap->drawable.bitsPerPixel,
bo->tiling));
if ((!kgem_bo_mapped(bo) || kgem_bo_is_busy(bo)) &&
if ((!kgem_bo_can_map(kgem, bo) || kgem_bo_is_busy(bo)) &&
indirect_replace(sna, pixmap, bo, src, stride))
return true;