diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-23 09:20:55 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-23 09:43:10 +0100 |
commit | 416c223861aaeb61c6408e6537315b78e908df43 (patch) | |
tree | ce9816ab3cb94db4e79dc36e15a83533f935a23b /src/sna | |
parent | fb51ec44f4b6069ab854233d5d0da34eb79f754c (diff) |
sna: Do not set CAN_CREATE_GPU flag for untiled allocations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/kgem.c | 4 | ||||
-rw-r--r-- | src/sna/sna_accel.c | 4 | ||||
-rw-r--r-- | src/sna/sna_glyphs.c | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 5e3c9f05..b54084ce 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -4260,7 +4260,7 @@ unsigned kgem_can_create_2d(struct kgem *kgem, if (size > 0) { if (size <= kgem->max_cpu_size) flags |= KGEM_CAN_CREATE_CPU; - if (size <= kgem->max_gpu_size) + else if (size <= kgem->max_gpu_size) flags |= KGEM_CAN_CREATE_GPU; if (size <= PAGE_SIZE*kgem->aperture_mappable/4) flags |= KGEM_CAN_CREATE_GTT; @@ -4282,8 +4282,6 @@ unsigned kgem_can_create_2d(struct kgem *kgem, DBG(("%s: tiled[%d] size=%d\n", __FUNCTION__, tiling, size)); if (size > 0 && size <= kgem->max_gpu_size) flags |= KGEM_CAN_CREATE_GPU; - if (size > kgem->max_gpu_size) - flags &= ~KGEM_CAN_CREATE_GPU; if (size > 0 && size <= PAGE_SIZE*kgem->aperture_mappable/4) flags |= KGEM_CAN_CREATE_GTT; if (size > PAGE_SIZE*kgem->aperture_mappable/4) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index f481c19e..067f7dd2 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -3502,10 +3502,6 @@ sna_drawable_use_bo(DrawablePtr drawable, unsigned flags, const BoxRec *box, DBG(("%s: last on cpu and needs damage, discard PREFER_GPU\n", __FUNCTION__)); flags &= ~PREFER_GPU; } - if ((flags & FORCE_GPU) == 0 && priv->gpu_bo == NULL && sna_pixmap_choose_tiling(pixmap, DEFAULT_TILING) == I915_TILING_NONE) { - DBG(("%s: no gpu bo and linear, discard PREFER_GPU\n", __FUNCTION__)); - flags &= ~PREFER_GPU; - } if ((flags & (PREFER_GPU | IGNORE_DAMAGE)) == IGNORE_DAMAGE) { if (priv->gpu_bo && (box_covers_pixmap(pixmap, box) || box_inplace(pixmap, box))) { diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index fb4d7f1d..5587fccc 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -1161,6 +1161,7 @@ glyphs_via_mask(struct sna *sna, if (use_small_mask(sna, width, height, format->depth)) { pixman_image_t *mask_image; +use_small_mask: DBG(("%s: small mask [format=%lx, depth=%d, size=%d], rendering glyphs to upload buffer\n", __FUNCTION__, (unsigned long)format->format, format->depth, (uint32_t)width*height*format->depth)); @@ -1340,6 +1341,11 @@ next_image: if (!pixmap) return false; + if (sna_pixmap(pixmap) == NULL) { + sna_pixmap_destroy(pixmap); + goto use_small_mask; + } + mask = CreatePicture(0, &pixmap->drawable, format, CPComponentAlpha, &component_alpha, serverClient, &error); |