mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
intel: Add some defense against buffer allocation failure for subimage blits
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
f627d429bd
commit
de7678ef52
1 changed files with 11 additions and 11 deletions
|
|
@ -90,19 +90,19 @@ intelTexSubimage(struct gl_context * ctx,
|
|||
intel->gen < 6 && target == GL_TEXTURE_2D &&
|
||||
drm_intel_bo_busy(dst_bo))
|
||||
{
|
||||
unsigned long pitch;
|
||||
uint32_t tiling_mode = I915_TILING_NONE;
|
||||
temp_bo = drm_intel_bo_alloc_tiled(intel->bufmgr,
|
||||
"subimage blit bo",
|
||||
width, height,
|
||||
intelImage->mt->cpp,
|
||||
&tiling_mode,
|
||||
&pitch,
|
||||
0);
|
||||
drm_intel_gem_bo_map_gtt(temp_bo);
|
||||
dstRowStride = width * intelImage->mt->cpp;
|
||||
temp_bo = drm_intel_bo_alloc(intel->bufmgr, "subimage blit bo",
|
||||
dstRowStride * height, 0);
|
||||
if (!temp_bo)
|
||||
return;
|
||||
|
||||
if (drm_intel_gem_bo_map_gtt(temp_bo)) {
|
||||
drm_intel_bo_unreference(temp_bo);
|
||||
return;
|
||||
}
|
||||
|
||||
texImage->Data = temp_bo->virtual;
|
||||
texImage->ImageOffsets[0] = 0;
|
||||
dstRowStride = pitch;
|
||||
|
||||
intel_miptree_get_image_offset(intelImage->mt, level,
|
||||
intelImage->face, 0,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue