Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bo create failure when run with prelim kernel #98

Open
wants to merge 1 commit into
base: celadon/s/mr0/master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions i915.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ bool i915_has_tile4(struct driver *drv)
return i915->genx10 >= 125;
}

bool i915_should_use_linear(struct i915_device *i915)
{
switch (i915->device_id) {
case 0x46A6:
return true;
default:
return false;
}
}

static uint64_t unset_flags(uint64_t current_flags, uint64_t mask)
{
uint64_t value = current_flags & ~mask;
Expand Down Expand Up @@ -282,6 +292,19 @@ static int i915_add_combinations(struct driver *drv)
render = unset_flags(render, linear_mask | camera_mask);
scanout_and_render = unset_flags(scanout_and_render, linear_mask |camera_mask);

/* TODO(OAM-115771):
* Some devices virtio has VIRTIO_GPU_F_MODIFIER feature,
* but some devices have not. If device virtio has not
* VIRTIO_GPU_F_MODIFIER, android display black screen with
* qemu + SRIOV. So far, we have not found out why device
* id of the two ADL device are both 0x46A6, one has
* VIRTIO_GPU_F_MODIFIER feature, the other one has not.
*
* For now, we use LINEAR as WA for the above devices with
* same device id.. */
if (is_kvm && i915_should_use_linear(i915)) {
scanout_and_render = unset_flags(scanout_and_render, BO_USE_SCANOUT);
}

/* On dGPU, only use linear */
if (i915->genx10 >= 125)
Expand Down
Loading