mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 00:50:07 +01:00
virgl: resize resource bo allocation if we need to.
This fixes an illegal command buffer on the host seen with piglit arb_internalformat_query2-max-dimensions Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
c1e47a3c1f
commit
4b15b5e803
2 changed files with 12 additions and 4 deletions
|
|
@ -620,8 +620,12 @@ static void virgl_drm_add_res(struct virgl_drm_winsys *qdws,
|
|||
unsigned hash = res->res_handle & (sizeof(cbuf->is_handle_added)-1);
|
||||
|
||||
if (cbuf->cres > cbuf->nres) {
|
||||
fprintf(stderr,"failure to add relocation\n");
|
||||
return;
|
||||
cbuf->nres += 256;
|
||||
cbuf->res_bo = realloc(cbuf->res_bo, cbuf->nres * sizeof(struct virgl_hw_buf*));
|
||||
if (!cbuf->res_bo) {
|
||||
fprintf(stderr,"failure to add relocation %d, %d\n", cbuf->cres, cbuf->nres);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
cbuf->res_bo[cbuf->cres] = NULL;
|
||||
|
|
|
|||
|
|
@ -460,8 +460,12 @@ static void virgl_vtest_add_res(struct virgl_vtest_winsys *vtws,
|
|||
unsigned hash = res->res_handle & (sizeof(cbuf->is_handle_added)-1);
|
||||
|
||||
if (cbuf->cres > cbuf->nres) {
|
||||
fprintf(stderr,"failure to add relocation\n");
|
||||
return;
|
||||
cbuf->nres += 256;
|
||||
cbuf->res_bo = realloc(cbuf->res_bo, cbuf->nres * sizeof(struct virgl_hw_buf*));
|
||||
if (!cbuf->res_bo) {
|
||||
fprintf(stderr,"failure to add relocation %d, %d\n", cbuf->cres, cbuf->nres);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
cbuf->res_bo[cbuf->cres] = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue