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;
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)
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))) {
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));
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);