enum isl_format linear_format = isl_format_srgb_to_linear(rt_format);
- if (!isl_format_supports_ccs_e(devinfo, linear_format))
+ if (linear_format == ISL_FORMAT_UNSUPPORTED ||
+ !isl_format_supports_ccs_e(devinfo, linear_format))
return false;
return devinfo->gen >= 9 && devinfo->gen <= 11;
initial_state = ISL_AUX_STATE_PASS_THROUGH;
*alloc_flags |= BO_ALLOC_ZEROED;
break;
+ case ISL_AUX_USAGE_MC:
+ unreachable("Unsupported aux mode");
}
/* Create the aux_state for the auxiliary buffer. */
if (templ->usage == PIPE_USAGE_STAGING ||
templ->bind & (PIPE_BIND_LINEAR | PIPE_BIND_CURSOR) )
tiling_flags = ISL_TILING_LINEAR_BIT;
+ else if (templ->bind & PIPE_BIND_SCANOUT)
+ tiling_flags = ISL_TILING_X_BIT;
}
isl_surf_usage_flags_t usage = pipe_bind_to_isl_usage(templ->bind);
}
assert(mod_inf);
+ res->external_format = whandle->format;
res->mod_info = mod_inf;
isl_surf_usage_flags_t isl_usage = pipe_bind_to_isl_usage(templ->bind);
if (templ->target == PIPE_BUFFER) {
res->surf.tiling = ISL_TILING_LINEAR;
} else {
- if (whandle->modifier == DRM_FORMAT_MOD_INVALID || whandle->plane == 0) {
+ /* Create a surface for each plane specified by the external format. */
+ if (whandle->plane < util_format_get_num_planes(whandle->format)) {
UNUSED const bool isl_surf_created_successfully =
isl_surf_init(&screen->isl_dev, &res->surf,
.dim = target_to_isl_surf_dim(templ->target),
whandle->stride = res->surf.row_pitch_B;
bo = res->bo;
}
+
+ whandle->format = res->external_format;
whandle->modifier =
res->mod_info ? res->mod_info->modifier
: tiling_to_modifier(res->bo->tiling_mode);
if (resource->target != PIPE_BUFFER)
return;
+ /* If it's already invalidated, don't bother doing anything. */
+ if (res->valid_buffer_range.start > res->valid_buffer_range.end)
+ return;
+
if (!resource_is_busy(ice, res)) {
/* The resource is idle, so just mark that it contains no data and
* keep using the same underlying buffer object.
/* Rebind the buffer, replacing any state referring to the old BO's
* address, and marking state dirty so it's reemitted.
*/
- ice->vtbl.rebind_buffer(ice, res, old_bo->gtt_offset);
+ ice->vtbl.rebind_buffer(ice, res);
util_range_set_empty(&res->valid_buffer_range);