Skip to content

Commit 29d219b

Browse files
phreersysopenci
authored andcommitted
Use ivshmem-backed virtio-GPU as KMS driver in the case of QNX
The QNX scenario uses ivshmem-backed virtio-GPU for display, a special use case for us. We distinguish this scenario by checking whether the ivshmem virtio-GPU is the only virtio-GPU on the system. Tracked-On: OAM-127906 Signed-off-by: Weifeng Liu <weifeng.liu@intel.com>
1 parent 0d8e92d commit 29d219b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

cros_gralloc/cros_gralloc_driver.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,9 +958,17 @@ int cros_gralloc_driver::select_render_driver(uint64_t gpu_grp_type)
958958

959959
int cros_gralloc_driver::select_kms_driver(uint64_t gpu_grp_type)
960960
{
961+
// virtio-GPU without blob cannot import external buffers.
961962
if (gpu_grp_type & GPU_GRP_TYPE_HAS_VIRTIO_GPU_NO_BLOB_BIT) {
962963
return GPU_GRP_TYPE_VIRTIO_GPU_NO_BLOB_IDX;
963964
}
965+
// QNX case: virtio-GPU is ivshmem backed device and cannot import external buffers.
966+
// Screen cast also uses ivshmem virtio-GPU but we have virtio-GPU supporting blob.
967+
if ((gpu_grp_type & GPU_GRP_TYPE_HAS_VIRTIO_GPU_IVSHMEM_BIT) &&
968+
!(gpu_grp_type & GPU_GRP_TYPE_HAS_VIRTIO_GPU_BLOB_BIT) &&
969+
!(gpu_grp_type & GPU_GRP_TYPE_HAS_VIRTIO_GPU_BLOB_P2P_BIT)) {
970+
return GPU_GRP_TYPE_VIRTIO_GPU_IVSHMEM_IDX;
971+
}
964972
if (gpu_grp_type & GPU_GRP_TYPE_HAS_INTEL_DGPU_BIT) {
965973
return GPU_GRP_TYPE_INTEL_DGPU_IDX;
966974
}

0 commit comments

Comments
 (0)