> + /* If ->gpu_access is 0, the BO is idle, and if the WRITE > flag > + * is cleared, that means we only have readers. > + */ > + if (!bo->gpu_access) > + return true; > + else if (!(access_type & PAN_BO_GPU_ACCESS_READ) && > + !(bo->gpu_access & PAN_BO_GPU_ACCESS_WRITE)) > + return true;
The second condition is a little confusing, though I think it's correct. Not sure if there's any way to clarify what's meant but just thought I'd comment, since inevitably future readers will squint too. > + /* Update the BO access flags so that panfrost_bo_wait() > knows > + * about all pending accesses. > + */ > + bo->gpu_access |= flags & (PAN_BO_GPU_ACCESS_RW); This looks like black magic. Maybe just clarify in the comment why this & is reasonable (relying on bit mask magic). --- That aside, as I mentioned it would maybe make more sense to squash this into the patch introduce the bo_wait ioctl() in the first place? If that's too complicated with merge conflicts and stuff, don't sweat it, though :) _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev