Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Fixes for customer issues on Release-july release #114

Open
wants to merge 2 commits into
base: release-july
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/mesa/drivers/dri/i965/intel_batchbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,11 +742,18 @@ submit_batch(struct brw_context *brw, int in_fence_fd, int *out_fence_fd)
int ret = 0;

if (batch->use_shadow_copy) {
void *bo_map = brw_bo_map(brw, batch->batch.bo, MAP_WRITE);
memcpy(bo_map, batch->batch.map, 4 * USED_BATCH(*batch));
void *state_map, *batch_map = brw_bo_map(brw, batch->batch.bo, MAP_WRITE);
if(batch_map == NULL)
return -1;

state_map = brw_bo_map(brw, batch->state.bo, MAP_WRITE);
if (state_map == NULL) {
brw_bo_unmap(batch->batch.bo);
return -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would the mapping fail, what was the failing usecase/app?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem happened only once and a core dump was the only thing the customer could provide, I found the the application tried to access a NULL pointer and triggered A/V. To answer your question: we don't know the root cause of the mapping failure,

This is simply a w/a to fail the submission in case of mapping failure, hopefully the user app checks the error and fails gracefully instead of crashes to terminal.

}

bo_map = brw_bo_map(brw, batch->state.bo, MAP_WRITE);
memcpy(bo_map, batch->state.map, batch->state_used);
memcpy(batch_map, batch->batch.map, 4 * USED_BATCH(*batch));
memcpy(state_map, batch->state.map, batch->state_used);
}

brw_bo_unmap(batch->batch.bo);
Expand Down