Skip to content

Commit

Permalink
Ignore set domain for dgpu
Browse files Browse the repository at this point in the history
Cause kernel doesn't support this op for dgpu.

Tracked-On: OAM-114098
Signed-off-by: chenyanxzhu <chenyanx.zhu@intel.com>
  • Loading branch information
chenyanxzhu authored and sysopenci committed Jan 26, 2024
1 parent 1717187 commit b4da934
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions i915.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,6 @@ static bool i915_bo_query_prelim_meminfo(struct driver *drv, struct i915_device
return false;
}
if (item.length <= 0) {
drv_log("drv: Invalid memory region length\n");
return false;
}
struct prelim_drm_i915_query_memory_regions *meminfo = calloc(1, item.length);
Expand Down Expand Up @@ -567,7 +566,6 @@ static int i915_init(struct driver *drv)
i915->has_fence_reg = gem_param(drv->fd, I915_PARAM_NUM_FENCES_AVAIL) > 0;

if (!i915_bo_query_prelim_meminfo(drv, i915)) {
drv_info("drv: Kernel does not support prelim\n");
i915_bo_query_meminfo(drv, i915);
} else {
drv_info("drv: kernel supports prelim\n");
Expand Down Expand Up @@ -1042,23 +1040,26 @@ static int i915_bo_invalidate(struct bo *bo, struct mapping *mapping)
{
int ret;
struct drm_i915_gem_set_domain set_domain;
struct i915_device *i915_dev = (struct i915_device *)bo->drv->priv;

memset(&set_domain, 0, sizeof(set_domain));
set_domain.handle = bo->handles[0].u32;
if (bo->meta.tiling == I915_TILING_NONE) {
set_domain.read_domains = I915_GEM_DOMAIN_CPU;
if (mapping->vma->map_flags & BO_MAP_WRITE)
set_domain.write_domain = I915_GEM_DOMAIN_CPU;
} else {
set_domain.read_domains = I915_GEM_DOMAIN_GTT;
if (mapping->vma->map_flags & BO_MAP_WRITE)
set_domain.write_domain = I915_GEM_DOMAIN_GTT;
}
if (i915_dev->genx10 != 125) {
memset(&set_domain, 0, sizeof(set_domain));
set_domain.handle = bo->handles[0].u32;
if (bo->meta.tiling == I915_TILING_NONE) {
set_domain.read_domains = I915_GEM_DOMAIN_CPU;
if (mapping->vma->map_flags & BO_MAP_WRITE)
set_domain.write_domain = I915_GEM_DOMAIN_CPU;
} else {
set_domain.read_domains = I915_GEM_DOMAIN_GTT;
if (mapping->vma->map_flags & BO_MAP_WRITE)
set_domain.write_domain = I915_GEM_DOMAIN_GTT;
}

ret = drmIoctl(bo->drv->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain);
if (ret) {
drv_log("DRM_IOCTL_I915_GEM_SET_DOMAIN with %d\n", ret);
return ret;
ret = drmIoctl(bo->drv->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain);
if (ret) {
drv_log("DRM_IOCTL_I915_GEM_SET_DOMAIN with %d\n", ret);
return ret;
}
}

return 0;
Expand Down

0 comments on commit b4da934

Please sign in to comment.