iris: handle aux properly in iris_resource_get_handle

Disable aux when resource seen the first time and EXPLICIT_FLUSH
not being set. This fixes issues seen when launching Xorg and
CCS_E getting utilized.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Tapani Pälli 2019-04-05 08:55:18 +03:00 committed by Kenneth Graunke
parent 276d22c52d
commit 361f3d19f1
1 changed files with 8 additions and 0 deletions

View File

@ -839,6 +839,14 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
{
struct iris_resource *res = (struct iris_resource *)resource;
/* Disable aux usage if explicit flush not set and this is the
* first time we are dealing with this resource.
*/
if ((!(usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH) && res->aux.usage != 0)) {
if (p_atomic_read(&resource->reference.count) == 1)
iris_resource_disable_aux(res);
}
/* If this is a buffer, stride should be 0 - no need to special case */
whandle->stride = res->surf.row_pitch_B;
whandle->modifier =