There's no flush or invalidate mechnaism with the DRI interface,
so we'll have to support mapping and unmapping.
BUG=b:
72972511
TEST=gbmtest passes in CQ
Change-Id: If3aef651f8549544ed4ed499e17f7f99c597974c
Reviewed-on: https://chromium-review.googlesource.com/990892
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Satyajit Sahu <satyajit.sahu@amd.com>
Reviewed-by: Joe Kniss <djmk@google.com>
Reviewed-by: Satyajit Sahu <satyajit.sahu@amd.com>
if (!--lockcount_) {
if (lock_data_[0]) {
- drv_bo_flush(bo_, lock_data_[0]);
+ drv_bo_flush_or_unmap(bo_, lock_data_[0]);
lock_data_[0] = nullptr;
}
}
int drv_bo_unmap(struct bo *bo, struct mapping *mapping)
{
uint32_t i;
- int ret = drv_bo_flush(bo, mapping);
- if (ret)
- return ret;
+ int ret = 0;
pthread_mutex_lock(&bo->drv->driver_lock);
return ret;
}
-int drv_bo_flush(struct bo *bo, struct mapping *mapping)
+int drv_bo_flush_or_unmap(struct bo *bo, struct mapping *mapping)
{
int ret = 0;
if (bo->drv->backend->bo_flush)
ret = bo->drv->backend->bo_flush(bo, mapping);
+ else
+ ret = drv_bo_unmap(bo, mapping);
return ret;
}
int drv_bo_invalidate(struct bo *bo, struct mapping *mapping);
-int drv_bo_flush(struct bo *bo, struct mapping *mapping);
+int drv_bo_flush_or_unmap(struct bo *bo, struct mapping *mapping);
uint32_t drv_bo_get_width(struct bo *bo);
PUBLIC void gbm_bo_unmap(struct gbm_bo *bo, void *map_data)
{
assert(bo);
- drv_bo_flush(bo->bo, map_data);
+ drv_bo_flush_or_unmap(bo->bo, map_data);
}
PUBLIC uint32_t gbm_bo_get_width(struct gbm_bo *bo)