sna: do not bother attaching to a miniscule ShmPixmap
If the pixmap is less than a page in size we are unlikely to recover the cost of tracking it via the GPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
2f4de90709
commit
9b016d2e46
|
|
@ -757,7 +757,7 @@ sna_pixmap_create_shm(ScreenPtr screen,
|
|||
DBG(("%s(%dx%d, depth=%d, bpp=%d, pitch=%d)\n",
|
||||
__FUNCTION__, width, height, depth, bpp, pitch));
|
||||
|
||||
if (wedged(sna) || bpp == 0) {
|
||||
if (wedged(sna) || bpp == 0 || pitch*height <= 4096) {
|
||||
fallback:
|
||||
pixmap = sna_pixmap_create_unattached(screen, 0, 0, depth);
|
||||
if (pixmap == NULL)
|
||||
|
|
@ -809,9 +809,7 @@ fallback:
|
|||
}
|
||||
}
|
||||
|
||||
priv->cpu_bo = kgem_create_map(&sna->kgem,
|
||||
addr, pitch*(height-1)+width*bpp/8,
|
||||
false);
|
||||
priv->cpu_bo = kgem_create_map(&sna->kgem, addr, pitch*height, false);
|
||||
if (priv->cpu_bo == NULL) {
|
||||
priv->header = true;
|
||||
sna_pixmap_destroy(pixmap);
|
||||
|
|
|
|||
Loading…
Reference in New Issue